[alsa-devel] [PATCH] ASoC: simple-card: Add device's module clock selection.
Try to get the device's module clock if the dt has no clocks and system-clock-frequency properties.
Signed-off-by: Xiubo Li Li.Xiubo@freescale.com --- a.out | 0 sound/soc/generic/simple-card.c | 21 ++++++++++++++++++--- 2 files changed, 18 insertions(+), 3 deletions(-) create mode 100644 a.out
diff --git a/a.out b/a.out new file mode 100644 index 0000000..e69de29 diff --git a/sound/soc/generic/simple-card.c b/sound/soc/generic/simple-card.c index 6ce9745..c0d92813 100644 --- a/sound/soc/generic/simple-card.c +++ b/sound/soc/generic/simple-card.c @@ -90,14 +90,29 @@ asoc_simple_card_sub_parse_of(struct device_node *np, * dai->sysclk come from * "clocks = <&xxx>" (if system has common clock) * or "system-clock-frequency = <xxx>" + * or device's module clock. */ - clk = of_clk_get(np, 0); - if (IS_ERR(clk)) + if (of_property_read_bool(np, "clocks")) { + clk = of_clk_get(np, 0); + if (IS_ERR(clk)) { + ret = PTR_ERR(clk); + goto parse_error; + } + + dai->sysclk = clk_get_rate(clk); + } else if (of_property_read_bool(np, "system-clock-frequency")) { of_property_read_u32(np, "system-clock-frequency", &dai->sysclk); - else + } else { + clk = of_clk_get(*node, 0); + if (IS_ERR(clk)) { + ret = PTR_ERR(clk); + goto parse_error; + } + dai->sysclk = clk_get_rate(clk); + }
ret = 0;
On 12/23/2013 08:25 AM, Xiubo Li wrote:
diff --git a/a.out b/a.out new file mode 100644 index 0000000..e69de29
This patch did add a empty a.out file in the toplevel folder.
- Lars
On Wed, Jan 01, 2014 at 01:11:09PM +0100, Lars-Peter Clausen wrote:
On 12/23/2013 08:25 AM, Xiubo Li wrote:
diff --git a/a.out b/a.out new file mode 100644 index 0000000..e69de29
This patch did add a empty a.out file in the toplevel folder.
Removed now. This is one of several patches from Xiubo that have done this - Xiubo, please check this.
Hi Mark, Lars
Subject: Re: [alsa-devel] [PATCH] ASoC: simple-card: Add device's module clock selection.
On Wed, Jan 01, 2014 at 01:11:09PM +0100, Lars-Peter Clausen wrote:
On 12/23/2013 08:25 AM, Xiubo Li wrote:
diff --git a/a.out b/a.out new file mode 100644 index 0000000..e69de29
This patch did add a empty a.out file in the toplevel folder.
Removed now. This is one of several patches from Xiubo that have done this - Xiubo, please check this.
Yes, this had been removed by Mark already.
Thanks,
-- Best Regards, Xiubo
Subject: Re: [alsa-devel] [PATCH] ASoC: simple-card: Add device's module clock selection.
On 12/23/2013 08:25 AM, Xiubo Li wrote:
diff --git a/a.out b/a.out new file mode 100644 index 0000000..e69de29
This patch did add a empty a.out file in the toplevel folder.
- Lars
Yes, sorry, my mistake.
Thanks very much
-- Best regards, Xiubo
participants (4)
-
Lars-Peter Clausen
-
Li.Xiubo@freescale.com
-
Mark Brown
-
Xiubo Li