summaryrefslogtreecommitdiff
path: root/sound/soc/generic
AgeCommit message (Collapse)AuthorFilesLines
2025-02-05ASoC: simple-card-utils.c: add missing dlc->of_nodeKuninori Morimoto1-0/+1
commit 90de551c1bf ("ASoC: simple-card-utils.c: enable multi Component support") added muiti Component support, but was missing to add dlc->of_node. Because of it, Sound device list will indicates strange name if it was DPCM connection and driver supports dai->driver->dai_args, like below > aplay -l card X: sndulcbmix [xxxx], device 0: fe.(null).rsnd-dai.0 (*) [] ... ^^^^^^ It will be fixed by this patch > aplay -l card X: sndulcbmix [xxxx], device 0: fe.sound@ec500000.rsnd-dai.0 (*) [] ... ^^^^^^^^^^^^^^ Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Reviewed-by: Daniel Baluta <daniel.baluta@nxp.com> Link: https://patch.msgid.link/87ikpp2rtb.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Mark Brown <broonie@kernel.org>
2025-01-29Merge tag 'asoc-fix-v6.14-merge-window' of ↵Takashi Iwai1-33/+29
https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound into for-linus ASoC: Fixes for v6.14 A bunch of fixes that came in during the merge window, plus a few new device IDs. The i.MX changes are a little large since they add some new quirk data as well as device IDs, and the audio graph card change for picking the correct endpoint for links is large due to updating a number of call sites.
2025-01-22ASoC: audio-graph-card2: use correct endpoint when getting link parametersIvaylo Dimitrov1-33/+29
When link DT nodes are parsed, most functions get port as a parameter, which results in port endpoint@0 always being used. However, each endpoint might have different settings, but those are currently ignored. Fix that by passing endpoint instead of port when parsing link parameters. Signed-off-by: Ivaylo Dimitrov <ivo.g.dimitrov.75@gmail.com> Acked-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Link: https://patch.msgid.link/20250121064815.741820-1-ivo.g.dimitrov.75@gmail.com Signed-off-by: Mark Brown <broonie@kernel.org>
2025-01-20Merge tag 'asoc-v6.14' of ↵Takashi Iwai4-274/+173
https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound into for-linus ASoC: Updates for v6.14 This was quite a quiet release for what I imagine are holiday related reasons, the diffstat is dominated by some Cirrus Logic Kunit tests. There's the usual mix of small improvements and fixes, plus a few new drivers and features. The diffstat includes some DRM changes due to work on HDMI audio. - Allow clocking on each DAI in an audio graph card to be configured separately. - Improved power management for Renesas RZ-SSI. - KUnit testing for the Cirrus DSP framework. - Memory to meory operation support for Freescale/NXP platforms. - Support for pause operations in SOF. - Support for Allwinner suinv F1C100s, Awinc AW88083, Realtek ALC5682I-VE
2025-01-15ASoC: simple-card-utils: fix priv->dai_props indexingLaurentiu Mihalcea1-5/+5
As of commit cb18cd26039f ("ASoC: soc-core: do rtd->id trick at snd_soc_add_pcm_runtime()") the ID stored in the PCM runtime data can no longer be safely used to index the priv->dai_props array. This is because the ID may be modified during snd_soc_add_pcm_runtime(), thus resulting in an ID that's no longer a valid array index. To fix this, use the position of the dai_link stored inside the PCM runtime data relative to the start of the dai_link array as index into the priv->dai_props array. Signed-off-by: Laurentiu Mihalcea <laurentiu.mihalcea@nxp.com> Acked-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Link: https://patch.msgid.link/20250114184314.3583-2-laurentiumihalcea111@gmail.com Signed-off-by: Mark Brown <broonie@kernel.org>
2025-01-13ASoC: extra format on each DAIMark Brown3-228/+140
Merge series from Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>: Current clock provider/consumer setting is set by dai_link->dai_fmt, and it is Codec base on Sound Card driver (= SND_SOC_DAIFMT_CBx_CFx). Current CPU/Codec drivers are already based on its own base (= SND_SOC_DAIFMT_Bx_Fx). So, Codec clock setting uses dai_link->dai_fmt as-is, and CPU side clock setting is created from Codec base setting by flipping. Because of this, we can't set both CPU/Codec clock consumer for example. To solve this issue, this patch-set adds new ext_fmt on each DAI. It can keep compatible with legacy style. 1. SND_SOC_DAIFMT_FORMAT_MASK 2. SND_SOC_DAIFMT_CLOCK 3. SND_SOC_DAIFMT_INV 4. SND_SOC_DAIFMT_CLOCK_PROVIDER dai_fmt : dai_link->dai_fmt = common settings ext_fmt : each DAI settings Legacy dai_fmt includes 1, 2, 3, 4 New style dai_fmt includes 1, 2, 3 ext_fmt includes 4 Audio-Graph-Card2 will use this new style by this patch-set. By this patch, Card2 default behavior (= no "clock-master / frame-master" settings on DT) will be changed, but no drivers are using it. In case of no DAI has "clock-master / frame-master" property on DT, it will be... Legacy CPU : provider (because flipped from Codec) Codec: consumer New style CPU : consumer Codec: consumer One note is that Simple-Card, Audio-Graph-Card don't implement this new style to keep compatiblily. In Overlay case, port order can be random, so we shouldn't use get_next() function to get next port.
2025-01-13ASoC: audio-graph-card2: Use extra format on each DAIKuninori Morimoto1-32/+44
Current ASoC is using dai_link->dai_fmt to set DAI format for both CPU/Codec. But because it is using same settings, and SND_SOC_DAIFMT_CLOCK_PROVIDER is flipped for CPU, we can't set both CPU/Codec as clock consumer, for example. To solve this issue, this patch uses extra format for each DAI which can keep compatibility with legacy system, 1. SND_SOC_DAIFMT_FORMAT_MASK 2. SND_SOC_DAIFMT_CLOCK 3. SND_SOC_DAIFMT_INV 4. SND_SOC_DAIFMT_CLOCK_PROVIDER Legacy dai_fmt includes 1, 2, 3, 4 New idea dai_fmt includes 1, 2, 3 ext_fmt includes 4 Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Tested-by: Stephen Gordon <gordoste@iinet.net.au> Link: https://patch.msgid.link/87pll0o5j6.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Mark Brown <broonie@kernel.org>
2025-01-13ASoC: audio-graph-card2: use of_graph_get_port_by_id() at ↵Kuninori Morimoto1-5/+14
graph_get_next_multi_ep() Audio Graph Card2 is assuming "port" are necessarily in order, but there is no guarantee in case of overlay. Use of_graph_get_port_by_id() instead to handle it correctly. Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Tested-by: Stephen Gordon <gordoste@iinet.net.au> Link: https://patch.msgid.link/87sepwo5jf.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Mark Brown <broonie@kernel.org>
2025-01-13ASoC: simple-card: use __free(device_node) for device nodeKuninori Morimoto1-41/+17
simple-card handles many type of device_node, thus need to use of_node_put() in many place. Let's use __free(device_node) and avoid it. Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Tested-by: Stephen Gordon <gordoste@iinet.net.au> Link: https://patch.msgid.link/87v7uso5js.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Mark Brown <broonie@kernel.org>
2025-01-13ASoC: audio-graph-card: use __free(device_node) for device nodeKuninori Morimoto1-34/+14
audio-graph-card handles many type of device_node, thus need to use of_node_put() in many place. Let's use __free(device_node) and avoid it. Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Tested-by: Stephen Gordon <gordoste@iinet.net.au> Link: https://patch.msgid.link/87wmf8o5k1.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Mark Brown <broonie@kernel.org>
2025-01-13ASoC: audio-graph-card2: use __free(device_node) for device nodeKuninori Morimoto1-119/+54
audio-graph-card2 handles many type of device_node, thus need to use of_node_put() in many place. Let's use __free(device_node) and avoid it. Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Tested-by: Stephen Gordon <gordoste@iinet.net.au> Link: https://patch.msgid.link/87y0zoo5kc.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Mark Brown <broonie@kernel.org>
2025-01-10ASoC: simple-card: Drop unnecessary "dai-tdm-slot-width-map" property ↵Rob Herring (Arm)1-3/+2
presence check It doesn't matter whether "dai-tdm-slot-width-map" is not present or there is some other issue parsing it in of_property_count_elems_of_size() causing an error. Drop the presence check and rely on of_property_count_elems_of_size() error return if not present. Signed-off-by: Rob Herring (Arm) <robh@kernel.org> Acked-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Link: https://patch.msgid.link/20250109182202.3971965-2-robh@kernel.org Signed-off-by: Mark Brown <broonie@kernel.org>
2025-01-09ASoC: Use of_property_present() for non-boolean propertiesRob Herring (Arm)1-2/+2
The use of of_property_read_bool() for non-boolean properties is deprecated in favor of of_property_present() when testing for property presence. Signed-off-by: Rob Herring (Arm) <robh@kernel.org> Link: https://patch.msgid.link/20250109182303.3973082-1-robh@kernel.org Signed-off-by: Mark Brown <broonie@kernel.org>
2025-01-08ASoC: Merge up v6.13-rc6Mark Brown1-1/+1
This helps several of my boards in CI.
2024-12-16ASoC: simple-card-utils: Unify clock direction by clk_directionKuninori Morimoto1-6/+6
Original sample-card assumes SND_SOC_CLOCK_IN is used for snd_soc_dai_set_sysclk(), but someday, Codec uses SND_SOC_CLOCK_IN and CPU uses SND_SOC_CLOCK_OUT at hw_params(), and dai->clk_direction is used at simple_init_dai(). There is no uniformity today. Let's use dai->clk_direction for all cases. Fortunately, almost all DAI doesn't care about "dir" (= SND_SOC_CLOCK_IN/OUT) in .set_sysclk callback function (which is called in snd_soc_dai_set_sysclk()), so this patch has no effect in such DAIs. But this patch might breaks some existing Sound Card. Use "system-clock-direction-out" property if it needs to use SND_SOC_CLOCK_OUT Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Link: https://patch.msgid.link/87y10lu0gx.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Mark Brown <broonie@kernel.org>
2024-12-10ASoC: audio-graph-card: Call of_node_put() on correct nodeStephen Gordon1-1/+1
Signed-off-by: Stephen Gordon <gordoste@iinet.net.au> Acked-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Link: https://patch.msgid.link/20241207122257.165096-1-gordoste@iinet.net.au Signed-off-by: Mark Brown <broonie@kernel.org>
2024-12-09ASoC: simple-card-utils: use for_each_of_graph_port() on graph_get_dai_id()Kuninori Morimoto1-3/+4
Because DT check when compiling become very strict in these days, we need to add reg = <x> if it has multi port/endpoint, otherwise it will get error or warning. But it was not so strict and/or mandatry before. Current code is counting "endpoint" to get DAI ID, but it should count "port" instead, otherwise strange ID will be used for DAI if it was multi connected case (A). There is no issue if it was not multi connected (B). One note is that this code will be used if neither port/endpoint doesn't have reg = <x> property on DT. case (A) /* This should be handled as DAI-0 */ port@0 { endpoint@0 { } /* It will be DAI-0 by endpoint count */ endpoint@1 { } /* It will be DAI-1 by endpoint count */ }; /* This should be handled as DAI-1 */ port@1 { endpoint { } /* It will be DAI-2 by endpoint count */ }; case (B) /* both endpoint cound and port count are same */ port@0 { endpoint { ... } }; port@1 { endpoint { ... } }; It will be issue if Audio-Graph-Card is used with Multi Connection. No issue will be happen with Audio-Graph-Card2 / Simple-Card. This patch uses for_each_of_graph_port() instead of for_each_endpoint_of_node(), and thus, we can use "break" to quit from loop. Because for_each_of_graph_port() uses __free(device_node) inside. Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Link: https://patch.msgid.link/87o71tfrdz.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Mark Brown <broonie@kernel.org>
2024-12-09ASoC: simple-card-utils: check port reg first on graph_get_dai_id()Kuninori Morimoto1-2/+5
Because DT check when compiling become very strict in these days, we need to add reg = <x> if it has multi port/endpoint, otherwise it will get error or warning. But it was not so strict and/or mandatry before. Current code uses reg number as DAI ID, but it will use "endpoint" reg first and use "port" reg 2nd. But it should use port number as 1st (A) if it was used for multi connected case. There is no priority for port/endpoint if it was not multi connected (B). case (A) port { /* * "port" and "endpoint" are using different reg number. * It should use <x> as DAI ID, not <y> not <z> */ reg = <x>; endpoint@y { reg = <y>; ... }; endpoint@z { reg = <z>; ... }; }; case (B) port { /* * Both port/endpoint are using same reg numer <x>. */ reg = <x>; endpoint { reg = <x>; ... }; }; It will be issue if Audio-Graph-Card is used with Multi Connection. No issue will be happen with Audio-Graph-Card2 / Simple-Card. This patch swtich port/endpoint priority. Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Link: https://patch.msgid.link/87plm9fre3.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Mark Brown <broonie@kernel.org>
2024-12-09ASoC: simple-card-utils: use __free(device_node) for device nodeKuninori Morimoto1-30/+14
simple-card-utils handles many type of device_node, thus need to use of_node_put() in many place. Let's use __free(device_node) and avoid it. Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Link: https://patch.msgid.link/87r06pfre8.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Mark Brown <broonie@kernel.org>
2024-11-22Merge tag 'sound-6.13-rc1' of ↵Linus Torvalds3-7/+13
git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound Pull sound updates from Takashi Iwai: "This is a relatively calm cycle, and majority of changes are about ASoC. There are little changes in the core side but we received lots of new drivers for new vendors. ALSA Core: - The new accel operation mode for compress-offload API; only the core part, the actual user will follow later ASoC: - Continued API simplification works - Renaming of the sh directory to Renesas - Factoring out of some of the common code for Realtek devices - Ussal ASoC Intel SOF, AMD and SoundWire updates - Support for Allwinner H616, AMD ACP 6.3 systems, AWInic AW88081, Cirrus Logic CS32L84, Everest ES8328, Iron Devices SMA1307, Longsoon I2S, NeoFidelity NTP8918 and NTP8835, Philips UDA1342, Qualcomm SM8750, RealTek RT721, and ST Microelectronics STM32MP25 HD- and USB-audio: - Clean up of IRQ handling in legacy HD-audio driver - Fix soft lockup at disconnection of non-standard USB drivers - Scarlett2 mixer improvements - New quirks and cleanups in HD- and USB-audio" * tag 'sound-6.13-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound: (278 commits) ALSA: hda: Poll jack events for LS7A HD-Audio ASoC: hdmi-codec: reorder channel allocation list ALSA: ump: Fix the wrong format specifier ASoC: Intel: soc-acpi-intel-lnl-match: add rt712_vb + rt1320 support ASoC: stm32: dfsdm: change rate upper limits ASoC: sma1307: fix uninitialized variable refence ASoC: dt-bindings: simple-mux: add idle-state property ASoc: simple-mux: add idle-state support ASoC: sdca: test adev before calling acpi_dev_for_each_child ASoC: SOF: ipc4-topology: remove redundant assignment to variable ret ASoC: amd: ps: fix the pcm device numbering for acp 6.3 platform ASoC: amd: acp: add soundwire machine driver for legacy stack ASoC: amd: acp: move get_acp63_cpu_pin_id() to common file ASoC: amd: ps: add soundwire machines for acp6.3 platform ASoC: amd: acp: add RT711, RT714 & RT1316 support for acp 6.3 platform ASoC: amd: acp: add rt722 based soundwire machines ALSA: compress_offload: Add missing descriptions in structs ALSA: 6fire: Release resources at card release ALSA: caiaq: Use snd_card_free_when_closed() at disconnection ALSA: us122l: Drop mmap_count field ...
2024-11-21Merge tag 'devicetree-for-6.13' of ↵Linus Torvalds3-59/+50
git://git.kernel.org/pub/scm/linux/kernel/git/robh/linux Pull devicetree updates from Rob Herring: "Bindings: - Enable dtc "interrupt_provider" warnings for binding examples. Fix the warnings in fsl,mu-msi and ti,sci-inta due to this. - Convert zii,rave-sp-wdt, zii,rave-sp-pwrbutton, and altr,fpga-passive-serial to DT schema format - Add some documentation on the different forms of YAML text blocks which are a constant source of review comments - Fix some schema errors in constraints for arrays - Add compatibles for qcom,sar2130p-pdc and onnn,adt7462 DT core: - Allow overlay kunit tests to run CONFIG_OF_OVERLAY=n - Add some warnings on deprecated address handling - Rework early_init_dt_scan() so the arch can pass in the phys address of the DTB as __pa() is not always valid to use. This fixes a warning for arm64 with kexec. - Add and use some new DT graph iterators for iterating over ports and endpoints - Rework reserved-memory handling to be sized dynamically for fixed regions - Optimize of_modalias() to avoid a strlen() call - Constify struct device_node and property pointers where ever possible" * tag 'devicetree-for-6.13' of git://git.kernel.org/pub/scm/linux/kernel/git/robh/linux: (36 commits) of: Allow overlay kunit tests to run CONFIG_OF_OVERLAY=n dt-bindings: interrupt-controller: qcom,pdc: Add SAR2130P compatible of/address: Rework bus matching to avoid warnings of: WARN on deprecated #address-cells/#size-cells handling of/fdt: Don't use default address cell sizes for address translation dt-bindings: Enable dtc "interrupt_provider" warnings of/fdt: add dt_phys arg to early_init_dt_scan and early_init_dt_verify dt-bindings: cache: qcom,llcc: Fix X1E80100 reg entries dt-bindings: watchdog: convert zii,rave-sp-wdt.txt to yaml format dt-bindings: input: convert zii,rave-sp-pwrbutton.txt to yaml media: xilinx-tpg: use new of_graph functions fbdev: omapfb: use new of_graph functions gpu: drm: omapdrm: use new of_graph functions ASoC: audio-graph-card2: use new of_graph functions ASoC: audio-graph-card: use new of_graph functions ASoC: test-component: use new of_graph functions of: property: use new of_graph functions of: property: add of_graph_get_next_port_endpoint() of: property: add of_graph_get_next_port() of: module: remove strlen() call in of_modalias() ...
2024-11-14ASoC: Merge up fixesMark Brown1-0/+3
Needed for new Intel board file changes.
2024-11-12ASoC: simple-card-utils: care simple_util_dai for dummy DAIKuninori Morimoto1-0/+6
Simple Card Utils has simple_util_dai which is paired to snd_soc_dai, and assmus that CPU/Codec DAI and its paired simple_util_dai are same order for CPU/Codec simple_util_dai[0] <--> snd_soc_dai[0] simple_util_dai[1] <--> snd_soc_dai[1] ... So, it is using same index in for_each loop. (X) gets simple_util_dai (Y) gets snd_soc_dai (Y) for_each_rtd_cpu_dais(.., i, ..) { (X)(A) udai = simple_props_to_dai_cpu(.., i); } (X) for_each_prop_dai_cpu(.., i, ...) { (Y) dai = snd_soc_rtd_to_cpu(.., i); ... } But current Simple Card Utils didn't have simple_util_dai for dummy DAI. So above (A) will get NULL pointer in such case. This patch cares simple_util_dai for dummy DAI. Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Link: https://patch.msgid.link/87msi5maz3.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Mark Brown <broonie@kernel.org>
2024-11-12ASoC: test-component: Support continuous rates for test componentJohn Watts1-1/+1
There's no reason to limit the supported rates of the test component to specific ones as if it's a real piece of hardware. Set the rates to continuous to aid in testing different rates. Signed-off-by: John Watts <contact@jookia.org> Link: https://patch.msgid.link/20241112-alsa_test_rates-v1-1-95cf529db871@jookia.org Signed-off-by: Mark Brown <broonie@kernel.org>
2024-11-11ASoC: audio-graph-card2: Purge absent supplies for device tree nodesJohn Watts1-0/+3
The audio graph card doesn't mark its subnodes such as multi {}, dpcm {} and c2c {} as not requiring any suppliers. This causes a hang as Linux waits for these phantom suppliers to show up on boot. Make it clear these nodes have no suppliers. Example error message: [ 15.208558] platform 2034000.i2s: deferred probe pending: platform: wait for supplier /sound/multi [ 15.208584] platform sound: deferred probe pending: asoc-audio-graph-card2: parse error Signed-off-by: John Watts <contact@jookia.org> Acked-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Link: https://patch.msgid.link/20241108-graph_dt_fix-v1-1-173e2f9603d6@jookia.org Signed-off-by: Mark Brown <broonie@kernel.org>
2024-11-01ASoC: generic: switch to use rtd->id from rtd->numKuninori Morimoto1-5/+5
Now rtd->num is renamed to rtd->id. Let's switch. Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Link: https://patch.msgid.link/87ttd2b858.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Mark Brown <broonie@kernel.org>
2024-10-30ASoC: audio-graph-card2: Update comment with renamed file pathLad Prabhakar1-1/+1
The "sound/soc/sh" directory has been renamed to "sound/soc/renesas". Update the comment in audio-graph-card2.c to reflect the new file path for better accuracy. Signed-off-by: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com> Acked-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Link: https://patch.msgid.link/20241025150511.722040-4-prabhakar.mahadev-lad.rj@bp.renesas.com Signed-off-by: Mark Brown <broonie@kernel.org>
2024-10-25ASoC: audio-graph-card2: use new of_graph functionsKuninori Morimoto1-56/+48
Now we can use new port related functions for port parsing. Use it. Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Acked-by: Mark Brown <broonie@kernel.org> Link: https://lore.kernel.org/r/87ed46b5sm.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Rob Herring (Arm) <robh@kernel.org>
2024-10-25ASoC: audio-graph-card: use new of_graph functionsKuninori Morimoto1-1/+1
Now we can use new port related functions for port parsing. Use it. Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Acked-by: Mark Brown <broonie@kernel.org> Link: https://lore.kernel.org/r/87fromb5sr.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Rob Herring (Arm) <robh@kernel.org>
2024-10-25ASoC: test-component: use new of_graph functionsKuninori Morimoto1-2/+1
Current test-component.c is using for_each_endpoint_of_node() for parsing "port", because there was no "port" base loop before. It has been assuming 1 port has 1 endpoint here. But now we can use "port" base loop (= for_each_of_graph_port()). Let's replace for_each function from "endpoint" base to "port" base. Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Acked-by: Mark Brown <broonie@kernel.org> Link: https://lore.kernel.org/r/87h692b5sw.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Rob Herring (Arm) <robh@kernel.org>
2024-09-09ASoC: Switch back to struct platform_driver::remove()Uwe Kleine-König5-5/+5
After commit 0edb555a65d1 ("platform: Make platform_driver::remove() return void") .remove() is (again) the right callback to implement for platform drivers. Convert all drivers below sound/soc to use .remove(), with the eventual goal to drop struct platform_driver::remove_new(). As .remove() and .remove_new() have the same prototypes, conversion is done by just changing the structure member name in the driver initializer. Signed-off-by: Uwe Kleine-König <u.kleine-koenig@baylibre.com> Link: https://patch.msgid.link/20240909151230.909818-2-u.kleine-koenig@baylibre.com Signed-off-by: Mark Brown <broonie@kernel.org>
2024-09-04Some clean up with helper fucntionMark Brown2-20/+3
Merge series from Zhang Zekun <zhangzekun11@huawei.com>: There are some helper functions which can be used to simplify the code. So, let's use these functions to make code more simple.
2024-09-04ASoC: audio-graph-card2: Use helper function of_get_child_count()Zhang Zekun1-10/+1
of_get_child_count() can help to get the num of child directly and we don't need to manually count the child num. No functional change with this conversion. Signed-off-by: Zhang Zekun <zhangzekun11@huawei.com> Reviewed-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Link: https://patch.msgid.link/20240827070650.11424-3-zhangzekun11@huawei.com Signed-off-by: Mark Brown <broonie@kernel.org>
2024-09-04ASoC: audio-graph-card: Use for_each_child_of_node_scoped() to simplify codeZhang Zekun1-10/+2
for_each_child_of_node_scoped() can put the device_node automatically. So, using it to make the code logic more simple and remove the device_node clean up code. Signed-off-by: Zhang Zekun <zhangzekun11@huawei.com> Reviewed-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Link: https://patch.msgid.link/20240827070650.11424-2-zhangzekun11@huawei.com Signed-off-by: Mark Brown <broonie@kernel.org>
2024-08-22ASoC: remove snd_soc_dai_link_set_capabilities()Kuninori Morimoto3-6/+0
dpcm_xxx flags are no longer needed. We need to use xxx_only flags instead if needed, but snd_soc_dai_link_set_capabilities() user adds dpcm_xxx if playback/capture were available. Thus converting dpcm_xxx to xxx_only is not needed. Just remove it. Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Tested-by: Jerome Brunet <jbrunet@baylibre.com> Link: https://patch.msgid.link/87r0aiaahh.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Mark Brown <broonie@kernel.org>
2024-08-06ASoC: remove bespoke trigger supportKuninori Morimoto1-9/+0
Bespoke trigger support was added when Linux v3.5 by this patch. commit 07bf84aaf736781a283b1bd36eaa911453b14574 ("ASoC: dpcm: Add bespoke trigger()") test-component driver is using it, but this is because it indicates used function for debug/trace purpose. Except test-component driver, bespoke trigger has never been used over 10 years in upstream. We can re-support it if needed in the future, but let's remove it for now, because it just noise in upstream. Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Link: https://patch.msgid.link/87v80ewmdi.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Mark Brown <broonie@kernel.org>
2024-07-08ASoC: simple-card: Use cleanup.h instead of devm_kfree()Krzysztof Kozlowski1-3/+2
Allocate the memory with scoped/cleanup.h, instead of devm interface, to make the code more obvious that memory is not used outside this scope. Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org> Acked-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Link: https://patch.msgid.link/20240703-asoc-cleanup-h-v1-8-71219dfd0aef@linaro.org Signed-off-by: Mark Brown <broonie@kernel.org>
2024-07-08ASoC: audio-graph-card2: Use cleanup.h instead of devm_kfree()Krzysztof Kozlowski1-4/+1
Allocate the memory with scoped/cleanup.h, instead of devm interface, to make the code more obvious that memory is not used outside this scope. Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org> Acked-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Link: https://patch.msgid.link/20240703-asoc-cleanup-h-v1-7-71219dfd0aef@linaro.org Signed-off-by: Mark Brown <broonie@kernel.org>
2024-07-08ASoC: audio-graph-card: Use cleanup.h instead of devm_kfree()Krzysztof Kozlowski1-3/+2
Allocate the memory with scoped/cleanup.h, instead of devm interface, to make the code more obvious that memory is not used outside this scope. Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org> Acked-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Link: https://patch.msgid.link/20240703-asoc-cleanup-h-v1-6-71219dfd0aef@linaro.org Signed-off-by: Mark Brown <broonie@kernel.org>
2024-07-08ASoC: simple-card-utils: Simplify with cleanup.hKrzysztof Kozlowski1-7/+6
Allocate the memory with scoped/cleanup.h to reduce error handling (less error paths) and make the code a bit simpler. Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org> Acked-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Link: https://patch.msgid.link/20240703-asoc-cleanup-h-v1-5-71219dfd0aef@linaro.org Signed-off-by: Mark Brown <broonie@kernel.org>
2024-06-26ASoC: audio-graph-card2: add link-trigger-order supportKuninori Morimoto1-0/+13
Some Sound Card might need special trigger ordering which is based on CPU/Codec connection. It is already supported on ASoC, but Audio Graph Card2 still not yet support it. Let's support it. Cc: Maxim Kochetkov <fido_max@inbox.ru> Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Link: https://patch.msgid.link/87msnqzoj8.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Mark Brown <broonie@kernel.org>
2024-06-26ASoC: audio-graph-card: add link-trigger-order supportKuninori Morimoto1-0/+13
Some Sound Card might need special trigger ordering which is based on CPU/Codec connection. It is already supported on ASoC, but Audio Graph Card still not yet support it. Let's support it. Cc: Maxim Kochetkov <fido_max@inbox.ru> Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Link: https://patch.msgid.link/87o786zojd.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Mark Brown <broonie@kernel.org>
2024-06-26ASoC: simple-audio-card: add link-trigger-order supportKuninori Morimoto1-0/+10
Some Sound Card might need special trigger ordering which is based on CPU/Codec connection. It is already supported on ASoC, but Simple Audio Card still not yet support it. Let's support it. Cc: Maxim Kochetkov <fido_max@inbox.ru> Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Link: https://patch.msgid.link/87plsmzojk.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Mark Brown <broonie@kernel.org>
2024-06-26ASoC: simple-card-utils: add link-trigger-order supportKuninori Morimoto1-0/+71
Some Sound Card might need special trigger ordering which is based on CPU/Codec connection. It is already supported on ASoC, but Simple Audio Card / Audio Graph Card still not support it. Let's support it. Cc: Maxim Kochetkov <fido_max@inbox.ru> Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Link: https://patch.msgid.link/87r0d2zojq.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Mark Brown <broonie@kernel.org>
2024-06-17ASoC: Constify DAI ops auto_selectable_formatsKrzysztof Kozlowski1-1/+1
The static arrays passed as 'auto_selectable_formats' are not modified by the drivers nor by the core code, so make it const for code safety. Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org> Acked-by: Herve Codina <herve.codina@bootlin.com> Link: https://msgid.link/r/20240617125735.582963-2-krzysztof.kozlowski@linaro.org Signed-off-by: Mark Brown <broonie@kernel.org>
2024-06-17ASoC: audio-graph-card2: add support for aux devicesKuninori Morimoto1-0/+4
Add device tree property to define auxiliary devices to be added to Audio Graph Card which is already supported on Simle Card. Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Link: https://msgid.link/r/878qz4ry81.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Mark Brown <broonie@kernel.org>
2024-06-10ASoC: generic: Replace of_gpio.h by proper oneAndy Shevchenko1-1/+2
of_gpio.h is deprecated and subject to remove. The driver doesn't use it directly, replace it with what is really being used. Acked-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Link: https://lore.kernel.org/r/20240605221446.2624964-6-andriy.shevchenko@linux.intel.com Reviewed-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Reviewed-by: Charles Keepax <ckeepax@opensource.cirrus.com> Acked-by: Heiko Stuebner <heiko@sntech.de> Signed-off-by: Mark Brown <broonie@kernel.org>
2024-06-03ASoC: simple-audio-card: merge simple_parse_mclk_fs() into simple_link_init()Kuninori Morimoto1-21/+10
Now graph_link_init() is parsing dai_link related property. Let's handle mclk_fs on it, too. Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Link: https://msgid.link/r/87v82yfrv0.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Mark Brown <broonie@kernel.org>
2024-06-03ASoC: simple-audio-card: enable playback/capture_only propertyKuninori Morimoto1-5/+20
Audio Graph Card2 is supporting playback/capture_only property, let's follow Simple Audio Card, too. Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Link: https://msgid.link/r/87wmnefrv4.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Mark Brown <broonie@kernel.org>
2024-06-03ASoC: audio-graph-card: merge graph_parse_mclk_fs() into graph_link_init()Kuninori Morimoto1-19/+13
Now graph_link_init() is parsing dai_link related property. Let's handle mclk_fs on it, too. Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Link: https://msgid.link/r/87y17ufrv8.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Mark Brown <broonie@kernel.org>