[alsa-devel] [PATCH] ASoC: imx-sgtl5000: Use devm_clk_get()
broonie at kernel.org
Tue Jun 11 10:41:57 CEST 2013
On Tue, Jun 11, 2013 at 10:50:40AM +0800, Shawn Guo wrote:
> Why do you need to pass it at all? It seems to me that the machine
> driver only needs the frequency to set up sgtl5000 sysclk. So it ends
> up with something below.
> - sgtl5000 driver calls clk_get_rate() to get the frequency
> - sgtl5000 driver passes the frequency to imx-sgtl500 driver
> - imx-sgtl500 driver sets the frequency back to sgtl5000 via
> .set_sysclk callback
> I need some help to understand why sgtl5000 driver can not just set up
> its sysclk but having to do the above.
If it's got the clock itself it can do. The main reason we have a
custom clock API in ASoC is that there's no generic clock API we can
rely on being available but since the driver has been modified to rely
on having a clock directly we may as well use it.
We do still want the ability to set the rate in order to allow machine
drivers to reprogram if they want to (so they can switch between 8kHz
and 44.1kHz based rates for example) but it's OK for the driver to
figure this out automatically if it has the clock provided.
-------------- next part --------------
A non-text attachment was scrubbed...
Size: 836 bytes
Desc: Digital signature
More information about the Alsa-devel