public inbox for linux-arm-kernel@lists.infradead.org
 help / color / mirror / Atom feed
From: thomas.abraham@linaro.org (Thomas Abraham)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH v6 07/10] ARM: Exynos4: Add a alias for pdma clocks
Date: Mon, 10 Oct 2011 23:45:35 +0530	[thread overview]
Message-ID: <1318270538-30450-8-git-send-email-thomas.abraham@linaro.org> (raw)
In-Reply-To: <1318270538-30450-7-git-send-email-thomas.abraham@linaro.org>

PDMA controllers when instantiated from device tree are registered using
amba_device_register(). The registration process enables clock to the
controllers to read the peripheral id of the PDMA amba device.

In case of Exynos4, the clocks to the PDMA controllers are named as 'dma'
but amba_device_register() looks up the clock using the name 'apb_pclk'.
Hence, alias clocks with name 'apb_pclk' clock are created for clocks
with name 'dma'.

Signed-off-by: Thomas Abraham <thomas.abraham@linaro.org>
---
 arch/arm/mach-exynos4/clock.c |   35 +++++++++++++++++++++++++----------
 1 files changed, 25 insertions(+), 10 deletions(-)

diff --git a/arch/arm/mach-exynos4/clock.c b/arch/arm/mach-exynos4/clock.c
index d589fe4..94fc337 100644
--- a/arch/arm/mach-exynos4/clock.c
+++ b/arch/arm/mach-exynos4/clock.c
@@ -558,16 +558,6 @@ static struct clk init_clocks_off[] = {
 		.enable		= exynos4_clk_ip_fsys_ctrl,
 		.ctrlbit	= (1 << 10),
 	}, {
-		.name		= "dma",
-		.devname	= "dma-pl330.0",
-		.enable		= exynos4_clk_ip_fsys_ctrl,
-		.ctrlbit	= (1 << 0),
-	}, {
-		.name		= "dma",
-		.devname	= "dma-pl330.1",
-		.enable		= exynos4_clk_ip_fsys_ctrl,
-		.ctrlbit	= (1 << 1),
-	}, {
 		.name		= "adc",
 		.enable		= exynos4_clk_ip_peril_ctrl,
 		.ctrlbit	= (1 << 15),
@@ -783,6 +773,20 @@ static struct clk init_clocks[] = {
 	}
 };
 
+static struct clk clk_pdma0 = {
+	.name		= "dma",
+	.devname	= "dma-pl330.0",
+	.enable		= exynos4_clk_ip_fsys_ctrl,
+	.ctrlbit	= (1 << 0),
+};
+
+static struct clk clk_pdma1 = {
+	.name		= "dma",
+	.devname	= "dma-pl330.1",
+	.enable		= exynos4_clk_ip_fsys_ctrl,
+	.ctrlbit	= (1 << 1),
+};
+
 struct clk *clkset_group_list[] = {
 	[0] = &clk_ext_xtal_mux,
 	[1] = &clk_xusbxti,
@@ -1292,6 +1296,11 @@ static struct clksrc_clk *sysclks[] = {
 	&clk_mout_mfc1,
 };
 
+static struct clk *clk_cdev[] = {
+	&clk_pdma0,
+	&clk_pdma1,
+};
+
 static struct clksrc_clk *clksrc_cdev[] = {
 	&clk_sclk_uart0,
 	&clk_sclk_uart1,
@@ -1312,6 +1321,8 @@ static struct clk_lookup exynos4_clk_lookup[] = {
 	CLKDEV_INIT("exynos4-sdhci.1", "mmc_busclk.2", &clk_sclk_mmc1.clk),
 	CLKDEV_INIT("exynos4-sdhci.2", "mmc_busclk.2", &clk_sclk_mmc2.clk),
 	CLKDEV_INIT("exynos4-sdhci.3", "mmc_busclk.2", &clk_sclk_mmc3.clk),
+	CLKDEV_INIT("dma-pl330.0", "apb_pclk", &clk_pdma0),
+	CLKDEV_INIT("dma-pl330.1", "apb_pclk", &clk_pdma1),
 };
 
 static int xtal_rate;
@@ -1527,6 +1538,10 @@ void __init exynos4_register_clocks(void)
 	s3c_register_clksrc(clksrcs, ARRAY_SIZE(clksrcs));
 	s3c_register_clocks(init_clocks, ARRAY_SIZE(init_clocks));
 
+	s3c24xx_register_clocks(clk_cdev, ARRAY_SIZE(clk_cdev));
+	for (ptr = 0; ptr < ARRAY_SIZE(clk_cdev); ptr++)
+		s3c_disable_clocks(clk_cdev[ptr], 1);
+
 	s3c_register_clocks(init_clocks_off, ARRAY_SIZE(init_clocks_off));
 	s3c_disable_clocks(init_clocks_off, ARRAY_SIZE(init_clocks_off));
 	clkdev_add_table(exynos4_clk_lookup, ARRAY_SIZE(exynos4_clk_lookup));
-- 
1.6.6.rc2

  reply	other threads:[~2011-10-10 18:15 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-10-10 18:15 [PATCH v6 00/10] Add device tree support for PL330 dma controller driver Thomas Abraham
2011-10-10 18:15 ` [PATCH v6 01/10] DMA: PL330: move filter function into driver Thomas Abraham
2011-10-10 18:15   ` [PATCH v6 02/10] DMA: PL330: Infer transfer direction from transfer request instead of platform data Thomas Abraham
2011-10-10 18:15     ` [PATCH v6 03/10] ARM: EXYNOS4: Modify platform data for pl330 driver Thomas Abraham
2011-10-10 18:15       ` [PATCH v6 04/10] DMA: PL330: Add device tree support Thomas Abraham
2011-10-10 18:15         ` [PATCH v6 05/10] ARM: SAMSUNG: Add device tree support for pl330 dma engine wrappers Thomas Abraham
2011-10-10 18:15           ` [PATCH v6 06/10] ARM: EXYNOS4: Limit usage of pl330 device instance to non-dt build Thomas Abraham
2011-10-10 18:15             ` Thomas Abraham [this message]
2011-10-10 18:15               ` [PATCH v6 08/10] ARM: S5P64x0: Modify platform data for pl330 driver Thomas Abraham
2011-10-10 18:15                 ` [PATCH v6 09/10] ARM: S5PC100: " Thomas Abraham
2011-10-10 18:15                   ` [PATCH v6 10/10] ARM: S5PV210: " Thomas Abraham
2011-10-12  3:59                     ` Boojin Kim
2011-10-12  3:58                   ` [PATCH v6 09/10] ARM: S5PC100: " Boojin Kim
2011-10-12  4:11                   ` Anca Emanuel
2011-10-12  4:34                     ` Thomas Abraham
2011-10-12  4:52                       ` Kukjin Kim
2011-10-12 11:51                   ` [PATCH v7 " Thomas Abraham
2011-10-12  4:04         ` [PATCH v6 04/10] DMA: PL330: Add device tree support Boojin Kim
2011-10-12  5:36       ` [PATCH v6 03/10] ARM: EXYNOS4: Modify platform data for pl330 driver Thomas Abraham
2011-10-12  8:08         ` Boojin Kim
2011-10-12  8:13           ` Thomas Abraham
2011-10-12 11:46       ` [PATCH v7 " Thomas Abraham
2011-10-12  4:01     ` [PATCH v6 02/10] DMA: PL330: Infer transfer direction from transfer request instead of platform data Boojin Kim
2011-10-11 12:06 ` [PATCH v6 00/10] Add device tree support for PL330 dma controller driver Kukjin Kim
2011-10-11 15:05   ` Thomas Abraham
2011-10-11 16:49   ` Vinod Koul
2011-10-12  5:03     ` Kukjin Kim
2011-10-12  5:20       ` Vinod Koul

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1318270538-30450-8-git-send-email-thomas.abraham@linaro.org \
    --to=thomas.abraham@linaro.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox