Commit graph

996369 commits

Author SHA1 Message Date
Pierre-Louis Bossart
43fe3fe8b3
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>
2021-03-11 13:24:13 +00:00
Pierre-Louis Bossart
b6021b5623
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>
2021-03-11 13:24:12 +00:00
Pierre-Louis Bossart
4988f0cc25
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>
2021-03-11 13:24:11 +00:00
Mark Brown
64682e1b77
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
2021-03-10 13:15:05 +00:00
Mark Brown
9bcf56c964
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
2021-03-10 13:15:04 +00:00
Shuming Fan
542712826f
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>
2021-03-10 13:14:34 +00:00
Wei Yongjun
d59cfc6544
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>
2021-03-10 13:14:33 +00:00
Wei Yongjun
d3223608c5
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>
2021-03-10 13:14:32 +00:00
Richard Fitzgerald
b7d00776eb
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>
2021-03-10 13:14:31 +00:00
Richard Fitzgerald
882589bb70
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>
2021-03-10 13:14:30 +00:00
Richard Fitzgerald
0ea23660c7
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>
2021-03-10 13:14:29 +00:00
Lucas Tanure
2cdba9b045
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>
2021-03-10 13:14:28 +00:00
Lucas Tanure
c5b8ee0879
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>
2021-03-10 13:14:27 +00:00
Lucas Tanure
585e7079de
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>
2021-03-10 13:14:26 +00:00
Lucas Tanure
43fc357199
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>
2021-03-10 13:14:25 +00:00
Lucas Tanure
621d65f3b8
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>
2021-03-10 13:14:24 +00:00
Lucas Tanure
1abca8e1c7
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>
2021-03-10 13:14:23 +00:00
Lucas Tanure
2b869e0ea5
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>
2021-03-10 13:14:22 +00:00
Codrin Ciubotariu
ac922edc80
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>
2021-03-10 13:14:21 +00:00
Mark Brown
32432b8eea
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
2021-03-10 13:14:20 +00:00
Shuming Fan
7ad4d237e7
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>
2021-03-10 13:13:31 +00:00
Hans de Goede
3f004d2dc1
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>
2021-03-10 13:13:30 +00:00
Hans de Goede
452801cabc
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>
2021-03-10 13:13:29 +00:00
Tang Bin
cc2d7429d6
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>
2021-03-10 13:13:28 +00:00
Jack Yu
20d17057f0
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>
2021-03-10 13:13:27 +00:00
Tang Bin
90b2d37338
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>
2021-03-10 13:13:26 +00:00
Shengjiu Wang
aa4890f673
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>
2021-03-10 13:13:25 +00:00
Mark Brown
98537d5c92
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
2021-03-10 13:13:24 +00:00
Mark Brown
d639089a84
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
2021-03-10 13:13:23 +00:00
Colin Ian King
51bc908fcc
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>
2021-03-10 13:13:22 +00:00
Yang Li
a5e78cfbd5
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>
2021-03-10 13:13:21 +00:00
Wei Yongjun
3d01f5ee19
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>
2021-03-10 13:13:20 +00:00
Fabio Estevam
5d90fef680
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>
2021-03-10 13:13:19 +00:00
Tang Bin
4c869beda4
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>
2021-03-10 13:13:18 +00:00
Pierre-Louis Bossart
f323ecedf3
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>
2021-03-10 13:10:44 +00:00
Pierre-Louis Bossart
45468f2cfe
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>
2021-03-10 13:10:43 +00:00
Pierre-Louis Bossart
9d02a30218
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>
2021-03-10 13:10:42 +00:00
Pierre-Louis Bossart
6a9287f5be
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>
2021-03-10 13:10:42 +00:00
Pierre-Louis Bossart
7655e32685
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>
2021-03-10 13:10:41 +00:00
Pierre-Louis Bossart
5dd902d99e
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>
2021-03-10 13:10:40 +00:00
Pierre-Louis Bossart
79d77f7fd1
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>
2021-03-10 13:10:39 +00:00
Pierre-Louis Bossart
c5036b8667
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>
2021-03-10 13:10:38 +00:00
Pierre-Louis Bossart
80cd73094c
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>
2021-03-10 13:10:37 +00:00
Pierre-Louis Bossart
f1a1da09fa
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>
2021-03-10 13:10:15 +00:00
Pierre-Louis Bossart
ec6aa9b59d
ASoC: rt5682: remove useless assignments
cppcheck warnings:

sound/soc/codecs/rt5682.c🔢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🔢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>
2021-03-10 13:10:14 +00:00
Pierre-Louis Bossart
e699b2c89f
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>
2021-03-10 13:10:13 +00:00
Pierre-Louis Bossart
51cb94f6c3
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>
2021-03-10 13:10:12 +00:00
Pierre-Louis Bossart
ae052909d1
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>
2021-03-10 13:10:11 +00:00
Pierre-Louis Bossart
7ad9b8d28d
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>
2021-03-10 13:10:10 +00:00
Pierre-Louis Bossart
6fa5445685
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>
2021-03-10 13:10:09 +00:00