[alsa-devel] Choosing the sysclk in simple-card looks broken to me.
Mark Brown
broonie at kernel.org
Mon Aug 11 12:48:54 CEST 2014
On Sun, Aug 10, 2014 at 02:42:23PM -0400, jonsmirl at gmail.com wrote:
> This should fix it to use the output clocks, but does it break any of
> the other DTS using simple-audio?
>
> diff --git a/sound/soc/generic/simple-card.c b/sound/soc/generic/simple-card.c
> index 03a7fdc..8c4b267 100644
> --- a/sound/soc/generic/simple-card.c
> +++ b/sound/soc/generic/simple-card.c
> @@ -116,6 +116,7 @@ asoc_simple_card_sub_parse_of(struct device_node *np,
> {
> struct device_node *node;
> struct clk *clk;
> + const char *clk_name = NULL;
> int ret;
>
> /*
> @@ -156,11 +157,14 @@ asoc_simple_card_sub_parse_of(struct device_node *np,
> "system-clock-frequency",
> &dai->sysclk);
> } else {
> - clk = of_clk_get(node, 0);
> - if (!IS_ERR(clk))
> - dai->sysclk = clk_get_rate(clk);
> + of_property_read_string(node, "clock-output-names", &clk_name);
> + if (clk_name) {
> + clk = of_clk_get_by_name(node, clk_name);
> + if (!IS_ERR(clk)) {
> + dai->sysclk = clk_get_rate(clk);
> + }
Jon, please use indentation when sending code via e-mail - this is far
too hard to read.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: Digital signature
URL: <http://mailman.alsa-project.org/pipermail/alsa-devel/attachments/20140811/022d7cb6/attachment.sig>
More information about the Alsa-devel
mailing list