summaryrefslogtreecommitdiff
path: root/sound/soc/generic
AgeCommit message (Collapse)Author
2024-05-13Merge tag 'asoc-v6.10' of ↵Takashi Iwai
https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound into for-linus ASoC: Updates for v6.10 This is a very big update, in large part due to extensive work the Intel people have been doing in their drivers though it's also been busy elsewhere. There's also a big overhaul of the DAPM documentation from Luca Ceresoli arising from the work he did putting together his recent ELC talk, and he also contributed a new tool for visualising the DAPM state. - A new tool dapm-graph for visualising the DAPM state. - Substantial fixes and clarifications for the DAPM documentation. - Very large updates throughout the Intel audio drivers. - Cleanups of accessors for driver data, module labelling, and for constification. - Modernsation and cleanup work in the Mediatek drivers. - Several fixes and features for the DaVinci I2S driver. - New drivers for several AMD and Intel platforms, Nuvoton NAU8325, Rockchip RK3308 and Texas Instruments PCM6240.
2024-05-10ASoC: audio-graph-card2: call of_node_get() before of_get_next_child()Kuninori Morimoto
commit c6f597bc598a8 ("ASoC: audio-graph-card2: remove unneeded of_node_get()") removed of_node_get(), but it need to keep original reference, so of_node_get() itself is needed. Because of_get_next_child() will call of_node_put() inside, if the reference count dropped to zero, then of_node_get() after that will be use afer free. Need to call of_node_get() *before* that. Fixes: c6f597bc598a ("ASoC: audio-graph-card2: remove unneeded of_node_get()") Link: https://lore.kernel.org/r/f930862e-9d30-4ea3-b3e7-b4b4f411f6d1@moroto.mountain Reported-by: Dan Carpenter <dan.carpenter@linaro.org> Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Link: https://lore.kernel.org/r/875xvmqzs8.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Mark Brown <broonie@kernel.org>
2024-05-09ASoC: audio-graph-card2: remove unneeded of_node_get()Kuninori Morimoto
"lnk" is used as "port0", and it will be used to get "port1" by of_get_next_child(ports, lnk). It will call of_node_put() inside. This function is calling of_node_get() to make up for it, but it doesn't call paired of_node_put(port0) when it quit function. This of_node_get() itself is not needed, let's remove it. Reported-by: Dan Carpenter <dan.carpenter@linaro.org> Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Link: https://lore.kernel.org/r/87jzk3akoo.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Mark Brown <broonie@kernel.org>
2024-05-08ASoC: generic: Use *-y instead of *-objs in MakefileTakashi Iwai
*-objs suffix is reserved rather for (user-space) host programs while usually *-y suffix is used for kernel drivers (although *-objs works for that purpose for now). Let's correct the old usages of *-objs in Makefiles. Signed-off-by: Takashi Iwai <tiwai@suse.de> Link: https://lore.kernel.org/r/20240507155540.24815-12-tiwai@suse.de Signed-off-by: Mark Brown <broonie@kernel.org>
2024-03-26ASoC: soc-jack: Get rid of legacy GPIO supportAndy Shevchenko
No more users. Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Link: https://msgid.link/r/20240326171134.1414462-1-andriy.shevchenko@linux.intel.com Signed-off-by: Mark Brown <broonie@kernel.org>
2024-01-12ASoC: audio-graph-card2: fix index check on graph_parse_node_multi_nm()Kuninori Morimoto
commit d685aea5e0a8 ("ASoC: audio-graph-card2: fix off by one in graph_parse_node_multi_nm()") uses ">=" instead of ">" for index check, but it was wrong. The nm_idx will be increment at end of loop, thus, ">" is correct. while (1) { ... => if (*nm_idx > nm_max) break; ... (*nm_idx)++; } Without this patch, "Multi-Codec-1" sample on ${LINUX}/sound/soc/generic/audio-graph-card2-custom-sample.dtsi will be error. Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Link: https://msgid.link/r/87o7drdqux.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Mark Brown <broonie@kernel.org>
2023-12-18ASoC: simple-card-utils: Drop GPIO includeLinus Walleij
The generic card utilities are including the legacy GPIO header <linux/gpio.h> but not using any symbols from it. Drop the include from all files. Signed-off-by: Linus Walleij <linus.walleij@linaro.org> Link: https://msgid.link/r/20231214-gpio-descriptors-sound-misc-v1-3-e3004176bd8b@linaro.org Signed-off-by: Mark Brown <broonie@kernel.org>
2023-12-14ASoC: audio-graph-card2: Introduce playback-only/capture-only DAI link flagsDaniel Baluta
We need this to support MICFIL PDM found on i.MX8MP where the DAI link supports only capture direction. Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com> Link: https://msgid.link/r/20231128081119.106360-2-daniel.baluta@oss.nxp.com Signed-off-by: Mark Brown <broonie@kernel.org>
2023-12-07ASoC: audio-graph-card2: fix off by one in graph_parse_node_multi_nm()Dan Carpenter
The > comparison should be >= to avoid writing one element beyond the end of the dai_link->ch_maps[] array. The dai_link->ch_maps[] array is allocated in graph_parse_node_multi() and it has "nm_max" elements. Fixes: e2de6808df4a ("ASoC: audio-graph-card2: add CPU:Codec = N:M support") Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org> Acked-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Link: https://lore.kernel.org/r/1032216f-902f-48f9-aa49-9d5ece8e87f2@moroto.mountain Signed-off-by: Mark Brown <broonie@kernel.org>
2023-11-27ASoC: audio-graph-card2-custom-sample: add CPU/Codec = N:M sampleKuninori Morimoto
Now ASoC is supporting CPU/Codec = N:M connection, add its sample settings. One note here is that it has many type of samples, it reached to maximum of sound minor number. Therefore, new sample is disabled so far. If you want to try it, you need to disable some other one instead. Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Link: https://lore.kernel.org/r/87o7fy4ey0.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Mark Brown <broonie@kernel.org>
2023-11-27ASoC: audio-graph-card2-custom-sample: Add connection imageKuninori Morimoto
Audio Graph Card2 is supporting many type of Sound connections, but thus it is very difficult to understand how these are connected. To support well understanding, adds each connection images and indicates each settings are for where. Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Link: https://lore.kernel.org/r/87pm0e4ezi.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Mark Brown <broonie@kernel.org>
2023-11-27ASoC: audio-graph-card2: add CPU:Codec = N:M supportKuninori Morimoto
Now ASoC is supporting CPU:Codec = N:M support. This patch enables it on Audio Graph Card2. Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Link: https://lore.kernel.org/r/87r0ku4f0t.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Mark Brown <broonie@kernel.org>
2023-11-27ASoC: audio-graph-card2: use better image for Multi connectionKuninori Morimoto
1st port on Multi ports is for paired CPU/Codec, and the 2nd or later port are for Multi Elements. This patch indicates its image to easy to understand. Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Link: https://lore.kernel.org/r/87sf5a4f1i.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Mark Brown <broonie@kernel.org>
2023-10-23ASoC: simple-card-utils: Make simple_util_remove() return voidUwe Kleine-König
The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is (mostly) ignored and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. simple_util_remove() returned zero unconditionally. Make it return void instead and convert all users to struct platform_device::remove_new(). Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Reviewed-by: Herve Codina <herve.codina@bootlin.com> Link: https://lore.kernel.org/r/20231013221945.1489203-13-u.kleine-koenig@pengutronix.de Signed-off-by: Mark Brown <broonie@kernel.org>
2023-10-09ASoC: Explicitly include correct DT includesRob Herring
The DT of_device.h and of_platform.h date back to the separate of_platform_bus_type before it was merged into the regular platform bus. As part of that merge prepping Arm DT support 13 years ago, they "temporarily" include each other. They also include platform_device.h and of.h. As a result, there's a pretty much random mix of those include files used throughout the tree. In order to detangle these headers and replace the implicit includes with struct declarations, users need to explicitly include the correct includes. Acked-by: Jernej Skrabec <jernej.skrabec@gmail.com> Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com> Acked-by: Charles Keepax <ckeepax@opensource.cirrus.com> Reviewed-by: Claudiu Beznea <claudiu.beznea@tuxon.dev> # for at91 Signed-off-by: Rob Herring <robh@kernel.org> Link: https://lore.kernel.org/r/20231006-dt-asoc-header-cleanups-v3-1-13a4f0f7fee6@kernel.org Signed-off-by: Mark Brown <broonie@kernel.org>
2023-09-26ASoC: Merge up fixesMark Brown
For the benefit of CI.
2023-09-25ASoC: generic: convert not to use asoc_xxx()Kuninori Morimoto
ASoC is now unified asoc_xxx() into snd_soc_xxx(). This patch convert asoc_xxx() to snd_soc_xxx(). Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Link: https://lore.kernel.org/r/87h6o0qnho.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Mark Brown <broonie@kernel.org>
2023-09-25ASoC: simple_card_utils.h: convert not to use asoc_xxx()Kuninori Morimoto
ASoC is using 2 type of prefix (asoc_xxx() vs snd_soc_xxx()), but these are unified into snd_soc_xxx(). simple_card / audio_graph drivers are historically using asoc_xxx() prefix too. simple_card / audio_graph are not ASoC framework, so let's use simple_card_xxx_() / audio_graph_xxx() for global function prefix. This patch has asoc_xxx() as define to keep compatible. It will be removed if all drivers were switched to new style. Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Link: https://lore.kernel.org/r/87edj4s26a.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Mark Brown <broonie@kernel.org>
2023-09-19ASoC: simple-card: fixup asoc_simple_probe() error handlingKuninori Morimoto
asoc_simple_probe() is used for both "DT probe" (A) and "platform probe" (B). It uses "goto err" when error case, but it is not needed for "platform probe" case (B). Thus it is using "return" directly there. static int asoc_simple_probe(...) { ^ if (...) { | ... (A) if (ret < 0) | goto err; v } else { ^ ... | if (ret < 0) (B) return -Exxx; v } ... ^ if (ret < 0) (C) goto err; v ... err: (D) simple_util_clean_reference(card); return ret; } Both case are using (C) part, and it calls (D) when err case. But (D) will do nothing for (B) case. Because of these behavior, current code itself is not wrong, but is confusable, and more, static analyzing tool will warning on (B) part (should use goto err). To avoid static analyzing tool warning, this patch uses "goto err" on (B) part. Reported-by: kernel test robot <lkp@intel.com> Reported-by: Dan Carpenter <dan.carpenter@linaro.org> Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Link: https://lore.kernel.org/r/87o7hy7mlh.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Mark Brown <broonie@kernel.org>
2023-09-19ASoC: simple-card-utils: fixup simple_util_startup() error handlingKuninori Morimoto
It should use "goto" instead of "return" Fixes: 5ca2ab459817 ("ASoC: simple-card-utils: Add new system-clock-fixed flag") Reported-by: kernel test robot <lkp@intel.com> Reported-by: Dan Carpenter <dan.carpenter@linaro.org> Closes: https://lore.kernel.org/all/202309141205.ITZeDJxV-lkp@intel.com/ Closes: https://lore.kernel.org/all/202309151840.au9Aa2W4-lkp@intel.com/ Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Link: https://lore.kernel.org/r/87v8c76jnz.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Mark Brown <broonie@kernel.org>
2023-08-24ASoC: audio-graph-card.c: move audio_graph_parse_of()Kuninori Morimoto
Current audio-graph-card functions definition are like below (A)' static int graph_get_dais_count(); (B) int audio_graph_parse_of(...) { ... (A) ret = graph_get_dais_count(); ... } (A) static int graph_get_dais_count(...) { ... } (C) We don't need to have (A)' definition if audio_graph_parse_of() (B) was defined at (C). This patch moves (B) to (C). Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com Link: https://lore.kernel.org/r/87r0ntmc3c.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Mark Brown <broonie@kernel.org
2023-08-23ASoC: audio-graph-card2: add comment for format propertyKuninori Morimoto
We don't need to have "format" property on DT any more if CPU/Codec driver has .auto_selectable_formats settings on snd_soc_dai_ops. The sample dtsi doesn't have it. To avoid user confusion, this patch indicates it on comment. Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Link: https://lore.kernel.org/r/87edjuzk2p.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Mark Brown <broonie@kernel.org>
2023-08-14ASoC: soc-dai.h: merge DAI call back functions into opsKuninori Morimoto
snd_soc_dai_driver has .ops for call back functions (A), but it also has other call back functions (B). It is duplicated and confusable. struct snd_soc_dai_driver { ... ^ int (*probe)(...); | int (*remove)(...); (B) int (*compress_new)(...); | int (*pcm_new)(...); v ... (A) const struct snd_soc_dai_ops *ops; ... } This patch merges (B) into (A). Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Link: https://lore.kernel.org/r/87v8dpb0w6.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Mark Brown <broonie@kernel.org>
2023-07-17ASoC: simple-card.c: enable multi Component supportKuninori Morimoto
If CPU/Codec driver keeps its DAI node, we can directly identify actual DAI by using snd_soc_get_dai_via_args(). This means we can use multi Component. This patch enables multi Component support for Simple Card Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Link: https://lore.kernel.org/r/878rboo943.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Mark Brown <broonie@kernel.org>
2023-07-17ASoC: simple-card-utils.c: enable multi Component supportKuninori Morimoto
If CPU/Codec driver keeps its DAI node, we can directly identify actual DAI by using snd_soc_get_dai_via_args(). This means we can use multi Component. This patch enables multi Component support on Audio Graph Card/Card2. Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Link: https://lore.kernel.org/r/87a5w4o949.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Mark Brown <broonie@kernel.org>
2023-07-17ASoC: soc-core.c: add snd_soc_dlc_use_cpu_as_platform()Kuninori Morimoto
Current snd_soc_is_matching_component() checks "of_node" or "dai_args". Thus coping "of_node" only is not enough to use CPU as Platform. This patch adds snd_soc_dlc_use_cpu_as_platform() and help it. This is helper function for multi Component support. Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Link: https://lore.kernel.org/r/87cz10o94k.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Mark Brown <broonie@kernel.org>
2023-07-09ASoC: simple-card: Handle additional devicesHerve Codina
An additional-devs subnode can be present in the simple-card top node. This subnode is used to declared some "virtual" additional devices. Create related devices from this subnode and avoid this subnode presence to interfere with the already supported subnodes analysis. Signed-off-by: Herve Codina <herve.codina@bootlin.com> Reviewed-by: Christophe Leroy <christophe.leroy@csgroup.eu> Link: https://lore.kernel.org/r/20230623085830.749991-14-herve.codina@bootlin.com Signed-off-by: Mark Brown <broonie@kernel.org>
2023-06-20ASoC: simple-card.c: use snd_soc_{of_}get_dlc()Kuninori Morimoto
Current ASoC has snd_soc_{of_}get_dai_name() to get DAI name for dlc (snd_soc_dai_link_component). But we now can use snd_soc_{of_}get_dlc() for it. Let's use it. Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Link: https://lore.kernel.org/r/87fs6mdgmc.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Mark Brown <broonie@kernel.org>
2023-06-20ASoC: soc-core.c: add index on snd_soc_of_get_dai_name()Kuninori Morimoto
Current snd_soc_of_get_dai_name() doesn't accept index for #sound-dai-cells. It is not useful for user. This patch adds it. Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Link: https://lore.kernel.org/r/87pm5qdgng.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Mark Brown <broonie@kernel.org>
2023-06-16ASoC: Merge fixes due to dependenciesMark Brown
So we can apply the tlv320aic3xxx DT conversion.
2023-06-15ASoC: simple_card_utils: remove unused cpus/codecs/platforms from propsKuninori Morimoto
simple_dai_props has cpus/codecs/platforms. These pointer were used for dai_link before, but are allocated today since commit 050c7950fd70 ("ASoC: simple-card-utils: alloc dai_link information for CPU/Codec/Platform"). We don't need to keep it anymore. This patch removes these. Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Link: https://lore.kernel.org/r/87bkhhxpc6.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Mark Brown <broonie@kernel.org>
2023-06-14ASoC: simple-card-utils.c: share asoc_graph_parse_dai()Kuninori Morimoto
Current Audio Graph Card/Card2 implements asoc_simple_parse_dai() on each driver, but these are same function. This patch share it as asoc_graph_parse_dai(). Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Link: https://lore.kernel.org/r/87o7lihpvy.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Mark Brown <broonie@kernel.org>
2023-06-12ASoC: audio-graph-card2-custom-sample.dtsi: remove DT warningKuninori Morimoto
Current audio-graph-card2-custom-sample.dtsi is missing address-cells / size-cells / reg. Thus it get too many DT warnings. This patch solved it. Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Link: https://lore.kernel.org/r/87a5x5qw3d.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Mark Brown <broonie@kernel.org>
2023-06-09ASoC: audio-graph-card2-custom-sample: add missing CPU:Codec = 1:N sampleKuninori Morimoto
It has CPU:Codec = 1:1 and N:N samples, but missing 1:N settings. This patch adds it. One note here is that because of registering timing, probing and CPU/Codec numbering are mismatching. Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Link: https://lore.kernel.org/r/87ilbx1kh3.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Mark Brown <broonie@kernel.org>
2023-06-02ASoC: simple-card-utils: fix PCM constraint error checkRobert Hancock
The code in asoc_simple_startup was treating any non-zero return from snd_pcm_hw_constraint_minmax as an error, when this can return 1 in some normal cases and only negative values indicate an error. When this happened, it caused asoc_simple_startup to disable the clocks it just enabled and return 1, which was not treated as an error by the calling code which only checks for negative return values. Then when the PCM is eventually shut down, it causes the clock framework to complain about disabling clocks that were not enabled. Fix the check for snd_pcm_hw_constraint_minmax return value to only treat negative values as an error. Fixes: 5ca2ab459817 ("ASoC: simple-card-utils: Add new system-clock-fixed flag") Signed-off-by: Robert Hancock <robert.hancock@calian.com> Link: https://lore.kernel.org/r/20230602011936.231931-1-robert.hancock@calian.com Signed-off-by: Mark Brown <broonie@kernel.org>
2023-05-26ASoC: simple-card: Add missing of_node_put() in case of errorHerve Codina
In the error path, a of_node_put() for platform is missing. Just add it. Signed-off-by: Herve Codina <herve.codina@bootlin.com> Acked-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Link: https://lore.kernel.org/r/20230523151223.109551-9-herve.codina@bootlin.com Signed-off-by: Mark Brown <broonie@kernel.org>
2023-05-08ASoC: simple_card_utils.c: use asoc_dummy_dlcKuninori Morimoto
Now we can share asoc_dummy_dlc. This patch use it. Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com Link: https://lore.kernel.org/r/87ttx6ypi3.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Mark Brown <broonie@kernel.org
2023-04-05ASoC: audio-graph-card2: switch to use c2c_params instead of paramsKuninori Morimoto
ASoC is now using c2c_params instead of params. This patch replace it. Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Link: https://lore.kernel.org/r/87mt3pc2la.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Mark Brown <broonie@kernel.org>
2023-03-27ASoC: audio-graph-card2-custom-sample.dtsi: use card->name to avoid long nameKuninori Morimoto
Current Card2 Custom Sample will be too long Card name, and be error audio-graph-card2-custom-sample audio-graph-card2-custom-sample \ ASoC: driver name too long \ audio-graph-card2-custom-sample' -> 'audio-graph-car' This patch uses short name to avoid it Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Link: https://lore.kernel.org/r/87bkke7qzf.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Mark Brown <broonie@kernel.org>
2023-03-24ASoC: simple-card.c: add missing of_node_put()Kuninori Morimoto
It is missing of_node_put() for platform. This patch fixup it. Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Link: https://lore.kernel.org/r/87ilerjcvr.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Mark Brown <broonie@kernel.org>
2023-03-22ASoC: simple-card: add comment to indicate don't remove platformsKuninori Morimoto
Basically CPU and Platform are different Component, but if CPU is using soc-generic-dmaengine-pcm, same dev will be shared between CPU and Platform, and Simple Card had been supporting it. When we focus to clean up Simple Card driver, we tend to remove platforms if no Platform was selected, but it is wrong because of above reasons. This patch adds comment why we shouldn't remove platforms. In case of CPU is not using soc-generic-dmaengine-pcm, CPU and Platform will be duplicated, but it will be ignored by snd_soc_rtd_add_component(). Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Link: https://lore.kernel.org/r/875yattwqv.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Mark Brown <broonie@kernel.org>
2023-03-20ASoC: generic: test-component: Convert to platform remove callback returning ↵Uwe Kleine-König
void The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is (mostly) ignored and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Acked-by: Takashi Iwai <tiwai@suse.de> Acked-by: Nicolas Ferre <nicolas.ferre@microchip.com> Link: https://lore.kernel.org/r/20230315150745.67084-86-u.kleine-koenig@pengutronix.de Signed-off-by: Mark Brown <broonie@kernel.org>
2023-03-11ASoC: Use of_property_present() for testing DT property presenceRob Herring
It is preferred to use typed property access functions (i.e. of_property_read_<type> functions) rather than low-level of_get_property/of_find_property functions for reading properties. As part of this, convert of_get_property/of_find_property calls to the recently added of_property_present() helper when we just want to test for presence of a property and nothing more. Signed-off-by: Rob Herring <robh@kernel.org> Link: https://lore.kernel.org/r/20230310144732.1546328-1-robh@kernel.org Signed-off-by: Mark Brown <broonie@kernel.org>
2023-01-27ASoC: simple-card-utils: create jack inputs for aux_devsAstrid Rost
Add a generic way to create jack inputs for auxiliary jack detection drivers (e.g. via i2c, spi), which are not part of any real codec. The simple-card can be used as combining card driver to add the jacks, no new one is required. Create a jack (for input-events) for jack devices in the auxiliary device list (aux_devs). A device which returns a valid value on get_jack_type counts as jack device; set_jack is required to add the jack to the device. Signed-off-by: Astrid Rost <astrid.rost@axis.com> Link: https://lore.kernel.org/r/20230123135913.2720991-3-astrid.rost@axis.com Signed-off-by: Mark Brown <broonie@kernel.org>
2022-12-07ASoC: audio-graph-card: fix refcount leak of cpu_ep in __graph_for_each_link()Wang Yufen
The of_get_next_child() returns a node with refcount incremented, and decrements the refcount of prev. So in the error path of the while loop, of_node_put() needs be called for cpu_ep. Fixes: fce9b90c1ab7 ("ASoC: audio-graph-card: cleanup DAI link loop method - step2") Signed-off-by: Wang Yufen <wangyufen@huawei.com> Acked-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Link: https://lore.kernel.org/r/1670228127-13835-1-git-send-email-wangyufen@huawei.com Signed-off-by: Mark Brown <broonie@kernel.org>
2022-11-11ASoC: audio-graph-card2: remove Experimental announceKuninori Morimoto
Audio Graph Card2 has been announcing "Audio Graph Card2 is still under Experimental stage", but it is time to remove it. This patch removes it. Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Link: https://lore.kernel.org/r/87k042nm6s.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Mark Brown <broonie@kernel.org>
2022-11-07ASoC: audio-graph-card2: check also dpcm node for convert-xxxKuninori Morimoto
DPCM connection on Card2, its DT looks like below. Current Card2 is checking (a)/(b) part only for convert-xxx settings. But it is not useful. This patch enables its settings at (A)/(B) part too. (A)/(B) settings will be overwritten (a)/(b) settings if it has. <Image> (A) (a) Card2 <--+--> FE <---> CPU | +--> BE <---> Codec (B) (b) <DT> card2-sound { ... links = <fe, be>; /* (A) (B) */ }; dpcm { /* FE */ ports@0 { /* (A) */ fe: port { fe_ep: endpoint { remote-endpoint = <&cpu_ep>; } }; }; /* BE */ ports@1 { /* (B) */ be: port { convert-rate = <44100>; /* This patch enables this */ be_ep: endpoint { remote-endpoint = <&codec_ep>; } }; }; }; cpu { /* CPU (a) */ port { cpu_ep: endpoint { remote-endpoint = <&fe_ep>; } }; }; codec { /* Codec (b) */ port { convert-rate = <48000>; /* (B) settings will be over written here */ codec_ep: endpoint { remote-endpoint = <&be_ep>; } }; }; Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Link: https://lore.kernel.org/r/871qqn8fst.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Mark Brown <broonie@kernel.org>
2022-11-07ASoC: audio-graph-card2-custom-sample.dtsi: add convert-rate for DPCM (MIXer)Kuninori Morimoto
audio-graph-card2-custom-sample.dtsi is assuming that DPCM sample is MIXer connection. FE BE **** CPU3 -- * * -- Codec3 CPU4 -- * * **** CPU3/CPU4 need to convert rate in this case. This patch adds missing "convert-rate" setting sample for it. Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Link: https://lore.kernel.org/r/8735b38fta.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Mark Brown <broonie@kernel.org>
2022-11-07ASoC: simple-card-utils: remove asoc_simple_convert_fixup()Kuninori Morimoto
No one is using asoc_simple_convert_fixup(), we don't need to export its symbol. This patch removes it. Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Link: https://lore.kernel.org/r/874jvj8ftp.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Mark Brown <broonie@kernel.org>
2022-10-19ASoC: simple-card: Fix up checks for HW param fixupsAidan MacDonald
The "convert-xxx" properties only have an effect for DPCM DAI links. A DAI link is only created as DPCM if the device tree requires it; part of this involves checking for the use of "convert-xxx" properties. When the convert-sample-format property was added, the checks got out of sync. A DAI link that specified only convert-sample-format but did not pass any of the other DPCM checks would not go into DPCM mode and the convert-sample-format property would be silently ignored. Fix this by adding a function to do the "convert-xxx" property checks, instead of open-coding it in simple-card and audio-graph-card. And add "convert-sample-format" to the check function so that DAI links using it will be initialized correctly. Fixes: 047a05366f4b ("ASoC: simple-card-utils: Fixup DAI sample format") Acked-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Signed-off-by: Aidan MacDonald <aidanmacdonald.0x0@gmail.com> Acked-by: Sameer Pujar <spujar@nvidia.com> Link: https://lore.kernel.org/r/20221019012302.633830-1-aidanmacdonald.0x0@gmail.com Signed-off-by: Mark Brown <broonie@kernel.org>