summaryrefslogtreecommitdiff
path: root/sound/soc/generic
AgeCommit message (Collapse)Author
2019-02-20ASoC: simple-card: Fix of-node refcount unbalance in DAI-link parserTakashi Iwai
The function simple_for_each_link() has a few missing places that forgot unrefereing of-nodes after the use. The main do-while loop may abort when loop=0, and this leaves the node object still referenced. A similar leak is found in the error handling of NULL codec that aborts the loop as well. Last but not least, the inner for_each_child_of_node() loop may abort in the middle, and this leaks the refcount of the iterator node. This patch addresses these missing refcount issues. Signed-off-by: Takashi Iwai <tiwai@suse.de> Acked-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2019-02-20ASoC: simple-card: Fix missing of_node_put() at simple_dai_link_of()Takashi Iwai
We forgot to unreference the platform node object obtained from of_get_child_by_name(). This leads to the unbalance of node refcount. Fixes: e0ae225b7e96 ("ASoC: simple-card: support platform in dts parse") Signed-off-by: Takashi Iwai <tiwai@suse.de> Acked-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2019-02-18ASoC: simple-card: Fix refcount underflowDaniel Baluta
of_get_child_by_name() takes a reference we'll need to drop later so when we substitute in top we need to take a reference as well as just assigning. Without this patch we hit the following error: [ 1.246852] OF: ERROR: Bad of_node_put() on /sound-wm8524 [ 1.262261] Hardware name: NXP i.MX8MQ EVK (DT) [ 1.266807] Workqueue: events deferred_probe_work_func [ 1.271950] Call trace: [ 1.274406] dump_backtrace+0x0/0x158 [ 1.278074] show_stack+0x14/0x20 [ 1.281396] dump_stack+0xa8/0xcc [ 1.284717] of_node_release+0xb0/0xc8 [ 1.288474] kobject_put+0x74/0xf0 [ 1.291879] of_node_put+0x14/0x28 [ 1.295286] __of_get_next_child+0x44/0x70 [ 1.299387] of_get_next_child+0x3c/0x60 [ 1.303315] simple_for_each_link+0x1dc/0x230 [ 1.307676] simple_probe+0x80/0x540 [ 1.311256] platform_drv_probe+0x50/0xa0 This patch is based on an earlier version posted by Kuninori Morimoto and commit message includes explanations from Mark Brown. https://patchwork.kernel.org/patch/10814255/ Reported-by: Vicente Bergas <vicencb@gmail.com> Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2019-01-21ASoC: simple-card: rename to asoc_simple_card_canonicalize_platform()Kuninori Morimoto
Current simple-card is using asoc_simple_card_canonicalize_dailink(). Its naming is "dailink", but is for "platform". We already have asoc_simple_card_canonicalize_cpu() for "cpu", let's follow same naming rule. It never return error, so, void function is better idea. Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2019-01-21ASoC: soc-core: add .num_platform for dai_linkKuninori Morimoto
Current snd_soc_dai_link is starting to use snd_soc_dai_link_component (= modern) style for Platform, but it is still assuming single Platform so far. We will need to have multi Platform support in the not far future. Currently only simple card is using it as sound card driver, and other drivers are converted to it from legacy style by snd_soc_init_platform(). To avoid future problem of multi Platform support, let's add num_platforms before it is too late. In the same time, to make it same naming mothed, "platform" should be "platforms". This patch fixup it too. Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2019-01-03ASoC: simple-card: reduce naming prefixKuninori Morimoto
Current simple-card is using asoc_simple_card_xxx() for function / data naming. Because of this long prefix, it is easy to be 80 character over. Let's reduce prefix from asoc_simple_card_xxx() to simple_xxx(). Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2019-01-03ASoC: simple-card: cleanup DAI link loop method - step2Kuninori Morimoto
Current simple-card is parsing DAI link for both "normal sound" and "DPCM sound". On this driver, it needs to count and parse DAIs/Links/Codec Conf from each links. Then, counting/parsing link loop are very similar, but using different implementation. Because of this background, the link loop code is very mysterious. Mystery code will be trouble in the future. This patch cleanups the code by using asoc_simple_card_for_each_link() which judges normal link / DPCM link. Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2019-01-03ASoC: simple-card: cleanup DAI link loop method - step1Kuninori Morimoto
Current simple-card is parsing DAI link for both "normal sound" and "DPCM sound". On this driver, it needs to count and parse DAIs/Links/Codec Conf from each links. Then, counting/parsing link loop are very similar, but using different implementation. Because of this background, the link loop code is very mysterious. Mystery code will be trouble in the future. This patch adds/modifies counting and parsing function for "normal sound" and "DPCM sound", and call it from link loop. This is prepare for cleanup DAI link loop method. Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2019-01-03ASoC: simple-card: add link_infoKuninori Morimoto
Current simple-card is parsing DAI link for both "normal sound" and "DPCM sound". On this driver, it needs to count and parse DAIs/Links/Codec Conf from each links. Then, counting/parsing link loop are very similar, but using different implementation. Because of this background, the link loop code is very mysterious. Mystery code will be trouble in the future. To preparing cleanup code, this patch adds link_info which handles number of DAIs/Links/Codec Conf, and CPU/Codec turn. Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2019-01-03ASoC: simple-card: add 1 CPU : 1 Codec support againKuninori Morimoto
simple-card is now supporting normal sound and DPCM sound. For DPCM sound, original sound card (= simple-scu-card) had been supported 1 CPU : 1 Codec connection which uses hw_params_fixup() for convert-rate/channel. But, merged simple-card is completely forgeting about it. This patch re-support it. Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2019-01-03ASoC: simple-card: add asoc_simple_card_get_conversion()Kuninori Morimoto
simple-card is now supporting normal sound and DPCM sound. For DPCM sound, original sound card (= simple-scu-card) had been supported 1 CPU : 1 Codec connection which uses hw_params_fixup() for convert-rate/channel. But, merged simple-card is completely forgeting about it. To re-support 1 CPU : 1 Codec DPCM for hw_params_fixup(), it need to judge whether it is DPCM by checking convert-rate/channel. For this purpose, this patch adds asoc_simple_card_get_conversion() as preparation Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2019-01-03ASoC: audio-graph-card: reduce naming prefixKuninori Morimoto
Current audio-graph-card is using asoc_graph_card_xxx() for function / data naming. Because of this long prefix, it is easy to be 80 character over. Let's reduce prefix from asoc_graph_card_xxx() to graph_xxx(). Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2019-01-03ASoC: audio-graph-card: cleanup DAI link loop method - step2Kuninori Morimoto
Current audio-graph-card is parsing DAI link for both "normal sound" and "DPCM sound". On this driver, it needs to count and parse DAIs/Links/Codec Conf from each links. Then, counting/parsing link loop are very similar, but using different implementation. Because of this background, the link loop code is very mysterious. Mystery code will be trouble in the future. This patch cleanups the code by using asoc_graph_card_for_each_link() which judges normal link / DPCM link. Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2019-01-03ASoC: audio-graph-card: cleanup DAI link loop method - step1Kuninori Morimoto
Current audio-graph-card is parsing DAI link for both "normal sound" and "DPCM sound". On this driver, it needs to count and parse DAIs/Links/Codec Conf from each links. Then, counting/parsing link loop are very similar, but using different implementation. Because of this background, the link loop code is very mysterious. Mystery code will be trouble in the future. This patch adds/modifies counting and parsing function for "normal sound" and "DPCM sound", and call it from link loop. This is prepare for cleanup DAI link loop method. Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2019-01-03ASoC: audio-graph-card: add link_infoKuninori Morimoto
Current audio-graph-card is parsing DAI link for both "normal sound" and "DPCM sound". On this driver, it needs to count and parse DAIs/Links/Codec Conf from each links. Then, counting/parsing link loop are very similar, but using different implementation. Because of this background, the link loop code is very mysterious. Mystery code will be trouble in the future. To preparing cleanup code, this patch adds link_info which handles number of DAIs/Links/Codec Conf, and CPU/Codec turn. Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2019-01-03ASoC: audio-graph-card: add 1 CPU : 1 Codec support againKuninori Morimoto
audio-graph-card is now supporting normal sound and DPCM sound. For DPCM sound, original sound card (= audio-graph-scu) had been supported 1 CPU : 1 Codec connection which uses hw_params_fixup() for convert-rate/channel. But, merged audio-graph-card is completely forgeting about it. This patch re-support it. Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2019-01-03ASoC: simple-scu-card: remove simple-scu-cardKuninori Morimoto
It is already merged into simple-card. simple-scu-card is no longer needed. Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2019-01-03ASoC: audio-graph-scu-card: remove audio-graph-scu-cardKuninori Morimoto
It is already merged into audio-graph-card. audio-graph-scu-card is no longer needed. Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2019-01-03ASoC: audio-graph-card: add asoc_graph_card_get_conversion()Kuninori Morimoto
audio-graph-card is now supporting normal sound and DPCM sound. For DPCM sound, original sound card (= audio-graph-scu) had been supported 1 CPU : 1 Codec connection which uses hw_params_fixup() for convert-rate/channel. But, merged audio-graph-card is completely forgeting about it. To re-support 1 CPU : 1 Codec DPCM for hw_params_fixup(), it need to judge whether it is DPCM by checking convert-rate/channel. For this purpose, this patch adds asoc_graph_card_get_conversion() as preparation Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2019-01-03ASoC: simple-card-utils: check "reg" property on asoc_simple_card_get_dai_id()Kuninori Morimoto
We will get DAI ID from "reg" property if it has on DT, otherwise get it by counting port/endpoint. But in below case, we need to get DAI ID = 0 via port reg = <0>, but current implementation returns ID = 1, because it can't judge ID = 0 was from "non reg" or "reg = <0>". Thus, it will count port/endpoint number as "non reg" case. of_graph_parse_endpoint() implementation itself is not a problem, but because asoc_simple_card_get_dai_id() need to count port/endpoint number when "non reg" case, it need to know ID = 0 was from "non reg" or "reg = <0>". This patch fix this issue. port { reg = <0>; xxxx: endpoint@0 { }; => xxxx: endpoint@1 { }; }; Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2018-12-14ASoC: simple-card: tidyup prefix for snd_soc_codec_confKuninori Morimoto
Current simple-card is handling "prefix" by many ways. But, it is not useful and readable. We want to do is that allow having it everywere. This patch supports it. It will be overwrote if lower node has it. sound { simple-audio-card,prefix = "xxx"; // initial simple-audio-card,dai-link { prefix = "xxx"; // overwrite cpu { ... }; codec { prefix = "xxx"; // overwrite }; }; }; Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2018-12-14ASoC: simple-card: tidyup convert_rate/channel methodKuninori Morimoto
Current simple-card is handling "convert_rate/channel" by many ways. But, it is not useful and readable. We want to do is that allow having it everywere. This patch support it. It will be overwrote if lower node has it. sound { simple-audio-card,convert_channels = <xxx>; // initial simple-audio-card,dai-link { convert_channels = <xxx>; // overwrite cpu { convert_channels = <xxx>; // overwrite }; codec { convert_channels = <xxx>; // overwrite }; }; }; Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2018-12-14ASoC: simple-card: tidyup mclk-fs methodKuninori Morimoto
Current simple-card is handling "mclk-fs" by many way. But, it is not useful and readable. We want to do is that allow having mclk-fs everywere. This patch support it. It will be overwrote if lower node has it. sound { simple-audio-card,mclk-fs = <xxx>; // for initial simple-audio-card,dai-link { mclk-fs = <xxx>; // overwrite cpu { mclk-fs = <xxx>; // overwrite }; codec { mclk-fs = <xxx>; // overwrite }; }; }; Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2018-12-14ASoC: simple-card: merge simple-scu-cardKuninori Morimoto
simple-card and simple-scu-card are very similar driver, but the former is supporting normal sound card, the latter is supporting DPCM sound card. We couldn't use normal sound and DPCM sound in same time by one sound card. This patch merges both sound card into simple-card. Now we can use both feature on same driver. simple-card is now supporting .compatible = "simple-scu-audio-card". Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2018-12-14ASoC: audio-graph-card: tidyup prefix for snd_soc_codec_confKuninori Morimoto
Current audio-graph-card is handling "prefix" by many ways. But, it is not useful and readable. We want to do is that allow having it everywere. This patch supports it. It will be overwrote if lower node has it. sound { prefix = "xxx"; // initial }; codec { audio-graph-card,prefix = "xxx"; // overwrite ports { prefix = "xxx"; // overwrite port { prefix = "xxx"; // overwrite }; }; }; Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2018-12-14ASoC: audio-graph-card: tidyup convert_rate/channel methodKuninori Morimoto
Current audio-graph-card is handling "convert_rate/channel" by many ways. But, it is not useful and readable. We want to do is that allow having it everywere. This patch support it. It will be overwrote if lower node has it. sound { convert-channels = <xxx>; // initial }; codec { audio-graph-card,convert-channels = <xxx>; // overwrite ports { convert_channels = <xxx>; // overwrite port { convert_channels = <xxx>; // overwrite endpoint { convert_channels = <xxx>; // overwrite }; }; }; }; Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2018-12-14ASoC: audio-graph-card: tidyup mclk-fs methodKuninori Morimoto
Current audio-graph-card is handling "mclk-fs" by many way. But, it is not useful and readable. We want to do is that allow having mclk-fs everywere. This patch support it. It will be overwrote if lower node has it. sound { mclk-fs = <xxx>; // initial }; codec { ports { mclk-fs = <xxx>; // overwrite port { mclk-fs = <xxx>; // overwrite endpoint { mclk-fs = <xxx>; // overwrite }; }; }; }; Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2018-12-14ASoC: audio-graph-card: merge audio-graph-scu-cardKuninori Morimoto
audio-graph-card and audio-graph-scu-card are very similar driver, but the former is supporting normal sound card, the latter is supporting DPCM sound card. We couldn't use normal sound and DPCM sound in same sound card by audio-graph-card. This patch merges both sound card into it. Now we can use both feature on same driver. audio-grap-card is now supporting .compatible = "audio-graph-scu-card". Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Tested-by: Tony Lindgren <tony@atomide.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2018-12-14ASoC: simple-card-utils: fixup asoc_simple_card_get_dai_id() ID methodKuninori Morimoto
commit b6f3fc005a2c8 ("ASoC: simple-card-utils: fixup asoc_simple_card_get_dai_id() counting") fixuped getting DAI ID method. It will get DAI ID from OF graph "port", but, we want to consider about "endpoint", too. And, we also want to keep compatibility. This patch fixup it as if (driver has specified DAI ID) use it as DAI ID else if (OF graph endpoint has reg) use it as DAI ID else if (OF graph port has reg) use it as DAI ID else use endpoint count as DAI ID Fixes: commit b6f3fc005a2c8 ("ASoC: simple-card-utils: fixup asoc_simple_card_get_dai_id() counting") Reported-by: Tony Lindgren <tony@atomide.com> Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Tested-by: Tony Lindgren <tony@atomide.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2018-12-13ASoC: simple-card: Dereference pointer for memcpy sizeof in ↵Nathan Chancellor
asoc_simple_card_probe Commit 4fb7f4df49d3 ("ASoC: simple-card: use cpu/codec pointer on simple_dai_props") updated {cpu,codec}_dai to be pointers in struct simple_dai_props but didn't update these locations to dereference the pointers. This patch fixup it for non DT simple-card use case. Signed-off-by: Nathan Chancellor <natechancellor@gmail.com> Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2018-12-11ASoC: simple-scu-card: care multi DPCM codec_confKuninori Morimoto
Current simple-scu-card didn't care about codec_conf for multi DPCM case. This patch cares it. Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2018-12-11ASoC: simple-scu-card: use cpu/codec pointer on graph_dai_propsKuninori Morimoto
In DPCM case, it uses CPU-dummy / dummy-Codec dai links, and non DPCM case, it uses CPU-Codec dai links. Now, we want to merge simple-card and simple-scu-card. These sound cards are using silimar but not same logic on each functions. Then, of course we want to share same logic. To compromise, this patch uses cpu/codec pointer on simple-scu-card. It is same logic with simple-card, thus easy merging. This is prepare for merging simple card Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2018-12-11ASoC: simple-scu-card: tidyup "convert-rate/channels" parsingKuninori Morimoto
simple-scu-card.c is supporting "convert-rate/channels" which is used for DPCM. But, sound card might have multi codecs, and each codec might need each convert-rate/channels. This patch supports each codec's convert-rate/channles support. top node convert-rate/channels will overwrite settings if exist. It can't support each codec's convert-rate/channels if sound card had multi codecs without this patch. Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2018-12-11ASoC: simple-scu-card: care link / dai countKuninori Morimoto
In DPCM case, it uses CPU-dummy / dummy-Codec dai links. If sound card is caring only DPCM, link count = dai count, but, if non DPCM case, link count != dai count. Now, we want to merge simple-card and simple-scu-card, then, we need to care both link / dai count more carefly This patch cares it, and prepare for merging simple card Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2018-12-11ASoC: simple-scu-card: add dai-link supportKuninori Morimoto
simple-card is supporting dai-link support, but simple-scu-card doesn't have it. This patch support it. This is prepare for merging simple-card and simple-scu-card. Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2018-12-11ASoC: simple-scu-card: tidyup asoc_simple_card_parse_daifmt() timingKuninori Morimoto
Current simple-scu-card driver is parsing codec position for DPCM and consider DAI format. But, current operation is doing totally pointless, because it should be called for each CPU/Codec pair. Let's tidyup asoc_simple_card_parse_daifmt() timing. Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2018-12-11ASoC: simple-card: use cpu/codec pointer on simple_dai_propsKuninori Morimoto
In DPCM case, it uses CPU-dummy / dummy-Codec dai links, and non DPCM case, it uses CPU-Codec dai links. Now, we want to merge simple-card and simple-scu-card. These sound cards are using silimar but not same logic on each functions. Then, of course we want to share same logic. To compromise, this patch uses cpu/codec pointer on simple-card. It is same logic with simple-scu-card, thus easy merging. This is prepare for merging audio card Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2018-12-11ASoC: simple-card-utils: fix build warning without CONFIG_OFArnd Bergmann
When CONFIG_OF is disabled, of_graph_parse_endpoint() does not initialize 'info', and gcc can see that: sound/soc/generic/simple-card-utils.c: In function 'asoc_simple_card_parse_graph_dai': sound/soc/generic/simple-card-utils.c:284:13: error: 'info.port' may be used uninitialized in this function [-Werror=maybe-uninitialized] It's probably best to check the return code anyway, and that also takes care of the warning. Fixes: b6f3fc005a2c ("ASoC: simple-card-utils: fixup asoc_simple_card_get_dai_id() counting") Signed-off-by: Arnd Bergmann <arnd@arndb.de> Acked-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2018-12-06ASoC: Use of_node_name_eq for node name comparisonsRob Herring
Convert string compares of DT node names to use of_node_name_eq helper instead. This removes direct access to the node name pointer. For the FSL ASoC card, the full node names appear to be "ssi", "esai", and "sai", so there's not any reason to use strstr and of_node_name_eq can be used instead. Cc: Timur Tabi <timur@kernel.org> Cc: Nicolin Chen <nicoleotsuka@gmail.com> Cc: Xiubo Li <Xiubo.Lee@gmail.com> Cc: Fabio Estevam <fabio.estevam@nxp.com> Cc: Liam Girdwood <lgirdwood@gmail.com> Cc: Mark Brown <broonie@kernel.org> Cc: Jaroslav Kysela <perex@perex.cz> Cc: Takashi Iwai <tiwai@suse.com> Cc: alsa-devel@alsa-project.org Cc: linuxppc-dev@lists.ozlabs.org Signed-off-by: Rob Herring <robh@kernel.org> Signed-off-by: Mark Brown <broonie@kernel.org>
2018-12-04ASoC: audio-graph-card: use cpu/codec pointer on graph_dai_propsKuninori Morimoto
In DPCM case, it uses CPU-dummy / dummy-Codec dai links, and non DPCM case, it uses CPU-Codec dai links. Now, we want to merge audio-graph-card and audio-graph-scu-card. These sound cards are using silimar but not same logic on each functions. Then, of course we want to share same logic. To compromise, this patch uses cpu/codec pointer on audio-graph-card. It is same logic with audio-graph-scu-card, thus easy merging. This is prepare for merging audio card Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2018-12-04ASoC: audio-graph-scu-card: care multi DPCM codec_confKuninori Morimoto
Current audio-graph-scu-card didn't care about codec_conf for multi DPCM case. This patch cares it. Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2018-12-04ASoC: audio-graph-scu-card: use cpu/codec pointer on graph_dai_propsKuninori Morimoto
In DPCM case, it uses CPU-dummy / dummy-Codec dai links, and non DPCM case, it uses CPU-Codec dai links. Now, we want to merge audio-graph-card and audio-graph-scu-card. These sound cards are using silimar but not same logic on each functions. Then, of course we want to share same logic. To compromise, this patch uses cpu/codec pointer on audio-graph-scu-card. It is same logic with audio-graph-card, thus easy merging. This is prepare for merging audio card Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2018-12-04ASoC: audio-graph-scu-card: care link / dai countKuninori Morimoto
In DPCM case, it uses CPU-dummy / dummy-Codec dai links. If sound card is caring only DPCM, link count = dai count, but, if non DPCM case, link count != dai count. Now, we want to merge audio-graph-card and audio-graph-scu-card, then, we need to care both link / dai count more carefly This patch cares it, and prepare for merging audio card Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2018-12-04ASoC: simple-card-utils: fixup asoc_simple_card_get_dai_id() countingKuninori Morimoto
asoc_simple_card_get_dai_id() returns DAI ID, but it is based on DT node's "endpoint" position. Almost all cases 1 port has 1 endpoint, thus, it was no problem. But in reality, port : endpoint = 1 : N, thus, counting endpoint is BUG, it should based on "port" ID. This patch fixup it. Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2018-11-23ASoC: audio-graph-card: tidyup define positionKuninori Morimoto
commit f986907c9225 ("ASoC: audio-graph-card: add widgets and routing for external amplifier support") added new function asoc_graph_card_outdrv_event(), but the inserted position breaks define area. This patch tidyup it Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2018-11-23ASoC: audio-graph-card: tidyup typo SND_AUDIO_GRAPH_CARDKuninori Morimoto
1 "simple" is enough on Kconfig help Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2018-11-23ASoC: audio-graph-scu-card: tidyup asoc_simple_card_parse_daifmt() timingKuninori Morimoto
Current audio-graph-scu-card driver is parsing codec position for DPCM and consider DAI format. But, current operation is doing totally pointless, because 1) asoc_simple_card_parse_daifmt() will be called not only for 1st codec on current implementation, and it will be used as fixed format 2) it should be called for each CPU/Codec pair. Let's tidyup asoc_simple_card_parse_daifmt() timing. Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2018-11-23ASoC: audio-graph-scu-card: tidyup "convert-rate/channels" parsingKuninori Morimoto
audio-graph-scu-card.c is supporting "convert-rate/channels" which is used for DPCM. But, sound card might have multi codecs, and each codec might need each convert-rate/channels. This patch supports each codec's convert-rate/channles support. top node convert-rate/channels will overwrite settings if exist. It can't support each codec's convert-rate/channels if sound card had multi codecs without this patch. Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2018-11-23ASoC: audio-graph-scu-card: tidyup "prefix" parsingKuninori Morimoto
audio-graph-scu-card.c is supporting "prefix" which is used to avoid DAI naming conflict when CPU/Codec matching. But, sound card might have multi sub-devices, and each codec might need each prefix. Now, ASoC is supporting snd_soc_of_parse_node_prefix(), let's support it on audio-graph-scu-card, too. It is keeping existing DT style. It can't support each codec's prefix if sound card had multi sub-devices without this patch. Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2018-11-23ASoC: simple-scu-card: tidyup "prefix" parsingKuninori Morimoto
simple-scu-card.c is supporting "prefix" which is used to avoid DAI naming conflict when CPU/Codec matching. But, sound card might have multi sub-devices, and each codec might need each prefix. Now, ASoC is supporting snd_soc_of_parse_node_prefix(), let's support it on audio-graph-scu-card, too. It is keeping existing DT style. It can't support each codec's prefix if sound card had multi sub-devices without this patch. Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Signed-off-by: Mark Brown <broonie@kernel.org>