platform/kernel/linux-starfive.git
3 years agoASoC: Intel: Skylake: skl-topology: fix -frame-larger-than
Nick Desaulniers [Mon, 15 Mar 2021 01:39:08 +0000 (18:39 -0700)]
ASoC: Intel: Skylake: skl-topology: fix -frame-larger-than

sound/soc/intel/skylake/skl-topology.c:3613:13: warning: stack frame
size of 1304 bytes in function 'skl_tplg_complete'
[-Wframe-larger-than=]

struct snd_ctl_elem_value is 1224 bytes in my configuration.

Heap allocate it, then free it within the current frame.

Suggested-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Signed-off-by: Nick Desaulniers <nick.desaulniers@gmail.com>
Link: https://lore.kernel.org/r/20210315013908.217219-1-nick.desaulniers@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
3 years agoASoC: ti: Fix a typo in the file ams-delta.c
Bhaskar Chowdhury [Wed, 17 Mar 2021 08:20:42 +0000 (13:50 +0530)]
ASoC: ti: Fix a typo in the file ams-delta.c

s/functonality/functionality/

Signed-off-by: Bhaskar Chowdhury <unixbhaskar@gmail.com>
Link: https://lore.kernel.org/r/20210317082042.3670745-1-unixbhaskar@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
3 years agoMerge series "ASoC: SOF: debug: cleanups" from Pierre-Louis Bossart <pierre-louis...
Mark Brown [Tue, 16 Mar 2021 17:55:39 +0000 (17:55 +0000)]
Merge series "ASoC: SOF: debug: cleanups" from Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>:

cleanups of allocation and error handling

Guennadi Liakhovetski (3):
  ASoC: SOF: fix debugfs initialisation error handling
  ASoC: SOF: only allocate debugfs cache buffers for IPC flood entries
  ASoC: SOF: remove superfluous NULL check in debugfs read

 sound/soc/sof/core.c  |  5 +++--
 sound/soc/sof/debug.c | 21 +++++++++++----------
 2 files changed, 14 insertions(+), 12 deletions(-)

--
2.25.1

3 years agoASoC: imx-hdmi: fix platform_no_drv_owner.cocci warnings
Yang Li [Thu, 4 Mar 2021 09:08:01 +0000 (17:08 +0800)]
ASoC: imx-hdmi: fix platform_no_drv_owner.cocci warnings

./sound/soc/fsl/imx-hdmi.c:226:3-8: No need to set .owner here. The core
will do it.

Remove .owner field if calls are used which set it automatically

Reported-by: Abaci Robot <abaci@linux.alibaba.com>
Signed-off-by: Yang Li <yang.lee@linux.alibaba.com>
Reviewed-by: Fabio Estevam <festevam@gmail.com>
Link: https://lore.kernel.org/r/1614848881-29637-1-git-send-email-yang.lee@linux.alibaba.com
Signed-off-by: Mark Brown <broonie@kernel.org>
3 years agoASoC: rsnd: core: Check convert rate in rsnd_hw_params
Mikhail Durnev [Tue, 16 Mar 2021 04:47:35 +0000 (14:47 +1000)]
ASoC: rsnd: core: Check convert rate in rsnd_hw_params

snd_pcm_hw_params_set_rate_near can return incorrect sample rate in
some cases, e.g. when the backend output rate is set to some value higher
than 48000 Hz and the input rate is 8000 Hz. So passing the value returned
by snd_pcm_hw_params_set_rate_near to snd_pcm_hw_params will result in
"FSO/FSI ratio error" and playing no audio at all while the userland
is not properly notified about the issue.

If SRC is unable to convert the requested sample rate to the sample rate
the backend is using, then the requested sample rate should be adjusted in
rsnd_hw_params. The userland will be notified about that change in the
returned hw_params structure.

Signed-off-by: Mikhail Durnev <mikhail_durnev@mentor.com>
Link: https://lore.kernel.org/r/1615870055-13954-1-git-send-email-mikhail_durnev@mentor.com
Signed-off-by: Mark Brown <broonie@kernel.org>
3 years agoASoC: mx27vis: Remove unused file
Fabio Estevam [Mon, 15 Mar 2021 19:38:42 +0000 (16:38 -0300)]
ASoC: mx27vis: Remove unused file

i.MX has been converted to a devicetree-only platform and
asoc-mx27vis.h is no longer used.

Get rid of this unused file.

Signed-off-by: Fabio Estevam <festevam@gmail.com>
Link: https://lore.kernel.org/r/20210315193842.183042-1-festevam@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
3 years agoASoC: fsl_spdif: use snd_ctl_boolean_mono_info
Viorel Suman [Tue, 16 Mar 2021 09:42:16 +0000 (17:42 +0800)]
ASoC: fsl_spdif: use snd_ctl_boolean_mono_info

Remove redundant code and use snd_ctl_boolean_mono_info
instead.

Signed-off-by: Viorel Suman <viorel.suman@nxp.com>
Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com>
Link: https://lore.kernel.org/r/1615887736-31217-1-git-send-email-shengjiu.wang@nxp.com
Signed-off-by: Mark Brown <broonie@kernel.org>
3 years agoASoC: SOF: remove superfluous NULL check in debugfs read
Guennadi Liakhovetski [Mon, 15 Mar 2021 16:39:32 +0000 (11:39 -0500)]
ASoC: SOF: remove superfluous NULL check in debugfs read

When reading from IPC flood debugfs entries no need to check whether
.cache_buf is NULL - it's impossible since otherwise the initialisation
would have failed. This also fixes a klocwork reported issue:

passed to function and may be dereferenced there by passing argument 2
to function 'memcpy' at line 510.
sound/soc/sof/debug.c:510 | sof_dfsentry_read()

Reported-by: Keqiao Zhang <keqiao.zhang@intel.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: Xiuli Pan <xiulipan@outlook.com>
Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20210315163932.18663-4-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
3 years agoASoC: SOF: only allocate debugfs cache buffers for IPC flood entries
Guennadi Liakhovetski [Mon, 15 Mar 2021 16:39:31 +0000 (11:39 -0500)]
ASoC: SOF: only allocate debugfs cache buffers for IPC flood entries

snd_sof_debugfs_buf_item() is an exported function and is called from
different locations to initialise different debugfs entries. However
.cache_buf is only needed for IPC flood entries. Limit allocations
respectively.

Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: Xiuli Pan <xiulipan@outlook.com>
Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20210315163932.18663-3-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
3 years agoASoC: SOF: fix debugfs initialisation error handling
Guennadi Liakhovetski [Mon, 15 Mar 2021 16:39:30 +0000 (11:39 -0500)]
ASoC: SOF: fix debugfs initialisation error handling

If debugfs initialisation fails partially in sof_probe_continue() some
debugfs files and the root directory might have been created
successfully. They have to be cleaned up if some of them failed too.

Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: Xiuli Pan <xiulipan@outlook.com>
Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20210315163932.18663-2-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
3 years agoMerge series "AsoC: rt5640/rt5651: Volume control fixes" from Hans de Goede <hdegoede...
Mark Brown [Fri, 12 Mar 2021 22:54:34 +0000 (22:54 +0000)]
Merge series "AsoC: rt5640/rt5651: Volume control fixes" from Hans de Goede <hdegoede@redhat.com>:

Hi All,

Here is a resent of the remaining patches from my
"[PATCH 0/5] AsoC: rt5640/rt5651: Volume control fixes" series,
with the controversial "[PATCH 3/5] ASoC: rt5640: Add emulated
'DAC1 Playback Switch' control" patch dropped, and these
remaining 2 patches rebased to still apply with that patch dropped.

Regards,

Hans

Hans de Goede (2):
  ASoC: rt5640: Rename 'Mono DAC Playback Volume' to 'DAC2 Playback
    Volume'
  ASoC: Intel: bytcr_rt5640: Add used AIF to the components string

 sound/soc/codecs/rt5640.c             |  6 +++---
 sound/soc/intel/boards/bytcr_rt5640.c | 11 ++++++++---
 2 files changed, 11 insertions(+), 6 deletions(-)

--
2.30.1

3 years agoMerge series "ASoC: samsung: remove cppcheck warnings" from Pierre-Louis Bossart...
Mark Brown [Fri, 12 Mar 2021 22:54:33 +0000 (22:54 +0000)]
Merge series "ASoC: samsung: remove cppcheck warnings" from Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>:

v4:
corrected Fixes tag
Added added Krzysztof Kozlowski's r-v-b tag
reverted patch2 to v2 since this is the agreement.

v3:
Added Sylwester tag
Rebased and squashed fix with initial patch which was merged at some
point but can't be found in broonie/for-next (not sure what happened?)
Corrected patch subjects to tm2_wm5110
Reverted second patch to initial v1, after agreement between Krzysztof
and Sylwester

v2:
added Krzysztof Kozlowski's tags
added fix for first patch already merged as suggested by Krzysztof Kozlowski
moved variable to lower scope in patch6

Pierre-Louis Bossart (2):
  ASoC: samsung: tm2_wm5110: check of of_parse return value
  ASoC: samsung: tm2_wm5110: remove shadowed variable

 sound/soc/samsung/tm2_wm5110.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

--
2.25.1

3 years agoASoC: fsl_asrc_dma: request dma channel from specific controller
Robin Gong [Fri, 5 Mar 2021 09:19:37 +0000 (17:19 +0800)]
ASoC: fsl_asrc_dma: request dma channel from specific controller

Request dma channel from specific dma controller instead of generic
dma controller list, otherwise, may get the wrong dma controller
if there are multi dma controllers such as i.MX8MP.

Signed-off-by: Robin Gong <yibin.gong@nxp.com>
Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com>
Link: https://lore.kernel.org/r/1614935977-21638-1-git-send-email-shengjiu.wang@nxp.com
Signed-off-by: Mark Brown <broonie@kernel.org>
3 years agoASoC: Intel: bytcr_rt5640: Add used AIF to the components string
Hans de Goede [Sun, 7 Mar 2021 15:05:03 +0000 (16:05 +0100)]
ASoC: Intel: bytcr_rt5640: Add used AIF to the components string

Depending on which AIF is used the UCM profile needs to setup
a different path through the rt5640's "Digital Mixer Path" graph.

ATM the UCM profiles solve this by just enabling paths to the outputs /
from the input from both AIF1 and AIF2 and then relying on the DAPM
framework to power-down the parts of the graph connected to the
unused AIF.

But in order to be able to use hardware-volumecontrol and to use
the hardware mute controls, which are necessary for mute LED control,
the UCM profiles need to know which AIF is actually being used.

Add a new "aif:1" or "aif:2" part to the component string to provide
info about the used AIF to userspace / to the UCM profiles.

Note the size of byt_rt5640_components is not increased because the
size of 32 chars already is big enough.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Link: https://lore.kernel.org/r/20210307150503.34906-3-hdegoede@redhat.com
Signed-off-by: Mark Brown <broonie@kernel.org>
3 years agoASoC: rt5640: Rename 'Mono DAC Playback Volume' to 'DAC2 Playback Volume'
Hans de Goede [Sun, 7 Mar 2021 15:05:02 +0000 (16:05 +0100)]
ASoC: rt5640: Rename 'Mono DAC Playback Volume' to 'DAC2 Playback Volume'

Rename 'Mono DAC Playback Volume' to 'DAC2 Playback Volume' and move it
from rt5640_specific_snd_controls[] to rt5640_snd_controls[].

The RT5640_DAC2_DIG_VOL register controlled by this mixer-element has
nothing to do with the Mono (Amplified) output which is only available
on the ALC5640 chip and not on the ALC5642 chip.

The RT5640_DAC2_DIG_VOL volume-control is the main volume control for
audio coming from the I2S2 / AIF2 input of the chip and as such is also
available on the ALC5642.

This commit results in the following userspace visible changes:

1. On devices with an ACL5640 codec, the 'Mono DAC Playback Volume'
control is renamed to 'DAC2 Playback Volume' allowing the alsa-lib
mixer code to properly group it with the 'DAC2 Playback Switch' which
is controlling the mute bits in the RT5640_DAC2_DIG_VOL register.

Note the removal of the 'Mono DAC Playback Volume' is not an issue for
userspace because the UCM profiles do not use it (the UCM profiles are
shared betweent the 5640 and 5642 and only the 5640 had this control).

2. On devices with an ACL5642 codec, there now will be a new
'DAC2 Playback Volume', grouped with the 'DAC2 Playback Switch'

Having a complete 'DAC2 Playback Volume' / 'DAC2 Playback Switch' pair
on both variants will allow enabling hardware-volume control by
setting the UCM PlaybackMasterElem to "DAC2" on devices where the
I2S2/AIF2 interface of the codec is used.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Link: https://lore.kernel.org/r/20210307150503.34906-2-hdegoede@redhat.com
Signed-off-by: Mark Brown <broonie@kernel.org>
3 years agoASoC: samsung: tm2_wm5110: remove shadowed variable
Pierre-Louis Bossart [Fri, 12 Mar 2021 18:02:31 +0000 (12:02 -0600)]
ASoC: samsung: tm2_wm5110: remove shadowed variable

cppcheck warning:

sound/soc/samsung/tm2_wm5110.c:552:26: style: Local variable 'args'
shadows outer variable [shadowVariable]
  struct of_phandle_args args;
                         ^
sound/soc/samsung/tm2_wm5110.c:504:25: note: Shadowed declaration
 struct of_phandle_args args;
                        ^
sound/soc/samsung/tm2_wm5110.c:552:26: note: Shadow variable
  struct of_phandle_args args;
                         ^
Move the top-level variable to the lower scope where it's needed.

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@canonical.com>
Link: https://lore.kernel.org/r/20210312180231.2741-3-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
3 years agoASoC: samsung: tm2_wm5110: check of of_parse return value
Pierre-Louis Bossart [Fri, 12 Mar 2021 18:02:30 +0000 (12:02 -0600)]
ASoC: samsung: tm2_wm5110: check of of_parse return value

cppcheck warning:

sound/soc/samsung/tm2_wm5110.c:605:6: style: Variable 'ret' is
reassigned a value before the old one has been
used. [redundantAssignment]
 ret = devm_snd_soc_register_component(dev, &tm2_component,
     ^
sound/soc/samsung/tm2_wm5110.c:554:7: note: ret is assigned
  ret = of_parse_phandle_with_args(dev->of_node, "i2s-controller",
      ^
sound/soc/samsung/tm2_wm5110.c:605:6: note: ret is overwritten
 ret = devm_snd_soc_register_component(dev, &tm2_component,
     ^

The args is a stack variable, so it could have junk (uninitialized)
therefore args.np could have a non-NULL and random value even though
property was missing. Later could trigger invalid pointer dereference.

There's no need to check for args.np because args.np won't be
initialized on errors.

Fixes: 8d1513cef51a ("ASoC: samsung: Add support for HDMI audio on TM2 board")
Cc: <stable@vger.kernel.org>
Suggested-by: Krzysztof Kozlowski <krzk@kernel.org>
Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@canonical.com>
Reviewed-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20210312180231.2741-2-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
3 years agoASoC: rt1015p: add acpi device id for rt1015p
Jack Yu [Fri, 12 Mar 2021 02:45:15 +0000 (02:45 +0000)]
ASoC: rt1015p: add acpi device id for rt1015p

Add acpi device id for rt1015p.

Signed-off-by: Jack Yu <jack.yu@realtek.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/949671bd00c14b6d9aa5e85cc14be5d4@realtek.com
Signed-off-by: Mark Brown <broonie@kernel.org>
3 years agoASoC: Intel: bytcr_rt5640: Enable jack-detect support on Asus T100TAF
Hans de Goede [Fri, 12 Mar 2021 11:48:50 +0000 (12:48 +0100)]
ASoC: Intel: bytcr_rt5640: Enable jack-detect support on Asus T100TAF

The Asus T100TAF uses the same jack-detect settings as the T100TA,
this has been confirmed on actual hardware.

Add these settings to the T100TAF quirks to enable jack-detect support
on the T100TAF.

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/20210312114850.13832-1-hdegoede@redhat.com
Signed-off-by: Mark Brown <broonie@kernel.org>
3 years agoMerge series "ASoC: soc-pcm: cleanup each functions" from Kuninori Morimoto <kuninori...
Mark Brown [Fri, 12 Mar 2021 18:05:09 +0000 (18:05 +0000)]
Merge series "ASoC: soc-pcm: cleanup each functions" from Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>:

Hi Mark

These are v2 of soc-pcm cleanup patches.
These has no relationship to each other.

My 1 concern is [3/8] patch. I think it is no problem,
but I'm not 100% sure why current code was such code.
Pierre-Louis / Liam might about something.

v1 -> v2
- soc_cpu/codec_dai_name() is now inline function
- rename soc_pcm_care_symmetry() to soc_pcm_update_symmetry()

v2 -> v3
- log fix at [6/8]
  - Thus, it will be minus users at (2).
  + Thus, users will be a negative number at (2)

Link: https://lore.kernel.org/r/87tupuqqc8.wl-kuninori.morimoto.gx@renesas.com
Link: https://lore.kernel.org/r/87tupqpg9x.wl-kuninori.morimoto.gx@renesas.com
Kuninori Morimoto (8):
  ASoC: soc-pcm: check DAI activity under soc_pcm_apply_symmetry()
  ASoC: soc-pcm: add soc_cpu/codec_dai_name() macro
  ASoC: soc-pcm: direct copy at snd_soc_set_runtime_hwparams()
  ASoC: soc-pcm: add soc_pcm_update_symmetry()
  ASoC: soc-pcm: add soc_hw_sanity_check()
  ASoC: soc-pcm: fixup dpcm_be_dai_startup() user count
  ASoC: soc-pcm: remove unneeded !rtd->dai_link check
  ASoC: soc-pcm: share DPCM BE DAI stop operation

 include/sound/soc-dpcm.h |   8 +-
 sound/soc/soc-compress.c |   2 +-
 sound/soc/soc-pcm.c      | 243 ++++++++++++++++-----------------------
 3 files changed, 105 insertions(+), 148 deletions(-)

--
2.25.1

3 years agoASoC: mediatek: mt8173: rename local irq variable
Pierre-Louis Bossart [Thu, 11 Mar 2021 00:49:04 +0000 (18:49 -0600)]
ASoC: mediatek: mt8173: rename local irq variable

cppcheck warning:

sound/soc/mediatek/mt8173/mt8173-afe-pcm.c:929:28: style: Local
variable 'irq' shadows outer argument [shadowArgument]
  struct mtk_base_afe_irq *irq;
                           ^
sound/soc/mediatek/mt8173/mt8173-afe-pcm.c:914:47: note: Shadowed
declaration
static irqreturn_t mt8173_afe_irq_handler(int irq, void *dev_id)
                                              ^
sound/soc/mediatek/mt8173/mt8173-afe-pcm.c:929:28: note: Shadow
variable
  struct mtk_base_afe_irq *irq;
                           ^

Not a great idea to have two 'irq' variables in the same function...

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20210311004904.121205-5-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
3 years agoASoC: mediatek: mt2701: rename shadowed array
Pierre-Louis Bossart [Thu, 11 Mar 2021 00:49:03 +0000 (18:49 -0600)]
ASoC: mediatek: mt2701: rename shadowed array

cppcheck warning:

sound/soc/mediatek/mt2701/mt2701-afe-pcm.c:406:36: style: Local
variable 'memif_data' shadows outer variable [shadowVariable]
 const struct mtk_base_memif_data *memif_data;
                                   ^
sound/soc/mediatek/mt2701/mt2701-afe-pcm.c:977:41: note: Shadowed
declaration
static const struct mtk_base_memif_data memif_data[MT2701_MEMIF_NUM] = {
                                        ^
sound/soc/mediatek/mt2701/mt2701-afe-pcm.c:406:36: note: Shadow
variable
 const struct mtk_base_memif_data *memif_data;
                                   ^
sound/soc/mediatek/mt2701/mt2701-afe-pcm.c:431:36: style: Local
variable 'memif_data' shadows outer variable [shadowVariable]
 const struct mtk_base_memif_data *memif_data;
                                   ^
sound/soc/mediatek/mt2701/mt2701-afe-pcm.c:977:41: note: Shadowed
declaration
static const struct mtk_base_memif_data memif_data[MT2701_MEMIF_NUM] = {
                                        ^
sound/soc/mediatek/mt2701/mt2701-afe-pcm.c:431:36: note: Shadow
variable
 const struct mtk_base_memif_data *memif_data;
                                   ^

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20210311004904.121205-4-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
3 years agoASoC: mediatek: mt2701: align function prototype
Pierre-Louis Bossart [Thu, 11 Mar 2021 00:49:02 +0000 (18:49 -0600)]
ASoC: mediatek: mt2701: align function prototype

cppcheck warnings:

sound/soc/mediatek/mt2701/mt2701-afe-clock-ctrl.c:102:30:
style:inconclusive: Function 'mt2701_afe_enable_i2s' argument 2 names
different: declaration 'path' definition
'i2s_path'. [funcArgNamesDifferent]
     struct mt2701_i2s_path *i2s_path,
                             ^
sound/soc/mediatek/mt2701/mt2701-afe-clock-ctrl.h:21:30: note:
Function 'mt2701_afe_enable_i2s' argument 2 names different:
declaration 'path' definition 'i2s_path'.
     struct mt2701_i2s_path *path,
                             ^
sound/soc/mediatek/mt2701/mt2701-afe-clock-ctrl.c:102:30: note:
Function 'mt2701_afe_enable_i2s' argument 2 names different:
declaration 'path' definition 'i2s_path'.

     struct mt2701_i2s_path *i2s_path,
                             ^
sound/soc/mediatek/mt2701/mt2701-afe-clock-ctrl.c:128:32:
style:inconclusive: Function 'mt2701_afe_disable_i2s' argument 2 names
different: declaration 'path' definition
'i2s_path'. [funcArgNamesDifferent]
       struct mt2701_i2s_path *i2s_path,
                               ^
sound/soc/mediatek/mt2701/mt2701-afe-clock-ctrl.h:24:32: note:
Function 'mt2701_afe_disable_i2s' argument 2 names different:
declaration 'path' definition 'i2s_path'.
       struct mt2701_i2s_path *path,
                               ^
sound/soc/mediatek/mt2701/mt2701-afe-clock-ctrl.c:128:32: note:
Function 'mt2701_afe_disable_i2s' argument 2 names different:
declaration 'path' definition 'i2s_path'.
       struct mt2701_i2s_path *i2s_path,
                               ^

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20210311004904.121205-3-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
3 years agoASoC: mediatek: mtk-btcvsd: remove useless assignment
Pierre-Louis Bossart [Thu, 11 Mar 2021 00:49:01 +0000 (18:49 -0600)]
ASoC: mediatek: mtk-btcvsd: remove useless assignment

cppcheck warning:

sound/soc/mediatek/common/mtk-btcvsd.c:783:34: style: Variable 'avail'
is assigned a value that is never used. [unreadVariable]
 int written_size = count, avail = 0, cur_write_idx, write_size, cont;
                                 ^

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20210311004904.121205-2-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
3 years agoASoC: soc-pcm: share DPCM BE DAI stop operation
Kuninori Morimoto [Tue, 9 Mar 2021 01:08:17 +0000 (10:08 +0900)]
ASoC: soc-pcm: share DPCM BE DAI stop operation

soc-pcm has very similar but different DPCM BE DAI stop operation at
1) dpcm_be_dai_startup() error case rollback
2) dpcm_be_dai_startup_unwind()
3) dpcm_be_dai_shutdown()

The differences are
1) for rollback
2) Doesn't check by snd_soc_dpcm_be_can_update() (Is this bug ?)
3) Do soc_pcm_hw_free() if it was not !OPENed and !HW_FREEed,
   and call soc_pcm_close().

We can share same code by
1) hw_free is not needed. Needs last dpcm as rollback.
2) hw_free is not needed.
3) hw_free is     needed.

This patch adds new dpcm_be_dai_stop() and share these 3.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/87a6rduoam.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
3 years agoASoC: soc-pcm: remove unneeded !rtd->dai_link check
Kuninori Morimoto [Tue, 9 Mar 2021 01:08:12 +0000 (10:08 +0900)]
ASoC: soc-pcm: remove unneeded !rtd->dai_link check

rtd->dai_link is setuped at soc_new_pcm_runtime(),
thus "rtd->dai_link == NULL" is never happen.
This patch removes unneeded !rtd->dai_link check

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/87blbtuoar.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
3 years agoASoC: soc-pcm: fixup dpcm_be_dai_startup() user count
Kuninori Morimoto [Tue, 9 Mar 2021 01:08:08 +0000 (10:08 +0900)]
ASoC: soc-pcm: fixup dpcm_be_dai_startup() user count

At dpcm_be_dai_startup_unwind(), it indicates error message at (1)
if this function was called with no users.
But, it doesn't use "continue" here. Thus, users will be a
negative number at (2)

void dpcm_be_dai_startup_unwind(...)
{
...
for_each_dpcm_be(...) {
...
(1) if (be->dpcm[stream].users == 0)
dev_err(...);

(2) if (--be->dpcm[stream].users != 0)
continue;

At dpcm_be_dai_startup(), it indicates error message if
user reached to MAX USERS at (A).
But, it doesn't use "continue" here. Thus, it will be over
MAX USERS at (B).

int dpcm_be_dai_startup(...)
{
...
for_each_dpcm_be(...) {
...
(A) if (be->dpcm[stream].users == DPCM_MAX_BE_USERS)
dev_err(...);

(B) if (be->dpcm[stream].users++ != 0)
continue;

These are just bug. This patch fixup these.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/87czw9uoav.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
3 years agoASoC: soc-pcm: add soc_hw_sanity_check()
Kuninori Morimoto [Tue, 9 Mar 2021 01:08:02 +0000 (10:08 +0900)]
ASoC: soc-pcm: add soc_hw_sanity_check()

Current soc_pcm_open() is checking runtime->hw parameters, but having
such function is very helpful for reading code.

This patch adds new soc_hw_sanity_check() and checks runtime->hw
parameters there. And print its debug message there, too.

Debug message print out timing is exchanged after this patch,
but it is not a big deal, because it is for debug.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/87eegpuob1.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
3 years agoASoC: soc-pcm: add soc_pcm_update_symmetry()
Kuninori Morimoto [Tue, 9 Mar 2021 01:07:57 +0000 (10:07 +0900)]
ASoC: soc-pcm: add soc_pcm_update_symmetry()

Current soc-pcm has soc_pcm_has_symmetry() and using it as

if (soc_pcm_has_symmetry(substream))
substream->runtime->hw.info |= SNDRV_PCM_INFO_JOINT_DUPLEX;

We want to share same operation as same function.
This patch adds soc_pcm_update_symmetry() and pack above code in
one function.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/87ft15uob6.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
3 years agoASoC: soc-pcm: direct copy at snd_soc_set_runtime_hwparams()
Kuninori Morimoto [Tue, 9 Mar 2021 01:07:53 +0000 (10:07 +0900)]
ASoC: soc-pcm: direct copy at snd_soc_set_runtime_hwparams()

snd_soc_set_runtime_hwparams() is called from each driver
to initialize hw parameters,
but coping each parameters one-by-one.

Current code is not copying all parameters, but no big effect
if we do it. This patch copies all parameters by simple code.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/87h7lluoba.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
3 years agoASoC: soc-pcm: add soc_cpu/codec_dai_name() macro
Kuninori Morimoto [Tue, 9 Mar 2021 01:07:48 +0000 (10:07 +0900)]
ASoC: soc-pcm: add soc_cpu/codec_dai_name() macro

soc-pcm needs DAI name and it will be "multicpu/multicodec" if it has
many DAIs. But current code is using very verbose for it.
This patch uses macro and makes code simple.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/87im61uobf.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
3 years agoASoC: soc-pcm: check DAI activity under soc_pcm_apply_symmetry()
Kuninori Morimoto [Tue, 9 Mar 2021 01:07:42 +0000 (10:07 +0900)]
ASoC: soc-pcm: check DAI activity under soc_pcm_apply_symmetry()

soc_pcm_apply_symmetry() is used like below in all cases.

if (snd_soc_dai_active(dai)) {
err = soc_pcm_apply_symmetry(fe_substream, dai);
...
}

Because of this style, the code is deep nested.
This patch checks it under soc_pcm_apply_symmetry(), and makes code simple.

static int soc_pcm_apply_symmetry(...)
{
...
=> if (!snd_soc_dai_active(...))
return 0;
...
}

=> ret = soc_pcm_apply_symmetry();
if (ret < 0)
...

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/87k0qhuobl.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
3 years agoMerge series "ASoC: mediatek: mt8183-mt6358: support machine driver for rt1015p"...
Mark Brown [Thu, 11 Mar 2021 16:16:35 +0000 (16:16 +0000)]
Merge series "ASoC: mediatek: mt8183-mt6358: support machine driver for rt1015p" from Tzung-Bi Shih <tzungbi@google.com>:

The series reuses mt8183-mt6358-ts3a227-max98357.c for supporting
machine driver with rt1015p speaker amplifier.

The 1st patch adds document for the new proposed compatible string.

The 2nd patch changes the machine driver to support "RT1015P" codec.

Tzung-Bi Shih (2):
  ASoC: dt-bindings: mt8183: add compatible string for using rt1015p
  ASoC: mediatek: mt8183: support machine driver with rt1015p

 .../sound/mt8183-mt6358-ts3a227-max98357.txt  |  1 +
 sound/soc/mediatek/Kconfig                    |  1 +
 .../mt8183/mt8183-mt6358-ts3a227-max98357.c   | 29 +++++++++++++++++++
 3 files changed, 31 insertions(+)

--
2.31.0.rc2.261.g7f71774620-goog

3 years agoMerge series "ASoC: codecs: wolfson: remove cppcheck warnings" from Pierre-Louis...
Mark Brown [Thu, 11 Mar 2021 16:16:34 +0000 (16:16 +0000)]
Merge series "ASoC: codecs: wolfson: remove cppcheck warnings" from Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>:

There should be no functionality change, just minor fixes to make
warnings go away.

Pierre-Louis Bossart (10):
  ASoC: arizona: fix function argument
  ASoC: madera: align function prototype
  ASoC: wm2200: remove unused structure
  ASoC: wm8903: remove useless assignments
  ASoC: wm8958-dsp2: rename local 'control' arrays
  ASoC: wm8978: clarify expression
  ASoC: wm8994: align function prototype
  ASoC: wm8996: clarify expression
  ASoC: wm_adsp: simplify return value
  ASoC: wm_hubs: align function prototype

 sound/soc/codecs/arizona.h     |  2 +-
 sound/soc/codecs/madera.h      |  2 +-
 sound/soc/codecs/wm2200.c      |  7 -------
 sound/soc/codecs/wm8903.c      |  2 --
 sound/soc/codecs/wm8958-dsp2.c | 16 ++++++++--------
 sound/soc/codecs/wm8978.c      |  2 +-
 sound/soc/codecs/wm8994.h      |  2 +-
 sound/soc/codecs/wm8996.c      |  2 +-
 sound/soc/codecs/wm_adsp.c     |  2 +-
 sound/soc/codecs/wm_hubs.h     |  2 +-
 10 files changed, 15 insertions(+), 24 deletions(-)

--
2.25.1

3 years agoASoC: soc-core: fix DMI handling
Pierre-Louis Bossart [Wed, 10 Mar 2021 19:39:27 +0000 (13:39 -0600)]
ASoC: soc-core: fix DMI handling

When DMI information is not present, trying to assign the card long
name results in the following warning.

WARNING KERN tegra-audio-graph-card sound: ASoC: no DMI vendor name!

The initial solution suggested was to test if the card device is an
ACPI one. This causes a regression visible to userspace on all Intel
platforms, with UCM unable to load card profiles based on DMI
information: the card devices are not necessarily ACPI ones, e.g. when
the parent creates platform devices on Intel devices.

To fix this problem, this patch exports the existing dmi_available
variable and tests it in the ASoC core.

Fixes: c014170408bc ("ASoC: soc-core: Prevent warning if no DMI table is present")
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Takashi Iwai <tiwai@suse.de>
Acked-by: Jean Delvare <jdelvare@suse.de>
Link: https://lore.kernel.org/r/20210310193928.108850-1-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
3 years agoASoC: mediatek: mt8183: support machine driver with rt1015p
Tzung-Bi Shih [Thu, 11 Mar 2021 03:31:51 +0000 (11:31 +0800)]
ASoC: mediatek: mt8183: support machine driver with rt1015p

Supports machine driver with rt1015p ("mt8183_mt6358_ts3a227_rt1015p").
Embeds in the existing mt8183-mt6358-ts3a227-max98357.c because they
share most of the code.

Signed-off-by: Tzung-Bi Shih <tzungbi@google.com>
Link: https://lore.kernel.org/r/20210311033151.1818603-3-tzungbi@google.com
Signed-off-by: Mark Brown <broonie@kernel.org>
3 years agoASoC: dt-bindings: mt8183: add compatible string for using rt1015p
Tzung-Bi Shih [Thu, 11 Mar 2021 03:31:50 +0000 (11:31 +0800)]
ASoC: dt-bindings: mt8183: add compatible string for using rt1015p

Machines with rt1015p should use the compatible string
"mt8183-mt6358-ts3a227-rt1015p".

Signed-off-by: Tzung-Bi Shih <tzungbi@google.com>
Link: https://lore.kernel.org/r/20210311033151.1818603-2-tzungbi@google.com
Signed-off-by: Mark Brown <broonie@kernel.org>
3 years agoASoC: wm_hubs: align function prototype
Pierre-Louis Bossart [Thu, 11 Mar 2021 00:43:32 +0000 (18:43 -0600)]
ASoC: wm_hubs: align function prototype

cppcheck warnings:

sound/soc/codecs/wm_hubs.c:1194:11: style:inconclusive: Function
'wm_hubs_handle_analogue_pdata' argument 8 names different:
declaration 'micbias1_dly' definition
'micbias1_delay'. [funcArgNamesDifferent]
      int micbias1_delay, int micbias2_delay,
          ^
sound/soc/codecs/wm_hubs.h:59:11: note: Function
'wm_hubs_handle_analogue_pdata' argument 8 names different:
declaration 'micbias1_dly' definition 'micbias1_delay'.
      int micbias1_dly, int micbias2_dly,
          ^
sound/soc/codecs/wm_hubs.c:1194:11: note: Function
'wm_hubs_handle_analogue_pdata' argument 8 names different:
declaration 'micbias1_dly' definition 'micbias1_delay'.
      int micbias1_delay, int micbias2_delay,
          ^
sound/soc/codecs/wm_hubs.c:1194:31: style:inconclusive: Function
'wm_hubs_handle_analogue_pdata' argument 9 names different:
declaration 'micbias2_dly' definition
'micbias2_delay'. [funcArgNamesDifferent]
      int micbias1_delay, int micbias2_delay,
                              ^
sound/soc/codecs/wm_hubs.h:59:29: note: Function
'wm_hubs_handle_analogue_pdata' argument 9 names different:
declaration 'micbias2_dly' definition 'micbias2_delay'.
      int micbias1_dly, int micbias2_dly,
                            ^
sound/soc/codecs/wm_hubs.c:1194:31: note: Function
'wm_hubs_handle_analogue_pdata' argument 9 names different:
declaration 'micbias2_dly' definition 'micbias2_delay'.
      int micbias1_delay, int micbias2_delay,
                              ^

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Acked-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Link: https://lore.kernel.org/r/20210311004332.120901-11-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
3 years agoASoC: wm_adsp: simplify return value
Pierre-Louis Bossart [Thu, 11 Mar 2021 00:43:31 +0000 (18:43 -0600)]
ASoC: wm_adsp: simplify return value

cppcheck warning:

sound/soc/codecs/wm_adsp.c:2092:9: warning: Identical condition and
return expression 'ret', return value is always 0
[identicalConditionAfterEarlyExit]
 return ret;
        ^
sound/soc/codecs/wm_adsp.c:2070:6: note: If condition 'ret' is true,
the function will return/exit
 if (ret)
     ^
sound/soc/codecs/wm_adsp.c:2092:9: note: Returning identical
expression 'ret'
 return ret;
        ^

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Acked-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Link: https://lore.kernel.org/r/20210311004332.120901-10-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
3 years agoASoC: wm8996: clarify expression
Pierre-Louis Bossart [Thu, 11 Mar 2021 00:43:30 +0000 (18:43 -0600)]
ASoC: wm8996: clarify expression

cppcheck warning:
sound/soc/codecs/wm8996.c:2109:23: style: Clarify calculation
precedence for '/' and '?'. [clarifyCalculation]
  timeout = timeout/2 ? : 1;
                      ^

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Acked-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Link: https://lore.kernel.org/r/20210311004332.120901-9-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
3 years agoASoC: wm8994: align function prototype
Pierre-Louis Bossart [Thu, 11 Mar 2021 00:43:29 +0000 (18:43 -0600)]
ASoC: wm8994: align function prototype

cppcheck warning:

sound/soc/codecs/wm8994.c:3923:26: style:inconclusive: Function
'wm8958_mic_detect' argument 3 names different: declaration 'cb'
definition 'det_cb'. [funcArgNamesDifferent]
        wm1811_micdet_cb det_cb, void *det_cb_data,
                         ^
sound/soc/codecs/wm8994.h:53:26: note: Function 'wm8958_mic_detect'
argument 3 names different: declaration 'cb' definition 'det_cb'.
        wm1811_micdet_cb cb, void *det_cb_data,
                         ^
sound/soc/codecs/wm8994.c:3923:26: note: Function 'wm8958_mic_detect'
argument 3 names different: declaration 'cb' definition 'det_cb'.
        wm1811_micdet_cb det_cb, void *det_cb_data,
                         ^

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Acked-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Link: https://lore.kernel.org/r/20210311004332.120901-8-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
3 years agoASoC: wm8978: clarify expression
Pierre-Louis Bossart [Thu, 11 Mar 2021 00:43:28 +0000 (18:43 -0600)]
ASoC: wm8978: clarify expression

cppcheck warning:

sound/soc/codecs/wm8978.c:727:57: style: Clarify calculation
precedence for '&' and '?'. [clarifyCalculation]
 enum wm8978_sysclk_src current_clk_id = clking & 0x100 ?
                                                        ^

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Acked-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Link: https://lore.kernel.org/r/20210311004332.120901-7-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
3 years agoASoC: wm8958-dsp2: rename local 'control' arrays
Pierre-Louis Bossart [Thu, 11 Mar 2021 00:43:27 +0000 (18:43 -0600)]
ASoC: wm8958-dsp2: rename local 'control' arrays

cppcheck complains about shadowed variables:

sound/soc/codecs/wm8958-dsp2.c:926:27: style: Local variable 'control'
shadows outer variable [shadowVariable]

  struct snd_kcontrol_new control[] = {
                          ^
sound/soc/codecs/wm8958-dsp2.c:900:17: note: Shadowed declaration
 struct wm8994 *control = wm8994->wm8994;
                ^
sound/soc/codecs/wm8958-dsp2.c:926:27: note: Shadow variable
  struct snd_kcontrol_new control[] = {
                          ^
sound/soc/codecs/wm8958-dsp2.c:952:27: style: Local variable 'control'
shadows outer variable [shadowVariable]
  struct snd_kcontrol_new control[] = {
                          ^
sound/soc/codecs/wm8958-dsp2.c:900:17: note: Shadowed declaration
 struct wm8994 *control = wm8994->wm8994;
                ^
sound/soc/codecs/wm8958-dsp2.c:952:27: note: Shadow variable
  struct snd_kcontrol_new control[] = {
                          ^
sound/soc/codecs/wm8958-dsp2.c:978:27: style: Local variable 'control'
shadows outer variable [shadowVariable]
  struct snd_kcontrol_new control[] = {
                          ^
sound/soc/codecs/wm8958-dsp2.c:900:17: note: Shadowed declaration
 struct wm8994 *control = wm8994->wm8994;
                ^
sound/soc/codecs/wm8958-dsp2.c:978:27: note: Shadow variable
  struct snd_kcontrol_new control[] = {
                          ^
sound/soc/codecs/wm8958-dsp2.c:1006:27: style: Local variable
'control' shadows outer variable [shadowVariable]
  struct snd_kcontrol_new control[] = {
                          ^
sound/soc/codecs/wm8958-dsp2.c:900:17: note: Shadowed declaration
 struct wm8994 *control = wm8994->wm8994;
                ^
sound/soc/codecs/wm8958-dsp2.c:1006:27: note: Shadow variable
  struct snd_kcontrol_new control[] = {
                          ^

fix by adding a prefix related to each control.

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Acked-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Link: https://lore.kernel.org/r/20210311004332.120901-6-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
3 years agoASoC: wm8903: remove useless assignments
Pierre-Louis Bossart [Thu, 11 Mar 2021 00:43:26 +0000 (18:43 -0600)]
ASoC: wm8903: remove useless assignments

cppcheck warnings:

sound/soc/codecs/wm8903.c:1552:11: style: Variable 'best_val' is
assigned a value that is never used. [unreadVariable]
 best_val = ((clk_sys * 10) / bclk_divs[0].ratio) - bclk;
          ^
sound/soc/codecs/wm8903.c:1559:12: style: Variable 'best_val' is
assigned a value that is never used. [unreadVariable]
  best_val = cur_val;
           ^

Indeed what matters in the code is the blck_div, the best_val is
assigned but never tested or used.

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Acked-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Link: https://lore.kernel.org/r/20210311004332.120901-5-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
3 years agoASoC: wm2200: remove unused structure
Pierre-Louis Bossart [Thu, 11 Mar 2021 00:43:25 +0000 (18:43 -0600)]
ASoC: wm2200: remove unused structure

cppcheck complains about some members not being used, but it's really
the entire structure that is never used anywhere.

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Acked-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Link: https://lore.kernel.org/r/20210311004332.120901-4-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
3 years agoASoC: madera: align function prototype
Pierre-Louis Bossart [Thu, 11 Mar 2021 00:43:24 +0000 (18:43 -0600)]
ASoC: madera: align function prototype

cppcheck warning:

sound/soc/codecs/madera.c:3372:51: style:inconclusive: Function
'madera_init_dai' argument 2 names different: declaration 'dai'
definition 'id'. [funcArgNamesDifferent]
int madera_init_dai(struct madera_priv *priv, int id)
                                                  ^
sound/soc/codecs/madera.h:433:51: note: Function 'madera_init_dai'
argument 2 names different: declaration 'dai' definition 'id'.
int madera_init_dai(struct madera_priv *priv, int dai);
                                                  ^
sound/soc/codecs/madera.c:3372:51: note: Function 'madera_init_dai'
argument 2 names different: declaration 'dai' definition 'id'.
int madera_init_dai(struct madera_priv *priv, int id)
                                                  ^

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Acked-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Link: https://lore.kernel.org/r/20210311004332.120901-3-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
3 years agoASoC: arizona: fix function argument
Pierre-Louis Bossart [Thu, 11 Mar 2021 00:43:23 +0000 (18:43 -0600)]
ASoC: arizona: fix function argument

Cppcheck warning:

sound/soc/codecs/arizona.c:2042:53: style:inconclusive: Function
'arizona_init_dai' argument 2 names different: declaration 'dai'
definition 'id'. [funcArgNamesDifferent]
int arizona_init_dai(struct arizona_priv *priv, int id)
                                                    ^
sound/soc/codecs/arizona.h:320:53: note: Function 'arizona_init_dai'
argument 2 names different: declaration 'dai' definition 'id'.
int arizona_init_dai(struct arizona_priv *priv, int dai);
                                                    ^
sound/soc/codecs/arizona.c:2042:53: note: Function 'arizona_init_dai'
argument 2 names different: declaration 'dai' definition 'id'.
int arizona_init_dai(struct arizona_priv *priv, int id)
                                                    ^

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Acked-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Link: https://lore.kernel.org/r/20210311004332.120901-2-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
3 years agoMerge series "Report jack and button detection + Capture Support" from Lucas Tanure...
Mark Brown [Tue, 9 Mar 2021 19:04:34 +0000 (19:04 +0000)]
Merge series "Report jack and button detection + Capture Support" from Lucas Tanure <tanureal@opensource.cirrus.com>:

Hi All,

Here is a patch series for reporting to user space jack and button events and
add the support for Capture. With some cleanups and fixes along the way.

Regards,

Lucas Tanure

Lucas Tanure (12):
  ASoC: cs42l42: Fix Bitclock polarity inversion
  ASoC: cs42l42: Fix channel width support
  ASoC: cs42l42: Fix mixer volume control
  ASoC: cs42l42: Don't enable/disable regulator at Bias Level
  ASoC: cs42l42: Always wait at least 3ms after reset
  ASoC: cs42l42: Remove power if the driver is being removed
  ASoC: cs42l42: Disable regulators if probe fails
  ASoC: cs42l42: Provide finer control on playback path
  ASoC: cs42l42: Set clock source for both ways of stream
  ASoC: cs42l42: Add Capture Support
  ASoC: cs42l42: Report jack and button detection
  ASoC: cs42l42: Use bclk from hw_params if set_sysclk was not called

Richard Fitzgerald (3):
  ASoC: cs42l42: Wait at least 150us after writing SCLK_PRESENT
  ASoC: cs42l42: Only start PLL if it is needed
  ASoC: cs42l42: Wait for PLL to lock before switching to it

 sound/soc/codecs/cs42l42.c | 435 +++++++++++++++++++++----------------
 sound/soc/codecs/cs42l42.h |  41 +++-
 2 files changed, 282 insertions(+), 194 deletions(-)

--
2.30.1

3 years agoMerge series "Add I2S-MCC support for Microchip's SAMA7G5" from Codrin Ciubotariu...
Mark Brown [Tue, 9 Mar 2021 19:04:33 +0000 (19:04 +0000)]
Merge series "Add I2S-MCC support for Microchip's SAMA7G5" from Codrin Ciubotariu <codrin.ciubotariu@microchip.com>:

SAMA7G5 includes an updated version of I2S-MCC, found previously on
SAM9X60. This controller includes 8 data pins, 4 for playback and 4 for
capture. For I2S and LEFT_J formats, these pins can be used to
send/receive up to 8 audio channels. For DSP_A, with TDM, any pins pair
(DIN/DOUT) from these 4 can be selected to send/receive data. This
version also includes 2 FIFOs (send and receive).
This patch set starts by moving the driver's bindings to yaml and
continues with adding a new compatible for the SAMA7G5 variant, followed
by the changes needed for I2S/LEFT_J support, TDM pin pair selection and
FIFO support, exclusively for SAMA7G5.

Changes in v2:
- moved DT binding conversion patch from the beginning to the end of the
  patch serieses
- patches that update the DT binding are modified to change .txt file
  instead of .yaml

Codrin Ciubotariu (7):
  dt-bindings: mchp,i2s-mcc: Add SAMA7G5 to binding
  ASoC: mchp-i2s-mcc: Add compatible for SAMA7G5
  ASoC: mchp-i2s-mcc: Add multi-channel support for I2S and LEFT_J
    formats
  dt-bindings: mchp,i2s-mcc: Add property to specify pin pair for TDM
  ASoC: mchp-i2s-mcc: Add support to select TDM pins
  ASoC: mchp-i2s-mcc: Add FIFOs support
  ASoC: convert Microchip I2SMCC binding to yaml

 .../bindings/sound/mchp,i2s-mcc.yaml          | 108 ++++++++++++
 .../bindings/sound/mchp-i2s-mcc.txt           |  43 -----
 sound/soc/atmel/Kconfig                       |   3 +
 sound/soc/atmel/mchp-i2s-mcc.c                | 161 +++++++++++++++---
 4 files changed, 252 insertions(+), 63 deletions(-)
 create mode 100644 Documentation/devicetree/bindings/sound/mchp,i2s-mcc.yaml
 delete mode 100644 Documentation/devicetree/bindings/sound/mchp-i2s-mcc.txt

--
2.27.0

3 years agoASoC: rt5682: add delay time of workqueue to control next IRQ event
Shuming Fan [Tue, 9 Mar 2021 08:58:27 +0000 (16:58 +0800)]
ASoC: rt5682: add delay time of workqueue to control next IRQ event

This patch keeps the delay time (50 ms) for jack detection and zero delay time for the button press.
This patch improves the reaction of the button press.

Signed-off-by: Shuming Fan <shumingf@realtek.com>
Link: https://lore.kernel.org/r/20210309085827.32032-1-shumingf@realtek.com
Tested-by Curtis Malainey <cujomalainey@chromium.org>
Signed-off-by: Mark Brown <broonie@kernel.org>
3 years agoASoC: rt715-sdca: Remove unused including <linux/version.h>
Wei Yongjun [Tue, 9 Mar 2021 13:14:55 +0000 (13:14 +0000)]
ASoC: rt715-sdca: Remove unused including <linux/version.h>

Remove including <linux/version.h> that don't need it.

Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
Link: https://lore.kernel.org/r/20210309131455.1883120-1-weiyongjun1@huawei.com
Signed-off-by: Mark Brown <broonie@kernel.org>
3 years agoASoC: rt715-sdca: Fix return value check in rt715_sdca_sdw_probe()
Wei Yongjun [Tue, 9 Mar 2021 13:14:58 +0000 (13:14 +0000)]
ASoC: rt715-sdca: Fix return value check in rt715_sdca_sdw_probe()

In case of error, the function devm_regmap_init_sdw_mbq() and
devm_regmap_init_sdw() returns ERR_PTR() not NULL. The NULL test
in the return value check should be replaced with IS_ERR().

Fixes: 393c52d2d109 ("ASoC: rt715-sdca: Add RT715 sdca vendor-specific driver")
Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
Link: https://lore.kernel.org/r/20210309131458.1884899-1-weiyongjun1@huawei.com
Signed-off-by: Mark Brown <broonie@kernel.org>
3 years agoASoC: cs42l42: Wait for PLL to lock before switching to it
Richard Fitzgerald [Sat, 6 Mar 2021 18:55:53 +0000 (18:55 +0000)]
ASoC: cs42l42: Wait for PLL to lock before switching to it

The PLL should have locked before using it to supply MCLK.

Signed-off-by: Richard Fitzgerald <rf@opensource.cirrus.com>
Signed-off-by: Lucas Tanure <tanureal@opensource.cirrus.com>
Link: https://lore.kernel.org/r/20210306185553.62053-16-tanureal@opensource.cirrus.com
Signed-off-by: Mark Brown <broonie@kernel.org>
3 years agoASoC: cs42l42: Only start PLL if it is needed
Richard Fitzgerald [Sat, 6 Mar 2021 18:55:52 +0000 (18:55 +0000)]
ASoC: cs42l42: Only start PLL if it is needed

The PLL is only needed for sclk < 11289600 Hz and cs42l42_pll_config()
will not configure it for higher rates. So it must only be enabled
when it is needed.

Signed-off-by: Richard Fitzgerald <rf@opensource.cirrus.com>
Signed-off-by: Lucas Tanure <tanureal@opensource.cirrus.com>
Link: https://lore.kernel.org/r/20210306185553.62053-15-tanureal@opensource.cirrus.com
Signed-off-by: Mark Brown <broonie@kernel.org>
3 years agoASoC: cs42l42: Wait at least 150us after writing SCLK_PRESENT
Richard Fitzgerald [Sat, 6 Mar 2021 18:55:51 +0000 (18:55 +0000)]
ASoC: cs42l42: Wait at least 150us after writing SCLK_PRESENT

There must be a delay of at least 150us after writing SCLK_PRESENT
before issuing another I2C write.

This is done using struct reg_sequence because it can specify a delay
after the write and the whole sequence is written atomically.

Signed-off-by: Richard Fitzgerald <rf@opensource.cirrus.com>
Signed-off-by: Lucas Tanure <tanureal@opensource.cirrus.com>
Link: https://lore.kernel.org/r/20210306185553.62053-14-tanureal@opensource.cirrus.com
Signed-off-by: Mark Brown <broonie@kernel.org>
3 years agoASoC: cs42l42: Use bclk from hw_params if set_sysclk was not called
Lucas Tanure [Sat, 6 Mar 2021 18:55:50 +0000 (18:55 +0000)]
ASoC: cs42l42: Use bclk from hw_params if set_sysclk was not called

Add support for reading the source clock from snd_soc_params_to_bclk
so the machine driver is not required to call cs42l42_set_sysclk

Signed-off-by: Lucas Tanure <tanureal@opensource.cirrus.com>
Link: https://lore.kernel.org/r/20210306185553.62053-13-tanureal@opensource.cirrus.com
Signed-off-by: Mark Brown <broonie@kernel.org>
3 years agoASoC: cs42l42: Report jack and button detection
Lucas Tanure [Sat, 6 Mar 2021 18:55:49 +0000 (18:55 +0000)]
ASoC: cs42l42: Report jack and button detection

Report the Jack events to the user space through ALSA.
Also moves request_threaded_irq() to component_probe so it don't get
interrupts before the initialization the struct snd_soc_jack.

Signed-off-by: Lucas Tanure <tanureal@opensource.cirrus.com>
Link: https://lore.kernel.org/r/20210306185553.62053-12-tanureal@opensource.cirrus.com
Signed-off-by: Mark Brown <broonie@kernel.org>
3 years agoASoC: cs42l42: Add Capture Support
Lucas Tanure [Sat, 6 Mar 2021 18:55:48 +0000 (18:55 +0000)]
ASoC: cs42l42: Add Capture Support

Add support for capture path on headseat pins

Signed-off-by: Lucas Tanure <tanureal@opensource.cirrus.com>
Link: https://lore.kernel.org/r/20210306185553.62053-11-tanureal@opensource.cirrus.com
Signed-off-by: Mark Brown <broonie@kernel.org>
3 years agoASoC: cs42l42: Set clock source for both ways of stream
Lucas Tanure [Sat, 6 Mar 2021 18:55:47 +0000 (18:55 +0000)]
ASoC: cs42l42: Set clock source for both ways of stream

Move the enable/disable of clocks to cs42l42_mute_stream so the record
path also get clocks.

Signed-off-by: Lucas Tanure <tanureal@opensource.cirrus.com>
Link: https://lore.kernel.org/r/20210306185553.62053-10-tanureal@opensource.cirrus.com
Signed-off-by: Mark Brown <broonie@kernel.org>
3 years agoASoC: cs42l42: Provide finer control on playback path
Lucas Tanure [Sat, 6 Mar 2021 18:55:46 +0000 (18:55 +0000)]
ASoC: cs42l42: Provide finer control on playback path

Removing cs42l42_hpdrv_evt that enables the entire chain and replace by
a set of widgets that can better define the codec

Signed-off-by: Lucas Tanure <tanureal@opensource.cirrus.com>
Link: https://lore.kernel.org/r/20210306185553.62053-9-tanureal@opensource.cirrus.com
Signed-off-by: Mark Brown <broonie@kernel.org>
3 years agoASoC: cs42l42: Disable regulators if probe fails
Lucas Tanure [Sat, 6 Mar 2021 18:55:45 +0000 (18:55 +0000)]
ASoC: cs42l42: Disable regulators if probe fails

In case of cs42l42_i2c_probe() fail, the regulators were left enabled.

Signed-off-by: Lucas Tanure <tanureal@opensource.cirrus.com>
Link: https://lore.kernel.org/r/20210306185553.62053-8-tanureal@opensource.cirrus.com
Signed-off-by: Mark Brown <broonie@kernel.org>
3 years agoASoC: cs42l42: Remove power if the driver is being removed
Lucas Tanure [Sat, 6 Mar 2021 18:55:44 +0000 (18:55 +0000)]
ASoC: cs42l42: Remove power if the driver is being removed

Ensure the power supplies are turned off when removing the driver

Signed-off-by: Lucas Tanure <tanureal@opensource.cirrus.com>
Link: https://lore.kernel.org/r/20210306185553.62053-7-tanureal@opensource.cirrus.com
Signed-off-by: Mark Brown <broonie@kernel.org>
3 years agoASoC: convert Microchip I2SMCC binding to yaml
Codrin Ciubotariu [Mon, 1 Mar 2021 17:09:05 +0000 (19:09 +0200)]
ASoC: convert Microchip I2SMCC binding to yaml

This patch converts the Microchip I2SMCC bindings to DT schema format
using json-schema.

Signed-off-by: Codrin Ciubotariu <codrin.ciubotariu@microchip.com>
Reviewed-by: Rob Herring <robh@kernel.org>
Link: https://lore.kernel.org/r/20210301170905.835091-8-codrin.ciubotariu@microchip.com
Signed-off-by: Mark Brown <broonie@kernel.org>
3 years agoMerge series "Report jack and button detection + Capture Support" from Lucas Tanure...
Mark Brown [Mon, 8 Mar 2021 16:41:22 +0000 (16:41 +0000)]
Merge series "Report jack and button detection + Capture Support" from Lucas Tanure <tanureal@opensource.cirrus.com>:

Hi All,

Here is a patch series for reporting to user space jack and button events and
add the support for Capture. With some cleanups and fixes along the way.

Regards,

Lucas Tanure

Lucas Tanure (12):
  ASoC: cs42l42: Fix Bitclock polarity inversion
  ASoC: cs42l42: Fix channel width support
  ASoC: cs42l42: Fix mixer volume control
  ASoC: cs42l42: Don't enable/disable regulator at Bias Level
  ASoC: cs42l42: Always wait at least 3ms after reset
  ASoC: cs42l42: Remove power if the driver is being removed
  ASoC: cs42l42: Disable regulators if probe fails
  ASoC: cs42l42: Provide finer control on playback path
  ASoC: cs42l42: Set clock source for both ways of stream
  ASoC: cs42l42: Add Capture Support
  ASoC: cs42l42: Report jack and button detection
  ASoC: cs42l42: Use bclk from hw_params if set_sysclk was not called

Richard Fitzgerald (3):
  ASoC: cs42l42: Wait at least 150us after writing SCLK_PRESENT
  ASoC: cs42l42: Only start PLL if it is needed
  ASoC: cs42l42: Wait for PLL to lock before switching to it

 sound/soc/codecs/cs42l42.c | 437 +++++++++++++++++++++----------------
 sound/soc/codecs/cs42l42.h |  41 +++-
 2 files changed, 282 insertions(+), 196 deletions(-)

--
2.30.1

3 years agoASoC: rt711-sdca: Add RT711 SDCA vendor-specific driver
Shuming Fan [Tue, 2 Mar 2021 09:15:06 +0000 (17:15 +0800)]
ASoC: rt711-sdca: Add RT711 SDCA vendor-specific driver

This is the initial codec driver for rt711 SDCA version.

Signed-off-by: Shuming Fan <shumingf@realtek.com>
Link: https://lore.kernel.org/r/20210302091506.18745-1-shumingf@realtek.com
Signed-off-by: Mark Brown <broonie@kernel.org>
3 years agoASoC: rt5645: The ALC3270 variant does not have a headset-mic pin
Hans de Goede [Sat, 6 Mar 2021 23:02:23 +0000 (00:02 +0100)]
ASoC: rt5645: The ALC3270 variant does not have a headset-mic pin

The Asus T100HA and T101HA 2-in-1s use a rt5645 family codec and always
report that a headset (rather then headphones) are plugged in even when
regular headphones are plugged in.

And when a headset is used, then the headset-microphone does not work.
According to RealTek the ALC3270 variant used in these devices does not
support headsets only headphones.

Since the ALC3270 is a budget version of the regular ALC5645 codec,
I assume that it is using a package with less pins and the headset-mic
pin is simply not connected.

Detect if the codec is an ALC3270 based on the ACPI HID and if it is
an ALC3270 then always report SND_JACK_MICROPHONE as false, so that
userspace will not try to use the not-connected headset-mic.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Link: https://lore.kernel.org/r/20210306230223.516566-2-hdegoede@redhat.com
Signed-off-by: Mark Brown <broonie@kernel.org>
3 years agoASoC: rt5645: Move rt5645_platform_data to sound/soc/codecs/rt5645.c
Hans de Goede [Sat, 6 Mar 2021 23:02:22 +0000 (00:02 +0100)]
ASoC: rt5645: Move rt5645_platform_data to sound/soc/codecs/rt5645.c

sound/soc/codecs/rt5645.c is the only user of the rt5645_platform_data,
move its definition to sound/soc/codecs/rt5645.c and remove the now
empty include/sound/rt5645.h file.

Note since the DMI quirk mechanism uses pointers to the
rt5645_platform_data struct we can NOT simply add its members to
the rt5645_priv struct and completely remove the struct.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Link: https://lore.kernel.org/r/20210306230223.516566-1-hdegoede@redhat.com
Signed-off-by: Mark Brown <broonie@kernel.org>
3 years agoASoC: codecs/jz4770: Remove superfluous error message
Tang Bin [Sun, 7 Mar 2021 07:21:33 +0000 (15:21 +0800)]
ASoC: codecs/jz4770: Remove superfluous error message

The function devm_platform_ioremap_resource has already contained
error message if failed, so remove superfluous dev_err here.

Signed-off-by: Zhang Shengju <zhangshengju@cmss.chinamobile.com>
Signed-off-by: Tang Bin <tangbin@cmss.chinamobile.com>
Acked-by: Paul Cercueil <paul@crapouillou.net>
Link: https://lore.kernel.org/r/20210307072133.10832-1-tangbin@cmss.chinamobile.com
Signed-off-by: Mark Brown <broonie@kernel.org>
3 years agoASoC: rt715-sdca: Add RT715 sdca vendor-specific driver
Jack Yu [Tue, 2 Mar 2021 10:30:42 +0000 (18:30 +0800)]
ASoC: rt715-sdca: Add RT715 sdca vendor-specific driver

This is initial sdca version of codec driver for rt715.

Signed-off-by: Jack Yu <jack.yu@realtek.com>
Link: https://lore.kernel.org/r/20210302103042.19528-1-jack.yu@realtek.com
Signed-off-by: Mark Brown <broonie@kernel.org>
3 years agoASoC: fsl_xcvr: Use devm_platform_ioremap_resource_byname() to simplify code
Tang Bin [Tue, 2 Mar 2021 12:50:02 +0000 (20:50 +0800)]
ASoC: fsl_xcvr: Use devm_platform_ioremap_resource_byname() to simplify code

In this function, devm_platform_ioremap_resource_byname() should be
suitable to simplify code.

Signed-off-by: Tang Bin <tangbin@cmss.chinamobile.com>
Link: https://lore.kernel.org/r/20210302125002.23900-1-tangbin@cmss.chinamobile.com
Signed-off-by: Mark Brown <broonie@kernel.org>
3 years agoASoC: wm8962: Relax bit clock divider searching
Shengjiu Wang [Mon, 8 Mar 2021 02:34:37 +0000 (10:34 +0800)]
ASoC: wm8962: Relax bit clock divider searching

With S20_3LE format case, the sysclk = rate * 384,
the bclk = rate * 20 * 2, there is no proper bclk divider
for 384 / 40, because current condition needs exact match.
So driver fails to configure the clocking:

wm8962 3-001a: Unsupported BCLK ratio 9

Fix this by relaxing bitclk divider searching, so that when
no exact value can be derived from sysclk pick the closest
value greater than expected bitclk.

Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com>
Reviewed-by: Daniel Baluta <daniel.baluta@nxp.com>
Acked-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Link: https://lore.kernel.org/r/1615170877-25918-1-git-send-email-shengjiu.wang@nxp.com
Signed-off-by: Mark Brown <broonie@kernel.org>
3 years agoMerge series "ASoC: remove more make W=1 warnings" from Pierre-Louis Bossart <pierre...
Mark Brown [Thu, 4 Mar 2021 00:52:07 +0000 (00:52 +0000)]
Merge series "ASoC: remove more make W=1 warnings" from Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>:

These warnings get in the way of automation/CI, let's remove them.

Pierre-Louis Bossart (9):
  ASoC: cs4270: fix kernel-doc
  ASoC: jz4760: fix set but not used warning
  ASoC: rt5631: fix kernel-doc warning
  ASoC: sigmadsp-regmap: fix kernel-doc warning
  ASoC: amd: renoir: remove invalid kernel-doc comment
  ASoC: fsl: fsl_ssi: fix kernel-doc warning
  ASoC: fsl: fsl_easrc: fix kernel-doc warning
  ASoC: Intel: bytcr_wm5102: remove unused static variable
  ASoC: qcom: q6dsp: fix kernel-doc warning

 sound/soc/amd/renoir/rn-pci-acp3x.c   | 2 +-
 sound/soc/codecs/cs4270.c             | 1 +
 sound/soc/codecs/jz4760.c             | 4 ++--
 sound/soc/codecs/rt5631.c             | 2 +-
 sound/soc/codecs/sigmadsp-regmap.c    | 2 +-
 sound/soc/fsl/fsl_easrc.c             | 2 +-
 sound/soc/fsl/fsl_ssi.c               | 2 +-
 sound/soc/intel/boards/bytcr_wm5102.c | 8 --------
 sound/soc/qcom/qdsp6/q6afe.c          | 2 +-
 9 files changed, 9 insertions(+), 16 deletions(-)

--
2.25.1

3 years agoMerge series "ASoC: realtek: fix cppcheck warnings" from Pierre-Louis Bossart <pierre...
Mark Brown [Thu, 4 Mar 2021 00:52:05 +0000 (00:52 +0000)]
Merge series "ASoC: realtek: fix cppcheck warnings" from Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>:

Lots of trivial issues that make cppcheck too verbose. There shouldn't
be any functionality change with this patchset.

Pierre-Louis Bossart (24):
  ASoC: rt1011: use logical OR
  ASoC: rt1011: remove redundant test
  ASoC: rt1011: clarify expression
  ASoC: rt1015: clarify expression
  ASoC: rt1016: clarify expression
  ASoC: rt1305: clarify expression
  ASoC: rt1308: clarify expression
  ASoC: rt5640: clarify expression
  ASoC: rt5645: use logical OR
  ASoC: rt5645: clarify expression
  ASoC: rt5651: clarify expression
  ASoC: rt5651: remove useless assignment
  ASoC: rt5659: clarify expression
  ASoC: rt5660: clarify expression
  ASoC: rt5663: clarify expression
  ASoC: rt5665: clarify expression
  ASoC: rt5668: clarify expression
  ASoC: rt5668: remove useless assignments
  ASoC: rt5670: clarify expression
  ASoC: rt5677: clarify expression
  ASoC: rt5677: remove useless assignment
  ASoC: rt5682: clarify expression
  ASoC: rt5682: remove useless assignments
  ASoC: rt5682: remove useless initialization

 sound/soc/codecs/rt1011.c | 47 ++++++++++++++++++---------------------
 sound/soc/codecs/rt1015.c |  5 +++--
 sound/soc/codecs/rt1016.c |  7 +++---
 sound/soc/codecs/rt1305.c |  4 ++--
 sound/soc/codecs/rt1308.c |  8 +++----
 sound/soc/codecs/rt5640.c |  6 ++---
 sound/soc/codecs/rt5645.c |  6 ++---
 sound/soc/codecs/rt5651.c |  6 ++---
 sound/soc/codecs/rt5659.c |  4 ++--
 sound/soc/codecs/rt5660.c |  4 ++--
 sound/soc/codecs/rt5663.c |  4 ++--
 sound/soc/codecs/rt5665.c |  4 ++--
 sound/soc/codecs/rt5668.c |  8 +++----
 sound/soc/codecs/rt5670.c |  4 ++--
 sound/soc/codecs/rt5677.c |  6 ++---
 sound/soc/codecs/rt5682.c | 12 +++++-----
 16 files changed, 67 insertions(+), 68 deletions(-)

--
2.25.1

3 years agoASoC: fsl: fsl_easrc: Fix uninitialized variable st2_mem_alloc
Colin Ian King [Wed, 3 Mar 2021 09:18:35 +0000 (09:18 +0000)]
ASoC: fsl: fsl_easrc: Fix uninitialized variable st2_mem_alloc

A previous cleanup commit removed the ininitialization of st2_mem_alloc.
Fix this by restoring the original behaviour by initializing it to zero.

Addresses-Coverity: ("Uninitialized scalar variable")
Fixes: e80382fe721f ("ASoC: fsl: fsl_easrc: remove useless assignments")
Signed-off-by: Colin Ian King <colin.king@canonical.com>
Link: https://lore.kernel.org/r/20210303091835.5024-1-colin.king@canonical.com
Signed-off-by: Mark Brown <broonie@kernel.org>
3 years agoASoC: codecs: fix platform_no_drv_owner.cocci warnings
Yang Li [Wed, 3 Mar 2021 09:08:01 +0000 (17:08 +0800)]
ASoC: codecs: fix platform_no_drv_owner.cocci warnings

./sound/soc/codecs/lpass-rx-macro.c:3588:3-8: No need to set .owner here.
The core will do it.

Remove .owner field if calls are used which set it automatically

Reported-by: Abaci Robot <abaci@linux.alibaba.com>
Signed-off-by: Yang Li <yang.lee@linux.alibaba.com>
Link: https://lore.kernel.org/r/1614762481-102466-1-git-send-email-yang.lee@linux.alibaba.com
Signed-off-by: Mark Brown <broonie@kernel.org>
3 years agoASoC: rt1316: Fix return value check in rt1316_sdw_probe()
Wei Yongjun [Wed, 3 Mar 2021 06:40:41 +0000 (06:40 +0000)]
ASoC: rt1316: Fix return value check in rt1316_sdw_probe()

In case of error, the function devm_regmap_init_sdw() returns ERR_PTR()
and never returns NULL. The NULL test in the return value check should
be replaced with IS_ERR().

Fixes: a262057df513 ("ASoC: rt1316: Add RT1316 SDCA vendor-specific driver")
Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
Link: https://lore.kernel.org/r/20210303064041.898281-1-weiyongjun1@huawei.com
Signed-off-by: Mark Brown <broonie@kernel.org>
3 years agoASoC: sgtl5000: Fix identation of .driver elements
Fabio Estevam [Tue, 2 Mar 2021 14:28:17 +0000 (11:28 -0300)]
ASoC: sgtl5000: Fix identation of .driver elements

The .driver elements are not correctly idented.

Fix the identation of the .driver elements.

Signed-off-by: Fabio Estevam <festevam@gmail.com>
Link: https://lore.kernel.org/r/20210302142817.2141923-1-festevam@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
3 years agoASoC: codec: Omit superfluous error message in jz4760_codec_probe()
Tang Bin [Tue, 2 Mar 2021 13:56:30 +0000 (21:56 +0800)]
ASoC: codec: Omit superfluous error message in jz4760_codec_probe()

The function devm_platform_ioremap_resource has already contained
error message, so remove the redundant dev_err here.

Signed-off-by: Tang Bin <tangbin@cmss.chinamobile.com>
Acked-by: Paul Cercueil <paul@crapouillou.net>
Link: https://lore.kernel.org/r/20210302135630.11456-1-tangbin@cmss.chinamobile.com
Signed-off-by: Mark Brown <broonie@kernel.org>
3 years agoASoC: qcom: q6dsp: fix kernel-doc warning
Pierre-Louis Bossart [Tue, 2 Mar 2021 20:59:26 +0000 (14:59 -0600)]
ASoC: qcom: q6dsp: fix kernel-doc warning

make W=1 warning:

sound/soc/qcom/qdsp6/q6afe.c:1460: warning: expecting prototype for
q6afe_dam_port_prepare(). Prototype was for
q6afe_cdc_dma_port_prepare() instead

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20210302205926.49063-10-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
3 years agoASoC: Intel: bytcr_wm5102: remove unused static variable
Pierre-Louis Bossart [Tue, 2 Mar 2021 20:59:25 +0000 (14:59 -0600)]
ASoC: Intel: bytcr_wm5102: remove unused static variable

make W=1 warning:

sound/soc/intel/boards/bytcr_wm5102.c:216:40: error:
‘byt_wm5102_dai_params’ defined but not used
[-Werror=unused-const-variable=]
  216 | static const struct snd_soc_pcm_stream byt_wm5102_dai_params = {
      |                                        ^~~~~~~~~~~~~~~~~~~~~

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20210302205926.49063-9-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
3 years agoASoC: fsl: fsl_easrc: fix kernel-doc warning
Pierre-Louis Bossart [Tue, 2 Mar 2021 20:59:24 +0000 (14:59 -0600)]
ASoC: fsl: fsl_easrc: fix kernel-doc warning

make W=1 warning:

sound/soc/fsl/fsl_easrc.c:383: warning: wrong kernel-doc identifier on
line:
 *  Scale filter coefficients (64 bits float)

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20210302205926.49063-8-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
3 years agoASoC: fsl: fsl_ssi: fix kernel-doc warning
Pierre-Louis Bossart [Tue, 2 Mar 2021 20:59:23 +0000 (14:59 -0600)]
ASoC: fsl: fsl_ssi: fix kernel-doc warning

make W=1 warning:

sound/soc/fsl/fsl_ssi.c:371: warning: expecting prototype for
fsl_ssi_irq(). Prototype was for fsl_ssi_isr() instead

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20210302205926.49063-7-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
3 years agoASoC: amd: renoir: remove invalid kernel-doc comment
Pierre-Louis Bossart [Tue, 2 Mar 2021 20:59:22 +0000 (14:59 -0600)]
ASoC: amd: renoir: remove invalid kernel-doc comment

make W=1 warning:

sound/soc/amd/renoir/rn-pci-acp3x.c:24: warning: wrong kernel-doc
identifier on line:
 * dmic_acpi_check = -1 - Use ACPI/DMI method to detect the DMIC
   hardware presence at runtime

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20210302205926.49063-6-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
3 years agoASoC: sigmadsp-regmap: fix kernel-doc warning
Pierre-Louis Bossart [Tue, 2 Mar 2021 20:59:21 +0000 (14:59 -0600)]
ASoC: sigmadsp-regmap: fix kernel-doc warning

make W=1 warning:

sound/soc/codecs/sigmadsp-regmap.c:42: warning: expecting prototype
for devm_sigmadsp_init_i2c(). Prototype was for
devm_sigmadsp_init_regmap() instead

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20210302205926.49063-5-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
3 years agoASoC: rt5631: fix kernel-doc warning
Pierre-Louis Bossart [Tue, 2 Mar 2021 20:59:20 +0000 (14:59 -0600)]
ASoC: rt5631: fix kernel-doc warning

make W=1 warning:

sound/soc/codecs/rt5631.c:446: warning: expecting prototype for
onebit_depop_power_stage(). Prototype was for depop_seq_power_stage()
instead

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20210302205926.49063-4-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
3 years agoASoC: jz4760: fix set but not used warning
Pierre-Louis Bossart [Tue, 2 Mar 2021 20:59:19 +0000 (14:59 -0600)]
ASoC: jz4760: fix set but not used warning

make W=1 warning:

sound/soc/codecs/jz4760.c: In function ‘jz4760_codec_startup’:
sound/soc/codecs/jz4760.c:201:6: error: variable ‘ret’ set but not
used [-Werror=unused-but-set-variable]
  201 |  int ret;
      |      ^~~

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20210302205926.49063-3-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
3 years agoASoC: cs4270: fix kernel-doc
Pierre-Louis Bossart [Tue, 2 Mar 2021 20:59:18 +0000 (14:59 -0600)]
ASoC: cs4270: fix kernel-doc

Add missing parameter (which happens to be ignored)

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20210302205926.49063-2-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
3 years agoASoC: rt5682: remove useless initialization
Pierre-Louis Bossart [Tue, 2 Mar 2021 21:25:27 +0000 (15:25 -0600)]
ASoC: rt5682: remove useless initialization

cppcheck complains about a possible null pointer dereference, but the
problem is rather an useless initialization before walking through a
list.

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20210302212527.55158-25-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
3 years agoASoC: rt5682: remove useless assignments
Pierre-Louis Bossart [Tue, 2 Mar 2021 21:25:26 +0000 (15:25 -0600)]
ASoC: rt5682: remove useless assignments

cppcheck warnings:

sound/soc/codecs/rt5682.c:1234:6: style: Redundant initialization for
'idx'. The initialized value is overwritten before it is
read. [redundantInitialization]
 idx = rt5682_div_sel(rt5682, dmic_clk_rate, div, ARRAY_SIZE(div));
     ^
sound/soc/codecs/rt5682.c:1228:10: note: idx is initialized
 int idx = -EINVAL, dmic_clk_rate = 3072000;
         ^
sound/soc/codecs/rt5682.c:1234:6: note: idx is overwritten
 idx = rt5682_div_sel(rt5682, dmic_clk_rate, div, ARRAY_SIZE(div));
     ^

sound/soc/codecs/rt5682.c:1263:6: style: Redundant initialization for
'idx'. The initialized value is overwritten before it is
read. [redundantInitialization]
 idx = rt5682_div_sel(rt5682, ref, div_f, ARRAY_SIZE(div_f));
     ^
sound/soc/codecs/rt5682.c:1248:25: note: idx is initialized
 int ref, val, reg, idx = -EINVAL;
                        ^
sound/soc/codecs/rt5682.c:1263:6: note: idx is overwritten
 idx = rt5682_div_sel(rt5682, ref, div_f, ARRAY_SIZE(div_f));
     ^

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20210302212527.55158-24-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
3 years agoASoC: rt5682: clarify expression
Pierre-Louis Bossart [Tue, 2 Mar 2021 21:25:25 +0000 (15:25 -0600)]
ASoC: rt5682: clarify expression

cppcheck warning:

sound/soc/codecs/rt5682.c:2401:65: style: Boolean result is used in
bitwise operation. Clarify expression with
parentheses. [clarifyCondition]
      (pll_code.m_bp ? 0 : pll_code.m_code) << RT5682_PLL_M_SFT |

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20210302212527.55158-23-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
3 years agoASoC: rt5677: remove useless assignment
Pierre-Louis Bossart [Tue, 2 Mar 2021 21:25:24 +0000 (15:25 -0600)]
ASoC: rt5677: remove useless assignment

cppcheck warning:

sound/soc/codecs/rt5677.c:5335:10: style: Variable 'ret' is assigned a
value that is never used. [unreadVariable]
 int ret = 0, loop, i, reg_irq, virq;
         ^

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20210302212527.55158-22-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
3 years agoASoC: rt5677: clarify expression
Pierre-Louis Bossart [Tue, 2 Mar 2021 21:25:23 +0000 (15:25 -0600)]
ASoC: rt5677: clarify expression

cppcheck warning:

sound/soc/codecs/rt5677.c:4571:61: style: Boolean result is used in
bitwise operation. Clarify expression with
parentheses. [clarifyCondition]
  (pll_code.m_bp ? 0 : pll_code.m_code) << RT5677_PLL_M_SFT |
                                                            ^

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20210302212527.55158-21-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
3 years agoASoC: rt5670: clarify expression
Pierre-Louis Bossart [Tue, 2 Mar 2021 21:25:22 +0000 (15:25 -0600)]
ASoC: rt5670: clarify expression

cppcheck warning:

sound/soc/codecs/rt5670.c:2519:61: style: Boolean result is used in
bitwise operation. Clarify expression with
parentheses. [clarifyCondition]
  (pll_code.m_bp ? 0 : pll_code.m_code) << RT5670_PLL_M_SFT |
                                                            ^

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20210302212527.55158-20-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
3 years agoASoC: rt5668: remove useless assignments
Pierre-Louis Bossart [Tue, 2 Mar 2021 21:25:21 +0000 (15:25 -0600)]
ASoC: rt5668: remove useless assignments

cppcheck warnings:

sound/soc/codecs/rt5668.c:1177:6: style: Redundant initialization for
'idx'. The initialized value is overwritten before it is
read. [redundantInitialization]
 idx = rt5668_div_sel(rt5668, 1500000, div, ARRAY_SIZE(div));
     ^
sound/soc/codecs/rt5668.c:1174:10: note: idx is initialized
 int idx = -EINVAL;
         ^
sound/soc/codecs/rt5668.c:1177:6: note: idx is overwritten
 idx = rt5668_div_sel(rt5668, 1500000, div, ARRAY_SIZE(div));
     ^

sound/soc/codecs/rt5668.c:1202:6: style: Redundant initialization for
'idx'. The initialized value is overwritten before it is
read. [redundantInitialization]
 idx = rt5668_div_sel(rt5668, ref, div, ARRAY_SIZE(div));
     ^
sound/soc/codecs/rt5668.c:1191:25: note: idx is initialized
 int ref, val, reg, idx = -EINVAL;
                        ^
sound/soc/codecs/rt5668.c:1202:6: note: idx is overwritten
 idx = rt5668_div_sel(rt5668, ref, div, ARRAY_SIZE(div));
     ^

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20210302212527.55158-19-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
3 years agoASoC: rt5668: clarify expression
Pierre-Louis Bossart [Tue, 2 Mar 2021 21:25:20 +0000 (15:25 -0600)]
ASoC: rt5668: clarify expression

cppcheck warning:

sound/soc/codecs/rt5668.c:2185:61: style: Boolean result is used in
bitwise operation. Clarify expression with
parentheses. [clarifyCondition]
  (pll_code.m_bp ? 0 : pll_code.m_code) << RT5668_PLL_M_SFT |
                                                            ^

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20210302212527.55158-18-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
3 years agoASoC: rt5665: clarify expression
Pierre-Louis Bossart [Tue, 2 Mar 2021 21:25:19 +0000 (15:25 -0600)]
ASoC: rt5665: clarify expression

cppcheck warning:

sound/soc/codecs/rt5665.c:4388:61: style: Boolean result is used in
bitwise operation. Clarify expression with
parentheses. [clarifyCondition]
  (pll_code.m_bp ? 0 : pll_code.m_code) << RT5665_PLL_M_SFT |
                                                            ^

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20210302212527.55158-17-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
3 years agoASoC: rt5663: clarify expression
Pierre-Louis Bossart [Tue, 2 Mar 2021 21:25:18 +0000 (15:25 -0600)]
ASoC: rt5663: clarify expression

cppcheck warning:

bitwise operation. Clarify expression with
parentheses. [clarifyCondition]
  (pll_code.m_bp ? 0 : pll_code.m_code) << RT5663_PLL_M_SHIFT |
                                                              ^

sound/soc/codecs/rt5663.c:2955:63: style: Boolean result is used in
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20210302212527.55158-16-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
3 years agoASoC: rt5660: clarify expression
Pierre-Louis Bossart [Tue, 2 Mar 2021 21:25:17 +0000 (15:25 -0600)]
ASoC: rt5660: clarify expression

cppcheck warning:

sound/soc/codecs/rt5660.c:1060:61: style: Boolean result is used in
bitwise operation. Clarify expression with
parentheses. [clarifyCondition]
  (pll_code.m_bp ? 0 : pll_code.m_code) << RT5660_PLL_M_SFT |
                                                            ^

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20210302212527.55158-15-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
3 years agoASoC: rt5659: clarify expression
Pierre-Louis Bossart [Tue, 2 Mar 2021 21:25:16 +0000 (15:25 -0600)]
ASoC: rt5659: clarify expression

cppcheck warning:

sound/soc/codecs/rt5659.c:3515:61: style: Boolean result is used in
bitwise operation. Clarify expression with
parentheses. [clarifyCondition]
  (pll_code.m_bp ? 0 : pll_code.m_code) << RT5659_PLL_M_SFT |
                                                            ^

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20210302212527.55158-14-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
3 years agoASoC: rt5651: remove useless assignment
Pierre-Louis Bossart [Tue, 2 Mar 2021 21:25:15 +0000 (15:25 -0600)]
ASoC: rt5651: remove useless assignment

cppcheck warning:

sound/soc/codecs/rt5651.c:1786:13: style: Variable 'report' is
assigned a value that is never used. [unreadVariable]
 int report = 0;
            ^

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20210302212527.55158-13-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>