* [PATCH 1/2] ASoC: Ux500: Fixup use of clocks @ 2012-10-22 12:32 Ulf Hansson 2012-10-22 12:32 ` [PATCH 2/2] ASoC: Ux500: Control apb clock Ulf Hansson ` (2 more replies) 0 siblings, 3 replies; 9+ messages in thread From: Ulf Hansson @ 2012-10-22 12:32 UTC (permalink / raw) To: linux-arm-kernel From: Ulf Hansson <ulf.hansson@linaro.org> Make sure clocks are being prepared and unprepared as well as enabled and disabled. Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org> --- sound/soc/ux500/ux500_msp_dai.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/sound/soc/ux500/ux500_msp_dai.c b/sound/soc/ux500/ux500_msp_dai.c index be94bf9..e11187f 100644 --- a/sound/soc/ux500/ux500_msp_dai.c +++ b/sound/soc/ux500/ux500_msp_dai.c @@ -398,11 +398,13 @@ static int ux500_msp_dai_startup(struct snd_pcm_substream *substream, return ret; } - /* Enable clock */ + /* Prepare and enable clock */ dev_dbg(dai->dev, "%s: Enabling MSP-clock.\n", __func__); - clk_enable(drvdata->clk); + ret = clk_prepare_enable(drvdata->clk); + if (ret) + regulator_disable(drvdata->reg_vape); - return 0; + return ret; } static void ux500_msp_dai_shutdown(struct snd_pcm_substream *substream, @@ -428,8 +430,8 @@ static void ux500_msp_dai_shutdown(struct snd_pcm_substream *substream, __func__, dai->id, snd_pcm_stream_str(substream)); } - /* Disable clock */ - clk_disable(drvdata->clk); + /* Disable and unprepare clock */ + clk_disable_unprepare(drvdata->clk); /* Disable regulator */ ret = regulator_disable(drvdata->reg_vape); -- 1.7.10 ^ permalink raw reply related [flat|nested] 9+ messages in thread
* [PATCH 2/2] ASoC: Ux500: Control apb clock 2012-10-22 12:32 [PATCH 1/2] ASoC: Ux500: Fixup use of clocks Ulf Hansson @ 2012-10-22 12:32 ` Ulf Hansson 2012-10-22 13:20 ` Linus Walleij 2012-10-22 13:32 ` Mark Brown 2012-10-22 13:19 ` [PATCH 1/2] ASoC: Ux500: Fixup use of clocks Linus Walleij 2012-10-22 13:30 ` Mark Brown 2 siblings, 2 replies; 9+ messages in thread From: Ulf Hansson @ 2012-10-22 12:32 UTC (permalink / raw) To: linux-arm-kernel From: Ulf Hansson <ulf.hansson@linaro.org> When switching to common clock driver for ux500 this clock needs to be handled as well. Before this clock was internally managed by the clock driver itself. Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org> --- sound/soc/ux500/ux500_msp_dai.c | 38 ++++++++++++++++++++++++++++++++------ sound/soc/ux500/ux500_msp_dai.h | 1 + 2 files changed, 33 insertions(+), 6 deletions(-) diff --git a/sound/soc/ux500/ux500_msp_dai.c b/sound/soc/ux500/ux500_msp_dai.c index e11187f..74bb3c0 100644 --- a/sound/soc/ux500/ux500_msp_dai.c +++ b/sound/soc/ux500/ux500_msp_dai.c @@ -398,13 +398,28 @@ static int ux500_msp_dai_startup(struct snd_pcm_substream *substream, return ret; } - /* Prepare and enable clock */ - dev_dbg(dai->dev, "%s: Enabling MSP-clock.\n", __func__); + /* Prepare and enable clocks */ + dev_dbg(dai->dev, "%s: Enabling MSP-clocks.\n", __func__); + ret = clk_prepare_enable(drvdata->pclk); + if (ret) { + dev_err(drvdata->msp->dev, + "%s: Failed to prepare/enable pclk!\n", __func__); + goto err_pclk; + } + ret = clk_prepare_enable(drvdata->clk); - if (ret) - regulator_disable(drvdata->reg_vape); + if (ret) { + dev_err(drvdata->msp->dev, + "%s: Failed to prepare/enable clk!\n", __func__); + goto err_clk; + } return ret; +err_clk: + clk_disable_unprepare(drvdata->pclk); +err_pclk: + regulator_disable(drvdata->reg_vape); + return ret; } static void ux500_msp_dai_shutdown(struct snd_pcm_substream *substream, @@ -430,8 +445,9 @@ static void ux500_msp_dai_shutdown(struct snd_pcm_substream *substream, __func__, dai->id, snd_pcm_stream_str(substream)); } - /* Disable and unprepare clock */ + /* Disable and unprepare clocks */ clk_disable_unprepare(drvdata->clk); + clk_disable_unprepare(drvdata->pclk); /* Disable regulator */ ret = regulator_disable(drvdata->reg_vape); @@ -782,6 +798,14 @@ static int __devinit ux500_msp_drv_probe(struct platform_device *pdev) } prcmu_qos_add_requirement(PRCMU_QOS_APE_OPP, (char *)pdev->name, 50); + drvdata->pclk = clk_get(&pdev->dev, "apb_pclk"); + if (IS_ERR(drvdata->pclk)) { + ret = (int)PTR_ERR(drvdata->pclk); + dev_err(&pdev->dev, "%s: ERROR: clk_get of pclk failed (%d)!\n", + __func__, ret); + goto err_pclk; + } + drvdata->clk = clk_get(&pdev->dev, NULL); if (IS_ERR(drvdata->clk)) { ret = (int)PTR_ERR(drvdata->clk); @@ -812,8 +836,9 @@ static int __devinit ux500_msp_drv_probe(struct platform_device *pdev) err_init_msp: clk_put(drvdata->clk); - err_clk: + clk_put(drvdata->pclk); +err_pclk: devm_regulator_put(drvdata->reg_vape); return ret; @@ -829,6 +854,7 @@ static int __devexit ux500_msp_drv_remove(struct platform_device *pdev) prcmu_qos_remove_requirement(PRCMU_QOS_APE_OPP, "ux500_msp_i2s"); clk_put(drvdata->clk); + clk_put(drvdata->pclk); ux500_msp_i2s_cleanup_msp(pdev, drvdata->msp); diff --git a/sound/soc/ux500/ux500_msp_dai.h b/sound/soc/ux500/ux500_msp_dai.h index 98202a3..9c778d9 100644 --- a/sound/soc/ux500/ux500_msp_dai.h +++ b/sound/soc/ux500/ux500_msp_dai.h @@ -69,6 +69,7 @@ struct ux500_msp_i2s_drvdata { /* Clocks */ unsigned int master_clk; struct clk *clk; + struct clk *pclk; /* Regulators */ int vape_opp_constraint; -- 1.7.10 ^ permalink raw reply related [flat|nested] 9+ messages in thread
* [PATCH 2/2] ASoC: Ux500: Control apb clock 2012-10-22 12:32 ` [PATCH 2/2] ASoC: Ux500: Control apb clock Ulf Hansson @ 2012-10-22 13:20 ` Linus Walleij 2012-10-22 13:32 ` Mark Brown 1 sibling, 0 replies; 9+ messages in thread From: Linus Walleij @ 2012-10-22 13:20 UTC (permalink / raw) To: linux-arm-kernel On Mon, Oct 22, 2012 at 2:32 PM, Ulf Hansson <ulf.hansson@stericsson.com> wrote: > From: Ulf Hansson <ulf.hansson@linaro.org> > > When switching to common clock driver for ux500 this clock needs to > be handled as well. Before this clock was internally managed by the > clock driver itself. > > Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org> Looks correct, Acked-by: Linus Walleij <linus.walleij@linaro.org> Yours, Linus Walleij ^ permalink raw reply [flat|nested] 9+ messages in thread
* [PATCH 2/2] ASoC: Ux500: Control apb clock 2012-10-22 12:32 ` [PATCH 2/2] ASoC: Ux500: Control apb clock Ulf Hansson 2012-10-22 13:20 ` Linus Walleij @ 2012-10-22 13:32 ` Mark Brown 2012-10-22 14:07 ` Ulf Hansson 1 sibling, 1 reply; 9+ messages in thread From: Mark Brown @ 2012-10-22 13:32 UTC (permalink / raw) To: linux-arm-kernel On Mon, Oct 22, 2012 at 02:32:05PM +0200, Ulf Hansson wrote: > From: Ulf Hansson <ulf.hansson@linaro.org> > > When switching to common clock driver for ux500 this clock needs to > be handled as well. Before this clock was internally managed by the > clock driver itself. Applied but why isn't this a deficiency in the common clock implementation for the platform? -------------- 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/20121022/fe94e73f/attachment-0001.sig> ^ permalink raw reply [flat|nested] 9+ messages in thread
* [PATCH 2/2] ASoC: Ux500: Control apb clock 2012-10-22 13:32 ` Mark Brown @ 2012-10-22 14:07 ` Ulf Hansson 0 siblings, 0 replies; 9+ messages in thread From: Ulf Hansson @ 2012-10-22 14:07 UTC (permalink / raw) To: linux-arm-kernel On 22 October 2012 15:32, Mark Brown <broonie@opensource.wolfsonmicro.com> wrote: > On Mon, Oct 22, 2012 at 02:32:05PM +0200, Ulf Hansson wrote: >> From: Ulf Hansson <ulf.hansson@linaro.org> >> >> When switching to common clock driver for ux500 this clock needs to >> be handled as well. Before this clock was internally managed by the >> clock driver itself. > > Applied but why isn't this a deficiency in the common clock > implementation for the platform? Good question. :-) Patches have just been sent to Mike Turquette clk tree for adding the clock lookups. First, I thought I might wanted to group them all in a series but decided that splitting them are probably easier to handle. Kind regards Ulf Hansson ^ permalink raw reply [flat|nested] 9+ messages in thread
* [PATCH 1/2] ASoC: Ux500: Fixup use of clocks 2012-10-22 12:32 [PATCH 1/2] ASoC: Ux500: Fixup use of clocks Ulf Hansson 2012-10-22 12:32 ` [PATCH 2/2] ASoC: Ux500: Control apb clock Ulf Hansson @ 2012-10-22 13:19 ` Linus Walleij 2012-10-22 13:30 ` Mark Brown 2 siblings, 0 replies; 9+ messages in thread From: Linus Walleij @ 2012-10-22 13:19 UTC (permalink / raw) To: linux-arm-kernel On Mon, Oct 22, 2012 at 2:32 PM, Ulf Hansson <ulf.hansson@stericsson.com> wrote: > From: Ulf Hansson <ulf.hansson@linaro.org> > > Make sure clocks are being prepared and unprepared as well > as enabled and disabled. > > Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org> Acked-by: Linus Walleij <linus.walleij@linaro.org> Thanks, Linus Walleij ^ permalink raw reply [flat|nested] 9+ messages in thread
* [PATCH 1/2] ASoC: Ux500: Fixup use of clocks 2012-10-22 12:32 [PATCH 1/2] ASoC: Ux500: Fixup use of clocks Ulf Hansson 2012-10-22 12:32 ` [PATCH 2/2] ASoC: Ux500: Control apb clock Ulf Hansson 2012-10-22 13:19 ` [PATCH 1/2] ASoC: Ux500: Fixup use of clocks Linus Walleij @ 2012-10-22 13:30 ` Mark Brown 2012-11-05 14:27 ` Ulf Hansson 2 siblings, 1 reply; 9+ messages in thread From: Mark Brown @ 2012-10-22 13:30 UTC (permalink / raw) To: linux-arm-kernel On Mon, Oct 22, 2012 at 02:32:04PM +0200, Ulf Hansson wrote: > From: Ulf Hansson <ulf.hansson@linaro.org> > > Make sure clocks are being prepared and unprepared as well > as enabled and disabled. 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/20121022/e8e52d11/attachment.sig> ^ permalink raw reply [flat|nested] 9+ messages in thread
* [PATCH 1/2] ASoC: Ux500: Fixup use of clocks 2012-10-22 13:30 ` Mark Brown @ 2012-11-05 14:27 ` Ulf Hansson 2012-11-06 8:26 ` Mark Brown 0 siblings, 1 reply; 9+ messages in thread From: Ulf Hansson @ 2012-11-05 14:27 UTC (permalink / raw) To: linux-arm-kernel On 22 October 2012 15:30, Mark Brown <broonie@opensource.wolfsonmicro.com> wrote: > On Mon, Oct 22, 2012 at 02:32:04PM +0200, Ulf Hansson wrote: >> From: Ulf Hansson <ulf.hansson@linaro.org> >> >> Make sure clocks are being prepared and unprepared as well >> as enabled and disabled. > > Applied, thanks. I can not find this patch on any "next-tree" yet. Same goes for: "[PATCH 2/2] ASoC: Ux500: Control apb clock". Maybe I should be more patient, but thought it make sense to send a ping on this. :-) Kind regards Ulf Hansson ^ permalink raw reply [flat|nested] 9+ messages in thread
* [PATCH 1/2] ASoC: Ux500: Fixup use of clocks 2012-11-05 14:27 ` Ulf Hansson @ 2012-11-06 8:26 ` Mark Brown 0 siblings, 0 replies; 9+ messages in thread From: Mark Brown @ 2012-11-06 8:26 UTC (permalink / raw) To: linux-arm-kernel On Mon, Nov 05, 2012 at 03:27:08PM +0100, Ulf Hansson wrote: > I can not find this patch on any "next-tree" yet. Same goes for: > "[PATCH 2/2] ASoC: Ux500: Control apb clock". > Maybe I should be more patient, but thought it make sense to send a > ping on this. :-) As I've had to tell you before pings are pointless, don't do this - to repeat, if you think something has been missed resend 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/20121106/d3358676/attachment.sig> ^ permalink raw reply [flat|nested] 9+ messages in thread
end of thread, other threads:[~2012-11-06 8:26 UTC | newest] Thread overview: 9+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2012-10-22 12:32 [PATCH 1/2] ASoC: Ux500: Fixup use of clocks Ulf Hansson 2012-10-22 12:32 ` [PATCH 2/2] ASoC: Ux500: Control apb clock Ulf Hansson 2012-10-22 13:20 ` Linus Walleij 2012-10-22 13:32 ` Mark Brown 2012-10-22 14:07 ` Ulf Hansson 2012-10-22 13:19 ` [PATCH 1/2] ASoC: Ux500: Fixup use of clocks Linus Walleij 2012-10-22 13:30 ` Mark Brown 2012-11-05 14:27 ` Ulf Hansson 2012-11-06 8:26 ` 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).