Message ID | 871t4xrrq4.wl%kuninori.morimoto.gx@renesas.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
On Fri, May 20, 2016 at 09:48:07AM +0000, Kuninori Morimoto wrote: > From: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> > > simple-card like driver is supporting DPCM FE/BE. > This patch makes this method simple style standard. DPCM is very much an implementation detail of the current stack, providing helpers that promote its use doesn't seem like the best idea - we want to change it for in kernel use going forwards and that's going to be harder with DPCM. We should be encouraging bindings that make DSPs look more like CODECs.
Hi Mark > > From: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> > > > > simple-card like driver is supporting DPCM FE/BE. > > This patch makes this method simple style standard. > > DPCM is very much an implementation detail of the current stack, > providing helpers that promote its use doesn't seem like the best idea - > we want to change it for in kernel use going forwards and that's going > to be harder with DPCM. We should be encouraging bindings that make > DSPs look more like CODECs. rsrc-card which is using DPCM is already existing in upstream. And, sharing code between simple-card <-> rsrc-card (= simple-dpcm-card), (and expand it to simple-graph-card) is the purpose of this patch-set. So, I will drop this "DPCM specific helper function" from simple-card-core (= will be simple-card-util). But simple-dpcm-card itself is OK. Is this correct ? Best regards --- Kuninori Morimoto
diff --git a/include/sound/simple_card_core.h b/include/sound/simple_card_core.h index 8155001..5e2e824 100644 --- a/include/sound/simple_card_core.h +++ b/include/sound/simple_card_core.h @@ -69,4 +69,11 @@ int asoc_simple_card_parse_endpoint(struct device_node *port_np, const char *cells_name, int *is_single_links); +#define asoc_simple_card_parse_dpcm_fe(dai_link) \ + asoc_simple_card_parse_dpcm(dai_link, NULL) +#define asoc_simple_card_parse_dpcm_be(dai_link, fixup) \ + asoc_simple_card_parse_dpcm(dai_link, fixup) +void asoc_simple_card_parse_dpcm(struct snd_soc_dai_link *dai_link, + int (*be_fixup)(struct snd_soc_pcm_runtime *rtd, + struct snd_pcm_hw_params *params)); #endif /* __SIMPLE_CARD_CORE_H */ diff --git a/sound/soc/generic/simple-card-core.c b/sound/soc/generic/simple-card-core.c index d9285df..d3aab6d 100644 --- a/sound/soc/generic/simple-card-core.c +++ b/sound/soc/generic/simple-card-core.c @@ -242,3 +242,32 @@ int asoc_simple_card_parse_endpoint(struct device_node *port_np, return 0; } EXPORT_SYMBOL_GPL(asoc_simple_card_parse_endpoint); + +void asoc_simple_card_parse_dpcm(struct snd_soc_dai_link *dai_link, + int (*be_fixup)(struct snd_soc_pcm_runtime *rtd, + struct snd_pcm_hw_params *params)) +{ + if (be_fixup) { + /* FE is dummy */ + dai_link->cpu_of_node = NULL; + dai_link->cpu_dai_name = "snd-soc-dummy-dai"; + dai_link->cpu_name = "snd-soc-dummy"; + + /* BE settings */ + dai_link->no_pcm = 1; + dai_link->be_hw_params_fixup = be_fixup; + } else { + /* BE is dummy */ + dai_link->codec_of_node = NULL; + dai_link->codec_dai_name = "snd-soc-dummy-dai"; + dai_link->codec_name = "snd-soc-dummy"; + + /* FE settings */ + dai_link->dynamic = 1; + dai_link->dpcm_merged_format = 1; + } + + dai_link->dpcm_playback = 1; + dai_link->dpcm_capture = 1; +} +EXPORT_SYMBOL_GPL(asoc_simple_card_parse_dpcm);