linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v3 0/9] Add clk_prepare/clk_unprepare
@ 2012-06-05  4:29 Prashant Gaikwad
  2012-06-05  4:29 ` [PATCH v3 1/9] ARM: tegra: add clk_prepare/clk_unprepare Prashant Gaikwad
                   ` (9 more replies)
  0 siblings, 10 replies; 17+ messages in thread
From: Prashant Gaikwad @ 2012-06-05  4:29 UTC (permalink / raw)
  To: linux-arm-kernel

This patch set adds use of clk_prepare/clk_unprepare as
required by generic clock framework.

Tested on Ventana and Cardhu.

Please ignore previous versions. Updated commit message and
maintainers properly in this version. No other change.

Prashant Gaikwad (9):
  ARM: tegra: add clk_prepare/clk_unprepare
  i2c: tegra: Add clk_prepare/clk_unprepare
  mmc: tegra: add clk_prepare/clk_unprepare
  USB: ehci-tegra: add clk_prepare/clk_unprepare
  Input: tegra-kbc - add clk_prepare/clk_unprepare
  spi/tegra: add clk_prepare/clk_unprepare
  staging: nvec: add clk_prepare/clk_unprepare
  ASoC: tegra: add clk_prepare/clk_unprepare
  crypto: add clk_prepare/clk_unprepare

 arch/arm/mach-tegra/cpu-tegra.c    |    6 +++---
 arch/arm/mach-tegra/dma.c          |    2 +-
 arch/arm/mach-tegra/pcie.c         |    6 +++---
 arch/arm/mach-tegra/powergate.c    |    4 ++--
 arch/arm/mach-tegra/timer.c        |    4 ++--
 arch/arm/mach-tegra/usb_phy.c      |   16 ++++++++--------
 drivers/crypto/tegra-aes.c         |   12 ++++++------
 drivers/i2c/busses/i2c-tegra.c     |   10 +++++-----
 drivers/input/keyboard/tegra-kbc.c |    4 ++--
 drivers/mmc/host/sdhci-tegra.c     |    6 +++---
 drivers/spi/spi-tegra.c            |    4 ++--
 drivers/staging/nvec/nvec.c        |    8 ++++----
 drivers/usb/host/ehci-tegra.c      |   20 ++++++++++----------
 sound/soc/tegra/tegra20_i2s.c      |    4 ++--
 sound/soc/tegra/tegra20_spdif.c    |    4 ++--
 sound/soc/tegra/tegra30_ahub.c     |    8 ++++----
 sound/soc/tegra/tegra30_i2s.c      |    4 ++--
 sound/soc/tegra/tegra_asoc_utils.c |   12 ++++++------
 18 files changed, 67 insertions(+), 67 deletions(-)

-- 
1.7.4.1

^ permalink raw reply	[flat|nested] 17+ messages in thread

* [PATCH v3 1/9] ARM: tegra: add clk_prepare/clk_unprepare
  2012-06-05  4:29 [PATCH v3 0/9] Add clk_prepare/clk_unprepare Prashant Gaikwad
@ 2012-06-05  4:29 ` Prashant Gaikwad
  2012-06-05  4:29 ` [PATCH v3 2/9] i2c: tegra: Add clk_prepare/clk_unprepare Prashant Gaikwad
                   ` (8 subsequent siblings)
  9 siblings, 0 replies; 17+ messages in thread
From: Prashant Gaikwad @ 2012-06-05  4:29 UTC (permalink / raw)
  To: linux-arm-kernel

Use clk_prepare/clk_unprepare as required by the generic clk framework.

Tested on Ventana and Cardhu.

Signed-off-by: Prashant Gaikwad <pgaikwad@nvidia.com>
---
Please ignore previous versions. Updated commit message and
maintainers properly in this version. No other change.

This patch should go through Tegra tree since other patches to port Tegra
to generic clock framework are dependent on it.

 arch/arm/mach-tegra/cpu-tegra.c |    6 +++---
 arch/arm/mach-tegra/dma.c       |    2 +-
 arch/arm/mach-tegra/pcie.c      |    6 +++---
 arch/arm/mach-tegra/powergate.c |    4 ++--
 arch/arm/mach-tegra/timer.c     |    4 ++--
 arch/arm/mach-tegra/usb_phy.c   |   16 ++++++++--------
 6 files changed, 19 insertions(+), 19 deletions(-)

diff --git a/arch/arm/mach-tegra/cpu-tegra.c b/arch/arm/mach-tegra/cpu-tegra.c
index 7a065f0..ceb52db 100644
--- a/arch/arm/mach-tegra/cpu-tegra.c
+++ b/arch/arm/mach-tegra/cpu-tegra.c
@@ -189,8 +189,8 @@ static int tegra_cpu_init(struct cpufreq_policy *policy)
 		return PTR_ERR(emc_clk);
 	}
 
-	clk_enable(emc_clk);
-	clk_enable(cpu_clk);
+	clk_prepare_enable(emc_clk);
+	clk_prepare_enable(cpu_clk);
 
 	cpufreq_frequency_table_cpuinfo(policy, freq_table);
 	cpufreq_frequency_table_get_attr(freq_table, policy->cpu);
@@ -212,7 +212,7 @@ static int tegra_cpu_init(struct cpufreq_policy *policy)
 static int tegra_cpu_exit(struct cpufreq_policy *policy)
 {
 	cpufreq_frequency_table_cpuinfo(policy, freq_table);
-	clk_disable(emc_clk);
+	clk_disable_unprepare(emc_clk);
 	clk_put(emc_clk);
 	clk_put(cpu_clk);
 	return 0;
diff --git a/arch/arm/mach-tegra/dma.c b/arch/arm/mach-tegra/dma.c
index abea4f6..2698d7d 100644
--- a/arch/arm/mach-tegra/dma.c
+++ b/arch/arm/mach-tegra/dma.c
@@ -720,7 +720,7 @@ int __init tegra_dma_init(void)
 		ret = PTR_ERR(c);
 		goto fail;
 	}
-	ret = clk_enable(c);
+	ret = clk_prepare_enable(c);
 	if (ret != 0) {
 		pr_err("Unable to enable clock for APB DMA\n");
 		goto fail;
diff --git a/arch/arm/mach-tegra/pcie.c b/arch/arm/mach-tegra/pcie.c
index 0e09137..d3ad515 100644
--- a/arch/arm/mach-tegra/pcie.c
+++ b/arch/arm/mach-tegra/pcie.c
@@ -723,9 +723,9 @@ static int tegra_pcie_power_regate(void)
 
 	tegra_pcie_xclk_clamp(false);
 
-	clk_enable(tegra_pcie.afi_clk);
-	clk_enable(tegra_pcie.pex_clk);
-	return clk_enable(tegra_pcie.pll_e);
+	clk_prepare_enable(tegra_pcie.afi_clk);
+	clk_prepare_enable(tegra_pcie.pex_clk);
+	return clk_prepare_enable(tegra_pcie.pll_e);
 }
 
 static int tegra_pcie_clocks_get(void)
diff --git a/arch/arm/mach-tegra/powergate.c b/arch/arm/mach-tegra/powergate.c
index f5b12fb..15d5065 100644
--- a/arch/arm/mach-tegra/powergate.c
+++ b/arch/arm/mach-tegra/powergate.c
@@ -146,7 +146,7 @@ int tegra_powergate_sequence_power_up(int id, struct clk *clk)
 	if (ret)
 		goto err_power;
 
-	ret = clk_enable(clk);
+	ret = clk_prepare_enable(clk);
 	if (ret)
 		goto err_clk;
 
@@ -162,7 +162,7 @@ int tegra_powergate_sequence_power_up(int id, struct clk *clk)
 	return 0;
 
 err_clamp:
-	clk_disable(clk);
+	clk_disable_unprepare(clk);
 err_clk:
 	tegra_powergate_power_off(id);
 err_power:
diff --git a/arch/arm/mach-tegra/timer.c b/arch/arm/mach-tegra/timer.c
index 315672c..57b5bdc 100644
--- a/arch/arm/mach-tegra/timer.c
+++ b/arch/arm/mach-tegra/timer.c
@@ -189,7 +189,7 @@ static void __init tegra_init_timer(void)
 			" Assuming 12Mhz input clock.\n");
 		rate = 12000000;
 	} else {
-		clk_enable(clk);
+		clk_prepare_enable(clk);
 		rate = clk_get_rate(clk);
 	}
 
@@ -201,7 +201,7 @@ static void __init tegra_init_timer(void)
 	if (IS_ERR(clk))
 		pr_warn("Unable to get rtc-tegra clock\n");
 	else
-		clk_enable(clk);
+		clk_prepare_enable(clk);
 
 	switch (rate) {
 	case 12000000:
diff --git a/arch/arm/mach-tegra/usb_phy.c b/arch/arm/mach-tegra/usb_phy.c
index 54e353c..022b33a 100644
--- a/arch/arm/mach-tegra/usb_phy.c
+++ b/arch/arm/mach-tegra/usb_phy.c
@@ -247,7 +247,7 @@ static void utmip_pad_power_on(struct tegra_usb_phy *phy)
 	unsigned long val, flags;
 	void __iomem *base = phy->pad_regs;
 
-	clk_enable(phy->pad_clk);
+	clk_prepare_enable(phy->pad_clk);
 
 	spin_lock_irqsave(&utmip_pad_lock, flags);
 
@@ -259,7 +259,7 @@ static void utmip_pad_power_on(struct tegra_usb_phy *phy)
 
 	spin_unlock_irqrestore(&utmip_pad_lock, flags);
 
-	clk_disable(phy->pad_clk);
+	clk_disable_unprepare(phy->pad_clk);
 }
 
 static int utmip_pad_power_off(struct tegra_usb_phy *phy)
@@ -272,7 +272,7 @@ static int utmip_pad_power_off(struct tegra_usb_phy *phy)
 		return -EINVAL;
 	}
 
-	clk_enable(phy->pad_clk);
+	clk_prepare_enable(phy->pad_clk);
 
 	spin_lock_irqsave(&utmip_pad_lock, flags);
 
@@ -284,7 +284,7 @@ static int utmip_pad_power_off(struct tegra_usb_phy *phy)
 
 	spin_unlock_irqrestore(&utmip_pad_lock, flags);
 
-	clk_disable(phy->pad_clk);
+	clk_disable_unprepare(phy->pad_clk);
 
 	return 0;
 }
@@ -580,7 +580,7 @@ static int ulpi_phy_power_on(struct tegra_usb_phy *phy)
 	msleep(5);
 	gpio_direction_output(config->reset_gpio, 1);
 
-	clk_enable(phy->clk);
+	clk_prepare_enable(phy->clk);
 	msleep(1);
 
 	val = readl(base + USB_SUSP_CTRL);
@@ -689,7 +689,7 @@ struct tegra_usb_phy *tegra_usb_phy_open(struct device *dev, int instance,
 		err = PTR_ERR(phy->pll_u);
 		goto err0;
 	}
-	clk_enable(phy->pll_u);
+	clk_prepare_enable(phy->pll_u);
 
 	parent_rate = clk_get_rate(clk_get_parent(phy->pll_u));
 	for (i = 0; i < ARRAY_SIZE(tegra_freq_table); i++) {
@@ -735,7 +735,7 @@ struct tegra_usb_phy *tegra_usb_phy_open(struct device *dev, int instance,
 	return phy;
 
 err1:
-	clk_disable(phy->pll_u);
+	clk_disable_unprepare(phy->pll_u);
 	clk_put(phy->pll_u);
 err0:
 	kfree(phy);
@@ -810,7 +810,7 @@ void tegra_usb_phy_close(struct tegra_usb_phy *phy)
 		clk_put(phy->clk);
 	else
 		utmip_pad_close(phy);
-	clk_disable(phy->pll_u);
+	clk_disable_unprepare(phy->pll_u);
 	clk_put(phy->pll_u);
 	kfree(phy);
 }
-- 
1.7.4.1

^ permalink raw reply related	[flat|nested] 17+ messages in thread

* [PATCH v3 2/9] i2c: tegra: Add clk_prepare/clk_unprepare
  2012-06-05  4:29 [PATCH v3 0/9] Add clk_prepare/clk_unprepare Prashant Gaikwad
  2012-06-05  4:29 ` [PATCH v3 1/9] ARM: tegra: add clk_prepare/clk_unprepare Prashant Gaikwad
@ 2012-06-05  4:29 ` Prashant Gaikwad
  2012-06-05  4:29 ` [PATCH v3 3/9] mmc: tegra: add clk_prepare/clk_unprepare Prashant Gaikwad
                   ` (7 subsequent siblings)
  9 siblings, 0 replies; 17+ messages in thread
From: Prashant Gaikwad @ 2012-06-05  4:29 UTC (permalink / raw)
  To: linux-arm-kernel

Use clk_prepare/clk_unprepare as required by the generic clk framework.

Signed-off-by: Prashant Gaikwad <pgaikwad@nvidia.com>
---
Please ignore previous versions. Updated commit message and
maintainers properly in this version. No other change.

This patch should go through Tegra tree since other patches to port tegra
to generic clock framework are dependent on it. Posting here to get ack from
the maintainers.

 drivers/i2c/busses/i2c-tegra.c |   10 +++++-----
 1 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/drivers/i2c/busses/i2c-tegra.c b/drivers/i2c/busses/i2c-tegra.c
index 8b2e555..3da7ee3 100644
--- a/drivers/i2c/busses/i2c-tegra.c
+++ b/drivers/i2c/busses/i2c-tegra.c
@@ -341,7 +341,7 @@ static int tegra_i2c_init(struct tegra_i2c_dev *i2c_dev)
 	u32 val;
 	int err = 0;
 
-	clk_enable(i2c_dev->clk);
+	clk_prepare_enable(i2c_dev->clk);
 
 	tegra_periph_reset_assert(i2c_dev->clk);
 	udelay(2);
@@ -372,7 +372,7 @@ static int tegra_i2c_init(struct tegra_i2c_dev *i2c_dev)
 	if (tegra_i2c_flush_fifos(i2c_dev))
 		err = -ETIMEDOUT;
 
-	clk_disable(i2c_dev->clk);
+	clk_disable_unprepare(i2c_dev->clk);
 
 	if (i2c_dev->irq_disabled) {
 		i2c_dev->irq_disabled = 0;
@@ -546,14 +546,14 @@ static int tegra_i2c_xfer(struct i2c_adapter *adap, struct i2c_msg msgs[],
 	if (i2c_dev->is_suspended)
 		return -EBUSY;
 
-	clk_enable(i2c_dev->clk);
+	clk_prepare_enable(i2c_dev->clk);
 	for (i = 0; i < num; i++) {
 		int stop = (i == (num - 1)) ? 1  : 0;
 		ret = tegra_i2c_xfer_msg(i2c_dev, &msgs[i], stop);
 		if (ret)
 			break;
 	}
-	clk_disable(i2c_dev->clk);
+	clk_disable_unprepare(i2c_dev->clk);
 	return ret ?: i;
 }
 
@@ -666,7 +666,7 @@ static int __devinit tegra_i2c_probe(struct platform_device *pdev)
 		goto err_free;
 	}
 
-	clk_enable(i2c_dev->i2c_clk);
+	clk_prepare_enable(i2c_dev->i2c_clk);
 
 	i2c_set_adapdata(&i2c_dev->adapter, i2c_dev);
 	i2c_dev->adapter.owner = THIS_MODULE;
-- 
1.7.4.1

^ permalink raw reply related	[flat|nested] 17+ messages in thread

* [PATCH v3 3/9] mmc: tegra: add clk_prepare/clk_unprepare
  2012-06-05  4:29 [PATCH v3 0/9] Add clk_prepare/clk_unprepare Prashant Gaikwad
  2012-06-05  4:29 ` [PATCH v3 1/9] ARM: tegra: add clk_prepare/clk_unprepare Prashant Gaikwad
  2012-06-05  4:29 ` [PATCH v3 2/9] i2c: tegra: Add clk_prepare/clk_unprepare Prashant Gaikwad
@ 2012-06-05  4:29 ` Prashant Gaikwad
  2012-06-05  4:29 ` [PATCH v3 4/9] USB: ehci-tegra: " Prashant Gaikwad
                   ` (6 subsequent siblings)
  9 siblings, 0 replies; 17+ messages in thread
From: Prashant Gaikwad @ 2012-06-05  4:29 UTC (permalink / raw)
  To: linux-arm-kernel

Use clk_prepare/clk_unprepare as required by the generic clk framework.

Signed-off-by: Prashant Gaikwad <pgaikwad@nvidia.com>
---
Please ignore previous versions. Updated commit message and
maintainers properly in this version. No other change.

This patch should go through Tegra tree since other patches to port tegra
to generic clock framework are dependent on it. Posting here to get ack from
the maintainers.

 drivers/mmc/host/sdhci-tegra.c |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/mmc/host/sdhci-tegra.c b/drivers/mmc/host/sdhci-tegra.c
index b38d8a7..2789656 100644
--- a/drivers/mmc/host/sdhci-tegra.c
+++ b/drivers/mmc/host/sdhci-tegra.c
@@ -334,7 +334,7 @@ static int __devinit sdhci_tegra_probe(struct platform_device *pdev)
 		rc = PTR_ERR(clk);
 		goto err_clk_get;
 	}
-	clk_enable(clk);
+	clk_prepare_enable(clk);
 	pltfm_host->clk = clk;
 
 	host->mmc->pm_caps = plat->pm_flags;
@@ -349,7 +349,7 @@ static int __devinit sdhci_tegra_probe(struct platform_device *pdev)
 	return 0;
 
 err_add_host:
-	clk_disable(pltfm_host->clk);
+	clk_disable_unprepare(pltfm_host->clk);
 	clk_put(pltfm_host->clk);
 err_clk_get:
 	if (gpio_is_valid(plat->wp_gpio))
@@ -390,7 +390,7 @@ static int __devexit sdhci_tegra_remove(struct platform_device *pdev)
 	if (gpio_is_valid(plat->power_gpio))
 		gpio_free(plat->power_gpio);
 
-	clk_disable(pltfm_host->clk);
+	clk_disable_unprepare(pltfm_host->clk);
 	clk_put(pltfm_host->clk);
 
 	sdhci_pltfm_free(pdev);
-- 
1.7.4.1

^ permalink raw reply related	[flat|nested] 17+ messages in thread

* [PATCH v3 4/9] USB: ehci-tegra: add clk_prepare/clk_unprepare
  2012-06-05  4:29 [PATCH v3 0/9] Add clk_prepare/clk_unprepare Prashant Gaikwad
                   ` (2 preceding siblings ...)
  2012-06-05  4:29 ` [PATCH v3 3/9] mmc: tegra: add clk_prepare/clk_unprepare Prashant Gaikwad
@ 2012-06-05  4:29 ` Prashant Gaikwad
  2012-06-05  4:29 ` [PATCH v3 5/9] Input: tegra-kbc - " Prashant Gaikwad
                   ` (5 subsequent siblings)
  9 siblings, 0 replies; 17+ messages in thread
From: Prashant Gaikwad @ 2012-06-05  4:29 UTC (permalink / raw)
  To: linux-arm-kernel

Use clk_prepare/clk_unprepare as required by the generic clk framework.

Signed-off-by: Prashant Gaikwad <pgaikwad@nvidia.com>
---
Please ignore previous versions. Updated commit message and
maintainers properly in this version. No other change.

This patch should go through Tegra tree since other patches to port Tegra
to generic clock framework are dependent on it. Posting here to get ack from
the maintainers.

 drivers/usb/host/ehci-tegra.c |   20 ++++++++++----------
 1 files changed, 10 insertions(+), 10 deletions(-)

diff --git a/drivers/usb/host/ehci-tegra.c b/drivers/usb/host/ehci-tegra.c
index 6854823..ab8a3bf 100644
--- a/drivers/usb/host/ehci-tegra.c
+++ b/drivers/usb/host/ehci-tegra.c
@@ -46,8 +46,8 @@ static void tegra_ehci_power_up(struct usb_hcd *hcd)
 {
 	struct tegra_ehci_hcd *tegra = dev_get_drvdata(hcd->self.controller);
 
-	clk_enable(tegra->emc_clk);
-	clk_enable(tegra->clk);
+	clk_prepare_enable(tegra->emc_clk);
+	clk_prepare_enable(tegra->clk);
 	tegra_usb_phy_power_on(tegra->phy);
 	tegra->host_resumed = 1;
 }
@@ -58,8 +58,8 @@ static void tegra_ehci_power_down(struct usb_hcd *hcd)
 
 	tegra->host_resumed = 0;
 	tegra_usb_phy_power_off(tegra->phy);
-	clk_disable(tegra->clk);
-	clk_disable(tegra->emc_clk);
+	clk_disable_unprepare(tegra->clk);
+	clk_disable_unprepare(tegra->emc_clk);
 }
 
 static int tegra_ehci_internal_port_reset(
@@ -671,7 +671,7 @@ static int tegra_ehci_probe(struct platform_device *pdev)
 		goto fail_clk;
 	}
 
-	err = clk_enable(tegra->clk);
+	err = clk_prepare_enable(tegra->clk);
 	if (err)
 		goto fail_clken;
 
@@ -682,7 +682,7 @@ static int tegra_ehci_probe(struct platform_device *pdev)
 		goto fail_emc_clk;
 	}
 
-	clk_enable(tegra->emc_clk);
+	clk_prepare_enable(tegra->emc_clk);
 	clk_set_rate(tegra->emc_clk, 400000000);
 
 	res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
@@ -782,10 +782,10 @@ fail:
 fail_phy:
 	iounmap(hcd->regs);
 fail_io:
-	clk_disable(tegra->emc_clk);
+	clk_disable_unprepare(tegra->emc_clk);
 	clk_put(tegra->emc_clk);
 fail_emc_clk:
-	clk_disable(tegra->clk);
+	clk_disable_unprepare(tegra->clk);
 fail_clken:
 	clk_put(tegra->clk);
 fail_clk:
@@ -820,10 +820,10 @@ static int tegra_ehci_remove(struct platform_device *pdev)
 	tegra_usb_phy_close(tegra->phy);
 	iounmap(hcd->regs);
 
-	clk_disable(tegra->clk);
+	clk_disable_unprepare(tegra->clk);
 	clk_put(tegra->clk);
 
-	clk_disable(tegra->emc_clk);
+	clk_disable_unprepare(tegra->emc_clk);
 	clk_put(tegra->emc_clk);
 
 	kfree(tegra);
-- 
1.7.4.1

^ permalink raw reply related	[flat|nested] 17+ messages in thread

* [PATCH v3 5/9] Input: tegra-kbc - add clk_prepare/clk_unprepare
  2012-06-05  4:29 [PATCH v3 0/9] Add clk_prepare/clk_unprepare Prashant Gaikwad
                   ` (3 preceding siblings ...)
  2012-06-05  4:29 ` [PATCH v3 4/9] USB: ehci-tegra: " Prashant Gaikwad
@ 2012-06-05  4:29 ` Prashant Gaikwad
  2012-06-12  7:30   ` Dmitry Torokhov
  2012-06-05  4:29 ` [PATCH v3 6/9] spi/tegra: " Prashant Gaikwad
                   ` (4 subsequent siblings)
  9 siblings, 1 reply; 17+ messages in thread
From: Prashant Gaikwad @ 2012-06-05  4:29 UTC (permalink / raw)
  To: linux-arm-kernel

Use clk_prepare/clk_unprepare as required by the generic clk framework.

Signed-off-by: Prashant Gaikwad <pgaikwad@nvidia.com>
---
Please ignore previous versions. Updated commit message and
maintainers properly in this version. No other change.

This patch should go through Tegra tree since other patches to port tegra
to generic clock framework are dependent on it. Posting here to get ack from
the maintainers.

 drivers/input/keyboard/tegra-kbc.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/input/keyboard/tegra-kbc.c b/drivers/input/keyboard/tegra-kbc.c
index 4ffe64d..2c1c9ed 100644
--- a/drivers/input/keyboard/tegra-kbc.c
+++ b/drivers/input/keyboard/tegra-kbc.c
@@ -492,7 +492,7 @@ static int tegra_kbc_start(struct tegra_kbc *kbc)
 	unsigned int debounce_cnt;
 	u32 val = 0;
 
-	clk_enable(kbc->clk);
+	clk_prepare_enable(kbc->clk);
 
 	/* Reset the KBC controller to clear all previous status.*/
 	tegra_periph_reset_assert(kbc->clk);
@@ -556,7 +556,7 @@ static void tegra_kbc_stop(struct tegra_kbc *kbc)
 	disable_irq(kbc->irq);
 	del_timer_sync(&kbc->timer);
 
-	clk_disable(kbc->clk);
+	clk_disable_unprepare(kbc->clk);
 }
 
 static int tegra_kbc_open(struct input_dev *dev)
-- 
1.7.4.1

^ permalink raw reply related	[flat|nested] 17+ messages in thread

* [PATCH v3 6/9] spi/tegra: add clk_prepare/clk_unprepare
  2012-06-05  4:29 [PATCH v3 0/9] Add clk_prepare/clk_unprepare Prashant Gaikwad
                   ` (4 preceding siblings ...)
  2012-06-05  4:29 ` [PATCH v3 5/9] Input: tegra-kbc - " Prashant Gaikwad
@ 2012-06-05  4:29 ` Prashant Gaikwad
  2012-06-05  4:29 ` [PATCH v3 7/9] staging: nvec: " Prashant Gaikwad
                   ` (3 subsequent siblings)
  9 siblings, 0 replies; 17+ messages in thread
From: Prashant Gaikwad @ 2012-06-05  4:29 UTC (permalink / raw)
  To: linux-arm-kernel

Use clk_prepare/clk_unprepare as required by the generic clk framework.

Signed-off-by: Prashant Gaikwad <pgaikwad@nvidia.com>
---
Please ignore previous versions. Updated commit message and
maintainers properly in this version. No other change.

This patch should go through Tegra tree since other patches to port Tegra
to generic clock framework are dependent on it. Posting here to get ack from
the maintainers.

 drivers/spi/spi-tegra.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/spi/spi-tegra.c b/drivers/spi/spi-tegra.c
index ae6d78a..7f99ff3 100644
--- a/drivers/spi/spi-tegra.c
+++ b/drivers/spi/spi-tegra.c
@@ -261,7 +261,7 @@ static void spi_tegra_start_transfer(struct spi_device *spi,
 		clk_set_rate(tspi->clk, speed);
 
 	if (tspi->cur_speed == 0)
-		clk_enable(tspi->clk);
+		clk_prepare_enable(tspi->clk);
 
 	tspi->cur_speed = speed;
 
@@ -373,7 +373,7 @@ static void tegra_spi_rx_dma_complete(struct tegra_dma_req *req)
 			spi = m->state;
 			spi_tegra_start_message(spi, m);
 		} else {
-			clk_disable(tspi->clk);
+			clk_disable_unprepare(tspi->clk);
 			tspi->cur_speed = 0;
 		}
 	}
-- 
1.7.4.1

^ permalink raw reply related	[flat|nested] 17+ messages in thread

* [PATCH v3 7/9] staging: nvec: add clk_prepare/clk_unprepare
  2012-06-05  4:29 [PATCH v3 0/9] Add clk_prepare/clk_unprepare Prashant Gaikwad
                   ` (5 preceding siblings ...)
  2012-06-05  4:29 ` [PATCH v3 6/9] spi/tegra: " Prashant Gaikwad
@ 2012-06-05  4:29 ` Prashant Gaikwad
  2012-06-08 19:48   ` Marc Dietrich
  2012-06-05  4:29 ` [PATCH v3 8/9] ASoC: tegra: " Prashant Gaikwad
                   ` (2 subsequent siblings)
  9 siblings, 1 reply; 17+ messages in thread
From: Prashant Gaikwad @ 2012-06-05  4:29 UTC (permalink / raw)
  To: linux-arm-kernel

Use clk_prepare/clk_unprepare as required by the generic clk framework.

Signed-off-by: Prashant Gaikwad <pgaikwad@nvidia.com>
---
Please ignore previous versions. Updated commit message and
maintainers properly in this version. No other change.

This patch should go through Tegra tree since other patches to port Tegra
to generic clock framework are dependent on it. Posting here to get ack from
the maintainers.

 drivers/staging/nvec/nvec.c |    8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/staging/nvec/nvec.c b/drivers/staging/nvec/nvec.c
index 3c60088..9356886 100644
--- a/drivers/staging/nvec/nvec.c
+++ b/drivers/staging/nvec/nvec.c
@@ -675,7 +675,7 @@ static void tegra_init_i2c_slave(struct nvec_chip *nvec)
 {
 	u32 val;
 
-	clk_enable(nvec->i2c_clk);
+	clk_prepare_enable(nvec->i2c_clk);
 
 	tegra_periph_reset_assert(nvec->i2c_clk);
 	udelay(2);
@@ -695,14 +695,14 @@ static void tegra_init_i2c_slave(struct nvec_chip *nvec)
 
 	enable_irq(nvec->irq);
 
-	clk_disable(nvec->i2c_clk);
+	clk_disable_unprepare(nvec->i2c_clk);
 }
 
 static void nvec_disable_i2c_slave(struct nvec_chip *nvec)
 {
 	disable_irq(nvec->irq);
 	writel(I2C_SL_NEWSL | I2C_SL_NACK, nvec->base + I2C_SL_CNFG);
-	clk_disable(nvec->i2c_clk);
+	clk_disable_unprepare(nvec->i2c_clk);
 }
 
 static void nvec_power_off(void)
@@ -812,7 +812,7 @@ static int __devinit tegra_nvec_probe(struct platform_device *pdev)
 
 	tegra_init_i2c_slave(nvec);
 
-	clk_enable(i2c_clk);
+	clk_prepare_enable(i2c_clk);
 
 
 	/* enable event reporting */
-- 
1.7.4.1

^ permalink raw reply related	[flat|nested] 17+ messages in thread

* [PATCH v3 8/9] ASoC: tegra: add clk_prepare/clk_unprepare
  2012-06-05  4:29 [PATCH v3 0/9] Add clk_prepare/clk_unprepare Prashant Gaikwad
                   ` (6 preceding siblings ...)
  2012-06-05  4:29 ` [PATCH v3 7/9] staging: nvec: " Prashant Gaikwad
@ 2012-06-05  4:29 ` Prashant Gaikwad
  2012-06-08  1:02   ` Mark Brown
  2012-06-08  4:43   ` Pankaj Jangra
  2012-06-05  4:29 ` [PATCH v3 9/9] crypto: " Prashant Gaikwad
  2012-06-11 18:04 ` [PATCH v3 0/9] Add clk_prepare/clk_unprepare Stephen Warren
  9 siblings, 2 replies; 17+ messages in thread
From: Prashant Gaikwad @ 2012-06-05  4:29 UTC (permalink / raw)
  To: linux-arm-kernel

Use clk_prepare/clk_unprepare as required by the generic clk framework.

Signed-off-by: Prashant Gaikwad <pgaikwad@nvidia.com>
---
Please ignore previous versions. Updated commit message and
maintainers properly in this version. No other change.

This patch should go through Tegra tree since other patches to port Tegra
to generic clock framework are dependent on it. Posting here to get ack from
the maintainers.

 sound/soc/tegra/tegra20_i2s.c      |    4 ++--
 sound/soc/tegra/tegra20_spdif.c    |    4 ++--
 sound/soc/tegra/tegra30_ahub.c     |    8 ++++----
 sound/soc/tegra/tegra30_i2s.c      |    4 ++--
 sound/soc/tegra/tegra_asoc_utils.c |   12 ++++++------
 5 files changed, 16 insertions(+), 16 deletions(-)

diff --git a/sound/soc/tegra/tegra20_i2s.c b/sound/soc/tegra/tegra20_i2s.c
index 0c7af63..1647dbf 100644
--- a/sound/soc/tegra/tegra20_i2s.c
+++ b/sound/soc/tegra/tegra20_i2s.c
@@ -62,7 +62,7 @@ static int tegra20_i2s_runtime_suspend(struct device *dev)
 {
 	struct tegra20_i2s *i2s = dev_get_drvdata(dev);
 
-	clk_disable(i2s->clk_i2s);
+	clk_disable_unprepare(i2s->clk_i2s);
 
 	return 0;
 }
@@ -72,7 +72,7 @@ static int tegra20_i2s_runtime_resume(struct device *dev)
 	struct tegra20_i2s *i2s = dev_get_drvdata(dev);
 	int ret;
 
-	ret = clk_enable(i2s->clk_i2s);
+	ret = clk_prepare_enable(i2s->clk_i2s);
 	if (ret) {
 		dev_err(dev, "clk_enable failed: %d\n", ret);
 		return ret;
diff --git a/sound/soc/tegra/tegra20_spdif.c b/sound/soc/tegra/tegra20_spdif.c
index f9b5741..2262e4f 100644
--- a/sound/soc/tegra/tegra20_spdif.c
+++ b/sound/soc/tegra/tegra20_spdif.c
@@ -54,7 +54,7 @@ static int tegra20_spdif_runtime_suspend(struct device *dev)
 {
 	struct tegra20_spdif *spdif = dev_get_drvdata(dev);
 
-	clk_disable(spdif->clk_spdif_out);
+	clk_disable_unprepare(spdif->clk_spdif_out);
 
 	return 0;
 }
@@ -64,7 +64,7 @@ static int tegra20_spdif_runtime_resume(struct device *dev)
 	struct tegra20_spdif *spdif = dev_get_drvdata(dev);
 	int ret;
 
-	ret = clk_enable(spdif->clk_spdif_out);
+	ret = clk_prepare_enable(spdif->clk_spdif_out);
 	if (ret) {
 		dev_err(dev, "clk_enable failed: %d\n", ret);
 		return ret;
diff --git a/sound/soc/tegra/tegra30_ahub.c b/sound/soc/tegra/tegra30_ahub.c
index 57cd419..1efb822 100644
--- a/sound/soc/tegra/tegra30_ahub.c
+++ b/sound/soc/tegra/tegra30_ahub.c
@@ -56,8 +56,8 @@ static int tegra30_ahub_runtime_suspend(struct device *dev)
 	regcache_cache_only(ahub->regmap_apbif, true);
 	regcache_cache_only(ahub->regmap_ahub, true);
 
-	clk_disable(ahub->clk_apbif);
-	clk_disable(ahub->clk_d_audio);
+	clk_disable_unprepare(ahub->clk_apbif);
+	clk_disable_unprepare(ahub->clk_d_audio);
 
 	return 0;
 }
@@ -77,12 +77,12 @@ static int tegra30_ahub_runtime_resume(struct device *dev)
 {
 	int ret;
 
-	ret = clk_enable(ahub->clk_d_audio);
+	ret = clk_prepare_enable(ahub->clk_d_audio);
 	if (ret) {
 		dev_err(dev, "clk_enable d_audio failed: %d\n", ret);
 		return ret;
 	}
-	ret = clk_enable(ahub->clk_apbif);
+	ret = clk_prepare_enable(ahub->clk_apbif);
 	if (ret) {
 		dev_err(dev, "clk_enable apbif failed: %d\n", ret);
 		clk_disable(ahub->clk_d_audio);
diff --git a/sound/soc/tegra/tegra30_i2s.c b/sound/soc/tegra/tegra30_i2s.c
index 8596032..d308faa 100644
--- a/sound/soc/tegra/tegra30_i2s.c
+++ b/sound/soc/tegra/tegra30_i2s.c
@@ -62,7 +62,7 @@ static int tegra30_i2s_runtime_suspend(struct device *dev)
 
 	regcache_cache_only(i2s->regmap, true);
 
-	clk_disable(i2s->clk_i2s);
+	clk_disable_unprepare(i2s->clk_i2s);
 
 	return 0;
 }
@@ -72,7 +72,7 @@ static int tegra30_i2s_runtime_resume(struct device *dev)
 	struct tegra30_i2s *i2s = dev_get_drvdata(dev);
 	int ret;
 
-	ret = clk_enable(i2s->clk_i2s);
+	ret = clk_prepare_enable(i2s->clk_i2s);
 	if (ret) {
 		dev_err(dev, "clk_enable failed: %d\n", ret);
 		return ret;
diff --git a/sound/soc/tegra/tegra_asoc_utils.c b/sound/soc/tegra/tegra_asoc_utils.c
index 9515ce5..6872c77 100644
--- a/sound/soc/tegra/tegra_asoc_utils.c
+++ b/sound/soc/tegra/tegra_asoc_utils.c
@@ -69,9 +69,9 @@ int tegra_asoc_utils_set_rate(struct tegra_asoc_utils_data *data, int srate,
 	data->set_baseclock = 0;
 	data->set_mclk = 0;
 
-	clk_disable(data->clk_cdev1);
-	clk_disable(data->clk_pll_a_out0);
-	clk_disable(data->clk_pll_a);
+	clk_disable_unprepare(data->clk_cdev1);
+	clk_disable_unprepare(data->clk_pll_a_out0);
+	clk_disable_unprepare(data->clk_pll_a);
 
 	err = clk_set_rate(data->clk_pll_a, new_baseclock);
 	if (err) {
@@ -87,19 +87,19 @@ int tegra_asoc_utils_set_rate(struct tegra_asoc_utils_data *data, int srate,
 
 	/* Don't set cdev1/extern1 rate; it's locked to pll_a_out0 */
 
-	err = clk_enable(data->clk_pll_a);
+	err = clk_prepare_enable(data->clk_pll_a);
 	if (err) {
 		dev_err(data->dev, "Can't enable pll_a: %d\n", err);
 		return err;
 	}
 
-	err = clk_enable(data->clk_pll_a_out0);
+	err = clk_prepare_enable(data->clk_pll_a_out0);
 	if (err) {
 		dev_err(data->dev, "Can't enable pll_a_out0: %d\n", err);
 		return err;
 	}
 
-	err = clk_enable(data->clk_cdev1);
+	err = clk_prepare_enable(data->clk_cdev1);
 	if (err) {
 		dev_err(data->dev, "Can't enable cdev1: %d\n", err);
 		return err;
-- 
1.7.4.1

^ permalink raw reply related	[flat|nested] 17+ messages in thread

* [PATCH v3 9/9] crypto: add clk_prepare/clk_unprepare
  2012-06-05  4:29 [PATCH v3 0/9] Add clk_prepare/clk_unprepare Prashant Gaikwad
                   ` (7 preceding siblings ...)
  2012-06-05  4:29 ` [PATCH v3 8/9] ASoC: tegra: " Prashant Gaikwad
@ 2012-06-05  4:29 ` Prashant Gaikwad
  2012-06-12  8:10   ` Herbert Xu
  2012-06-11 18:04 ` [PATCH v3 0/9] Add clk_prepare/clk_unprepare Stephen Warren
  9 siblings, 1 reply; 17+ messages in thread
From: Prashant Gaikwad @ 2012-06-05  4:29 UTC (permalink / raw)
  To: linux-arm-kernel

Use clk_prepare/clk_unprepare as required by the generic clk framework.

Signed-off-by: Prashant Gaikwad <pgaikwad@nvidia.com>
---
Please ignore previous versions. Updated commit message and
maintainers properly in this version. No other change.

This patch should go through Tegra tree since other patches to port Tegra
to generic clock framework are dependent on it. Posting here to get ack from
the maintainers.

 drivers/crypto/tegra-aes.c |   12 ++++++------
 1 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/drivers/crypto/tegra-aes.c b/drivers/crypto/tegra-aes.c
index 422a976..ac236f6 100644
--- a/drivers/crypto/tegra-aes.c
+++ b/drivers/crypto/tegra-aes.c
@@ -572,7 +572,7 @@ static void aes_workqueue_handler(struct work_struct *work)
 	struct tegra_aes_dev *dd = aes_dev;
 	int ret;
 
-	ret = clk_enable(dd->aes_clk);
+	ret = clk_prepare_enable(dd->aes_clk);
 	if (ret)
 		BUG_ON("clock enable failed");
 
@@ -581,7 +581,7 @@ static void aes_workqueue_handler(struct work_struct *work)
 		ret = tegra_aes_handle_req(dd);
 	} while (!ret);
 
-	clk_disable(dd->aes_clk);
+	clk_disable_unprepare(dd->aes_clk);
 }
 
 static irqreturn_t aes_irq(int irq, void *dev_id)
@@ -673,7 +673,7 @@ static int tegra_aes_get_random(struct crypto_rng *tfm, u8 *rdata,
 	/* take mutex to access the aes hw */
 	mutex_lock(&aes_lock);
 
-	ret = clk_enable(dd->aes_clk);
+	ret = clk_prepare_enable(dd->aes_clk);
 	if (ret)
 		return ret;
 
@@ -700,7 +700,7 @@ static int tegra_aes_get_random(struct crypto_rng *tfm, u8 *rdata,
 	}
 
 out:
-	clk_disable(dd->aes_clk);
+	clk_disable_unprepare(dd->aes_clk);
 	mutex_unlock(&aes_lock);
 
 	dev_dbg(dd->dev, "%s: done\n", __func__);
@@ -758,7 +758,7 @@ static int tegra_aes_rng_reset(struct crypto_rng *tfm, u8 *seed,
 
 	dd->flags = FLAGS_ENCRYPT | FLAGS_RNG;
 
-	ret = clk_enable(dd->aes_clk);
+	ret = clk_prepare_enable(dd->aes_clk);
 	if (ret)
 		return ret;
 
@@ -788,7 +788,7 @@ static int tegra_aes_rng_reset(struct crypto_rng *tfm, u8 *seed,
 	memcpy(dd->dt, dt, DEFAULT_RNG_BLK_SZ);
 
 out:
-	clk_disable(dd->aes_clk);
+	clk_disable_unprepare(dd->aes_clk);
 	mutex_unlock(&aes_lock);
 
 	dev_dbg(dd->dev, "%s: done\n", __func__);
-- 
1.7.4.1

^ permalink raw reply related	[flat|nested] 17+ messages in thread

* [PATCH v3 8/9] ASoC: tegra: add clk_prepare/clk_unprepare
  2012-06-05  4:29 ` [PATCH v3 8/9] ASoC: tegra: " Prashant Gaikwad
@ 2012-06-08  1:02   ` Mark Brown
  2012-06-08  4:43   ` Pankaj Jangra
  1 sibling, 0 replies; 17+ messages in thread
From: Mark Brown @ 2012-06-08  1:02 UTC (permalink / raw)
  To: linux-arm-kernel

On Tue, Jun 05, 2012 at 09:59:42AM +0530, Prashant Gaikwad wrote:
> Use clk_prepare/clk_unprepare as required by the generic clk framework.

Acked-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20120608/841fc67b/attachment.sig>

^ permalink raw reply	[flat|nested] 17+ messages in thread

* [PATCH v3 8/9] ASoC: tegra: add clk_prepare/clk_unprepare
  2012-06-05  4:29 ` [PATCH v3 8/9] ASoC: tegra: " Prashant Gaikwad
  2012-06-08  1:02   ` Mark Brown
@ 2012-06-08  4:43   ` Pankaj Jangra
  2012-06-08  4:54     ` Prashant Gaikwad
  1 sibling, 1 reply; 17+ messages in thread
From: Pankaj Jangra @ 2012-06-08  4:43 UTC (permalink / raw)
  To: linux-arm-kernel

Hi Prashant,

On Tue, Jun 5, 2012 at 9:59 AM, Prashant Gaikwad <pgaikwad@nvidia.com>wrote:

> Use clk_prepare/clk_unprepare as required by the generic clk framework.
>
> Signed-off-by: Prashant Gaikwad <pgaikwad@nvidia.com>
> ---
> Please ignore previous versions. Updated commit message and
> maintainers properly in this version. No other change.
>
> This patch should go through Tegra tree since other patches to port Tegra
> to generic clock framework are dependent on it. Posting here to get ack
> from
> the maintainers.
>
>  sound/soc/tegra/tegra20_i2s.c      |    4 ++--
>  sound/soc/tegra/tegra20_spdif.c    |    4 ++--
>  sound/soc/tegra/tegra30_ahub.c     |    8 ++++----
>  sound/soc/tegra/tegra30_i2s.c      |    4 ++--
>  sound/soc/tegra/tegra_asoc_utils.c |   12 ++++++------
>  5 files changed, 16 insertions(+), 16 deletions(-)
>
> diff --git a/sound/soc/tegra/tegra20_i2s.c b/sound/soc/tegra/tegra20_i2s.c
> index 0c7af63..1647dbf 100644
> --- a/sound/soc/tegra/tegra20_i2s.c
> +++ b/sound/soc/tegra/tegra20_i2s.c
> @@ -62,7 +62,7 @@ static int tegra20_i2s_runtime_suspend(struct device
> *dev)
>  {
>        struct tegra20_i2s *i2s = dev_get_drvdata(dev);
>
> -       clk_disable(i2s->clk_i2s);
> +       clk_disable_unprepare(i2s->clk_i2s);
>
>        return 0;
>  }
> @@ -72,7 +72,7 @@ static int tegra20_i2s_runtime_resume(struct device *dev)
>        struct tegra20_i2s *i2s = dev_get_drvdata(dev);
>        int ret;
>
> -       ret = clk_enable(i2s->clk_i2s);
> +       ret = clk_prepare_enable(i2s->clk_i2s);
>        if (ret) {
>                dev_err(dev, "clk_enable failed: %d\n", ret);
>                return ret;
> diff --git a/sound/soc/tegra/tegra20_spdif.c
> b/sound/soc/tegra/tegra20_spdif.c
> index f9b5741..2262e4f 100644
> --- a/sound/soc/tegra/tegra20_spdif.c
> +++ b/sound/soc/tegra/tegra20_spdif.c
> @@ -54,7 +54,7 @@ static int tegra20_spdif_runtime_suspend(struct device
> *dev)
>  {
>        struct tegra20_spdif *spdif = dev_get_drvdata(dev);
>
> -       clk_disable(spdif->clk_spdif_out);
> +       clk_disable_unprepare(spdif->clk_spdif_out);
>
>        return 0;
>  }
> @@ -64,7 +64,7 @@ static int tegra20_spdif_runtime_resume(struct device
> *dev)
>        struct tegra20_spdif *spdif = dev_get_drvdata(dev);
>        int ret;
>
> -       ret = clk_enable(spdif->clk_spdif_out);
> +       ret = clk_prepare_enable(spdif->clk_spdif_out);
>        if (ret) {
>                dev_err(dev, "clk_enable failed: %d\n", ret);
>                return ret;
> diff --git a/sound/soc/tegra/tegra30_ahub.c
> b/sound/soc/tegra/tegra30_ahub.c
> index 57cd419..1efb822 100644
> --- a/sound/soc/tegra/tegra30_ahub.c
> +++ b/sound/soc/tegra/tegra30_ahub.c
> @@ -56,8 +56,8 @@ static int tegra30_ahub_runtime_suspend(struct device
> *dev)
>        regcache_cache_only(ahub->regmap_apbif, true);
>        regcache_cache_only(ahub->regmap_ahub, true);
>
> -       clk_disable(ahub->clk_apbif);
> -       clk_disable(ahub->clk_d_audio);
> +       clk_disable_unprepare(ahub->clk_apbif);
> +       clk_disable_unprepare(ahub->clk_d_audio);
>
>        return 0;
>  }
> @@ -77,12 +77,12 @@ static int tegra30_ahub_runtime_resume(struct device
> *dev)
>  {
>        int ret;
>
> -       ret = clk_enable(ahub->clk_d_audio);
> +       ret = clk_prepare_enable(ahub->clk_d_audio);
>        if (ret) {
>                dev_err(dev, "clk_enable d_audio failed: %d\n", ret);
>                return ret;
>        }
> -       ret = clk_enable(ahub->clk_apbif);
> +       ret = clk_prepare_enable(ahub->clk_apbif);
>        if (ret) {
>                dev_err(dev, "clk_enable apbif failed: %d\n", ret);
>                clk_disable(ahub->clk_d_audio);
>

Don't you need to make change here to "clk_disable_unprepare" ??


> diff --git a/sound/soc/tegra/tegra30_i2s.c b/sound/soc/tegra/tegra30_i2s.c
> index 8596032..d308faa 100644
> --- a/sound/soc/tegra/tegra30_i2s.c
> +++ b/sound/soc/tegra/tegra30_i2s.c
> @@ -62,7 +62,7 @@ static int tegra30_i2s_runtime_suspend(struct device
> *dev)
>
>        regcache_cache_only(i2s->regmap, true);
>
> -       clk_disable(i2s->clk_i2s);
> +       clk_disable_unprepare(i2s->clk_i2s);
>
>        return 0;
>  }
> @@ -72,7 +72,7 @@ static int tegra30_i2s_runtime_resume(struct device *dev)
>        struct tegra30_i2s *i2s = dev_get_drvdata(dev);
>        int ret;
>
> -       ret = clk_enable(i2s->clk_i2s);
> +       ret = clk_prepare_enable(i2s->clk_i2s);
>        if (ret) {
>                dev_err(dev, "clk_enable failed: %d\n", ret);
>                return ret;
> diff --git a/sound/soc/tegra/tegra_asoc_utils.c
> b/sound/soc/tegra/tegra_asoc_utils.c
> index 9515ce5..6872c77 100644
> --- a/sound/soc/tegra/tegra_asoc_utils.c
> +++ b/sound/soc/tegra/tegra_asoc_utils.c
> @@ -69,9 +69,9 @@ int tegra_asoc_utils_set_rate(struct
> tegra_asoc_utils_data *data, int srate,
>        data->set_baseclock = 0;
>        data->set_mclk = 0;
>
> -       clk_disable(data->clk_cdev1);
> -       clk_disable(data->clk_pll_a_out0);
> -       clk_disable(data->clk_pll_a);
> +       clk_disable_unprepare(data->clk_cdev1);
> +       clk_disable_unprepare(data->clk_pll_a_out0);
> +       clk_disable_unprepare(data->clk_pll_a);
>
>        err = clk_set_rate(data->clk_pll_a, new_baseclock);
>        if (err) {
> @@ -87,19 +87,19 @@ int tegra_asoc_utils_set_rate(struct
> tegra_asoc_utils_data *data, int srate,
>
>        /* Don't set cdev1/extern1 rate; it's locked to pll_a_out0 */
>
> -       err = clk_enable(data->clk_pll_a);
> +       err = clk_prepare_enable(data->clk_pll_a);
>        if (err) {
>                dev_err(data->dev, "Can't enable pll_a: %d\n", err);
>                return err;
>        }
>
> -       err = clk_enable(data->clk_pll_a_out0);
> +       err = clk_prepare_enable(data->clk_pll_a_out0);
>        if (err) {
>                dev_err(data->dev, "Can't enable pll_a_out0: %d\n", err);
>                return err;
>        }
>
> -       err = clk_enable(data->clk_cdev1);
> +       err = clk_prepare_enable(data->clk_cdev1);
>        if (err) {
>                dev_err(data->dev, "Can't enable cdev1: %d\n", err);
>                return err;
> --
> 1.7.4.1
>
>
> _______________________________________________
> linux-arm-kernel mailing list
> linux-arm-kernel at lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20120608/17c7576e/attachment.html>

^ permalink raw reply	[flat|nested] 17+ messages in thread

* [PATCH v3 8/9] ASoC: tegra: add clk_prepare/clk_unprepare
  2012-06-08  4:43   ` Pankaj Jangra
@ 2012-06-08  4:54     ` Prashant Gaikwad
  0 siblings, 0 replies; 17+ messages in thread
From: Prashant Gaikwad @ 2012-06-08  4:54 UTC (permalink / raw)
  To: linux-arm-kernel

Hi Pankaj,

Thanks for pointing error. I will send another patch to fix the error
since this patch set is sent to multiple subsystems and I will have to
spam them for this fix.

Right now it won?t break anything since generic clock framework for
Tegra is not enabled yet. I will make sure this gets fixed before that.

Thanks & Regards,
Prashant G

On Fri, 2012-06-08 at 10:13 +0530, Pankaj Jangra wrote:
> Hi Prashant,
> 
> On Tue, Jun 5, 2012 at 9:59 AM, Prashant Gaikwad <pgaikwad@nvidia.com>
> wrote:
>         Use clk_prepare/clk_unprepare as required by the generic clk
>         framework.
>         
>         Signed-off-by: Prashant Gaikwad <pgaikwad@nvidia.com>
>         ---
>         Please ignore previous versions. Updated commit message and
>         maintainers properly in this version. No other change.
>         
>         This patch should go through Tegra tree since other patches to
>         port Tegra
>         to generic clock framework are dependent on it. Posting here
>         to get ack from
>         the maintainers.
>         
>          sound/soc/tegra/tegra20_i2s.c      |    4 ++--
>          sound/soc/tegra/tegra20_spdif.c    |    4 ++--
>          sound/soc/tegra/tegra30_ahub.c     |    8 ++++----
>          sound/soc/tegra/tegra30_i2s.c      |    4 ++--
>          sound/soc/tegra/tegra_asoc_utils.c |   12 ++++++------
>          5 files changed, 16 insertions(+), 16 deletions(-)
>         
>         diff --git a/sound/soc/tegra/tegra20_i2s.c
>         b/sound/soc/tegra/tegra20_i2s.c
>         index 0c7af63..1647dbf 100644
>         --- a/sound/soc/tegra/tegra20_i2s.c
>         +++ b/sound/soc/tegra/tegra20_i2s.c
>         @@ -62,7 +62,7 @@ static int
>         tegra20_i2s_runtime_suspend(struct device *dev)
>          {
>                struct tegra20_i2s *i2s = dev_get_drvdata(dev);
>         
>         -       clk_disable(i2s->clk_i2s);
>         +       clk_disable_unprepare(i2s->clk_i2s);
>         
>                return 0;
>          }
>         @@ -72,7 +72,7 @@ static int tegra20_i2s_runtime_resume(struct
>         device *dev)
>                struct tegra20_i2s *i2s = dev_get_drvdata(dev);
>                int ret;
>         
>         -       ret = clk_enable(i2s->clk_i2s);
>         +       ret = clk_prepare_enable(i2s->clk_i2s);
>                if (ret) {
>                        dev_err(dev, "clk_enable failed: %d\n", ret);
>                        return ret;
>         diff --git a/sound/soc/tegra/tegra20_spdif.c
>         b/sound/soc/tegra/tegra20_spdif.c
>         index f9b5741..2262e4f 100644
>         --- a/sound/soc/tegra/tegra20_spdif.c
>         +++ b/sound/soc/tegra/tegra20_spdif.c
>         @@ -54,7 +54,7 @@ static int
>         tegra20_spdif_runtime_suspend(struct device *dev)
>          {
>                struct tegra20_spdif *spdif = dev_get_drvdata(dev);
>         
>         -       clk_disable(spdif->clk_spdif_out);
>         +       clk_disable_unprepare(spdif->clk_spdif_out);
>         
>                return 0;
>          }
>         @@ -64,7 +64,7 @@ static int
>         tegra20_spdif_runtime_resume(struct device *dev)
>                struct tegra20_spdif *spdif = dev_get_drvdata(dev);
>                int ret;
>         
>         -       ret = clk_enable(spdif->clk_spdif_out);
>         +       ret = clk_prepare_enable(spdif->clk_spdif_out);
>                if (ret) {
>                        dev_err(dev, "clk_enable failed: %d\n", ret);
>                        return ret;
>         diff --git a/sound/soc/tegra/tegra30_ahub.c
>         b/sound/soc/tegra/tegra30_ahub.c
>         index 57cd419..1efb822 100644
>         --- a/sound/soc/tegra/tegra30_ahub.c
>         +++ b/sound/soc/tegra/tegra30_ahub.c
>         @@ -56,8 +56,8 @@ static int
>         tegra30_ahub_runtime_suspend(struct device *dev)
>                regcache_cache_only(ahub->regmap_apbif, true);
>                regcache_cache_only(ahub->regmap_ahub, true);
>         
>         -       clk_disable(ahub->clk_apbif);
>         -       clk_disable(ahub->clk_d_audio);
>         +       clk_disable_unprepare(ahub->clk_apbif);
>         +       clk_disable_unprepare(ahub->clk_d_audio);
>         
>                return 0;
>          }
>         @@ -77,12 +77,12 @@ static int
>         tegra30_ahub_runtime_resume(struct device *dev)
>          {
>                int ret;
>         
>         -       ret = clk_enable(ahub->clk_d_audio);
>         +       ret = clk_prepare_enable(ahub->clk_d_audio);
>                if (ret) {
>                        dev_err(dev, "clk_enable d_audio failed: %d\n",
>         ret);
>                        return ret;
>                }
>         -       ret = clk_enable(ahub->clk_apbif);
>         +       ret = clk_prepare_enable(ahub->clk_apbif);
>                if (ret) {
>                        dev_err(dev, "clk_enable apbif failed: %d\n",
>         ret);
>                        clk_disable(ahub->clk_d_audio);
>  
> Don't you need to make change here to "clk_disable_unprepare" ??
>  
>         diff --git a/sound/soc/tegra/tegra30_i2s.c
>         b/sound/soc/tegra/tegra30_i2s.c
>         index 8596032..d308faa 100644
>         --- a/sound/soc/tegra/tegra30_i2s.c
>         +++ b/sound/soc/tegra/tegra30_i2s.c
>         @@ -62,7 +62,7 @@ static int
>         tegra30_i2s_runtime_suspend(struct device *dev)
>         
>                regcache_cache_only(i2s->regmap, true);
>         
>         -       clk_disable(i2s->clk_i2s);
>         +       clk_disable_unprepare(i2s->clk_i2s);
>         
>                return 0;
>          }
>         @@ -72,7 +72,7 @@ static int tegra30_i2s_runtime_resume(struct
>         device *dev)
>                struct tegra30_i2s *i2s = dev_get_drvdata(dev);
>                int ret;
>         
>         -       ret = clk_enable(i2s->clk_i2s);
>         +       ret = clk_prepare_enable(i2s->clk_i2s);
>                if (ret) {
>                        dev_err(dev, "clk_enable failed: %d\n", ret);
>                        return ret;
>         diff --git a/sound/soc/tegra/tegra_asoc_utils.c
>         b/sound/soc/tegra/tegra_asoc_utils.c
>         index 9515ce5..6872c77 100644
>         --- a/sound/soc/tegra/tegra_asoc_utils.c
>         +++ b/sound/soc/tegra/tegra_asoc_utils.c
>         @@ -69,9 +69,9 @@ int tegra_asoc_utils_set_rate(struct
>         tegra_asoc_utils_data *data, int srate,
>                data->set_baseclock = 0;
>                data->set_mclk = 0;
>         
>         -       clk_disable(data->clk_cdev1);
>         -       clk_disable(data->clk_pll_a_out0);
>         -       clk_disable(data->clk_pll_a);
>         +       clk_disable_unprepare(data->clk_cdev1);
>         +       clk_disable_unprepare(data->clk_pll_a_out0);
>         +       clk_disable_unprepare(data->clk_pll_a);
>         
>                err = clk_set_rate(data->clk_pll_a, new_baseclock);
>                if (err) {
>         @@ -87,19 +87,19 @@ int tegra_asoc_utils_set_rate(struct
>         tegra_asoc_utils_data *data, int srate,
>         
>                /* Don't set cdev1/extern1 rate; it's locked to
>         pll_a_out0 */
>         
>         -       err = clk_enable(data->clk_pll_a);
>         +       err = clk_prepare_enable(data->clk_pll_a);
>                if (err) {
>                        dev_err(data->dev, "Can't enable pll_a: %d\n",
>         err);
>                        return err;
>                }
>         
>         -       err = clk_enable(data->clk_pll_a_out0);
>         +       err = clk_prepare_enable(data->clk_pll_a_out0);
>                if (err) {
>                        dev_err(data->dev, "Can't enable pll_a_out0: %d
>         \n", err);
>                        return err;
>                }
>         
>         -       err = clk_enable(data->clk_cdev1);
>         +       err = clk_prepare_enable(data->clk_cdev1);
>                if (err) {
>                        dev_err(data->dev, "Can't enable cdev1: %d\n",
>         err);
>                        return err;
>         --
>         1.7.4.1
>         
>         
>         _______________________________________________
>         linux-arm-kernel mailing list
>         linux-arm-kernel at lists.infradead.org
>         http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
> 

^ permalink raw reply	[flat|nested] 17+ messages in thread

* [PATCH v3 7/9] staging: nvec: add clk_prepare/clk_unprepare
  2012-06-05  4:29 ` [PATCH v3 7/9] staging: nvec: " Prashant Gaikwad
@ 2012-06-08 19:48   ` Marc Dietrich
  0 siblings, 0 replies; 17+ messages in thread
From: Marc Dietrich @ 2012-06-08 19:48 UTC (permalink / raw)
  To: linux-arm-kernel

On Tuesday 05 June 2012 09:59:41 Prashant Gaikwad wrote:
> Use clk_prepare/clk_unprepare as required by the generic clk framework.
> 
> Signed-off-by: Prashant Gaikwad <pgaikwad@nvidia.com>

I think I gave an ack already on the first (or second version), which was 
identical. Nevertheless, here is one more.

Acked-by: Marc Dietrich <marvin24@gmx.de>

> ---
> Please ignore previous versions. Updated commit message and
> maintainers properly in this version. No other change.
> 
> This patch should go through Tegra tree since other patches to port Tegra
> to generic clock framework are dependent on it. Posting here to get ack from
> the maintainers.
> 
>  drivers/staging/nvec/nvec.c |    8 ++++----
>  1 files changed, 4 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/staging/nvec/nvec.c b/drivers/staging/nvec/nvec.c
> index 3c60088..9356886 100644
> --- a/drivers/staging/nvec/nvec.c
> +++ b/drivers/staging/nvec/nvec.c
> @@ -675,7 +675,7 @@ static void tegra_init_i2c_slave(struct nvec_chip *nvec)
> {
>  	u32 val;
> 
> -	clk_enable(nvec->i2c_clk);
> +	clk_prepare_enable(nvec->i2c_clk);
> 
>  	tegra_periph_reset_assert(nvec->i2c_clk);
>  	udelay(2);
> @@ -695,14 +695,14 @@ static void tegra_init_i2c_slave(struct nvec_chip
> *nvec)
> 
>  	enable_irq(nvec->irq);
> 
> -	clk_disable(nvec->i2c_clk);
> +	clk_disable_unprepare(nvec->i2c_clk);
>  }
> 
>  static void nvec_disable_i2c_slave(struct nvec_chip *nvec)
>  {
>  	disable_irq(nvec->irq);
>  	writel(I2C_SL_NEWSL | I2C_SL_NACK, nvec->base + I2C_SL_CNFG);
> -	clk_disable(nvec->i2c_clk);
> +	clk_disable_unprepare(nvec->i2c_clk);
>  }
> 
>  static void nvec_power_off(void)
> @@ -812,7 +812,7 @@ static int __devinit tegra_nvec_probe(struct
> platform_device *pdev)
> 
>  	tegra_init_i2c_slave(nvec);
> 
> -	clk_enable(i2c_clk);
> +	clk_prepare_enable(i2c_clk);
> 
> 
>  	/* enable event reporting */

^ permalink raw reply	[flat|nested] 17+ messages in thread

* [PATCH v3 0/9] Add clk_prepare/clk_unprepare
  2012-06-05  4:29 [PATCH v3 0/9] Add clk_prepare/clk_unprepare Prashant Gaikwad
                   ` (8 preceding siblings ...)
  2012-06-05  4:29 ` [PATCH v3 9/9] crypto: " Prashant Gaikwad
@ 2012-06-11 18:04 ` Stephen Warren
  9 siblings, 0 replies; 17+ messages in thread
From: Stephen Warren @ 2012-06-11 18:04 UTC (permalink / raw)
  To: linux-arm-kernel

On 06/04/2012 10:29 PM, Prashant Gaikwad wrote:
> This patch set adds use of clk_prepare/clk_unprepare as
> required by generic clock framework.

In anticipation of not receiving any NAKs, I have applied the series to
Tegra's for-next.

^ permalink raw reply	[flat|nested] 17+ messages in thread

* [PATCH v3 5/9] Input: tegra-kbc - add clk_prepare/clk_unprepare
  2012-06-05  4:29 ` [PATCH v3 5/9] Input: tegra-kbc - " Prashant Gaikwad
@ 2012-06-12  7:30   ` Dmitry Torokhov
  0 siblings, 0 replies; 17+ messages in thread
From: Dmitry Torokhov @ 2012-06-12  7:30 UTC (permalink / raw)
  To: linux-arm-kernel

On Tue, Jun 05, 2012 at 09:59:39AM +0530, Prashant Gaikwad wrote:
> Use clk_prepare/clk_unprepare as required by the generic clk framework.
> 
> Signed-off-by: Prashant Gaikwad <pgaikwad@nvidia.com>

Acked-by: Dmitry Torokhov <dtor@mail.ru>

> ---
> Please ignore previous versions. Updated commit message and
> maintainers properly in this version. No other change.
> 
> This patch should go through Tegra tree since other patches to port tegra
> to generic clock framework are dependent on it. Posting here to get ack from
> the maintainers.
> 
>  drivers/input/keyboard/tegra-kbc.c |    4 ++--
>  1 files changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/input/keyboard/tegra-kbc.c b/drivers/input/keyboard/tegra-kbc.c
> index 4ffe64d..2c1c9ed 100644
> --- a/drivers/input/keyboard/tegra-kbc.c
> +++ b/drivers/input/keyboard/tegra-kbc.c
> @@ -492,7 +492,7 @@ static int tegra_kbc_start(struct tegra_kbc *kbc)
>  	unsigned int debounce_cnt;
>  	u32 val = 0;
>  
> -	clk_enable(kbc->clk);
> +	clk_prepare_enable(kbc->clk);
>  
>  	/* Reset the KBC controller to clear all previous status.*/
>  	tegra_periph_reset_assert(kbc->clk);
> @@ -556,7 +556,7 @@ static void tegra_kbc_stop(struct tegra_kbc *kbc)
>  	disable_irq(kbc->irq);
>  	del_timer_sync(&kbc->timer);
>  
> -	clk_disable(kbc->clk);
> +	clk_disable_unprepare(kbc->clk);
>  }
>  
>  static int tegra_kbc_open(struct input_dev *dev)
> -- 
> 1.7.4.1
> 
> --
> To unsubscribe from this list: send the line "unsubscribe linux-input" in
> the body of a message to majordomo at vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

-- 
Dmitry

^ permalink raw reply	[flat|nested] 17+ messages in thread

* [PATCH v3 9/9] crypto: add clk_prepare/clk_unprepare
  2012-06-05  4:29 ` [PATCH v3 9/9] crypto: " Prashant Gaikwad
@ 2012-06-12  8:10   ` Herbert Xu
  0 siblings, 0 replies; 17+ messages in thread
From: Herbert Xu @ 2012-06-12  8:10 UTC (permalink / raw)
  To: linux-arm-kernel

On Tue, Jun 05, 2012 at 09:59:43AM +0530, Prashant Gaikwad wrote:
> Use clk_prepare/clk_unprepare as required by the generic clk framework.
> 
> Signed-off-by: Prashant Gaikwad <pgaikwad@nvidia.com>

Acked-off: Herbert Xu <herbert@gondor.apana.org.au>
-- 
Email: Herbert Xu <herbert@gondor.apana.org.au>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt

^ permalink raw reply	[flat|nested] 17+ messages in thread

end of thread, other threads:[~2012-06-12  8:10 UTC | newest]

Thread overview: 17+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-06-05  4:29 [PATCH v3 0/9] Add clk_prepare/clk_unprepare Prashant Gaikwad
2012-06-05  4:29 ` [PATCH v3 1/9] ARM: tegra: add clk_prepare/clk_unprepare Prashant Gaikwad
2012-06-05  4:29 ` [PATCH v3 2/9] i2c: tegra: Add clk_prepare/clk_unprepare Prashant Gaikwad
2012-06-05  4:29 ` [PATCH v3 3/9] mmc: tegra: add clk_prepare/clk_unprepare Prashant Gaikwad
2012-06-05  4:29 ` [PATCH v3 4/9] USB: ehci-tegra: " Prashant Gaikwad
2012-06-05  4:29 ` [PATCH v3 5/9] Input: tegra-kbc - " Prashant Gaikwad
2012-06-12  7:30   ` Dmitry Torokhov
2012-06-05  4:29 ` [PATCH v3 6/9] spi/tegra: " Prashant Gaikwad
2012-06-05  4:29 ` [PATCH v3 7/9] staging: nvec: " Prashant Gaikwad
2012-06-08 19:48   ` Marc Dietrich
2012-06-05  4:29 ` [PATCH v3 8/9] ASoC: tegra: " Prashant Gaikwad
2012-06-08  1:02   ` Mark Brown
2012-06-08  4:43   ` Pankaj Jangra
2012-06-08  4:54     ` Prashant Gaikwad
2012-06-05  4:29 ` [PATCH v3 9/9] crypto: " Prashant Gaikwad
2012-06-12  8:10   ` Herbert Xu
2012-06-11 18:04 ` [PATCH v3 0/9] Add clk_prepare/clk_unprepare Stephen Warren

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).