* [PATCH] ASoC: soc-core: add snd_soc_of_parse_sysclk_id() for dt
@ 2014-01-02 7:34 Xiubo Li
2014-01-07 16:24 ` Mark Brown
0 siblings, 1 reply; 2+ messages in thread
From: Xiubo Li @ 2014-01-02 7:34 UTC (permalink / raw)
To: broonie, lgirdwood; +Cc: perex, tiwai, alsa-devel, linux-kernel, Xiubo Li
This patch adds snd_soc_of_parse_sysclk_id() and supports below
style on dt:
sysclk-id = <XXX>;
It's an optional property, If this property is absent the defualt
vaule 0 will be returned.
Signed-off-by: Xiubo Li <Li.Xiubo@freescale.com>
---
include/sound/soc.h | 1 +
sound/soc/soc-core.c | 16 ++++++++++++++++
2 files changed, 17 insertions(+)
diff --git a/include/sound/soc.h b/include/sound/soc.h
index 5a049d9..86ac72f 100644
--- a/include/sound/soc.h
+++ b/include/sound/soc.h
@@ -1170,6 +1170,7 @@ int snd_soc_of_parse_card_name(struct snd_soc_card *card,
const char *propname);
int snd_soc_of_parse_audio_routing(struct snd_soc_card *card,
const char *propname);
+unsigned int snd_soc_of_parse_sysclk_id(struct device_node *np);
unsigned int snd_soc_of_parse_daifmt(struct device_node *np,
const char *prefix);
int snd_soc_of_get_dai_name(struct device_node *of_node,
diff --git a/sound/soc/soc-core.c b/sound/soc/soc-core.c
index be88df5..572d95d 100644
--- a/sound/soc/soc-core.c
+++ b/sound/soc/soc-core.c
@@ -4472,6 +4472,22 @@ int snd_soc_of_parse_audio_routing(struct snd_soc_card *card,
}
EXPORT_SYMBOL_GPL(snd_soc_of_parse_audio_routing);
+unsigned int snd_soc_of_parse_sysclk_id(struct device_node *np)
+{
+ u32 id;
+
+ /*
+ * check "sysclk-id = <XX>"
+ * it is an optional property
+ * 0 will be returned if absent
+ */
+ if (of_property_read_u32(np, "sysclk-id", &id))
+ id = 0;
+
+ return id;
+}
+EXPORT_SYMBOL_GPL(snd_soc_of_parse_sysclk_id);
+
unsigned int snd_soc_of_parse_daifmt(struct device_node *np,
const char *prefix)
{
--
1.8.4
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [PATCH] ASoC: soc-core: add snd_soc_of_parse_sysclk_id() for dt
2014-01-02 7:34 [PATCH] ASoC: soc-core: add snd_soc_of_parse_sysclk_id() for dt Xiubo Li
@ 2014-01-07 16:24 ` Mark Brown
0 siblings, 0 replies; 2+ messages in thread
From: Mark Brown @ 2014-01-07 16:24 UTC (permalink / raw)
To: Xiubo Li; +Cc: lgirdwood, perex, tiwai, alsa-devel, linux-kernel
[-- Attachment #1: Type: text/plain, Size: 1122 bytes --]
On Thu, Jan 02, 2014 at 03:34:17PM +0800, Xiubo Li wrote:
> This patch adds snd_soc_of_parse_sysclk_id() and supports below
> style on dt:
>
> sysclk-id = <XXX>;
>
> It's an optional property, If this property is absent the defualt
> vaule 0 will be returned.
The trick with this is defining what the clock should be. Drivers would
have to start defining their clock IDs and then at some point we end up
reinventing the common clock API and bindings. We really ought to be
moving ASoC's clock handling over towards clk but there's issues with
that given that the clock API is not available at all on some platforms
and the common clock API isn't common. This is rather a larger bit of
work than I expect you want to do right now though...
What's your use case for this - is it possible to make the driver you're
looking at default to a clock that'll work for most systems? That'd
sidestep the need to say which clock. Alternatively is the CODEC only
likely to be used with systems supporting common clk in which case doing
the sysclk configuration via the clk API might be the way forwards?
[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2014-01-07 16:25 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-01-02 7:34 [PATCH] ASoC: soc-core: add snd_soc_of_parse_sysclk_id() for dt Xiubo Li
2014-01-07 16:24 ` Mark Brown
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®