linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2 REBASE] ASoC: fsl_ssi: convert to use devm_clk_get
@ 2012-06-04  1:42 Richard Zhao
  2012-06-04  1:42 ` [PATCH v2 REBASE] ASoC: imx-audmux: add pinctrl support Richard Zhao
                   ` (2 more replies)
  0 siblings, 3 replies; 11+ messages in thread
From: Richard Zhao @ 2012-06-04  1:42 UTC (permalink / raw)
  To: linux-arm-kernel

Signed-off-by: Richard Zhao <richard.zhao@freescale.com>
Acked-by: Timur Tabi <timur@freescale.com>
---

Rebase to 3.5rc1.

 sound/soc/fsl/fsl_ssi.c |    7 ++-----
 1 files changed, 2 insertions(+), 5 deletions(-)

diff --git a/sound/soc/fsl/fsl_ssi.c b/sound/soc/fsl/fsl_ssi.c
index 4ed2afd..b10a427 100644
--- a/sound/soc/fsl/fsl_ssi.c
+++ b/sound/soc/fsl/fsl_ssi.c
@@ -725,7 +725,7 @@ static int __devinit fsl_ssi_probe(struct platform_device *pdev)
 		u32 dma_events[2];
 		ssi_private->ssi_on_imx = true;
 
-		ssi_private->clk = clk_get(&pdev->dev, NULL);
+		ssi_private->clk = devm_clk_get(&pdev->dev, NULL);
 		if (IS_ERR(ssi_private->clk)) {
 			ret = PTR_ERR(ssi_private->clk);
 			dev_err(&pdev->dev, "could not get clock: %d\n", ret);
@@ -842,10 +842,8 @@ error_dev:
 	device_remove_file(&pdev->dev, dev_attr);
 
 error_clk:
-	if (ssi_private->ssi_on_imx) {
+	if (ssi_private->ssi_on_imx)
 		clk_disable_unprepare(ssi_private->clk);
-		clk_put(ssi_private->clk);
-	}
 
 error_irq:
 	free_irq(ssi_private->irq, ssi_private);
@@ -871,7 +869,6 @@ static int fsl_ssi_remove(struct platform_device *pdev)
 	if (ssi_private->ssi_on_imx) {
 		platform_device_unregister(ssi_private->imx_pcm_pdev);
 		clk_disable_unprepare(ssi_private->clk);
-		clk_put(ssi_private->clk);
 	}
 	snd_soc_unregister_dai(&pdev->dev);
 	device_remove_file(&pdev->dev, &ssi_private->dev_attr);
-- 
1.7.5.4

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

* [PATCH v2 REBASE] ASoC: imx-audmux: add pinctrl support
  2012-06-04  1:42 [PATCH v2 REBASE] ASoC: fsl_ssi: convert to use devm_clk_get Richard Zhao
@ 2012-06-04  1:42 ` Richard Zhao
  2012-06-04  9:52   ` Mark Brown
  2012-06-04  9:51 ` [PATCH v2 REBASE] ASoC: fsl_ssi: convert to use devm_clk_get Mark Brown
  2012-06-05  6:47 ` Sascha Hauer
  2 siblings, 1 reply; 11+ messages in thread
From: Richard Zhao @ 2012-06-04  1:42 UTC (permalink / raw)
  To: linux-arm-kernel

Signed-off-by: Richard Zhao <richard.zhao@freescale.com>
Acked-by: Dong Aisheng <dong.aisheng@linaro.org>
---
Rebase to 3.5rc1.

 sound/soc/fsl/imx-audmux.c |    8 ++++++++
 1 files changed, 8 insertions(+), 0 deletions(-)

diff --git a/sound/soc/fsl/imx-audmux.c b/sound/soc/fsl/imx-audmux.c
index f237003..0803274 100644
--- a/sound/soc/fsl/imx-audmux.c
+++ b/sound/soc/fsl/imx-audmux.c
@@ -26,6 +26,7 @@
 #include <linux/of_device.h>
 #include <linux/platform_device.h>
 #include <linux/slab.h>
+#include <linux/pinctrl/consumer.h>
 
 #include "imx-audmux.h"
 
@@ -249,6 +250,7 @@ EXPORT_SYMBOL_GPL(imx_audmux_v2_configure_port);
 static int __devinit imx_audmux_probe(struct platform_device *pdev)
 {
 	struct resource *res;
+	struct pinctrl *pinctrl;
 	const struct of_device_id *of_id =
 			of_match_device(imx_audmux_dt_ids, &pdev->dev);
 
@@ -257,6 +259,12 @@ static int __devinit imx_audmux_probe(struct platform_device *pdev)
 	if (!audmux_base)
 		return -EADDRNOTAVAIL;
 
+	pinctrl = devm_pinctrl_get_select_default(&pdev->dev);
+	if (IS_ERR(pinctrl)) {
+		dev_err(&pdev->dev, "setup pinctrl failed!");
+		return PTR_ERR(pinctrl);
+	}
+
 	audmux_clk = clk_get(&pdev->dev, "audmux");
 	if (IS_ERR(audmux_clk)) {
 		dev_dbg(&pdev->dev, "cannot get clock: %ld\n",
-- 
1.7.5.4

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

* [PATCH v2 REBASE] ASoC: fsl_ssi: convert to use devm_clk_get
  2012-06-04  1:42 [PATCH v2 REBASE] ASoC: fsl_ssi: convert to use devm_clk_get Richard Zhao
  2012-06-04  1:42 ` [PATCH v2 REBASE] ASoC: imx-audmux: add pinctrl support Richard Zhao
@ 2012-06-04  9:51 ` Mark Brown
  2012-06-05  6:47 ` Sascha Hauer
  2 siblings, 0 replies; 11+ messages in thread
From: Mark Brown @ 2012-06-04  9:51 UTC (permalink / raw)
  To: linux-arm-kernel

On Mon, Jun 04, 2012 at 09:42:53AM +0800, Richard Zhao wrote:
> Signed-off-by: Richard Zhao <richard.zhao@freescale.com>
> Acked-by: Timur Tabi <timur@freescale.com>

Applied, thanks.
-------------- 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/20120604/124b2fd6/attachment.sig>

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

* [PATCH v2 REBASE] ASoC: imx-audmux: add pinctrl support
  2012-06-04  1:42 ` [PATCH v2 REBASE] ASoC: imx-audmux: add pinctrl support Richard Zhao
@ 2012-06-04  9:52   ` Mark Brown
  0 siblings, 0 replies; 11+ messages in thread
From: Mark Brown @ 2012-06-04  9:52 UTC (permalink / raw)
  To: linux-arm-kernel

On Mon, Jun 04, 2012 at 09:42:54AM +0800, Richard Zhao wrote:
> Signed-off-by: Richard Zhao <richard.zhao@freescale.com>
> Acked-by: Dong Aisheng <dong.aisheng@linaro.org>

Applied, thanks.
-------------- 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/20120604/df2321ee/attachment.sig>

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

* [PATCH v2 REBASE] ASoC: fsl_ssi: convert to use devm_clk_get
  2012-06-04  1:42 [PATCH v2 REBASE] ASoC: fsl_ssi: convert to use devm_clk_get Richard Zhao
  2012-06-04  1:42 ` [PATCH v2 REBASE] ASoC: imx-audmux: add pinctrl support Richard Zhao
  2012-06-04  9:51 ` [PATCH v2 REBASE] ASoC: fsl_ssi: convert to use devm_clk_get Mark Brown
@ 2012-06-05  6:47 ` Sascha Hauer
  2012-06-05 10:03   ` Mark Brown
  2012-06-05 10:10   ` Mark Brown
  2 siblings, 2 replies; 11+ messages in thread
From: Sascha Hauer @ 2012-06-05  6:47 UTC (permalink / raw)
  To: linux-arm-kernel

On Mon, Jun 04, 2012 at 09:42:53AM +0800, Richard Zhao wrote:
> Signed-off-by: Richard Zhao <richard.zhao@freescale.com>
> Acked-by: Timur Tabi <timur@freescale.com>
> ---
> 
> Rebase to 3.5rc1.
> 
>  sound/soc/fsl/fsl_ssi.c |    7 ++-----
>  1 files changed, 2 insertions(+), 5 deletions(-)
> 
> diff --git a/sound/soc/fsl/fsl_ssi.c b/sound/soc/fsl/fsl_ssi.c
> index 4ed2afd..b10a427 100644
> --- a/sound/soc/fsl/fsl_ssi.c
> +++ b/sound/soc/fsl/fsl_ssi.c
> @@ -725,7 +725,7 @@ static int __devinit fsl_ssi_probe(struct platform_device *pdev)
>  		u32 dma_events[2];
>  		ssi_private->ssi_on_imx = true;
>  
> -		ssi_private->clk = clk_get(&pdev->dev, NULL);
> +		ssi_private->clk = devm_clk_get(&pdev->dev, NULL);

Have you tried compiling this on PowerPC? devm_clk_get is only available
with CONFIG_CLKDEV_LOOKUP, I think on PowerPC this is not the case.

Sascha

-- 
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

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

* [PATCH v2 REBASE] ASoC: fsl_ssi: convert to use devm_clk_get
  2012-06-05  6:47 ` Sascha Hauer
@ 2012-06-05 10:03   ` Mark Brown
  2012-06-05 10:08     ` Russell King - ARM Linux
  2012-06-05 10:10   ` Mark Brown
  1 sibling, 1 reply; 11+ messages in thread
From: Mark Brown @ 2012-06-05 10:03 UTC (permalink / raw)
  To: linux-arm-kernel

On Tue, Jun 05, 2012 at 08:47:14AM +0200, Sascha Hauer wrote:

> Have you tried compiling this on PowerPC? devm_clk_get is only available
> with CONFIG_CLKDEV_LOOKUP, I think on PowerPC this is not the case.

I've not, but I guess there will be an issue.  I'd say the fix here is
on the PowerPC side - it's not good to have to have Kconfig bodges for
things like this in individual drivers.  Ideally we'd add clkdev
support...
-------------- 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/20120605/fbe1f581/attachment.sig>

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

* [PATCH v2 REBASE] ASoC: fsl_ssi: convert to use devm_clk_get
  2012-06-05 10:03   ` Mark Brown
@ 2012-06-05 10:08     ` Russell King - ARM Linux
  2012-06-05 10:14       ` Mark Brown
  0 siblings, 1 reply; 11+ messages in thread
From: Russell King - ARM Linux @ 2012-06-05 10:08 UTC (permalink / raw)
  To: linux-arm-kernel

On Tue, Jun 05, 2012 at 11:03:16AM +0100, Mark Brown wrote:
> On Tue, Jun 05, 2012 at 08:47:14AM +0200, Sascha Hauer wrote:
> 
> > Have you tried compiling this on PowerPC? devm_clk_get is only available
> > with CONFIG_CLKDEV_LOOKUP, I think on PowerPC this is not the case.
> 
> I've not, but I guess there will be an issue.  I'd say the fix here is
> on the PowerPC side - it's not good to have to have Kconfig bodges for
> things like this in individual drivers.  Ideally we'd add clkdev
> support...

Or get rid of devm_clk_get()'s dependency on CLKDEV (which is in itself
silly.)

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

* [PATCH v2 REBASE] ASoC: fsl_ssi: convert to use devm_clk_get
  2012-06-05  6:47 ` Sascha Hauer
  2012-06-05 10:03   ` Mark Brown
@ 2012-06-05 10:10   ` Mark Brown
  1 sibling, 0 replies; 11+ messages in thread
From: Mark Brown @ 2012-06-05 10:10 UTC (permalink / raw)
  To: linux-arm-kernel

On Tue, Jun 05, 2012 at 08:47:14AM +0200, Sascha Hauer wrote:

> Have you tried compiling this on PowerPC? devm_clk_get is only available
> with CONFIG_CLKDEV_LOOKUP, I think on PowerPC this is not the case.

I just reverted the commit, we can try again when PowerPC has been
updated somehow.
-------------- 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/20120605/4198e562/attachment.sig>

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

* [PATCH v2 REBASE] ASoC: fsl_ssi: convert to use devm_clk_get
  2012-06-05 10:08     ` Russell King - ARM Linux
@ 2012-06-05 10:14       ` Mark Brown
  2012-06-05 10:15         ` Russell King - ARM Linux
  0 siblings, 1 reply; 11+ messages in thread
From: Mark Brown @ 2012-06-05 10:14 UTC (permalink / raw)
  To: linux-arm-kernel

On Tue, Jun 05, 2012 at 11:08:51AM +0100, Russell King - ARM Linux wrote:
> On Tue, Jun 05, 2012 at 11:03:16AM +0100, Mark Brown wrote:

> > I've not, but I guess there will be an issue.  I'd say the fix here is
> > on the PowerPC side - it's not good to have to have Kconfig bodges for
> > things like this in individual drivers.  Ideally we'd add clkdev
> > support...

> Or get rid of devm_clk_get()'s dependency on CLKDEV (which is in itself
> silly.)

That'd work too, of course (providing everyone has been implementing
clk_put()).  Though getting everyone on the same page with the clock API
seems much more worthwhile if we can do it.
-------------- 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/20120605/b70b6c52/attachment-0001.sig>

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

* [PATCH v2 REBASE] ASoC: fsl_ssi: convert to use devm_clk_get
  2012-06-05 10:14       ` Mark Brown
@ 2012-06-05 10:15         ` Russell King - ARM Linux
  2012-06-05 10:20           ` Mark Brown
  0 siblings, 1 reply; 11+ messages in thread
From: Russell King - ARM Linux @ 2012-06-05 10:15 UTC (permalink / raw)
  To: linux-arm-kernel

On Tue, Jun 05, 2012 at 11:14:13AM +0100, Mark Brown wrote:
> On Tue, Jun 05, 2012 at 11:08:51AM +0100, Russell King - ARM Linux wrote:
> > On Tue, Jun 05, 2012 at 11:03:16AM +0100, Mark Brown wrote:
> 
> > > I've not, but I guess there will be an issue.  I'd say the fix here is
> > > on the PowerPC side - it's not good to have to have Kconfig bodges for
> > > things like this in individual drivers.  Ideally we'd add clkdev
> > > support...
> 
> > Or get rid of devm_clk_get()'s dependency on CLKDEV (which is in itself
> > silly.)
> 
> That'd work too, of course (providing everyone has been implementing
> clk_put()).  Though getting everyone on the same page with the clock API
> seems much more worthwhile if we can do it.

Why wouldn't clk_put() be implemented?  Drivers call it just like clk_get().

The devm*() stuff should just be a layer on top of clk_get()/clk_put() and
nothing more.

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

* [PATCH v2 REBASE] ASoC: fsl_ssi: convert to use devm_clk_get
  2012-06-05 10:15         ` Russell King - ARM Linux
@ 2012-06-05 10:20           ` Mark Brown
  0 siblings, 0 replies; 11+ messages in thread
From: Mark Brown @ 2012-06-05 10:20 UTC (permalink / raw)
  To: linux-arm-kernel

On Tue, Jun 05, 2012 at 11:15:59AM +0100, Russell King - ARM Linux wrote:
> On Tue, Jun 05, 2012 at 11:14:13AM +0100, Mark Brown wrote:

> > That'd work too, of course (providing everyone has been implementing
> > clk_put()).  Though getting everyone on the same page with the clock API
> > seems much more worthwhile if we can do it.

> Why wouldn't clk_put() be implemented?  Drivers call it just like clk_get().

Lazy people who can't be bothered, especially on platforms that do
things like just return a pointer to a statically allocated clock or
never really expect their drivers to be unloaded.  Hopefully everyone
filled in the blank but I've just got a general pessimism about relying
on things like that.

> The devm*() stuff should just be a layer on top of clk_get()/clk_put() and
> nothing more.

It is, yes.
-------------- 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/20120605/3e744aea/attachment.sig>

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

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

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-06-04  1:42 [PATCH v2 REBASE] ASoC: fsl_ssi: convert to use devm_clk_get Richard Zhao
2012-06-04  1:42 ` [PATCH v2 REBASE] ASoC: imx-audmux: add pinctrl support Richard Zhao
2012-06-04  9:52   ` Mark Brown
2012-06-04  9:51 ` [PATCH v2 REBASE] ASoC: fsl_ssi: convert to use devm_clk_get Mark Brown
2012-06-05  6:47 ` Sascha Hauer
2012-06-05 10:03   ` Mark Brown
2012-06-05 10:08     ` Russell King - ARM Linux
2012-06-05 10:14       ` Mark Brown
2012-06-05 10:15         ` Russell King - ARM Linux
2012-06-05 10:20           ` Mark Brown
2012-06-05 10:10   ` Mark Brown

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).