summaryrefslogtreecommitdiffstats
AgeCommit message (Collapse)AuthorFilesLines
2021-08-23ASoC: Intel: kbl_da7219_max98927: Fix format selection for max98373Cezary Rojewski1-48/+7
Contrary to what is said in board's file, topology targeting kbl_da7219_max98373 expects format 16b, not 24/32b. Partially revert changes added in 'ASoC: Intel: Boards: Add Maxim98373 support' to bring old behavior back, aligning with topology expectations. Fixes: 716d53cc7837 ("ASoC: Intel: Boards: Add Maxim98373 support") Signed-off-by: Cezary Rojewski <cezary.rojewski@intel.com> Tested-by: Lukasz Majczak <lma@semihalf.com> Link: https://lore.kernel.org/r/20210818075742.1515155-2-cezary.rojewski@intel.com Signed-off-by: Mark Brown <broonie@kernel.org>
2021-08-20Merge series "ASoC: Intel/rt5640: Add support for HP Elite Pad 1000G2 ↵Mark Brown3-66/+234
jack-detect" from Hans de Goede <hdegoede@redhat.com>: Changes in v2: - Rebase on asoc/for-next - New patch: "ASoC: Intel: bytct_rt5640: Add a separate "Headset Mic 2" DAPM pin for the mic on the 2nd jack" - Addressed Pierre-Louis' comments about calling acpi_dev_add_driver_gpios() twice Original cover-letter: The HP Elitepad 1000 G2 tablet has 2 headset jacks: 1. on the dock which uses the output of the codecs built-in HP-amp + the standard IN2 input which is always used with the headset-jack. 2. on the tablet itself, this uses the line-out of the codec + an external HP-amp, which gets enabled by the ALC5642 codec's GPIO1 pin; and IN1 for the headset-mic. The codec's GPIO1 is also its only IRQ output pin, so this means that the codec's IRQ cannot be used on this tablet. Instead the jack-detect is connected directly to GPIOs on the main SoC. The dock has a helper chip which also detects if a headset-mic is present or not, so there are 2 GPIOs for the jack-detect status of the dock. The tablet jack uses a single GPIO which indicates if a jack is present or not. Differentiating between between headphones vs a headset on the tablet jack is done by using the usual mic-bias over-current-detection mechanism. Regards, Hans Hans de Goede (6): ASoC: rt5640: Move rt5640_disable_jack_detect() up in the rt5640.c file ASoC: rt5640: Delay requesting IRQ until the machine-drv calls set_jack ASoC: rt5640: Add optional hp_det_gpio parameter to rt5640_detect_headset() ASoC: rt5640: Add rt5640_set_ovcd_params() helper ASoC: Intel: bytct_rt5640: Add a separate "Headset Mic 2" DAPM pin for the mic on the 2nd jack ASoC: Intel: bytcr_rt5640: Add support for HP Elite Pad 1000G2 jack-detect sound/soc/codecs/rt5640.c | 136 ++++++++++++---------- sound/soc/codecs/rt5640.h | 6 + sound/soc/intel/boards/bytcr_rt5640.c | 158 +++++++++++++++++++++++++- 3 files changed, 234 insertions(+), 66 deletions(-) -- 2.31.1
2021-08-20ASoC: rsnd: adg: clearly handle clock error / NULL caseKuninori Morimoto1-6/+6
This driver is assuming that all adg->clk[i] is not NULL. Because of this prerequisites, for_each_rsnd_clk() is possible to work for all clk without checking NULL. In other words, all adg->clk[i] should not NULL. Some SoC might doesn't have clk_a/b/c/i. devm_clk_get() returns error in such case. This driver calls rsnd_adg_null_clk_get() and use null_clk instead of NULL in such cases. But devm_clk_get() might returns NULL even though such clocks exist, but it doesn't mean error (user deliberately chose to disable the feature). NULL clk itself is not error from clk point of view, but is error from this driver point of view because it is not assuming such case. But current code is using IS_ERR() which doesn't care NULL. This driver uses IS_ERR_OR_NULL() instead of IS_ERR() for clk check. And it uses ERR_CAST() to clarify null_clk error. One concern here is that it unconditionally uses null_clk if clk_a/b/c/i was error. It is correct if it doesn't exist, but is not correct if it returns error even though it exist. It needs to check "clock-names" from DT before calling devm_clk_get() to handling such case. But let's assume it is overkill so far. Link: https://lore.kernel.org/r/YMCmhfQUimHCSH/n@mwanda Reported-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Link: https://lore.kernel.org/r/87v940wyf9.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Mark Brown <broonie@kernel.org>
2021-08-20ASoC: rsnd: core: make some arrays static const, makes object smallerKuninori Morimoto1-3/+3
Don't populate arrays on the stack but instead them static const. Makes the object code smaller by 48 bytes. Before: text data bss dec hex filename 20938 916 104 21958 55c6 ./sound/soc/sh/rcar/core.o After: text data bss dec hex filename 20890 916 104 21910 5596 ./sound/soc/sh/rcar/core.o gcc version 11.1.0) Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Link: https://lore.kernel.org/r/87tujkwydx.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Mark Brown <broonie@kernel.org>
2021-08-19ASoC: Intel: bytcr_rt5640: Add support for HP Elite Pad 1000G2 jack-detectHans de Goede1-2/+144
The HP Elitepad 1000 G2 tablet has 2 headset jacks: 1. on the dock which uses the output of the codecs built-in HP-amp + the standard IN2 input which is always used with the headset-jack. 2. on the tablet itself, this uses the line-out of the codec + an external HP-amp, which gets enabled by the ALC5642 codec's GPIO1 pin; and IN1 for the headset-mic. The codec's GPIO1 is also its only IRQ output pin, so this means that the codec's IRQ cannot be used on this tablet. Instead the jack-detect is connected directly to GPIOs on the main SoC. The dock has a helper chip which also detects if a headset-mic is present or not, so there are 2 GPIOs for the jack-detect status of the dock. The tablet jack uses a single GPIO which indicates if a jack is present or not. Differentiating between headphones vs a headset on the tablet jack is done by using the usual mic-bias over-current-detection mechanism. Add support for this unique setup, this support gets enabled on this tablet through a new BYT_RT5640_JD_HP_ELITEP_1000G2 quirk. BugLink: https://bugzilla.kernel.org/show_bug.cgi?id=213415 Signed-off-by: Hans de Goede <hdegoede@redhat.com> Acked-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Link: https://lore.kernel.org/r/20210819190543.784415-7-hdegoede@redhat.com Signed-off-by: Mark Brown <broonie@kernel.org>
2021-08-19ASoC: Intel: bytct_rt5640: Add a separate "Headset Mic 2" DAPM pin for the ↵Hans de Goede1-2/+10
mic on the 2nd jack In order to be able to do jack-detection reporting for the mic contact on the 2nd jack found on some devices, the DAPM topology needs to have a separate DAPM pin/input for that microphone, instead of re-using the "Internal Mic" pin which is normally used together with the IN1P input of the codec. Using the "Internal Mic" dapm-pin-switch for this in a snd_soc_jack_pin to report hotplug events causes the "Internal Mic" pin to get deactivated when unplugging a headset from the 2nd jack, thus turning off the actual Internal Mic (typically a pair of digital mics on devices with 2 jacks). Fixes: 79c1123bac3b ("ASoC: Intel: bytcr_rt5640: Add support for a second headset mic input") Signed-off-by: Hans de Goede <hdegoede@redhat.com> Acked-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Link: https://lore.kernel.org/r/20210819190543.784415-6-hdegoede@redhat.com Signed-off-by: Mark Brown <broonie@kernel.org>
2021-08-19ASoC: rt5640: Add rt5640_set_ovcd_params() helperHans de Goede2-20/+34
Some devices don't use the builtin jack-detect but can still benefit from the mic-bias-current over-current-detection to differentiate between headphones vs a headset. Move the ovcd init code from rt5640_enable_jack_detect() into a new rt5640_set_ovcd_params() helper and export this helper as well as a couple of related ovcd functions. Signed-off-by: Hans de Goede <hdegoede@redhat.com> Acked-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Link: https://lore.kernel.org/r/20210819190543.784415-5-hdegoede@redhat.com Signed-off-by: Mark Brown <broonie@kernel.org>
2021-08-19ASoC: rt5640: Add optional hp_det_gpio parameter to rt5640_detect_headset()Hans de Goede2-4/+12
Some devices don't use the builtin jack-detect but can still benefit from the mic-bias-current over-current-detection headphones vs headset detection done by rt5640_detect_headset(). In this case the jack-inserted check done by rt5640_detect_headset() needs to be done through a GPIO rather then by using the codec's builtin jack-detect. Add an optional hp_det_gpio parameter and export rt5640_detect_headset() for use on machines where jack-detect is handled outside of the codec. Signed-off-by: Hans de Goede <hdegoede@redhat.com> Acked-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Link: https://lore.kernel.org/r/20210819190543.784415-4-hdegoede@redhat.com Signed-off-by: Mark Brown <broonie@kernel.org>
2021-08-19ASoC: rt5640: Delay requesting IRQ until the machine-drv calls set_jackHans de Goede1-17/+13
Delay requesting the IRQ until the machine-drv calls set_jack. The main reason for this is that the codec's IRQ is unused on some boards, in which case we really should not call request_irq at all. On some boards there is an IRQ listed at index 0 for the codec, but this is not connected to the codec, but rather is directly connected to the jack's jack-detect pin. These special setups will be handled by the machine-driver, but the machine driver can only request the IRQ if it is not first requested by the codec driver. Moving the request_irq to the set_jack callback (which will not get called in this case) avoids the codec-driver clobbering the IRQ. Moving the request_irq also removes the need to disable the IRQ immediately after requesting it, avoiding a small race (this could also have been fixed by using the new IRQF_NO_AUTOEN flag when requesting the IRQ). Signed-off-by: Hans de Goede <hdegoede@redhat.com> Acked-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Link: https://lore.kernel.org/r/20210819190543.784415-3-hdegoede@redhat.com Signed-off-by: Mark Brown <broonie@kernel.org>
2021-08-19ASoC: rt5640: Move rt5640_disable_jack_detect() up in the rt5640.c fileHans de Goede1-23/+23
Move rt5640_disable_jack_detect() to above rt5640_enable_jack_detect(). This is a preparation patch for reworking how the IRQ gets requested. Signed-off-by: Hans de Goede <hdegoede@redhat.com> Acked-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Link: https://lore.kernel.org/r/20210819190543.784415-2-hdegoede@redhat.com Signed-off-by: Mark Brown <broonie@kernel.org>
2021-08-19ASoC: uniphier: make arrays mul and div static const, makes object smallerColin Ian King1-2/+2
Don't populate the arrays mul and div on the stack but instead make them static const. Makes the object code smaller by 4 bytes. Before: text data bss dec hex filename 16226 4984 64 21274 531a ./sound/soc/uniphier/aio-cpu.o After: text data bss dec hex filename 16062 5144 64 21270 5316 ./sound/soc/uniphier/aio-cpu.o (gcc version 10.2.0) Signed-off-by: Colin Ian King <colin.king@canonical.com> Acked-by: Masami Hiramatsu <mhiramat@kernel.org> Link: https://lore.kernel.org/r/20210818151746.38520-1-colin.king@canonical.com Signed-off-by: Mark Brown <broonie@kernel.org>
2021-08-19ASoC: sh: rz-ssi: Improve error handling in rz_ssi_dma_request functionBiju Das1-2/+13
dma_request_chan() returns error pointer in case of failures, but the rz_ssi_dma_request() checked for NULL pointer instead. This patch fixes the issue by checking for ERR_PTR() instead of NULL and sets the DMA pointers to NULL in error case so that ssi can fallback to PIO mode. Fixes: 26ac471c5354 ("ASoC: sh: rz-ssi: Add SSI DMAC support") Signed-off-by: Biju Das <biju.das.jz@bp.renesas.com> Reviewed-by: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com> Link: https://lore.kernel.org/r/20210818101450.15948-1-biju.das.jz@bp.renesas.com Signed-off-by: Mark Brown <broonie@kernel.org>
2021-08-18ASoC: fsl_rpmsg: Check -EPROBE_DEFER for getting clocksShengjiu Wang1-10/+10
The devm_clk_get() may return -EPROBE_DEFER, then clocks will be assigned to NULL wrongly. As the clocks are optional so we can use devm_clk_get_optional() instead of devm_clk_get(). Fixes: b73d9e6225e8 ("ASoC: fsl_rpmsg: Add CPU DAI driver for audio base on rpmsg") Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com> Link: https://lore.kernel.org/r/1629266614-6942-1-git-send-email-shengjiu.wang@nxp.com Signed-off-by: Mark Brown <broonie@kernel.org>
2021-08-17Merge series "ASoC: tegra30: Fix use of of_device_get_match_data" from ↵Mark Brown2-8/+6
Aakash Hemadri <aakashhemadri123@gmail.com>: Hi, This patchset fixes my previous incorrect patches. 356b94a32a75 ("ASoC: tegra30: i2s: Use of_device_get_match_data") 80165bb80433 ("ASoC: tegra30: ahub: Use of_device_get_match_data") Aakash Hemadri (2): ASoC: tegra30: ahub: Fix incorrect usage of of_device_get_match_data ASoC: tegra30: i2s: Fix incorrect usage of of_device_get_match_data sound/soc/tegra/tegra30_ahub.c | 6 ++---- sound/soc/tegra/tegra30_i2s.c | 8 ++++---- 2 files changed, 6 insertions(+), 8 deletions(-) -- 2.32.0
2021-08-17ASoC: Intel: bytcr_rt5640: Use cfg-lineout:2 in the components stringHans de Goede1-1/+1
Use "cfg-lineout:2" in the components string on boards with a lineout instead of "cfg-lineout:1", this better mirrors the speaker part of the components string where we use "cfg-spk:1" for devices with a single speaker and "cfg-spk:2" for stereo speakers. The lineout is stereo by default, so using ":2" makes more sense, this way we keep ":1" reserved in case we ever encounter a device with a mono lineout. We can make this change without breaking userspace because no kernel has shipped with "cfg-lineout:1" in the component-string yet; and there also are no userspace bits (UCM profiles) checking for this yet. Signed-off-by: Hans de Goede <hdegoede@redhat.com> Acked-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Link: https://lore.kernel.org/r/20210816114722.107363-1-hdegoede@redhat.com Signed-off-by: Mark Brown <broonie@kernel.org>
2021-08-17ASoC: sh: rz-ssi: Fix wrong operator used issueBiju Das1-1/+1
Fix wrong operator used issue reported by Coverity by replacing | operator with & operator. Signed-off-by: Biju Das <biju.das.jz@bp.renesas.com> Reported-by: Colin Ian King <colin.king@canonical.com> Link: https://lore.kernel.org/r/20210816182336.29959-1-biju.das.jz@bp.renesas.com Signed-off-by: Mark Brown <broonie@kernel.org>
2021-08-17ASoC: tegra30: i2s: Fix incorrect usage of of_device_get_match_dataAakash Hemadri1-4/+4
const struct of_device_id incorrectly assigned "match->data" using of_device_get_match_data() Instead assign `const struct tegra30_i2s_soc_data *soc_data` with const void *of_device_get_match_data(...) Fixes: 356b94a32a75 ("ASoC: tegra30: i2s: Use of_device_get_match_data") Signed-off-by: Aakash Hemadri <aakashhemadri123@gmail.com> Link: https://lore.kernel.org/r/4805c7fcd35c8deada63d41cb34d40de80f85a13.1629148177.git.aakashhemadri123@gmail.com Signed-off-by: Mark Brown <broonie@kernel.org>
2021-08-17ASoC: tegra30: ahub: Fix incorrect usage of of_device_get_match_dataAakash Hemadri1-4/+2
const struct of_device_id incorrectly assigned "match->data" using of_device_get_match_data() Instead assign `const struct tegra30_ahub_soc_data *soc_data` with const void *of_device_get_match_data(...) Fixes: 80165bb80433 ("ASoC: tegra30: ahub: Use of_device_get_match_data") Signed-off-by: Aakash Hemadri <aakashhemadri123@gmail.com> Link: https://lore.kernel.org/r/bb61c41f2ee0cf0d85fecdfea05f23a7205992e6.1629148177.git.aakashhemadri123@gmail.com Signed-off-by: Mark Brown <broonie@kernel.org>
2021-08-16ASoC: sh: rz-ssi: Fix dereference of noderef expression warningBiju Das1-1/+1
Fix following sparse warning: sound/soc/sh/rz-ssi.c:156:15: sparse: warning: dereference of noderef expression Signed-off-by: Biju Das <biju.das.jz@bp.renesas.com> Reported-by: kernel test robot <lkp@intel.com> Link: https://lore.kernel.org/r/20210816132049.28128-1-biju.das.jz@bp.renesas.com Signed-off-by: Mark Brown <broonie@kernel.org>
2021-08-16Merge series "ASoC: soc-xxx: cleanup cppcheck warning" from Kuninori ↵Mark Brown5-34/+26
Morimoto <kuninori.morimoto.gx@renesas.com>: Hi Mark Now I'm posting audio-graph-card2 patch-set, but it seems it needs longer discussion. Thus I want to post more easy patch first, and reduce my local patches. These are cppcheck warning cleanup patches for soc-xxx. Kuninori Morimoto (9): ASoC: soc-generic-dmaengine-pcm: cleanup cppcheck warning at dmaengine_pcm_hw_params() ASoC: soc-generic-dmaengine-pcm: cleanup cppcheck warning at dmaengine_pcm_new() ASoC: soc-generic-dmaengine-pcm: cleanup cppcheck warning at dmaengine_copy_user() ASoC: soc-dai: cleanup cppcheck warning at snd_soc_dai_link_set_capabilities() ASoC: soc-dai: cleanup cppcheck warning at snd_soc_pcm_dai_new() ASoC: soc-jack: cleanup cppcheck warning at snd_soc_jack_report() ASoC: soc-jack: cleanup cppcheck warning for CONFIG_GPIOLIB ASoC: soc-component: cleanup cppcheck warning at snd_soc_pcm_component_pm_runtime_get() ASoC: soc-ac97: cleanup cppcheck warning sound/soc/soc-ac97.c | 14 ++++++-------- sound/soc/soc-component.c | 4 ++-- sound/soc/soc-dai.c | 18 ++++++++---------- sound/soc/soc-generic-dmaengine-pcm.c | 9 +++------ sound/soc/soc-jack.c | 15 +++++++-------- 5 files changed, 26 insertions(+), 34 deletions(-) -- 2.25.1
2021-08-16ASoC: tegra30: i2s: Use of_device_get_match_dataAakash Hemadri1-1/+1
Prefer `of_device_get_match_data` over `of_match_device` Retrieve OF match data using `of_device_get_match_data`, this is cleaner and better expresses intent. Signed-off-by: Aakash Hemadri <aakashhemadri123@gmail.com> Acked-by: Thierry Reding <treding@nvidia.com> Link: https://lore.kernel.org/r/f4e632e0023d90c43b2b927e752585142a9d9c26.1628971397.git.aakashhemadri123@gmail.com Signed-off-by: Mark Brown <broonie@kernel.org>
2021-08-16ASoC: tegra30: ahub: Use of_device_get_match_dataAakash Hemadri1-1/+1
Prefer `of_device_get_match_data` over `of_match_device` Retrieve OF match data using `of_device_get_match_data`, this is cleaner and better expresses intent. Signed-off-by: Aakash Hemadri <aakashhemadri123@gmail.com> Acked-by: Thierry Reding <treding@nvidia.com> Link: https://lore.kernel.org/r/e568d621c9c05ee23732a6a6f9e3606a780b1707.1628971397.git.aakashhemadri123@gmail.com Signed-off-by: Mark Brown <broonie@kernel.org>
2021-08-16ASoC: soc-ac97: cleanup cppcheck warningKuninori Morimoto1-8/+6
This patch cleanups below cppcheck warning. sound/soc/soc-ac97.c:41:15: style: struct member 'snd_ac97_gpio_priv::gpios_set' is never used. [unusedStructMember] unsigned int gpios_set; ^ sound/soc/soc-ac97.c:42:28: style: struct member 'snd_ac97_gpio_priv::component' is never used. [unusedStructMember] struct snd_soc_component *component; ^ Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Link: https://lore.kernel.org/r/87r1euyolk.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Mark Brown <broonie@kernel.org>
2021-08-16ASoC: soc-component: cleanup cppcheck warning at ↵Kuninori Morimoto1-2/+2
snd_soc_pcm_component_pm_runtime_get() This patch cleanups below cppcheck warning. sound/soc/soc-component.c:1183:9: style: The scope of the variable 'ret' can be reduced. [variableScope] int i, ret; ^ Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Link: https://lore.kernel.org/r/87sfzayolo.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Mark Brown <broonie@kernel.org>
2021-08-16ASoC: soc-jack: cleanup cppcheck warning for CONFIG_GPIOLIBKuninori Morimoto1-6/+6
This patch cleanups below cppcheck warning. sound/soc/soc-jack.c:21:6: style: struct member 'jack_gpio_tbl::count' is never used. [unusedStructMember] int count; ^ sound/soc/soc-jack.c:23:28: style: struct member 'jack_gpio_tbl::gpios' is never used. [unusedStructMember] struct snd_soc_jack_gpio *gpios; ^ Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Link: https://lore.kernel.org/r/87tujqyols.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Mark Brown <broonie@kernel.org>
2021-08-16ASoC: soc-jack: cleanup cppcheck warning at snd_soc_jack_report()Kuninori Morimoto1-2/+1
This patch cleanups below cppcheck warning. sound/soc/soc-jack.c:45:6: style: The scope of the variable 'enable' can be reduced. [variableScope] int enable; ^ Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Link: https://lore.kernel.org/r/87v946yolx.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Mark Brown <broonie@kernel.org>
2021-08-16ASoC: soc-dai: cleanup cppcheck warning at snd_soc_pcm_dai_new()Kuninori Morimoto1-2/+2
This patch cleanups below cppcheck warning. sound/soc/soc-dai.c:553:13: style: Variable 'ret' is assigned a value that is never used. [unreadVariable] int i, ret = 0; ^ Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Link: https://lore.kernel.org/r/87wnomyom1.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Mark Brown <broonie@kernel.org>
2021-08-16ASoC: soc-dai: cleanup cppcheck warning at snd_soc_dai_link_set_capabilities()Kuninori Morimoto1-8/+6
This patch cleanups below cppcheck warning. sound/soc/soc-dai.c:454:7: style: The scope of the variable 'supported_cpu' can be reduced. [variableScope] bool supported_cpu; ^ sound/soc/soc-dai.c:455:7: style: The scope of the variable 'supported_codec' can be reduced. [variableScope] bool supported_codec; ^ Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Link: https://lore.kernel.org/r/87y292yom6.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Mark Brown <broonie@kernel.org>
2021-08-16ASoC: soc-generic-dmaengine-pcm: cleanup cppcheck warning at ↵Kuninori Morimoto1-2/+1
dmaengine_copy_user() This patch cleanups below cppcheck warning. sound/soc/soc-generic-dmaengine-pcm.c:310:6: style: The scope of the variable 'ret' can be reduced. [variableScope] int ret; ^ Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Link: https://lore.kernel.org/r/87zgtiyomb.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Mark Brown <broonie@kernel.org>
2021-08-16ASoC: soc-generic-dmaengine-pcm: cleanup cppcheck warning at dmaengine_pcm_new()Kuninori Morimoto1-2/+1
This patch cleanups below cppcheck warning. sound/soc/soc-generic-dmaengine-pcm.c:233:28: style: The scope of the variable 'substream' can be reduced. [variableScope] struct snd_pcm_substream *substream; ^ Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Link: https://lore.kernel.org/r/871r6u0yzs.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Mark Brown <broonie@kernel.org>
2021-08-16ASoC: soc-generic-dmaengine-pcm: cleanup cppcheck warning at ↵Kuninori Morimoto1-2/+1
dmaengine_pcm_hw_params() This patch cleanups below cppcheck warning. sound/soc/soc-generic-dmaengine-pcm.c:82:6: style: The scope of the variable 'ret' can be reduced. [variableScope] int ret; ^ Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Link: https://lore.kernel.org/r/8735ra0yzz.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Mark Brown <broonie@kernel.org>
2021-08-13Merge series "ASoC: Intel: boards: use software node API" from Pierre-Louis ↵Mark Brown14-112/+223
Bossart <pierre-louis.bossart@linux.intel.com>: This is an update on an earlier contribution from Heikki Krogerus The function device_add_properties() is going to be removed. Replacing it with software node API equivalents. Thanks for Hans de Goede and Andy Shevchenko for their comments, suggestions and Reviewed-by tags on GitHub. The review thread can be found at https://github.com/thesofproject/linux/pull/3041) v3 changes: Fixed nit-picks from Andy: label, return value, missing commas/periods. Added Andy's Reviewed-by tag v2 changes: feedback from Andy and Hans Better error handling Codec reference is kept until the .remove callback Remove bus search to find device v1 changes from Heikki's patches: Avoid the use of devm_ routines for Baytrail machine drivers. Heikki Krogerus (1): ASoC: Intel: boards: use software node API in Atom boards Pierre-Louis Bossart (7): ASoC: Intel: boards: harden codec property handling ASoC: Intel: boards: handle errors with acpi_dev_get_first_match_dev() ASoC: Intel: boards: get codec device with ACPI instead of bus search ASoC: Intel: sof_sdw: pass card information to init/exit functions ASoC: Intel: sof_sdw_rt711*: keep codec device reference until remove ASoC: Intel: use software node API in SoundWire machines ASoC: Intel: remove device_properties for Atom boards sound/soc/intel/boards/bytcht_es8316.c | 31 ++++++++-- sound/soc/intel/boards/bytcr_rt5640.c | 60 +++++++++++++++----- sound/soc/intel/boards/bytcr_rt5651.c | 63 ++++++++++++++------- sound/soc/intel/boards/sof_sdw.c | 20 ++++--- sound/soc/intel/boards/sof_sdw_common.h | 37 +++++++----- sound/soc/intel/boards/sof_sdw_max98373.c | 3 +- sound/soc/intel/boards/sof_sdw_rt1308.c | 3 +- sound/soc/intel/boards/sof_sdw_rt1316.c | 3 +- sound/soc/intel/boards/sof_sdw_rt5682.c | 3 +- sound/soc/intel/boards/sof_sdw_rt700.c | 3 +- sound/soc/intel/boards/sof_sdw_rt711.c | 51 +++++++++-------- sound/soc/intel/boards/sof_sdw_rt711_sdca.c | 52 +++++++++-------- sound/soc/intel/boards/sof_sdw_rt715.c | 3 +- sound/soc/intel/boards/sof_sdw_rt715_sdca.c | 3 +- 14 files changed, 223 insertions(+), 112 deletions(-) -- 2.25.1
2021-08-13Merge series "Add RZ/G2L Sound support" from Biju Das ↵Mark Brown4-2/+1093
<biju.das.jz@bp.renesas.com>: This patch series aims to add ASoC support on RZ/G2L SoC's. It is based on the work done by Chris Brandt for RZ/A ASoC driver. v4->v5 * Moved validation of sample bits in hw_params * Removed validation of frame bits as it is redundant * split the rz_ssi_start_stop function into rz_ssi_start and rz_ssi_stop. * remove the spin_lock around rz_ssi_stream_init. * Updated dmas description and removed fixes as it is an enhancement now. * updated ssi_start functions with setting fifo thresholds and ssi_stop function with cancel all dma txn. v3->v4: * Updated the subject line as per style for the subsystem. * Removed select SND_SIMPLE_CARD from Kconfig * Added C++ comments for copyright and driver description. * Moved validation of channels in hw_params * removed asm issue reported by bot as well as Mark * replaced master/slave macros with provider/consumer macros * Improved locking and added more null pointer checks. v2->v3: * Fixed the dependency on KCONFIG * Merged the binding patch with dma feature added * Updated dt binding example with encoded #dma-cells value. * Improved Error handling in probe function * Removed the passing legacy channel configuration parameters from dmaengine_slave_config function * started using dma_request_chan instead of deprecated dma_request_slave_channel * Removed SoC dtsi and config patches from this series. Will send it later. v1->v2: * Rebased to latest rc kernel Biju Das (3): ASoC: sh: Add RZ/G2L SSIF-2 driver ASoC: dt-bindings: renesas,rz-ssi: Update slave dma channel configuration parameters ASoC: sh: rz-ssi: Add SSI DMAC support .../bindings/sound/renesas,rz-ssi.yaml | 22 +- sound/soc/sh/Kconfig | 6 + sound/soc/sh/Makefile | 4 + sound/soc/sh/rz-ssi.c | 1063 +++++++++++++++++ 4 files changed, 1093 insertions(+), 2 deletions(-) create mode 100644 sound/soc/sh/rz-ssi.c -- 2.17.1
2021-08-13Merge series "ASoC: SOF: Intel: DMI L1 power optimization for HDaudio ↵Mark Brown3-18/+19
platforms" from Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>: This patchset provides an optimization that result in significant power savings on Intel HDAudio platforms using SOF (Sound Open Firmware). We previously prevented the Intel DSP from enabling the DMI_L1 capability to work-around issues with pause on capture streams. It turns out that this also prevented the platform from entering high C states in full-duplex usages such as videoconferencing - a rather basic use case since the start of the pandemic. The support for pause_push/release was already a bit controversial for Intel platforms, in theory platforms should only enable PAUSE if they can resume on the same sample, which is not the case on any Intel platform. With this patchset, when the user enables DMI L1 via a kernel parameter, the PAUSE support is disabled for capture streams. A kernel parameter is far from ideal but it's a placeholder until we have an API to negotiate capabilities between applications and driver, and it's far less confusing than a Kconfig option. Changes since v1: Removal of SPIB support since it may conflict with Takashi's memalloc changes. These SPIB changes will be provided after rebase. Addition of one cleanup for cppcheck warning Move all changes to intel/ directory, no changes in shared code Flipped the logic: the selection of DMI L1 disables PAUSE Pierre-Louis Bossart (4): ASoC: SOF: Intel: Kconfig: clarify DMI L1 option description ASoC: SOF: Intel: hda-stream: remove always true condition ASoC: SOF: Intel: simplify logic for DMI_L1 handling ASoC: SOF: Intel: make DMI L1 selection more robust sound/soc/sof/intel/Kconfig | 10 ---------- sound/soc/sof/intel/hda-pcm.c | 16 ++++++++++++++-- sound/soc/sof/intel/hda-stream.c | 11 +++++------ 3 files changed, 19 insertions(+), 18 deletions(-) -- 2.25.1
2021-08-13ASoC: Intel: boards: use software node API in Atom boardsHeikki Krogerus3-11/+46
The function device_add_properties() is going to be removed. Replacing it with software node API equivalents. Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Reviewed-by: Hans de Goede <hdegoede@redhat.com> Co-developed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Signed-off-by: Heikki Krogerus <heikki.krogerus@linux.intel.com> Link: https://lore.kernel.org/r/20210813151116.23931-9-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown <broonie@kernel.org>
2021-08-13ASoC: Intel: remove device_properties for Atom boardsPierre-Louis Bossart3-2/+10
Prepare the transition to the software node API by removing device properties in the probe error handling and .remove callback. Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Reviewed-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Link: https://lore.kernel.org/r/20210813151116.23931-8-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown <broonie@kernel.org>
2021-08-13ASoC: Intel: use software node API in SoundWire machinesPierre-Louis Bossart2-4/+24
The function device_add_properties() is going to be removed. Replacing it with software node API equivalents. Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Reviewed-by: Hans de Goede <hdegoede@redhat.com> Co-developed-by: Heikki Krogerus <heikki.krogerus@linux.intel.com> Signed-off-by: Heikki Krogerus <heikki.krogerus@linux.intel.com> Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Link: https://lore.kernel.org/r/20210813151116.23931-7-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown <broonie@kernel.org>
2021-08-13ASoC: Intel: sof_sdw_rt711*: keep codec device reference until removePierre-Louis Bossart2-49/+38
Follow the example of Intel Atom drivers and keep a reference to the headset codec until the properties are removed. There is no guarantee that the module for the codec driver is loaded before the machine driver probe, the use of the deferred probe mechanism is required. Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Reviewed-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Link: https://lore.kernel.org/r/20210813151116.23931-6-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown <broonie@kernel.org>
2021-08-13ASoC: Intel: sof_sdw: pass card information to init/exit functionsPierre-Louis Bossart11-32/+56
If we want to handle a context in init/exit function, we have to pass the card information. This will be necessary to better deal with device properties in the follow-up commits. No functional change other than prototype update. Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Reviewed-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Link: https://lore.kernel.org/r/20210813151116.23931-5-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown <broonie@kernel.org>
2021-08-13ASoC: Intel: boards: get codec device with ACPI instead of bus searchPierre-Louis Bossart3-9/+6
We have an existing 'adev' handle from which we can find the codec device, no need for an I2C bus search. Suggested-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Reviewed-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Link: https://lore.kernel.org/r/20210813151116.23931-4-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown <broonie@kernel.org>
2021-08-13ASoC: Intel: boards: handle errors with acpi_dev_get_first_match_dev()Pierre-Louis Bossart3-1/+7
acpi_dev_get_first_match_dev() searches for an acpi_handle instantiated by the ACPI table scanning done early during boot. Two of three machine drivers using this search don't deal with errors and the one which does (bytcr_rt5651) returns -ENODEV, which doesn't make sense here: an alternate driver will not be probed. Add consistent error handling and report -ENXIO. Suggested-by: Hans de Goede <hdegoede@redhat.com> Reviewed-by: Hans de Goede <hdegoede@redhat.com> Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Link: https://lore.kernel.org/r/20210813151116.23931-3-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown <broonie@kernel.org>
2021-08-13ASoC: Intel: boards: harden codec property handlingPierre-Louis Bossart3-32/+64
In current ACPI-based devices, the DSDT does not include any of the properties required by the codec driver. This is not an ACPI limitation proper since the _DSD method could be used, as done for Camera and SoundWire in newer platforms. For legacy devices, there is unfortunately no other option than using a work-around: we add properties to the codec device from the machine driver. To avoid any issues with the codec driver being unbound, we need to keep a reference to the codec device until the card is removed. Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Co-developed-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Link: https://lore.kernel.org/r/20210813151116.23931-2-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown <broonie@kernel.org>
2021-08-13ASoC: rt5682: Remove unused variable in rt5682_i2c_remove()Douglas Anderson1-2/+0
In commit 772d44526e20 ("ASoC: rt5682: Properly turn off regulators if wrong device ID") I deleted code but forgot to delete a variable that's now unused. Delete it. Fixes: 772d44526e20 ("ASoC: rt5682: Properly turn off regulators if wrong device ID") Reported-by: Stephen Rothwell <sfr@canb.auug.org.au> Signed-off-by: Douglas Anderson <dianders@chromium.org> Reviewed-by: Stephen Boyd <swboyd@chromium.org> Link: https://lore.kernel.org/r/20210813073402.1.Iaa9425cfab80f5233afa78b32d02b6dc23256eb3@changeid Signed-off-by: Mark Brown <broonie@kernel.org>
2021-08-13ASoC: sh: rz-ssi: Add SSI DMAC supportBiju Das1-32/+224
Add SSI DMAC support to RZ/G2L SoC. Signed-off-by: Biju Das <biju.das.jz@bp.renesas.com> Reviewed-by: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com> Link: https://lore.kernel.org/r/20210813091156.10700-4-biju.das.jz@bp.renesas.com Signed-off-by: Mark Brown <broonie@kernel.org>
2021-08-13ASoC: dt-bindings: renesas,rz-ssi: Update slave dma channel configuration ↵Biju Das1-2/+20
parameter The DMAC on RZ/G2L has specific slave channel configuration parameters for SSI. This patch updates the dmas description and example node to include the encoded slave channel configuration. Signed-off-by: Biju Das <biju.das.jz@bp.renesas.com> Reviewed-by: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com> Link: https://lore.kernel.org/r/20210813091156.10700-3-biju.das.jz@bp.renesas.com Signed-off-by: Mark Brown <broonie@kernel.org>
2021-08-13ASoC: sh: Add RZ/G2L SSIF-2 driverBiju Das3-0/+881
Add serial sound interface(SSIF-2) driver support for RZ/G2L SoC. Based on the work done by Chris Brandt for RZ/A SSI driver. Signed-off-by: Biju Das <biju.das.jz@bp.renesas.com> Reviewed-by: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com> Link: https://lore.kernel.org/r/20210813091156.10700-2-biju.das.jz@bp.renesas.com Signed-off-by: Mark Brown <broonie@kernel.org>
2021-08-13ASoC: SOF: Intel: make DMI L1 selection more robustPierre-Louis Bossart2-13/+14
Exposing the DMI L1 configuration as a kernel Kconfig option was in hindsight a really bad idea. It led to several errors reported by distributions which selected it by mistake. The Kconfig is now replaced with a kernel parameter. Since DMI L1 entry is incompatible with pause on a capture stream, the latter is disabled when the kernel parameter is set. Experimental results show an increased residency in higher C states and a significant decrease of system power consumption for "work from home" usages such as VoIP calls. Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Reviewed-by: Péter Ujfalusi <peter.ujfalusi@linux.intel.com> Reviewed-by: Kai Vehmanen <kai.vehmanen@linux.intel.com> Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com> Link: https://lore.kernel.org/r/20210812231940.172547-5-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown <broonie@kernel.org>
2021-08-13ASoC: SOF: Intel: simplify logic for DMI_L1 handlingPierre-Louis Bossart2-7/+7
We don't need to test in multiple places if the kconfig SND_SOC_SOF_HDA_ALWAYS_ENABLE_DMI_L1 is enabled or not, we might as well set the existing DMI_L1_COMPATIBLE flag. Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Reviewed-by: Péter Ujfalusi <peter.ujfalusi@linux.intel.com> Reviewed-by: Kai Vehmanen <kai.vehmanen@linux.intel.com> Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com> Link: https://lore.kernel.org/r/20210812231940.172547-4-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown <broonie@kernel.org>
2021-08-13ASoC: SOF: Intel: hda-stream: remove always true conditionPierre-Louis Bossart1-1/+1
We test if (!stream) and return and later on re-test for stream. The second test is always true. This was detected by cppcheck but only after additional code changes. Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Reviewed-by: Péter Ujfalusi <peter.ujfalusi@linux.intel.com> Reviewed-by: Kai Vehmanen <kai.vehmanen@linux.intel.com> Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com> Link: https://lore.kernel.org/r/20210812231940.172547-3-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown <broonie@kernel.org>
2021-08-13ASoC: SOF: Intel: Kconfig: clarify DMI L1 option descriptionPierre-Louis Bossart1-1/+1
This option is only valid for HDaudio platforms. This was described in the help but not explicit in the option description. Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Reviewed-by: Péter Ujfalusi <peter.ujfalusi@linux.intel.com> Reviewed-by: Kai Vehmanen <kai.vehmanen@linux.intel.com> Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com> Link: https://lore.kernel.org/r/20210812231940.172547-2-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown <broonie@kernel.org>