[alsa-devel] [PATCH 2/2] ASoC: rockchip: i2s: add support for grabbing output clock to codec
Jianqun
xjq at rock-chips.com
Wed Nov 19 07:41:40 CET 2014
Hi sonny
Thanks, I'm not familiar with it, thanks to remaind me:-)
I will modify it at next version together with other changes if someone review it
在 11/19/2014 11:57 AM, Sonny Rao 写道:
> Jay,
>
> On Tue, Nov 18, 2014 at 7:07 PM, Jianqun Xu <jay.xu at rock-chips.com> wrote:
>
> Mostly FYI, but if you take someone else's patch, you should also
> retain their authorship by saying:
> From: <person>
> at the top of the message. I don't really mind, but please keep it in
> mind for the future, thanks.
>
>> We need to claim the clock which is driving the codec so that when we enable
>> clock gating, we continue to clock the codec when needed. I make this an
>> optional clock since there might be some applications where we don't need it
>> but can still use the I2S block.
>>
>> Signed-off-by: Sonny Rao <sonnyrao at chromium.org>
>> Signed-off-by: Jianqun Xu <jay.xu at rock-chips.com>
>> ---
>> sound/soc/rockchip/rockchip_i2s.c | 11 +++++++++++
>> 1 file changed, 11 insertions(+)
>>
>> diff --git a/sound/soc/rockchip/rockchip_i2s.c b/sound/soc/rockchip/rockchip_i2s.c
>> index c74ba37..2820ade 100644
>> --- a/sound/soc/rockchip/rockchip_i2s.c
>> +++ b/sound/soc/rockchip/rockchip_i2s.c
>> @@ -28,6 +28,7 @@ struct rk_i2s_dev {
>>
>> struct clk *hclk;
>> struct clk *mclk;
>> + struct clk *oclk;
>>
>> struct snd_dmaengine_dai_dma_data capture_dma_data;
>> struct snd_dmaengine_dai_dma_data playback_dma_data;
>> @@ -439,6 +440,14 @@ static int rockchip_i2s_probe(struct platform_device *pdev)
>> return PTR_ERR(i2s->mclk);
>> }
>>
>> + i2s->oclk = devm_clk_get(&pdev->dev, "i2s_clk_out");
>> + if (IS_ERR(i2s->oclk)) {
>> + dev_dbg(&pdev->dev, "Didn't find output clock\n");
>> + i2s->oclk = NULL;
>> + }
>> + if (i2s->oclk)
>> + ret = clk_prepare_enable(i2s->oclk);
>> +
>> res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
>> regs = devm_ioremap_resource(&pdev->dev, res);
>> if (IS_ERR(regs))
>> @@ -505,6 +514,8 @@ static int rockchip_i2s_remove(struct platform_device *pdev)
>> if (!pm_runtime_status_suspended(&pdev->dev))
>> i2s_runtime_suspend(&pdev->dev);
>>
>> + if (i2s->oclk)
>> + clk_disable_unprepare(i2s->oclk);
>> clk_disable_unprepare(i2s->mclk);
>> clk_disable_unprepare(i2s->hclk);
>> snd_dmaengine_pcm_unregister(&pdev->dev);
>> --
>> 1.9.1
>>
>
>
--
Jianqun Xu
****************************************************************************
*IMPORTANT NOTICE:*This email is from Fuzhou Rockchip Electronics Co.,
Ltd .The contents of this email and any attachments may contain
information that is privileged, confidential and/or exempt from
disclosure under applicable law and relevant NDA. If you are not the
intended recipient, you are hereby notified that any disclosure,
copying, distribution, or use of the information is STRICTLY PROHIBITED.
Please immediately contact the sender as soon as possible and destroy
the material in its entirety in any format. Thank you.
****************************************************************************
More information about the Alsa-devel
mailing list