Commit graph

23009 commits

Author SHA1 Message Date
Mac Chiang
c7721e9427
ASoC: Intel: add max98390 echo reference support
load new topology file with speaker capture pipeline.

Signed-off-by: Mac Chiang <mac.chiang@intel.com>
Acked-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/1616757689-22014-1-git-send-email-mac.chiang@intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-03-30 12:42:51 +01:00
Colin Ian King
f556de6087
ASoC: mediatek: mt6359: Fix spelling mistake "reate" -> "create"
There is a spelling mistake in a dev_err error message. Fix it.

Signed-off-by: Colin Ian King <colin.king@canonical.com>
Link: https://lore.kernel.org/r/20210330084710.997731-1-colin.king@canonical.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-03-30 12:42:50 +01:00
Mark Brown
3de72d6a28
Merge series "Add mediatek MT6359 ASoC accdet jack driver" from Argus Lin <argus.lin@mediatek.com>:
All of 3-pole and 4-pole jack are supported.

change since v2:
  - fixs missing blank at Kconfig.
  - fixs comment format and spelling mistake.
  - changes private structure mt6359_accdet to mt6359-accdet.h and uses this
    data as function parameter.
  - removes compatible string declaration.
  - uses regmap_read_poll_timeout as polling timer.
  - simplify jack detection and key detection report function.
  - adds mt6359_accdet_enable_jack_detect for sound card jack initialization.

change since v1:
  - adds mt6359 accdet binding document
  - adds mt6359 accdet driver

*** BLURB HERE ***

Argus Lin (2):
  dt-bindings: mediatek: mt6359: add ASoC mt6359 ASoC accdet jack
    document
  ASoC: mediatek: mt6359: add MT6359 accdet jack driver

 .../bindings/sound/mt6359-accdet.yaml         |  164 ++
 sound/soc/codecs/Kconfig                      |    8 +
 sound/soc/codecs/Makefile                     |    2 +
 sound/soc/codecs/mt6359-accdet.c              | 1080 ++++++++++
 sound/soc/codecs/mt6359-accdet.h              |  128 ++
 sound/soc/codecs/mt6359.h                     | 1864 ++++++++++++++++-
 6 files changed, 3139 insertions(+), 107 deletions(-)
 create mode 100644 Documentation/devicetree/bindings/sound/mt6359-accdet.yaml
 create mode 100644 sound/soc/codecs/mt6359-accdet.c
 create mode 100644 sound/soc/codecs/mt6359-accdet.h

--
2.18.0
2021-03-29 20:30:51 +01:00
Jaska Uimonen
c943a586f6
ASoC: SOF: match SSP config with pcm hw params
This patch adds a function to find a match between pcm hw params and SSP
DAI config. Config is matched against sample rate and if match is found
current config is set. If match isn't found last matched config is left
as current i.e. current config is not touched. Functionality for SSP
DAIs with 1 config remains the same as before.

Signed-off-by: Jaska Uimonen <jaska.uimonen@linux.intel.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Link: https://lore.kernel.org/r/20210326165150.255533-3-kai.vehmanen@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-03-29 17:28:19 +01:00
Jaska Uimonen
e12be9fbfb
ASoC: SOF: Intel: HDA: add hw params callback for SSP DAIs
Currently SSP DAIs don't have hw params callback function as there
wasn't anything to setup after initial topology loading. After enabling
multiple DAI configs the current config can be sent in the callback.

This patch changes the way SSP config ipc is sent to the dsp. Before it
was only sent once in topology loading, but now it will be additionally
sent always when stream is opened. Mechanism is similar as with HDA
DAIs.

Signed-off-by: Jaska Uimonen <jaska.uimonen@linux.intel.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Link: https://lore.kernel.org/r/20210326165150.255533-2-kai.vehmanen@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-03-29 17:28:18 +01:00
Jaska Uimonen
c1c03888f1
ASoC: SOF: parse multiple SSP DAI and hw configs
ASoC parses multiple hw_configs defined in topology. However currently
in SOF only the first config is used and others are discarded. First
change SOF driver to parse and save possible multiple configs in ssp
case. Also save the default config value provided by ASoC. Functionality
with only one defined config stays the same.

Signed-off-by: Jaska Uimonen <jaska.uimonen@linux.intel.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Link: https://lore.kernel.org/r/20210326165150.255533-1-kai.vehmanen@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-03-29 17:28:17 +01:00
Shengjiu Wang
502e5321d8
ASoC: fsl_rpmsg: initialise pointers to NULL
This fixes the following sparse warnings:

sound/soc/fsl/fsl_rpmsg.c:45:45: sparse: sparse: Using plain integer as NULL pointer
sound/soc/fsl/fsl_rpmsg.c:45:56: sparse: sparse: Using plain integer as NULL pointer

Fixes: b73d9e6225 ("ASoC: fsl_rpmsg: Add CPU DAI driver for audio base on rpmsg")
Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com>
Reported-by: kernel test robot <lkp@intel.com>
Link: https://lore.kernel.org/r/1616988868-971-1-git-send-email-shengjiu.wang@nxp.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-03-29 17:28:16 +01:00
Vijendar Mukunda
d463cead11
ASoC: amd: fix acpi dependency kernel warning
Fix ACPI dependency kernel warning produced by powerpc
allyesconfig.

sound/soc/amd/acp-da7219-max98357a.c:684:28: warning:
'cz_rt5682_card' defined but not used [-Wunused-variable]

sound/soc/amd/acp-da7219-max98357a.c:671:28: warning: 'cz_card'
defined but not used [-Wunused-variable]

Reported-by: Stephen Rothwell <sfr@canb.auug.org.au>
Signed-off-by: Vijendar Mukunda <Vijendar.Mukunda@amd.com>
Link: https://lore.kernel.org/r/1616777074-5151-2-git-send-email-Vijendar.Mukunda@amd.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-03-29 17:28:15 +01:00
Vijendar Mukunda
23f23db29a
ASoC: amd: update spdx license for acp machine driver
update SPDX license for acp machine driver.

Signed-off-by: Vijendar Mukunda <Vijendar.Mukunda@amd.com>
Link: https://lore.kernel.org/r/1616777074-5151-1-git-send-email-Vijendar.Mukunda@amd.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-03-29 17:28:14 +01:00
YueHaibing
0803a5cb5b
ASoC: dwc: Fix -Wmissing-prototypes warnings
while CONFIG_SND_DESIGNWARE_PCM is not set, building with W=1 shows this:

sound/soc/dwc/local.h:127:6: warning: no previous prototype for ‘dw_pcm_push_tx’ [-Wmissing-prototypes]
 void dw_pcm_push_tx(struct dw_i2s_dev *dev) { }
      ^~~~~~~~~~~~~~
sound/soc/dwc/local.h:128:6: warning: no previous prototype for ‘dw_pcm_pop_rx’ [-Wmissing-prototypes]
 void dw_pcm_pop_rx(struct dw_i2s_dev *dev) { }
      ^~~~~~~~~~~~~
sound/soc/dwc/local.h:129:5: warning: no previous prototype for ‘dw_pcm_register’ [-Wmissing-prototypes]
 int dw_pcm_register(struct platform_device *pdev)
     ^~~~~~~~~~~~~~~

Change these to inline functions to fix the warnings.

Signed-off-by: YueHaibing <yuehaibing@huawei.com>
Link: https://lore.kernel.org/r/20210329150524.18184-1-yuehaibing@huawei.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-03-29 17:28:13 +01:00
kernel test robot
aa320c7cd4
ASoC: cygnus: fix for_each_child.cocci warnings
Function "for_each_available_child_of_node" should have of_node_put()
before return around line 1352.

Generated by: scripts/coccinelle/iterators/for_each_child.cocci

CC: Sumera Priyadarsini <sylphrenadin@gmail.com>
Reported-by: kernel test robot <lkp@intel.com>
Signed-off-by: kernel test robot <lkp@intel.com>
Signed-off-by: Julia Lawall <julia.lawall@inria.fr>
Link: https://lore.kernel.org/r/alpine.DEB.2.22.394.2103281651320.2854@hadrien
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-03-29 17:27:22 +01:00
Argus Lin
eef07b9e09
ASoC: mediatek: mt6359: add MT6359 accdet jack driver
MT6359 audio codec supports jack detection feature, adds MT6359
accdet driver to support jack plugged detection and key detection.

Signed-off-by: Argus Lin <argus.lin@mediatek.com>
Link: https://lore.kernel.org/r/1615383186-18500-3-git-send-email-argus.lin@mediatek.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-03-25 17:39:27 +00:00
Mark Brown
e49bcf4f55
Merge series "Add audio driver base on rpmsg on i.MX platform" from Shengjiu Wang <shengjiu.wang@nxp.com>:
On Asymmetric multiprocessor, there is Cortex-A core and Cortex-M core,
Linux is running on A core, RTOS is running on M core.
The audio hardware device can be controlled by Cortex-M device,
So audio playback/capture can be handled by M core.

Rpmsg is the interface for sending and receiving msg to and from M
core, that we can create a virtual sound on Cortex-A core side.

A core will tell the Cortex-M core sound format/rate/channel,
where is the data buffer, what is the period size, when to start,
when to stop and when suspend or resume happen, each of this behavior
there is defined rpmsg command.

Especially we designed the low power audio case, that is to
allocate a large buffer and fill the data, then Cortex-A core can go
to sleep mode, Cortex-M core continue to play the sound, when the
buffer is consumed, Cortex-M core will trigger the Cortex-A core to
wakeup to fill data.

changes in v5:
- remove unneeded property in binding doc and driver
- update binding doc according to Rob's comments.
- Fix link issue reported by kernel test robot

changes in v4:
- remove the sound card node, merge the property to cpu dai node
  according to Rob's comments.
- sound card device will be registered by cpu dai driver.
- Fix do_div issue reported by kernel test robot

changes in v3:
- add local refcount for clk enablement in hw_params()
- update the document according Rob's comments

changes in v2:
- update codes and comments according to Mark's comments

Shengjiu Wang (6):
  ASoC: soc-component: Add snd_soc_pcm_component_ack
  ASoC: fsl_rpmsg: Add CPU DAI driver for audio base on rpmsg
  ASoC: dt-bindings: fsl_rpmsg: Add binding doc for rpmsg audio device
  ASoC: imx-audio-rpmsg: Add rpmsg_driver for audio channel
  ASoC: imx-pcm-rpmsg: Add platform driver for audio base on rpmsg
  ASoC: imx-rpmsg: Add machine driver for audio base on rpmsg

 .../devicetree/bindings/sound/fsl,rpmsg.yaml  | 108 +++
 include/sound/soc-component.h                 |   3 +
 sound/soc/fsl/Kconfig                         |  30 +
 sound/soc/fsl/Makefile                        |   6 +
 sound/soc/fsl/fsl_rpmsg.c                     | 279 ++++++
 sound/soc/fsl/fsl_rpmsg.h                     |  35 +
 sound/soc/fsl/imx-audio-rpmsg.c               | 140 +++
 sound/soc/fsl/imx-pcm-rpmsg.c                 | 918 ++++++++++++++++++
 sound/soc/fsl/imx-pcm-rpmsg.h                 | 512 ++++++++++
 sound/soc/fsl/imx-rpmsg.c                     | 150 +++
 sound/soc/soc-component.c                     |  14 +
 sound/soc/soc-pcm.c                           |   2 +
 12 files changed, 2197 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/sound/fsl,rpmsg.yaml
 create mode 100644 sound/soc/fsl/fsl_rpmsg.c
 create mode 100644 sound/soc/fsl/fsl_rpmsg.h
 create mode 100644 sound/soc/fsl/imx-audio-rpmsg.c
 create mode 100644 sound/soc/fsl/imx-pcm-rpmsg.c
 create mode 100644 sound/soc/fsl/imx-pcm-rpmsg.h
 create mode 100644 sound/soc/fsl/imx-rpmsg.c

--
2.27.0
2021-03-25 17:32:00 +00:00
Ryan Lee
3a27875e91
ASoC: max98373: Added 30ms turn on/off time delay
Amp requires 10 ~ 30ms for the power ON and OFF.
Added 30ms delay for stability.

Signed-off-by: Ryan Lee <ryans.lee@maximintegrated.com>
Link: https://lore.kernel.org/r/20210325033555.29377-2-ryans.lee@maximintegrated.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-03-25 13:59:46 +00:00
Ryan Lee
a23f9099ff
ASoC: max98373: Changed amp shutdown register as volatile
0x20FF(amp global enable) register was defined as non-volatile,
but it is not. Overheating, overcurrent can cause amp shutdown
in hardware.
'regmap_write' compare register readback value before writing
to avoid same value writing. 'regmap_read' just read cache
not actual hardware value for the non-volatile register.
When amp is internally shutdown by some reason, next 'AMP ON'
command can be ignored because regmap think amp is already ON.

Signed-off-by: Ryan Lee <ryans.lee@maximintegrated.com>
Link: https://lore.kernel.org/r/20210325033555.29377-1-ryans.lee@maximintegrated.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-03-25 13:59:46 +00:00
Shengjiu Wang
99067c07e8
ASoC: wm8960: Remove bitclk relax condition in wm8960_configure_sysclk
The call sequence in wm8960_configure_clocking is

   ret = wm8960_configure_sysclk();
   if (ret >= 0)
        goto configure_clock;

   ....

   ret = wm8960_configure_pll();

configure_clock:
   ...

wm8960_configure_sysclk is called before wm8960_configure_pll, as
there is bitclk relax on both functions, so wm8960_configure_sysclk
always return success, then wm8960_configure_pll() never be called.

With this case:
aplay -Dhw:0,0 -d 5 -r 48000 -f S24_LE -c 2 audio48k24b2c.wav
the required bitclk is 48000 * 24 * 2 = 2304000, bitclk got from
wm8960_configure_sysclk is 3072000, but if go to wm8960_configure_pll.
it can get correct bitclk 2304000.

So bitclk relax condition should be removed in wm8960_configure_sysclk,
then wm8960_configure_pll can be called, and there is also bitclk relax
function in wm8960_configure_pll.

Fixes: 3c01b9ee2a ("ASoC: codec: wm8960: Relax bit clock computation")
Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com>
Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com>
Acked-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Link: https://lore.kernel.org/r/1614740862-30196-1-git-send-email-shengjiu.wang@nxp.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-03-25 13:59:00 +00:00
Shengjiu Wang
efd0b16608
ASoC: fsl-asoc-card: Add support for WM8958 codec
WM8958 codec is used on some i.MX based platform.
So add it support in this generic driver.

Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com>
Link: https://lore.kernel.org/r/1615986303-27959-1-git-send-email-shengjiu.wang@nxp.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-03-25 13:58:58 +00:00
Ryan Lee
7a0d884986
ASoC: max98373: Added controls for autorestart config
3 new controls are added.
"OVC Autorestart Switch" : controls whether or not the speaker amplifier
automatically re-enables after an overcurrent fault condition.
"THERM Autorestart Switch" : controls whether or not the device
automatically resumes playback when the die temperature recovers from
thermal shutdown.
"CMON Autorestart Switch" : controls whether or not the device
automatically resumes playback when the clock returns after stopping.

Above Auto Restart functions are enabled by default.

Signed-off-by: Ryan Lee <ryans.lee@maximintegrated.com>
Link: https://lore.kernel.org/r/20210325033555.29377-3-ryans.lee@maximintegrated.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-03-25 13:58:57 +00:00
Jack Yu
9f44673b7a
ASoC: rt1015: Add bclk detection and dc detection
Add bclk detection and dc detection before playback.

Signed-off-by: Jack Yu <jack.yu@realtek.com>
Link: https://lore.kernel.org/r/20210322055053.31797-1-jack.yu@realtek.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-03-25 13:58:56 +00:00
Shengjiu Wang
39f8405c3e
ASoC: imx-rpmsg: Add machine driver for audio base on rpmsg
The platform device is not registered by device tree or
cpu dai driver, it is registered by the rpmsg channel,
So add a dedicated machine driver to handle this case.

Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com>
Link: https://lore.kernel.org/r/1615516725-4975-7-git-send-email-shengjiu.wang@nxp.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-03-25 13:58:11 +00:00
Shengjiu Wang
3c00eceb2a
ASoC: imx-pcm-rpmsg: Add platform driver for audio base on rpmsg
Platform driver based on rpmsg is the interface for sending and
receiving rpmsg to and from M core. It will tell the Cortex-M core
sound format/rate/channel, where is the data buffer, where is
the period size, when to start, when to stop and when suspend
or resume happen, each this behavior there is defined rpmsg
command.

Especially we designed the low power audio case, that is to
allocate a large buffer and fill the data, then Cortex-A core can go
to sleep mode, Cortex-M core continue to play the sound, when the
buffer is consumed, Cortex-M core will trigger the Cortex-A core to
wake up.

Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com>
Link: https://lore.kernel.org/r/1615516725-4975-6-git-send-email-shengjiu.wang@nxp.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-03-25 13:58:10 +00:00
Shengjiu Wang
1935050de0
ASoC: imx-audio-rpmsg: Add rpmsg_driver for audio channel
This driver is used to accept the message from rpmsg audio
channel, and if this driver is probed, it will help to register
the platform driver, the platform driver will use this
audio channel to send and receive messages to and from Cortex-M
core.

Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com>
Link: https://lore.kernel.org/r/1615516725-4975-5-git-send-email-shengjiu.wang@nxp.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-03-25 13:58:09 +00:00
Shengjiu Wang
b73d9e6225
ASoC: fsl_rpmsg: Add CPU DAI driver for audio base on rpmsg
This is a cpu dai driver for rpmsg audio use case,
which is mainly used for getting the user's configuration
from devicetree and configure the clocks which is used by
Cortex-M core.

Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com>
Link: https://lore.kernel.org/r/1615516725-4975-3-git-send-email-shengjiu.wang@nxp.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-03-25 13:58:07 +00:00
Shengjiu Wang
8bdfc0455e
ASoC: soc-component: Add snd_soc_pcm_component_ack
Add snd_soc_pcm_component_ack back, which can be used to get an
updated buffer pointer in the platform driver.
On Asymmetric multiprocessor, this pointer can be sent to Cortex-M
core for audio processing.

Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com>
Link: https://lore.kernel.org/r/1615516725-4975-2-git-send-email-shengjiu.wang@nxp.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-03-25 13:58:06 +00:00
Mark Brown
3f994c2586
Merge series "MFD/extcon/ASoC: Rework arizona codec jack-detect support" from Hans de Goede <hdegoede@redhat.com>:
Hi All,

Here is v4 of my series to rework the arizona codec jack-detect support
to use the snd_soc_jack helpers instead of direct extcon reporting.

As discussed before here is a resend rebased on 5.12-rc2, making sure that
all patches this depends on are in place.

Lee, can you pick-up patches 1-6 through the MFD tree and then send a
pull-req to Mark so that Mark can merge the Asoc parts throught the ASoC
tree ?

Patches 2-6 touch drivers/extcon, these all have an Ack from Chanwoo Choi
for merging these through the MFD tree.

Here is some more generic info on this series from the previous
cover-letter:

This is done by reworking the extcon driver into an arizona-jackdet
library and then modifying the codec drivers to use that directly,
replacing the old separate extcon child-devices and extcon-driver.

This brings the arizona-codec jack-detect handling inline with how
all other ASoC codec driver do this. This was developed and tested on
a Lenovo Yoga Tablet 1051L with a WM5102 codec.

This was also tested by Charles Keepax, one of the Cirrus Codec folks.

Regards,

Hans

Hans de Goede (13):
  mfd: arizona: Drop arizona-extcon cells
  extcon: arizona: Fix some issues when HPDET IRQ fires after the jack
    has been unplugged
  extcon: arizona: Fix various races on driver unbind
  extcon: arizona: Fix flags parameter to the gpiod_get("wlf,micd-pol")
    call
  extcon: arizona: Always use pm_runtime_get_sync() when we need the
    device to be awake
  ASoC/extcon: arizona: Move arizona jack code to
    sound/soc/codecs/arizona-jack.c
  ASoC: arizona-jack: Move jack-detect variables to struct arizona_priv
  ASoC: arizona-jack: Use arizona->dev for runtime-pm
  ASoC: arizona-jack: convert into a helper library for codec drivers
  ASoC: arizona-jack: Use snd_soc_jack to report jack events
  ASoC: arizona-jack: Cleanup logging
  ASoC: arizona: Make the wm5102, wm5110, wm8997 and wm8998 drivers use
    the new jack library
  ASoC: Intel: bytcr_wm5102: Add jack detect support

 MAINTAINERS                                   |   3 +-
 drivers/extcon/Kconfig                        |   8 -
 drivers/extcon/Makefile                       |   1 -
 drivers/mfd/arizona-core.c                    |  20 -
 sound/soc/codecs/Makefile                     |   2 +-
 .../soc/codecs/arizona-jack.c                 | 577 +++++++-----------
 sound/soc/codecs/arizona.h                    |  44 ++
 sound/soc/codecs/wm5102.c                     |  12 +-
 sound/soc/codecs/wm5110.c                     |  12 +-
 sound/soc/codecs/wm8997.c                     |  14 +-
 sound/soc/codecs/wm8998.c                     |   9 +
 sound/soc/intel/boards/bytcr_wm5102.c         |  28 +-
 12 files changed, 325 insertions(+), 405 deletions(-)
 rename drivers/extcon/extcon-arizona.c => sound/soc/codecs/arizona-jack.c (76%)

--
2.30.1
2021-03-24 23:29:33 +00:00
Hans de Goede
ecd77d494e
ASoC: Intel: bytcr_wm5102: Add jack detect support
Add jack detect support by creating a jack and calling
snd_soc_component_set_jack to register the created jack
with the codec.

Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Link: https://lore.kernel.org/r/20210307151807.35201-14-hdegoede@redhat.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-03-24 19:50:20 +00:00
Hans de Goede
37dbabf14f
ASoC: arizona: Make the wm5102, wm5110, wm8997 and wm8998 drivers use the new jack library
Make all arizona codec drivers for which drivers/mfd/arizona-core.c used
to instantiate a "arizona-extcon" child-device use the new arizona-jack.c
library for jack-detection.

This has been tested on a Lenovo Yoga Tablet 2 1051L with a WM5102 codec.

Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Acked-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Tested-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Link: https://lore.kernel.org/r/20210307151807.35201-13-hdegoede@redhat.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-03-24 19:50:19 +00:00
Hans de Goede
69c58eb61e
ASoC: arizona-jack: Cleanup logging
Cleanup the use of dev_foo functions used for logging:

1. Many of these are unnecessarily split over multiple lines
2. Use dev_err_probe() in cases where we might get a -EPROBE_DEFER
   return value

Suggested-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Acked-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Tested-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Link: https://lore.kernel.org/r/20210307151807.35201-12-hdegoede@redhat.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-03-24 19:50:18 +00:00
Hans de Goede
236b7285e9
ASoC: arizona-jack: Use snd_soc_jack to report jack events
Use the snd_soc_jack code to report jack events, instead of using extcon
for reporting the cable-type + an input_dev for reporting the button
presses.

The snd_soc_jack code will report the cable-type through both input_dev
events and through ALSA controls and the button-presses through input_dev
events.

Note that this means that when the codec drivers are moved over to use
the new arizona-jack.c library code instead of having a separate MFD
extcon cell with the extcon-arizona.c driver, we will no longer report
extcon events to userspace for cable-type changes. This should not be
a problem since "standard" Linux distro userspace does not (and has
never) used the extcon class interface for this. Android does have
support for the extcon class interface, but that was introduced in
the same release as support for input_dev cable-type events, so this
should not be a problem for Android either.

Note this also reduces ARIZONA_MAX_MICD_RANGE from 8 to 6, this is
ok to do since this info is always provided through pdata (or defaults)
and cannot be overridden from devicetree. All in-kernel users of the
pdata (and the fallback defaults) define 6 or less buttons/ranges.

Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Acked-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Tested-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Link: https://lore.kernel.org/r/20210307151807.35201-11-hdegoede@redhat.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-03-24 19:50:17 +00:00
Hans de Goede
ffcc84b9e8
ASoC: arizona-jack: convert into a helper library for codec drivers
Convert the arizona extcon driver into a helper library for direct use
from the arizona codec-drivers, rather then being bound to a separate
MFD cell.

Note the probe (and remove) sequence is split into 2 parts:

1. The arizona_jack_codec_dev_probe() function inits a bunch of
jack-detect specific variables in struct arizona_priv and tries to get
a number of resources where getting them may fail with -EPROBE_DEFER.

2. Then once the machine driver has create a snd_sock_jack through
snd_soc_card_jack_new() it calls snd_soc_component_set_jack() on
the codec component, which will call the new arizona_jack_set_jack(),
which sets up jack-detection and requests the IRQs.

This split is necessary, because the IRQ handlers need access to the
arizona->dapm pointer and the snd_sock_jack which are not available
when the codec-driver's probe function runs.

Note this requires that machine-drivers for codecs which are converted
to use the new helper functions from arizona-jack.c are modified to
create a snd_soc_jack through snd_soc_card_jack_new() and register
this jack with the codec through snd_soc_component_set_jack().

Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Acked-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Tested-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Link: https://lore.kernel.org/r/20210307151807.35201-10-hdegoede@redhat.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-03-24 19:50:16 +00:00
Hans de Goede
688c8461a4
ASoC: arizona-jack: Use arizona->dev for runtime-pm
Drivers for MFD child-devices such as the arizona codec drivers
and the arizona-extcon driver can choose to either make
runtime_pm_get/_put calls on their own child-device, which will
then be propagated to their parent; or they can make them directly
on their MFD parent-device.

The arizona-extcon code was using runtime_pm_get/_put calls on
its own child-device where as the codec drivers are using
runtime_pm_get/_put calls on their parent.

The arizona-extcon MFD cell/child-device has been removed and this
commit is part of refactoring the arizona-extcon code into a library
to be used directly from the codec drivers.

Specifically this commit moves the code over to make
runtime_pm_get/_put calls on the parent device (on arizona->dev)
bringing the code inline with how the codec drivers do this.

Note this also removes the pm_runtime_enable/_disable calls
as pm_runtime support has already been enabled on the parent-device
by the arizona MFD driver.

This is part of a patch series converting the arizona extcon driver into
a helper library for letting the arizona codec-drivers directly report
jack state through the standard sound/soc/soc-jack.c functions.

Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Acked-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Tested-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Link: https://lore.kernel.org/r/20210307151807.35201-9-hdegoede@redhat.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-03-24 19:50:15 +00:00
Hans de Goede
bcda8cc4b8
ASoC: arizona-jack: Move jack-detect variables to struct arizona_priv
Move all the jack-detect variables from struct arizona_extcon_info to
struct arizona_priv.

This is part of a patch series converting the arizona extcon driver into
a helper library for letting the arizona codec-drivers directly report jack
state through the standard sound/soc/soc-jack.c functions.

Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Acked-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Tested-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Link: https://lore.kernel.org/r/20210307151807.35201-8-hdegoede@redhat.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-03-24 19:50:14 +00:00
Shengjiu Wang
b5cf28f7a8
ASoC: fsl_micfil: Don't use devm_regmap_init_mmio_clk
When there is power domain bind with ipg_clk clock,

The call flow:
devm_regmap_init_mmio_clk
   - clk_prepare()
      - clk_pm_runtime_get()

cause the power domain of clock always be enabled after
regmap_init(). which impact the power consumption.

So use devm_regmap_init_mmio instead of
devm_regmap_init_mmio_clk,but explicitly enable
clock when it is used.

Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com>
Reviewed-by: Viorel Suman <viorel.suman@nxp.com>
Link: https://lore.kernel.org/r/1616579928-22428-7-git-send-email-shengjiu.wang@nxp.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-03-24 19:49:32 +00:00
Shengjiu Wang
3feaba79d8
ASoC: fsl_audmix: Don't use devm_regmap_init_mmio_clk
When there is power domain bind with ipg clock,

The call flow:
devm_regmap_init_mmio_clk
   - clk_prepare()
       - clk_pm_runtime_get()

cause the power domain of clock always be enabled after
regmap_init(). which impact the power consumption.

So use devm_regmap_init_mmio instead of
devm_regmap_init_mmio_clk,but explicitly enable
clock when it is used.

Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com>
Link: https://lore.kernel.org/r/1616579928-22428-6-git-send-email-shengjiu.wang@nxp.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-03-24 19:49:31 +00:00
Shengjiu Wang
069b24f22e
ASoC: fsl_easrc: Don't use devm_regmap_init_mmio_clk
When there is power domain bind with mem clock,

The call flow:
devm_regmap_init_mmio_clk
  - clk_prepare()
      - clk_pm_runtime_get()

cause the power domain of clock always be enabled after
regmap_init(). which impact the power consumption.

So use devm_regmap_init_mmio instead of
devm_regmap_init_mmio_clk,but explicitly enable
clock when it is used.

Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com>
Link: https://lore.kernel.org/r/1616579928-22428-5-git-send-email-shengjiu.wang@nxp.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-03-24 19:49:30 +00:00
Shengjiu Wang
cab04ab590
ASoC: fsl_asrc: Don't use devm_regmap_init_mmio_clk
When there is power domain bind with mem clock,

The call flow:
devm_regmap_init_mmio_clk
   - clk_prepare()
       - clk_pm_runtime_get()

cause the power domain of clock always be enabled after
regmap_init(). which impact the power consumption.

So use devm_regmap_init_mmio instead of
devm_regmap_init_mmio_clk,but explicitly enable
clock when it is used.

Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com>
Link: https://lore.kernel.org/r/1616579928-22428-4-git-send-email-shengjiu.wang@nxp.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-03-24 19:49:29 +00:00
Shengjiu Wang
c256257246
ASoC: fsl_spdif: Don't use devm_regmap_init_mmio_clk
When there is power domain bind with core clock,

The call flow:
devm_regmap_init_mmio_clk
   - clk_prepare()
       - clk_pm_runtime_get()

cause the power domain of clock always be enabled after
regmap_init(). which impact the power consumption.

So use devm_regmap_init_mmio instead of
devm_regmap_init_mmio_clk,but explicitly enable
clock when it is used.

Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com>
Link: https://lore.kernel.org/r/1616579928-22428-3-git-send-email-shengjiu.wang@nxp.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-03-24 19:49:28 +00:00
Shengjiu Wang
203773e393
ASoC: fsl_esai: Don't use devm_regmap_init_mmio_clk
When there is power domain bind with bus clock,

The call flow:
devm_regmap_init_mmio_clk
    - clk_prepare()
       - clk_pm_runtime_get()

cause the power domain of clock always be enabled after
regmap_init(). which impact the power consumption.

So use devm_regmap_init_mmio instead of
devm_regmap_init_mmio_clk,but explicitly enable
clock when it is used.

Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com>
Link: https://lore.kernel.org/r/1616579928-22428-2-git-send-email-shengjiu.wang@nxp.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-03-24 19:49:28 +00:00
Hans de Goede
632aeebe1b
ASoC: intel: atom: Remove 44100 sample-rate from the media and deep-buffer DAI descriptions
The media and deep-buffer DAIs only support 48000 Hz samplerate,
remove the 44100 sample-rate from their descriptions.

Acked-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Link: https://lore.kernel.org/r/20210324132711.216152-3-hdegoede@redhat.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-03-24 19:48:05 +00:00
Hans de Goede
aa65bacdb7
ASoC: intel: atom: Stop advertising non working S24LE support
The SST firmware's media and deep-buffer inputs are hardcoded to
S16LE, the corresponding DAIs don't have a hw_params callback and
their prepare callback also does not take the format into account.

So far the advertising of non working S24LE support has not caused
issues because pulseaudio defaults to S16LE, but changing pulse-audio's
config to use S24LE will result in broken sound.

Pipewire is replacing pulse now and pipewire prefers S24LE over S16LE
when available, causing the problem of the broken S24LE support to
come to the surface now.

Cc: stable@vger.kernel.org
BugLink: https://gitlab.freedesktop.org/pipewire/pipewire/-/issues/866
Fixes: 098c2cd281 ("ASoC: Intel: Atom: add 24-bit support for media playback and capture")
Acked-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Link: https://lore.kernel.org/r/20210324132711.216152-2-hdegoede@redhat.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-03-24 19:48:04 +00:00
Mark Brown
f89c0a87b4 Immutable branch between MFD and Extcon due for the v5.13 merge window
-----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCgAdFiEEdrbJNaO+IJqU8IdIUa+KL4f8d2EFAmBTPZsACgkQUa+KL4f8
 d2Ew4g/8CZnru5gfuR2uMZIReS8Q4RniTKe3IoQNGE+nyZFp8heJm5sJ/tcHzHuX
 RcBbuY9hLhhZRvQ+WrveYiXYdC3tH/8j/5mHj6CLJDwh8ukEf9H/tcNAx1T0Y8by
 C3Y/lY7avAzfTorJQ2g+LRkbuei3mojTpUuEiwgdJEzydbg/GzYVv2edRvdCkW0Y
 6xCg8ufmWBTjrHHoXm4/wtGSJ2L17coieSRSIiQ4KsGf8xM6QAnUEXbwQV3KjlVS
 SbI0gucfjnYYdsYqrPy+yyA8gzA5utP/0Zis4pfDG1Av1dBm6ZfD5n/z+KYyJUoG
 C1GPkqxukZODBitwO6PdCoHpFTsbwfoqz6HD8o+6oFqScdBtU7C8SectMpis0G4/
 j3VrstGL6T0GgzuVmy5EnpPkqyiiJh3Smv5ZS91Rztiy4CTTvLlkrw5+h0GP9aR7
 uUfNmQU65KCG4WscnwuWeImcQzxRAlsiI0QxXFmHhIxZFG8Bq2z11V5rcpYdJXgx
 GbkOml6iq+G1UQu3sKYgLlE2Lg3IlehjytAbpY0Qoj9VE1FeE8STgYQMEwT5TqIB
 Em6T1fkpXp2kho92rmJ+rjcAJp7rKmlSQHO0xgbJwbzZsA5rKvClAn3PZmoZs7HY
 VHmeWjPihoo7qJTx7LVhWEtYptKG31JqCRPFTbVXjeCvClnjcFU=
 =3CZN
 -----END PGP SIGNATURE-----
gpgsig -----BEGIN PGP SIGNATURE-----
 
 iQEzBAABCgAdFiEEreZoqmdXGLWf4p/qJNaLcl1Uh9AFAmBaaBIACgkQJNaLcl1U
 h9CaNAgAgM5C0sZW05OQvat+2wpqN2RsTMVZJxdCQb68jU2PQNAj64Q20W17P/Uk
 BO4/Dpbi0RbnUCZ/qOG+teL8Hg+BIE2cA5hTHKfa7KMMGQ8WQfhgPsrWTwnpnkH8
 quBIBX3zRzG9VxiVqY4tbEwrQ87Os9by+OVQ3hb34MXeVRPZ4Z0t5hi3A9JKs9iK
 JGdLLgVZAtBFL8sGJt9eVeZeeDbF0PL0ooEA4elO9C4+ix+bfWKkXLo5tOEW7Onn
 MPvyB+axJ6nmI3+gJSn21Xwxf1OdW2DezHpFQxzbK2dxL/S56uE2UxX8jir3cKFc
 CkNs/e5fAJVNy//5VogQnTilwLqoyg==
 =GG2W
 -----END PGP SIGNATURE-----

Merge tag 'ib-mfd-extcon-v5.13' of git://git.kernel.org/pub/scm/linux/kernel/git/lee/mfd into asoc-5.13

Immutable branch between MFD and Extcon due for the v5.13 merge window
2021-03-23 22:13:35 +00:00
Mark Brown
2c0d7f9186
Merge series "ASoC: SOF: Intel: shutdown and core handling corrections" from Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>:
This patchset fixes a logical flow in the core status, improves
shutdown support on Intel SOF platforms with an HDaudio controller and
cleans-up ElkhartLake support.

Guennadi Liakhovetski (1):
  ASoC: SOF: Intel: HDA: fix core status verification

Libin Yang (5):
  ASoC: SOF: Intel: TGL: fix EHL ops
  ASoC: SOF: Intel: TGL: set shutdown callback to hda_dsp_shutdown
  ASoC: SOF: Intel: ICL: set shutdown callback to hda_dsp_shutdown
  ASoC: SOF: Intel: CNL: set shutdown callback to hda_dsp_shutdown
  ASoC: SOF: Intel: APL: set shutdown callback to hda_dsp_shutdown

Pierre-Louis Bossart (2):
  ASoC: SOF: core: harden shutdown helper
  ASoC: SOF: Intel: move ELH chip info

 sound/soc/sof/core.c          |  8 +++++++-
 sound/soc/sof/intel/apl.c     |  3 ++-
 sound/soc/sof/intel/cnl.c     | 19 ++-----------------
 sound/soc/sof/intel/hda-dsp.c | 21 +++++++++++++++++----
 sound/soc/sof/intel/hda.h     |  1 +
 sound/soc/sof/intel/icl.c     |  3 ++-
 sound/soc/sof/intel/pci-tgl.c |  2 +-
 sound/soc/sof/intel/tgl.c     | 18 +++++++++++++++++-
 8 files changed, 49 insertions(+), 26 deletions(-)

--
2.25.1
2021-03-23 22:09:37 +00:00
Kai Vehmanen
dfb81e3b5f
ASoC: SOF: Intel: hda: drop display power on/off in D0i3 flows
Controller needs to ensure display power is enabled only for
HDA controller reset. Drop the display power-up/down calls from
D0i3 entry/exit paths.

This was previously not possible as codec drivers could not resume the
links, and instead controller kept the reference to display power. The
state of display power had be maintained in the D0i3 entry/exit code.
With commit 87fc20e4a0 ("ASoC: SOF: Intel: hda: use hdac_ext
fine-grained link management"), this is no longer needed and the code
can be cleaned up.

Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: Keyon Jie <yang.jie@intel.com>
Link: https://lore.kernel.org/r/20210322143830.3880293-1-kai.vehmanen@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-03-23 17:19:01 +00:00
Shengjiu Wang
16b82e75c1
ASoC: wm8960: Fix wrong bclk and lrclk with pll enabled for some chips
The input MCLK is 12.288MHz, the desired output sysclk is 11.2896MHz
and sample rate is 44100Hz, with the configuration pllprescale=2,
postscale=sysclkdiv=1, some chip may have wrong bclk
and lrclk output with pll enabled in master mode, but with the
configuration pllprescale=1, postscale=2, the output clock is correct.

>From Datasheet, the PLL performs best when f2 is between
90MHz and 100MHz when the desired sysclk output is 11.2896MHz
or 12.288MHz, so sysclkdiv = 2 (f2/8) is the best choice.

So search available sysclk_divs from 2 to 1 other than from 1 to 2.

Fixes: 84fdc00d51 ("ASoC: codec: wm9860: Refactor PLL out freq search")
Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com>
Acked-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Link: https://lore.kernel.org/r/1616150926-22892-1-git-send-email-shengjiu.wang@nxp.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-03-23 17:14:33 +00:00
Pierre-Louis Bossart
8bb84ca873
ASoC: SOF: Intel: move ELH chip info
ELH is a derivative of TGL, so it should be exposed in tgl.c for
consistency.

No functional change.

Reviewed-by: Rander Wang <rander.wang@intel.com>
Reviewed-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20210322163728.16616-9-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-03-23 17:14:31 +00:00
Libin Yang
d3aa96bf34
ASoC: SOF: Intel: APL: set shutdown callback to hda_dsp_shutdown
According to hardware spec and PMC FW requirement, the DSP must be
in D3 state before entering S5. Set shutdown call to hda_dsp_shutdown.

Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Signed-off-by: Libin Yang <libin.yang@intel.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20210322163728.16616-8-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-03-23 17:14:30 +00:00
Libin Yang
b0503e8410
ASoC: SOF: Intel: CNL: set shutdown callback to hda_dsp_shutdown
According to hardware spec and PMC FW requirement, the DSP must be
in D3 state before entering S5. Set shutdown call to hda_dsp_shutdown.

Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Signed-off-by: Libin Yang <libin.yang@intel.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20210322163728.16616-7-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-03-23 17:14:29 +00:00
Libin Yang
4939e49ea5
ASoC: SOF: Intel: ICL: set shutdown callback to hda_dsp_shutdown
According to hardware spec and PMC FW requirement, the DSP must be
in D3 state before entering S5. Set shutdown call to hda_dsp_shutdown.

Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Signed-off-by: Libin Yang <libin.yang@intel.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20210322163728.16616-6-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-03-23 17:14:28 +00:00
Libin Yang
22aa9e021a
ASoC: SOF: Intel: TGL: set shutdown callback to hda_dsp_shutdown
According to hardware spec and PMC FW requirement, the DSP must be
in D3 state before entering S5. Define the shutdown function to use
snd_sof_suspend as shutdown callback to make sure DSP is in D3 state.

Fixes: 44a4cfad8d ("ASoC: SOF: Intel: tgl: do thorough remove at .shutdown() callback")
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Signed-off-by: Pan Xiuli <xiuli.pan@linux.intel.com>
Signed-off-by: Libin Yang <libin.yang@intel.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20210322163728.16616-5-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-03-23 17:14:27 +00:00
Libin Yang
3c429f861e
ASoC: SOF: Intel: TGL: fix EHL ops
EHL is derived from TGL, not CNL, so we shall use the TGL ops.

Fixes: 8d4ba1be3d ("ASoC: SOF: pci: split PCI into different drivers")
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Signed-off-by: Libin Yang <libin.yang@intel.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20210322163728.16616-4-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-03-23 17:14:26 +00:00
Pierre-Louis Bossart
91ec48f540
ASoC: SOF: core: harden shutdown helper
When the probe is handled in a workqueue, we must use
cancel_work_sync() in the shutdown helper to avoid possible race
conditions.

We must also take care of possible errors happening in a probe
workqueue or during pm_runtime resume (called e.g. before shutdown for
PCI devices). We should really only try to access hardware registers
and initiate IPCs if the DSP is fully booted.

Fixes: daff7f1478 ("ASoC: SOF: add snd_sof_device_shutdown() helper for shutdown")
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Reviewed-by: Libin Yang <libin.yang@intel.com>
Link: https://lore.kernel.org/r/20210322163728.16616-3-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-03-23 17:14:25 +00:00
Guennadi Liakhovetski
927280909f
ASoC: SOF: Intel: HDA: fix core status verification
When checking for enabled cores it isn't enough to check that
some of the requested cores are running, we have to check that
all of them are.

Fixes: 747503b181 ("ASoC: SOF: Intel: Add Intel specific HDA DSP HW operations")
Reviewed-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.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/20210322163728.16616-2-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-03-23 17:14:24 +00:00
Keyon Jie
bf939446c3
ASoC: intel: sof_rt5682: use the topology mclk
We should use the topology configured mclk if it existed, which can make
sure we are aligned with the FW side about the mclk usage.

Signed-off-by: Keyon Jie <yang.jie@linux.intel.com>
Reviewed-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
Reviewed-by: Daniel Baluta <daniel.baluta@gmail.com>
Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Link: https://lore.kernel.org/r/20210319124950.3853994-2-kai.vehmanen@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-03-22 12:32:23 +00:00
Keyon Jie
b951b51e2c
ASoC: SOF: add a helper to get topology configured mclk
Add helper sof_dai_ssp_mclk to get the topology configured MCLK from a
pcm_runtime, return 0 if it is not available, and error if the dai type
is not SSP at the moment.

Export the helper for external use, e.g. from machine drivers.

Signed-off-by: Keyon Jie <yang.jie@linux.intel.com>
Reviewed-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
Reviewed-by: Daniel Baluta <daniel.baluta@gmail.com>
Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Link: https://lore.kernel.org/r/20210319124950.3853994-1-kai.vehmanen@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-03-22 12:32:22 +00:00
Shengjiu Wang
2277e7e36b
ASoC: fsl_sai: Don't use devm_regmap_init_mmio_clk
When there is power domain bind with bus clock,

The call flow:
devm_regmap_init_mmio_clk
   - clk_prepare()
      - clk_pm_runtime_get()

cause the power domain of clock always be enabled after
regmap_init(). which impact the power consumption.

So use devm_regmap_init_mmio instead of
devm_regmap_init_mmio_clk, then explicitly enable clock when
using by pm_runtime_get(), if CONFIG_PM=n, then
fsl_sai_runtime_resume will be explicitly called.

Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com>
Signed-off-by: Viorel Suman <viorel.suman@nxp.com>
Link: https://lore.kernel.org/r/1616141203-13344-1-git-send-email-shengjiu.wang@nxp.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-03-22 12:32:21 +00:00
Vijendar Mukunda
7e71b48f9e
ASoC: amd: Add support for RT5682 codec in machine driver
Add support for RT5682 codec in machine driver.

Signed-off-by: Vijendar Mukunda <Vijendar.Mukunda@amd.com>
Link: https://lore.kernel.org/r/1616118056-5506-1-git-send-email-Vijendar.Mukunda@amd.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-03-22 12:32:20 +00:00
Mark Brown
3722e4ecef
Merge series "ASoC: tidyup error message timing" from Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>:
Hi Mark

Indicating error message when failed case is very useful for debuging.
In many case, it uses below style.

	int function(...)
	{
		...
		return ret;
	}

	int caller(...)
	{
		...
		ret = function(...);
		if (ret < 0)
			dev_err(...)
		...
	}

This is not so bad, but in this style *each caller* needs to indicate
duplicate same error message, and some caller is forgetting to do it.
And caller can't indicate detail function() error information.

I know many people have many opinion, but if function() indicates error
message, we can get same and detail information without forgot, and it is better.
This patch-set tidyup to do it.

	int function(...)
	{
		...
		if (ret < 0)
			dev_err(...)

		return ret;
	}

	int caller(...)
	{
		...
		ret = function(...);
		...
	}

Kuninori Morimoto (14):
  ASoC: soc-pcm: indicate error message at soc_pcm_open()
  ASoC: soc-pcm: indicate error message at soc_pcm_hw_params()
  ASoC: soc-pcm: indicate error message at soc_pcm_prepare()
  ASoC: soc-pcm: indicate error message at dpcm_path_get()
  ASoC: soc-pcm: indicate error message at dpcm_be_dai_trigger()
  ASoC: soc-pcm: indicate error message at dpcm_apply_symmetry()
  ASoC: soc-pcm: indicate error message at dpcm_run_update_startup/shutdown()
  ASoC: soc-pcm: indicate error message at dpcm_fe/be_dai_startup()
  ASoC: soc-pcm: indicate error message at dpcm_fe/be_dai_hw_params()
  ASoC: soc-pcm: indicate error message at dpcm_fe/be_dai_prepare()
  ASoC: soc-pcm: don't indicate error message for soc_pcm_hw_free()
  ASoC: soc-pcm: don't indicate error message for dpcm_be_dai_hw_free()
  ASoC: don't indicate error message for snd_soc_[pcm_]dai_xxx()
  ASoC: don't indicate error message for snd_soc_[pcm_]component_xxx()

 include/sound/soc-dpcm.h |   2 +-
 sound/soc/soc-compress.c |   9 +-
 sound/soc/soc-core.c     |  22 +----
 sound/soc/soc-dapm.c     |  24 ++---
 sound/soc/soc-pcm.c      | 197 +++++++++++++++++++--------------------
 5 files changed, 108 insertions(+), 146 deletions(-)

--
2.25.1
2021-03-19 16:31:39 +00:00
Wei Yongjun
e6d8af6687
ASoC: rt1019: make symbol 'rt1019_i2c_driver' static
The sparse tool complains as follows:

sound/soc/codecs/rt1019.c:927:19: warning:
 symbol 'rt1019_i2c_driver' was not declared. Should it be static?

This symbol is not used outside of rt1019.c, so this
commit marks it static.

Fixes: 7ec79d3850 ("ASoC: rt1019: add rt1019 amplifier driver")
Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
Link: https://lore.kernel.org/r/20210319094102.4185096-1-weiyongjun1@huawei.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-03-19 12:24:07 +00:00
Kuninori Morimoto
60adbd8fbf
ASoC: don't indicate error message for snd_soc_[pcm_]component_xxx()
All snd_soc_component_xxx() and snd_soc_pcm_component_xxx() itself
indicate error message if failed.
Its caller doesn't need to indicate duplicated error message.
This patch removes it.

All snd_soc_component_xxx() indicate error message if failed.
Its caller doesn't need to indicate duplicated error message.
This patch removes it.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/878s6puta6.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-03-19 12:24:05 +00:00
Kuninori Morimoto
62462e0182
ASoC: don't indicate error message for snd_soc_[pcm_]dai_xxx()
All snd_soc_dai_xxx() and snd_soc_pcm_dai_xxx() itself
indicate error message if failed.
Its caller doesn't need to indicate duplicated error message.
This patch removes it.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/87a6r5utaa.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-03-19 12:24:04 +00:00
Kuninori Morimoto
f52366e683
ASoC: soc-pcm: don't indicate error message for dpcm_be_dai_hw_free()
dpcm_be_dai_hw_free() never fail, error message is not needed.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/87blblutaf.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-03-19 12:24:03 +00:00
Kuninori Morimoto
e20c9c4f96
ASoC: soc-pcm: don't indicate error message for soc_pcm_hw_free()
soc_pcm_hw_free() never fail, error message is not needed.
We can't use void function for it, because it is used
part of struct snd_pcm_ops :: hw_free.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/87czw1utaj.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-03-19 12:24:02 +00:00
Kuninori Morimoto
273db971cf
ASoC: soc-pcm: indicate error message at dpcm_fe/be_dai_prepare()
Indicating error message when failed case is very useful for debuging.
In many case, its style is like below.

	int function(...)
	{
		...
		return ret;
	}

	int caller(...)
	{
		...
		ret = function(...);
		if (ret < 0)
			dev_err(...)
		...
	}

This is not so bad, but in this style *each caller* needs to indicate
duplicate same error message, and some caller is forgetting to do it.
And caller can't indicate detail function() error information.

If function() indicates error message, we can get same and
detail information without forgot.

	int function(...)
	{
		...
		if (ret < 0)
			dev_err(...)

		return ret;
	}

	int caller(...)
	{
		...
		ret = function(...);
		...
	}

This patch follow above style at dpcm_fe/be_dai_prepare()

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/87eeghutap.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-03-19 12:24:01 +00:00
Kuninori Morimoto
33b6b94f55
ASoC: soc-pcm: indicate error message at dpcm_fe/be_dai_hw_params()
Indicating error message when failed case is very useful for debuging.
In many case, its style is like below.

	int function(...)
	{
		...
		return ret;
	}

	int caller(...)
	{
		...
		ret = function(...);
		if (ret < 0)
			dev_err(...)
		...
	}

This is not so bad, but in this style *each caller* needs to indicate
duplicate same error message, and some caller is forgetting to do it.
And caller can't indicate detail function() error information.

If function() indicates error message, we can get same and
detail information without forgot.

	int function(...)
	{
		...
		if (ret < 0)
			dev_err(...)

		return ret;
	}

	int caller(...)
	{
		...
		ret = function(...);
		...
	}

This patch follow above style at dpcm_fe/be_dai_hw_params()

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/87ft0xutat.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-03-19 12:24:00 +00:00
Kuninori Morimoto
06aaeb8742
ASoC: soc-pcm: indicate error message at dpcm_fe/be_dai_startup()
Indicating error message when failed case is very useful for debuging.
In many case, its style is like below.

	int function(...)
	{
		...
		return ret;
	}

	int caller(...)
	{
		...
		ret = function(...);
		if (ret < 0)
			dev_err(...)
		...
	}

This is not so bad, but in this style *each caller* needs to indicate
duplicate same error message, and some caller is forgetting to do it.
And caller can't indicate detail function() error information.

If function() indicates error message, we can get same and
detail information without forgot.

	int function(...)
	{
		...
		if (ret < 0)
			dev_err(...)

		return ret;
	}

	int caller(...)
	{
		...
		ret = function(...);
		...
	}

This patch follow above style at dpcm_fe/be_dai_startup().

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/87h7ldutay.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-03-19 12:23:59 +00:00
Kuninori Morimoto
81c82a9edb
ASoC: soc-pcm: indicate error message at dpcm_run_update_startup/shutdown()
Indicating error message when failed case is very useful for debuging.
In many case, its style is like below.

	int function(...)
	{
		...
		return ret;
	}

	int caller(...)
	{
		...
		ret = function(...);
		if (ret < 0)
			dev_err(...)
		...
	}

This is not so bad, but in this style *each caller* needs to indicate
duplicate same error message, and some caller is forgetting to do it.
And caller can't indicate detail function() error information.

If function() indicates error message, we can get same and
detail information without forgot.

	int function(...)
	{
		...
		if (ret < 0)
			dev_err(...)

		return ret;
	}

	int caller(...)
	{
		...
		ret = function(...);
		...
	}

This patch also
do below to dpcm_run_update_startup()
	1) remove duplicated ret = -EINVAL
	2) remove blank line
do below to dpcm_run_update_shutdown()
	1) remove unused ret

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/87im5tutb3.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-03-19 12:23:58 +00:00
Kuninori Morimoto
bbd2bac8d6
ASoC: soc-pcm: indicate error message at dpcm_apply_symmetry()
Indicating error message when failed case is very useful for debuging.
In many case, its style is like below.

	int function(...)
	{
		...
		return ret;
	}

	int caller(...)
	{
		...
		ret = function(...);
		if (ret < 0)
			dev_err(...)
		...
	}

This is not so bad, but in this style *each caller* needs to indicate
duplicate same error message, and some caller is forgetting to do it.
And caller can't indicate detail function() error information.

If function() indicates error message, we can get same and
detail information without forgot.

	int function(...)
	{
		...
		if (ret < 0)
			dev_err(...)

		return ret;
	}

	int caller(...)
	{
		...
		ret = function(...);
		...
	}

This patch follow above style at dpcm_apply_symmetry(...)

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/87k0q9utb9.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-03-19 12:23:57 +00:00
Kuninori Morimoto
db3aa39c91
ASoC: soc-pcm: indicate error message at dpcm_be_dai_trigger()
Indicating error message when failed case is very useful for debuging.
In many case, its style is like below.

	int function(...)
	{
		...
		return ret;
	}

	int caller(...)
	{
		...
		ret = function(...);
		if (ret < 0)
			dev_err(...)
		...
	}

This is not so bad, but in this style *each caller* needs to indicate
duplicate same error message, and some caller is forgetting to do it.
And caller can't indicate detail function() error information.

If function() indicates error message, we can get same and
detail information without forgot.

	int function(...)
	{
		...
		if (ret < 0)
			dev_err(...)

		return ret;
	}

	int caller(...)
	{
		...
		ret = function(...);
		...
	}

Now, dpcm_be_dai_trigger() user uses it like below.

	err = dpcm_be_dai_trigger(...);
	if (err < 0)
		dev_err(..., "ASoC: trigger FE failed %d\n", err);

But we can get more detail information if dpcm_be_dai_trigger() itself
had dev_err(). And above error message is confusable,
failed is *BE*, not *FE*.

This patch indicates error message at dpcm_be_dai_trigger().

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/87lfaputbe.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-03-19 12:23:56 +00:00
Kuninori Morimoto
d479f00b79
ASoC: soc-pcm: indicate error message at dpcm_path_get()
Indicating error message when failed case is very useful for debuging.
In many case, its style is like below.

	int function(...)
	{
		...
		return ret;
	}

	int caller(...)
	{
		...
		ret = function(...);
		if (ret < 0)
			dev_err(...)
		...
	}

This is not so bad, but in this style *each caller* needs to indicate
duplicate same error message, and some caller is forgetting to do it.
And caller can't indicate detail function() error information.

If function() indicates error message, we can get same and
detail information without forgot.

	int function(...)
	{
		...
		if (ret < 0)
			dev_err(...)

		return ret;
	}

	int caller(...)
	{
		...
		ret = function(...);
		...
	}

Now, many place uses dpcm_path_get() like below

	ret = dpcm_path_get(...);
	if (ret < 0)
		goto error;
(A)	else if (ret == 0)
		dev_dbg(...)

But here, (A) part can be indicated at dpcm_path_get() not caller.
It is simple and readable code.

This patch do it.
Small detail behaviors will be exchanged by this patch.

	1) indicates debug info (= path numbers) if path > 0 case only
	   (It was *always* indicated).
	2) soc_dpcm_fe_runtime_update() is indicating error message
	   for paths < 0 case, but it is already done at dpcm_path_get().
	   Thus just remove it. but dev_dbg() vs dev_warn() is exchanged.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/87mtv5utbj.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-03-19 12:23:55 +00:00
Kuninori Morimoto
dab7eeb404
ASoC: soc-pcm: indicate error message at soc_pcm_prepare()
Indicating error message when failed case is very useful for debuging.
In many case, its style is like below.

	int function(...)
	{
		...
		return ret;
	}

	int caller(...)
	{
		...
		ret = function(...);
		if (ret < 0)
			dev_err(...)
		...
	}

This is not so bad, but in this style *each caller* needs to indicate
duplicate same error message, and some caller is forgetting to do it.
And caller can't indicate detail function() error information.

If function() indicates error message, we can get same and
detail information without forgot.

	int function(...)
	{
		...
		if (ret < 0)
			dev_err(...)

		return ret;
	}

	int caller(...)
	{
		...
		ret = function(...);
		...
	}

This patch follow above style at soc_pcm_prepare().

By this patch, dpcm_fe/be_dai_prepare(...)
temporary lacks FE/BE error info, but it will reborn soon.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/87o8flutbn.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-03-19 12:23:54 +00:00
Kuninori Morimoto
cb11f79b4a
ASoC: soc-pcm: indicate error message at soc_pcm_hw_params()
Indicating error message when failed case is very useful for debuging.
In many case, its style is like below.

	int function(...)
	{
		...
		return ret;
	}

	int caller(...)
	{
		...
		ret = function(...);
		if (ret < 0)
			dev_err(...)
		...
	}

This is not so bad, but in this style *each caller* needs to indicate
duplicate same error message, and some caller is forgetting to do it.
And caller can't indicate detail function() error information.

If function() indicates error message, we can get same and
detail information without forgot.

	int function(...)
	{
		...
		if (ret < 0)
			dev_err(...)

		return ret;
	}

	int caller(...)
	{
		...
		ret = function(...);
		...
	}

This patch follow above style at soc_pcm_hw_params().

By this patch, dpcm_fe/be_dai_hw_params(...)
temporary lacks FE/BE error info, but it will reborn soon.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/87pn01utbt.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-03-19 12:23:53 +00:00
Kuninori Morimoto
e4b044f458
ASoC: soc-pcm: indicate error message at soc_pcm_open()
Indicating error message when failed case is very useful for debuging.
In many case, its style is like below.

	int function(...)
	{
		...
		return ret;
	}

	int caller(...)
	{
		...
		ret = function(...);
		if (ret < 0)
			dev_err(...)
		...
	}

This is not so bad, but in this style *each caller* needs to indicate
duplicate same error message, and some caller is forgetting to do it.
And caller can't indicate detail function() error information.

If function() indicates error message, we can get same and
detail information without forgot.

	int function(...)
	{
		...
		if (ret < 0)
			dev_err(...)

		return ret;
	}

	int caller(...)
	{
		...
		ret = function(...);
		...
	}

This patch follow above style at soc_pcm_open().

By this patch, dpcm_fe/be_dai_startup(...)
temporary lacks FE/BE error info, but it will reborn soon.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/87r1khutby.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-03-19 12:23:52 +00:00
Mark Brown
bb9faeccbd
Merge series "ASoC: codecs: remove cppcheck warnings" from Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>:
Lots of small fixes in various codec drivers that should have no
functional impact.

Pierre-Louis Bossart (23):
  ASoC: ab8500-codec: remove useless structure
  ASoC: ad1836: remove useless return
  ASoC: adau1977: remove useless return
  ASoC: cros_ec_codec: remove null pointer dereference warning
  ASoC: cx2070x: remove useless assignment
  ASoC: cx2070x: remove duplicate else branch
  ASoC: da7219-aad: remove useless initialization
  ASoC: hdac_hdmi: remove useless initializations
  ASoC: hdac_hdmi: align function arguments
  ASoC: hdmi-codec: remove useless initialization
  ASoC: hdmi-codec: remove unused spk_mask member
  ASoC: max98090: remove useless assignment
  ASoC: mt6358: remove useless initializations
  ASoC: mt6359: remove useless assignment
  ASoC: nau8825: remove useless assignment
  ASoC: pcm1681: remove useless assignment
  ASoC: sigmadsp: align function prototype
  ASoC: sti-sas: remove unused struct members
  ASoC: tas2562: remove useless assignment
  ASoC: tas2562: remove warning on return value
  ASoC: tas2770: remove useless initialization
  ASoC: tlv320dac33: clarify expression
  ASoC: tscs454: remove useless test on PLL disable

 sound/soc/codecs/ab8500-codec.c  |  7 -------
 sound/soc/codecs/ad1836.c        |  2 --
 sound/soc/codecs/adau1977.c      |  2 --
 sound/soc/codecs/cros_ec_codec.c |  2 +-
 sound/soc/codecs/cx2072x.c       | 11 ++++-------
 sound/soc/codecs/da7219-aad.c    |  2 +-
 sound/soc/codecs/hdac_hdmi.c     | 14 +++++++-------
 sound/soc/codecs/hdac_hdmi.h     |  2 +-
 sound/soc/codecs/hdmi-codec.c    |  3 +--
 sound/soc/codecs/max98090.c      |  2 +-
 sound/soc/codecs/mt6358.c        |  4 ++--
 sound/soc/codecs/mt6359.c        |  4 ++--
 sound/soc/codecs/nau8825.c       |  2 +-
 sound/soc/codecs/pcm1681.c       |  2 +-
 sound/soc/codecs/sigmadsp.h      |  2 +-
 sound/soc/codecs/sti-sas.c       |  3 ---
 sound/soc/codecs/tas2562.c       |  3 +--
 sound/soc/codecs/tas2770.c       |  2 +-
 sound/soc/codecs/tlv320dac33.c   |  2 +-
 sound/soc/codecs/tscs454.c       |  7 ++++++-
 20 files changed, 32 insertions(+), 46 deletions(-)

--
2.25.1
2021-03-18 17:52:22 +00:00
Mark Brown
cdd23ae6e6
Merge series "Fix reset controls and RPM of NVIDIA Tegra ASoC drivers" from Dmitry Osipenko <digetx@gmail.com>:
Hi,

This series adds missing hardware reset controls to I2S and AC97 drivers,
corrects runtime PM usage and drivers probe/remove order. Currently drivers
happen to work properly because reset is implicitly deasserted by tegra-clk
driver, but clk driver shouldn't touch the resets and we need to fix it
because this breaks other Tegra drivers. Previously we fixed the resets of
the AHUB and HDMI codec drivers, but turned out that we missed the I2C and
AC97 drivers.

Thanks to Paul Fertser for testing the pending clk patches and finding
that audio got broken on Tegra20 AC100 netbook because of the missing I2S
reset.

Changelog:

v5: - After taking another look at the drivers I noticed couple more
      things that could be improved. These new patches correct runtime PM
      and probe/remove order of the drivers:

        ASoC: tegra20: spdif: Correct driver removal order
        ASoC: tegra20: spdif: Remove handing of disabled runtime PM
        ASoC: tegra20: i2s: Add system level suspend-resume callbacks
        ASoC: tegra20: i2s: Correct driver removal order
        ASoC: tegra20: i2s: Use devm_clk_get()
        ASoC: tegra20: i2s: Remove handing of disabled runtime PM
        ASoC: tegra30: i2s: Correct driver removal order
        ASoC: tegra30: i2s: Use devm_clk_get()
        ASoC: tegra30: i2s: Remove handing of disabled runtime PM
        ASoC: tegra30: ahub: Reset global variable
        ASoC: tegra30: ahub: Correct suspend-resume callbacks
        ASoC: tegra30: ahub: Remove handing of disabled runtime PM

v4: - Added missing prototype for reset_control_bulk_put().

v3: - Fixed reset stubs for !CONFIG_RESET_CONTROLLER.

v2: - After some more testing I found that I2S control logic doesn't require
      I2S clock to be enabled for resetting. Hence it's fine to have I2S to
      be reset by parent AHUB driver, so I dropped "tegra30: i2s: Add reset
      control" patch.

    - While I was double-checking resets on Tegra30, I found that that
      Tegra30 I2S driver has a broken runtime PM which doesn't restore
      hardware state on resume and it's lost after AHUB RPM-resume.
      Thus, added this new patch "tegra30: i2s: Restore hardware state
      on runtime PM resume".

    - Added new patches which switch AHUB driver to use reset-bulk API.
      I took the RFC patch from Philipp Zabel, fixed it and added
      devm_reset_control_bulk_optional_get_exclusive_released() that
      will be useful for further Tegra GPU patches. This is a minor
      improvement which makes code cleaner.

Dmitry Osipenko (16):
  ASoC: tegra20: ac97: Add reset control
  ASoC: tegra20: i2s: Add reset control
  ASoC: tegra30: i2s: Restore hardware state on runtime PM resume
  ASoC: tegra30: ahub: Switch to use reset-bulk API
  ASoC: tegra20: spdif: Correct driver removal order
  ASoC: tegra20: spdif: Remove handing of disabled runtime PM
  ASoC: tegra20: i2s: Add system level suspend-resume callbacks
  ASoC: tegra20: i2s: Correct driver removal order
  ASoC: tegra20: i2s: Use devm_clk_get()
  ASoC: tegra20: i2s: Remove handing of disabled runtime PM
  ASoC: tegra30: i2s: Correct driver removal order
  ASoC: tegra30: i2s: Use devm_clk_get()
  ASoC: tegra30: i2s: Remove handing of disabled runtime PM
  ASoC: tegra30: ahub: Reset global variable
  ASoC: tegra30: ahub: Correct suspend-resume callbacks
  ASoC: tegra30: ahub: Remove handing of disabled runtime PM

Philipp Zabel (1):
  reset: Add reset_control_bulk API

 drivers/reset/core.c            | 215 ++++++++++++++++++++++
 include/linux/reset.h           | 315 ++++++++++++++++++++++++++++++++
 sound/soc/tegra/tegra20_ac97.c  |  21 +++
 sound/soc/tegra/tegra20_ac97.h  |   1 +
 sound/soc/tegra/tegra20_i2s.c   |  60 +++---
 sound/soc/tegra/tegra20_i2s.h   |   1 +
 sound/soc/tegra/tegra20_spdif.c |  16 +-
 sound/soc/tegra/tegra30_ahub.c  | 168 ++++++-----------
 sound/soc/tegra/tegra30_ahub.h  |   5 +-
 sound/soc/tegra/tegra30_i2s.c   |  65 ++-----
 10 files changed, 667 insertions(+), 200 deletions(-)

--
2.30.2

base-commit: a38fd87484
2021-03-18 17:52:21 +00:00
Brent Lu
ad83b1adc5
ASoC: Intel: sof_rt5682: Add ALC1015Q-VB speaker amp support
This patch adds jsl_rt5682_rt1015p which supports the RT5682 headset
codec and ALC1015Q-VB speaker amplifier combination on JasperLake
platform.

This driver also supports ALC1015Q-CG if running in auto-mode.
Following table shows the audio interface support of the two
amplifiers.

          | ALC1015Q-CG | ALC1015Q-VB
=====================================
I2C       | Yes         | No
Auto-mode | 48K, 64fs   | 16k, 32fs
                        | 48k, 32fs
                        | 48k, 64fs

Signed-off-by: Brent Lu <brent.lu@intel.com>
Acked-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20210317110824.20814-1-brent.lu@intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-03-18 13:54:45 +00:00
Jack Yu
7ec79d3850
ASoC: rt1019: add rt1019 amplifier driver
This is initial amplifier driver for rt1019.

Signed-off-by: Jack Yu <jack.yu@realtek.com>
Link: https://lore.kernel.org/r/20210311025809.31852-1-jack.yu@realtek.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-03-18 13:54:44 +00:00
Nick Desaulniers
bef2897d31
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>
2021-03-18 13:54:42 +00:00
Pierre-Louis Bossart
a2cc1568dc
ASoC: tscs454: remove useless test on PLL disable
cppcheck warning:

sound/soc/codecs/tscs454.c:730:37: style: Same value in both branches
of ternary operator. [duplicateValueTernary]
  val = pll1 ? FV_PLL1CLKEN_DISABLE : FV_PLL2CLKEN_DISABLE;
                                    ^

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20210312182246.5153-24-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-03-18 13:50:55 +00:00
Pierre-Louis Bossart
39e69cef0a
ASoC: tlv320dac33: clarify expression
cppcheck warning:

sound/soc/codecs/tlv320dac33.c:1074:43: style: Clarify calculation
precedence for '%' and '?'. [clarifyCalculation]
    (dac33->alarm_threshold % period_size ?
                                          ^

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20210312182246.5153-23-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-03-18 13:50:54 +00:00
Pierre-Louis Bossart
ffab1215bd
ASoC: tas2770: remove useless initialization
cppcheck warning:

sound/soc/codecs/tas2770.c:109:10: style: Variable 'ret' is assigned a
value that is never used. [unreadVariable]
 int ret = 0;
         ^

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20210312182246.5153-22-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-03-18 13:50:53 +00:00
Pierre-Louis Bossart
2e40b21cd4
ASoC: tas2562: remove warning on return value
cppcheck warning:

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

Fix with return 0

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20210312182246.5153-21-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-03-18 13:50:52 +00:00
Pierre-Louis Bossart
e83c47861c
ASoC: tas2562: remove useless assignment
cppcheck throws a warning:

sound/soc/codecs/tas2562.c:203:4: style: Assignment of function
parameter has no effect outside the function. [uselessAssignmentArg]
   tx_mask &= ~(1 << right_slot);
   ^

This assignment seems to come from a copy/paste but the value is
indeed not used. Let's remove it.

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20210312182246.5153-20-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-03-18 13:50:51 +00:00
Pierre-Louis Bossart
02a70d7f26
ASoC: sti-sas: remove unused struct members
cppcheck warnings:

sound/soc/codecs/sti-sas.c:54:25: style: struct member
'sti_dac_audio::field' is never used. [unusedStructMember]
 struct regmap_field  **field;
                        ^

sound/soc/codecs/sti-sas.c:55:24: style: struct member
'sti_dac_audio::rst' is never used. [unusedStructMember]
 struct reset_control *rst;
                       ^

sound/soc/codecs/sti-sas.c:61:25: style: struct member
'sti_spdif_audio::field' is never used. [unusedStructMember]
 struct regmap_field  **field;
                        ^

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20210312182246.5153-19-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-03-18 13:50:50 +00:00
Pierre-Louis Bossart
17d74e68e9
ASoC: sigmadsp: align function prototype
cppcheck warning:

sound/soc/codecs/sigmadsp.c:736:60: style:inconclusive: Function
'sigmadsp_setup' argument 2 names different: declaration 'rate'
definition 'samplerate'. [funcArgNamesDifferent]
int sigmadsp_setup(struct sigmadsp *sigmadsp, unsigned int samplerate)
                                                           ^

sound/soc/codecs/sigmadsp.h:62:60: note: Function 'sigmadsp_setup'
argument 2 names different: declaration 'rate' definition
'samplerate'.
int sigmadsp_setup(struct sigmadsp *sigmadsp, unsigned int rate);
                                                           ^

sound/soc/codecs/sigmadsp.c:736:60: note: Function 'sigmadsp_setup'
argument 2 names different: declaration 'rate' definition
'samplerate'.
int sigmadsp_setup(struct sigmadsp *sigmadsp, unsigned int samplerate)
                                                           ^

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20210312182246.5153-18-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-03-18 13:50:49 +00:00
Pierre-Louis Bossart
f10280d5c5
ASoC: pcm1681: remove useless assignment
cppcheck warning:

sound/soc/codecs/pcm1681.c:87:8: style: Variable 'i' is assigned a
value that is never used. [unreadVariable]
 int i = 0, val = -1, enable = 0;
       ^

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20210312182246.5153-17-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-03-18 13:50:48 +00:00
Pierre-Louis Bossart
a3966b254c
ASoC: nau8825: remove useless assignment
cppcheck warning:

sound/soc/codecs/nau8825.c:2113:10: style: Variable 'ret' is assigned
a value that is never used. [unreadVariable]
 int ret = 0;
         ^

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20210312182246.5153-16-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-03-18 13:50:47 +00:00
Pierre-Louis Bossart
d068ab4eab
ASoC: mt6359: remove useless assignment
cppcheck warning:

sound/soc/codecs/mt6359.c:242:19: style: Variable 'stage' is assigned a value that is never used. [unreadVariable]
 int i = 0, stage = 0;
                  ^
sound/soc/codecs/mt6359.c:260:19: style: Variable 'stage' is assigned a value that is never used. [unreadVariable]
 int i = 0, stage = 0;
                  ^
sound/soc/codecs/mt6359.c:274:8: style: Variable 'i' is assigned a value that is never used. [unreadVariable]
 int i = 0, stage = 0;
       ^
sound/soc/codecs/mt6359.c:274:19: style: Variable 'stage' is assigned a value that is never used. [unreadVariable]
 int i = 0, stage = 0;
                  ^

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20210312182246.5153-15-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-03-18 13:50:46 +00:00
Pierre-Louis Bossart
2b5e8cd53f
ASoC: mt6358: remove useless initializations
cppcheck warnings:

sound/soc/codecs/mt6358.c:334:19: style: Variable 'stage' is assigned
a value that is never used. [unreadVariable]
 int i = 0, stage = 0;
                  ^
sound/soc/codecs/mt6358.c:350:19: style: Variable 'stage' is assigned
a value that is never used. [unreadVariable]
 int i = 0, stage = 0;
                  ^
185/930 files checked 25% done
Checking sound/soc/codecs/mt6359.c ...
sound/soc/codecs/mt6359.c:274:8: style: Variable 'i' is assigned a
value that is never used. [unreadVariable]
 int i = 0, stage = 0;
       ^
sound/soc/codecs/mt6359.c:274:19: style: Variable 'stage' is assigned
a value that is never used. [unreadVariable]
 int i = 0, stage = 0;
                  ^

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20210312182246.5153-14-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-03-18 13:50:45 +00:00
Pierre-Louis Bossart
226a783f3d
ASoC: max98090: remove useless assignment
cppcheck warning:

sound/soc/codecs/max98090.c:1835:16: style: Variable 'test_diff' is
assigned a value that is never used. [unreadVariable]
 int test_diff = INT_MAX;
               ^

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20210312182246.5153-13-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-03-18 13:50:44 +00:00
Pierre-Louis Bossart
9ad869fee5
ASoC: hdmi-codec: remove unused spk_mask member
fix cppcheck warning:

sound/soc/codecs/hdmi-codec.c:25:16: style: struct member
'hdmi_codec_channel_map_table::spk_mask' is never
used. [unusedStructMember]
 unsigned long spk_mask;  /* speaker position bit mask */
               ^

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20210312182246.5153-12-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-03-18 13:50:44 +00:00
Pierre-Louis Bossart
3c011ef344
ASoC: hdmi-codec: remove useless initialization
Fix cppcheck warning:

sound/soc/codecs/hdmi-codec.c:745:5: style: Redundant initialization
for 'cf'. The initialized value is overwritten before it is
read. [redundantInitialization]
 cf = dai->playback_dma_data;
    ^
sound/soc/codecs/hdmi-codec.c:738:31: note: cf is initialized
 struct hdmi_codec_daifmt *cf = dai->playback_dma_data;
                              ^
sound/soc/codecs/hdmi-codec.c:745:5: note: cf is overwritten
 cf = dai->playback_dma_data;
    ^

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20210312182246.5153-11-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-03-18 13:50:43 +00:00
Pierre-Louis Bossart
997994d7e6
ASoC: hdac_hdmi: align function arguments
cppcheck warning:

sound/soc/codecs/hdac_hdmi.c:1882:54: style:inconclusive: Function
'hdac_hdmi_jack_init' argument 2 names different: declaration 'pcm'
definition 'device'. [funcArgNamesDifferent]
int hdac_hdmi_jack_init(struct snd_soc_dai *dai, int device,
                                                     ^
sound/soc/codecs/hdac_hdmi.h:5:54: note: Function
'hdac_hdmi_jack_init' argument 2 names different: declaration 'pcm'
definition 'device'.
int hdac_hdmi_jack_init(struct snd_soc_dai *dai, int pcm,
                                                     ^

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20210312182246.5153-10-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-03-18 13:50:42 +00:00
Pierre-Louis Bossart
426b3bbcee
ASoC: hdac_hdmi: remove useless initializations
Cppcheck complains a lot about possible null pointer dereferences but
it's again a case of useless initializations to NULL.

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20210312182246.5153-9-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-03-18 13:50:41 +00:00
Pierre-Louis Bossart
f8a684a4c2
ASoC: da7219-aad: remove useless initialization
cppcheck warning:

sound/soc/codecs/da7219-aad.c:118:22: style: Variable 'ret' is
assigned a value that is never used. [unreadVariable]
 int report = 0, ret = 0;
                     ^

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Acked-by: Adam Thomson <Adam.Thomson.Opensource@diasemi.com>
Link: https://lore.kernel.org/r/20210312182246.5153-8-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-03-18 13:50:40 +00:00
Pierre-Louis Bossart
8d41c1ab24
ASoC: cx2070x: remove duplicate else branch
cppcheck warning:

sound/soc/codecs/cx2072x.c:1436:10: style:inconclusive: Found
duplicate branches for 'if' and 'else'. [duplicateBranch]
  } else if (type & 0x4) {
         ^
sound/soc/codecs/cx2072x.c:1439:5: note: Found duplicate branches for
'if' and 'else'.
  } else {
    ^
sound/soc/codecs/cx2072x.c:1436:10: note: Found duplicate branches for
'if' and 'else'.
  } else if (type & 0x4) {
         ^

The last two branches do the same thing and can be collapsed together.

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Takashi Iwai <tiwai@suse.de>
Link: https://lore.kernel.org/r/20210312182246.5153-7-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-03-18 13:50:39 +00:00
Pierre-Louis Bossart
4d753b6642
ASoC: cx2070x: remove useless assignment
Cppcheck warning:

sound/soc/codecs/cx2072x.c:830:26: style: Variable
'reg1.r.rx_data_one_line' is reassigned a value before the old one has
been used. [redundantAssignment]

 reg1.r.rx_data_one_line = 1;
                         ^

sound/soc/codecs/cx2072x.c:782:26: note: reg1.r.rx_data_one_line is
assigned
 reg1.r.rx_data_one_line = 1;
                         ^

sound/soc/codecs/cx2072x.c:830:26: note: reg1.r.rx_data_one_line is
overwritten
 reg1.r.rx_data_one_line = 1;
                         ^

sound/soc/codecs/cx2072x.c:831:26: style: Variable
'reg1.r.tx_data_one_line' is reassigned a value before the old one has
been used. [redundantAssignment]
 reg1.r.tx_data_one_line = 1;
                         ^
sound/soc/codecs/cx2072x.c:783:26: note: reg1.r.tx_data_one_line is
assigned
 reg1.r.tx_data_one_line = 1;
                         ^

sound/soc/codecs/cx2072x.c:831:26: note: reg1.r.tx_data_one_line is
overwritten
 reg1.r.tx_data_one_line = 1;
                         ^

Likely copy/paste.

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Takashi Iwai <tiwai@suse.de>
Link: https://lore.kernel.org/r/20210312182246.5153-6-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-03-18 13:50:38 +00:00
Pierre-Louis Bossart
157c4df677
ASoC: cros_ec_codec: remove null pointer dereference warning
Cppcheck complains of a possible issue:

sound/soc/codecs/cros_ec_codec.c:98:10: warning: Possible null pointer
dereference: in [nullPointer]
  memcpy(in, msg->data, insize);
         ^
sound/soc/codecs/cros_ec_codec.c:162:34: note: Calling function
'send_ec_host_command', 5th argument 'NULL' value is 0
       (uint8_t *)&p, sizeof(p), NULL, 0);
                                 ^
sound/soc/codecs/cros_ec_codec.c:98:10: note: Null pointer dereference
  memcpy(in, msg->data, insize);
         ^

In practice the access to the pointer is protected by another
argument, but this is likely to fool other static analysis tools. Add
a test to avoid doing the memcpy if the pointer is NULL or the size is
zero.

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Acked-by: Enric Balletbo i Serra <enric.balletbo@collabora.com>
Link: https://lore.kernel.org/r/20210312182246.5153-5-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-03-18 13:50:37 +00:00
Pierre-Louis Bossart
5b349c8f35
ASoC: adau1977: remove useless return
Cppcheck warning:

sound/soc/codecs/adau1977.c:242:9: warning: Identical condition and
return expression 'ret', return value is always 0
[identicalConditionAfterEarlyExit]

 return ret;
        ^
sound/soc/codecs/adau1977.c:239:6: note: If condition 'ret' is true,
the function will return/exit

 if (ret)
     ^
sound/soc/codecs/adau1977.c:242:9: note: Returning identical expression 'ret'
 return ret;
        ^

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20210312182246.5153-4-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-03-18 13:50:36 +00:00
Pierre-Louis Bossart
ca6b3a6ca0
ASoC: ad1836: remove useless return
Cppcheck warning:

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

Likely copy/paste between adc and dac cases.

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20210312182246.5153-3-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-03-18 13:50:35 +00:00
Pierre-Louis Bossart
73b4fe4a03
ASoC: ab8500-codec: remove useless structure
Cppcheck warnings:

sound/soc/codecs/ab8500-codec.c:117:20: style: struct member 'ab8500_codec_drvdata_dbg::vaud' is never used. [unusedStructMember]
 struct regulator *vaud;
                   ^
sound/soc/codecs/ab8500-codec.c:118:20: style: struct member 'ab8500_codec_drvdata_dbg::vamic1' is never used. [unusedStructMember]
 struct regulator *vamic1;
                   ^
sound/soc/codecs/ab8500-codec.c:119:20: style: struct member 'ab8500_codec_drvdata_dbg::vamic2' is never used. [unusedStructMember]
 struct regulator *vamic2;
                   ^
sound/soc/codecs/ab8500-codec.c:120:20: style: struct member 'ab8500_codec_drvdata_dbg::vdmic' is never used. [unusedStructMember]
 struct regulator *vdmic;
                   ^

The structure is never used, remove.

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20210312182246.5153-2-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-03-18 13:50:34 +00:00
Dmitry Osipenko
b5571449e6
ASoC: tegra30: ahub: Remove handing of disabled runtime PM
Runtime PM is always available on Tegra since commit 40b2bb1b13
("ARM: tegra: enforce PM requirement"), hence there is no need to
handle the case of a disabled RPM by Tegra drivers. Remove handing
of a disabled runtime PM from Tegra30 AHUB driver.

Signed-off-by: Dmitry Osipenko <digetx@gmail.com>
Link: https://lore.kernel.org/r/20210314154459.15375-18-digetx@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-03-18 13:49:45 +00:00
Dmitry Osipenko
e2965c2ca1
ASoC: tegra30: ahub: Correct suspend-resume callbacks
Tegra30 AHUB driver always syncs hardware state on a runtime PM resume,
hence there is no needed to re-sync the state on system resume. Replace
the suspend-resume callbacks with a generic helpers which ensure that
AHUB is suspended using RPM callbacks across system suspend-resume.

Signed-off-by: Dmitry Osipenko <digetx@gmail.com>
Link: https://lore.kernel.org/r/20210314154459.15375-17-digetx@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-03-18 13:49:44 +00:00
Dmitry Osipenko
5d956e3cb8
ASoC: tegra30: ahub: Reset global variable
Tegra30 AHUB uses global variable that is never reset by the driver on
a probe failure and on driver removal, meaning that driver will never try
to re-probe and can't be unbound. Make driver to reset the variable.

Signed-off-by: Dmitry Osipenko <digetx@gmail.com>
Link: https://lore.kernel.org/r/20210314154459.15375-16-digetx@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-03-18 13:49:43 +00:00
Dmitry Osipenko
b5f6f781fc
ASoC: tegra30: i2s: Remove handing of disabled runtime PM
Runtime PM is always available on Tegra since commit 40b2bb1b13
("ARM: tegra: enforce PM requirement"), hence there is no need to
handle the case of a disabled RPM by Tegra drivers. Remove handing
of a disabled runtime PM from Tegra30 I2S driver.

Signed-off-by: Dmitry Osipenko <digetx@gmail.com>
Link: https://lore.kernel.org/r/20210314154459.15375-15-digetx@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-03-18 13:49:42 +00:00
Dmitry Osipenko
52674aef9e
ASoC: tegra30: i2s: Use devm_clk_get()
Use resource-managed variant of clk_get() to simplify code.

Signed-off-by: Dmitry Osipenko <digetx@gmail.com>
Link: https://lore.kernel.org/r/20210314154459.15375-14-digetx@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-03-18 13:49:41 +00:00
Dmitry Osipenko
f852e1e4ac
ASoC: tegra30: i2s: Correct driver removal order
Tegra30 I2S driver has a wrong driver removal order, which should be
opposite to the registration order, but it's not. In particular the
runtime PM is disabled in a wrong order. Fix the order.

Signed-off-by: Dmitry Osipenko <digetx@gmail.com>
Link: https://lore.kernel.org/r/20210314154459.15375-13-digetx@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-03-18 13:49:40 +00:00
Dmitry Osipenko
80ec4a4cb3
ASoC: tegra20: i2s: Remove handing of disabled runtime PM
Runtime PM is always available on Tegra since commit 40b2bb1b13
("ARM: tegra: enforce PM requirement"), hence there is no need to
handle the case of a disabled RPM by Tegra drivers. Remove handing
of a disabled runtime PM from Tegra20 I2S driver.

Signed-off-by: Dmitry Osipenko <digetx@gmail.com>
Link: https://lore.kernel.org/r/20210314154459.15375-12-digetx@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-03-18 13:49:39 +00:00
Dmitry Osipenko
d3c6ef98da
ASoC: tegra20: i2s: Use devm_clk_get()
Use resource-managed variant of clk_get() to simplify code.

Signed-off-by: Dmitry Osipenko <digetx@gmail.com>
Link: https://lore.kernel.org/r/20210314154459.15375-11-digetx@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-03-18 13:49:38 +00:00
Dmitry Osipenko
ca6e960ed6
ASoC: tegra20: i2s: Correct driver removal order
Tegra20 I2S driver has a wrong driver removal order, which should be
opposite to the registration order, but it's not. In particular the
runtime PM is disabled in a wrong order. Fix the order.

Signed-off-by: Dmitry Osipenko <digetx@gmail.com>
Link: https://lore.kernel.org/r/20210314154459.15375-10-digetx@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-03-18 13:49:37 +00:00
Dmitry Osipenko
e33fdd9bee
ASoC: tegra20: i2s: Add system level suspend-resume callbacks
Add system level suspend-resume callbacks in order to ensure that I2S
is gated before system is suspended. This puts Tegra20 I2S driver on
par with the Tegra30 I2S driver.

Signed-off-by: Dmitry Osipenko <digetx@gmail.com>
Link: https://lore.kernel.org/r/20210314154459.15375-9-digetx@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-03-18 13:49:36 +00:00
Dmitry Osipenko
c53b396f0d
ASoC: tegra20: spdif: Remove handing of disabled runtime PM
Runtime PM is always available on Tegra since commit 40b2bb1b13
("ARM: tegra: enforce PM requirement"), hence there is no need to
handle the case of a disabled RPM by Tegra drivers. Remove handing
of a disabled runtime PM from Tegra20 SPDIF driver.

Signed-off-by: Dmitry Osipenko <digetx@gmail.com>
Link: https://lore.kernel.org/r/20210314154459.15375-8-digetx@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-03-18 13:49:35 +00:00
Dmitry Osipenko
0911f154a2
ASoC: tegra20: spdif: Correct driver removal order
Tegra20 SPDIF driver has a wrong driver removal order, which should be
opposite to the registration order, but it's not. In particular the
runtime PM is disabled in a wrong order. Fix the order.

Signed-off-by: Dmitry Osipenko <digetx@gmail.com>
Link: https://lore.kernel.org/r/20210314154459.15375-7-digetx@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-03-18 13:49:35 +00:00
Dmitry Osipenko
050086eb6d
ASoC: tegra30: ahub: Switch to use reset-bulk API
Switch to use reset-bulk API in order to make code cleaner.

Signed-off-by: Dmitry Osipenko <digetx@gmail.com>
Link: https://lore.kernel.org/r/20210314154459.15375-6-digetx@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-03-18 13:49:34 +00:00
Dmitry Osipenko
0bbcecaaab
ASoC: tegra30: i2s: Restore hardware state on runtime PM resume
Tegra30 I2S driver syncs regmap cache only on resume from system suspend,
but hardware is reset across the runtime suspend because RPM of the parent
AHUB driver resets the I2S hardware, hence h/w state is lost after each
RPM resume. The problem isn't visible because hardware happens to be fully
reprogrammed after each RPM resume. Move hardware syncing to RPM resume in
order to restore h/w state properly.

Fixes: ed9ce1ed22 ("ASoC: tegra: ahub: Reset hardware properly")
Signed-off-by: Dmitry Osipenko <digetx@gmail.com>
Link: https://lore.kernel.org/r/20210314154459.15375-4-digetx@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-03-18 13:49:32 +00:00
Dmitry Osipenko
9c648ef82d
ASoC: tegra20: i2s: Add reset control
The I2S reset may be asserted at a boot time, in particular this is the
case on Tegra20 AC100 netbook. Tegra20 I2S driver doesn't manage the
reset control and currently it happens to work because reset is implicitly
deasserted by the tegra-clk driver when I2S clock is enabled. The I2S
permanently stays in a reset once tegra-clk is fixed to not touch the
resets, which it shouldn't be doing. Add reset control to the Tegra20
I2S driver.

Note that I2S reset was always specified in Tegra20 device-tree, hence
DTB ABI changes aren't required.

Tested-by: Paul Fertser <fercerpav@gmail.com> # T20 AC100
Reported-by: Paul Fertser <fercerpav@gmail.com>
Signed-off-by: Dmitry Osipenko <digetx@gmail.com>
Link: https://lore.kernel.org/r/20210314154459.15375-3-digetx@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-03-18 13:49:31 +00:00
Dmitry Osipenko
a46b78247b
ASoC: tegra20: ac97: Add reset control
Tegra20 AC97 driver doesn't manage the AC97 controller reset, relying on
implicit deassertion of the reset by tegra-clk driver, which needs to be
fixed since this behaviour is unacceptable by other Tegra drivers. Add
explicit reset control to the Tegra20 AC97 driver.

Note that AC97 reset was always specified in Tegra20 device-tree, hence
DTB ABI changes aren't required.

Signed-off-by: Dmitry Osipenko <digetx@gmail.com>
Link: https://lore.kernel.org/r/20210314154459.15375-2-digetx@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-03-18 13:49:30 +00:00
Hans de Goede
a908a71669 ASoC/extcon: arizona: Move arizona jack code to sound/soc/codecs/arizona-jack.c
The jack handling for arizona codecs is being refactored so that it is
done directly by the codec drivers, instead of having an extcon-driver
bind to a separate "arizona-extcon" child-device for this.

drivers/mfd/arizona-core.c has already been updated to no longer
instantiate an "arizona-extcon" child-device for the arizona codecs.

This means that the "arizona-extcon" driver is no longer useful
(there are no longer any devices for it to bind to).

This commit drops the extcon Kconfig / Makefile bits and moves
drivers/extcon/extcon-arizona.c to sound/soc/codecs/arizona-jack.c .

This is a preparation patch for converting the arizona extcon-driver into
a helper library for letting the arizona codec-drivers directly report jack
state through the standard sound/soc/soc-jack.c functions.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Acked-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Tested-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Acked-by: Chanwoo Choi <cw00.choi@samsung.com>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
2021-03-18 11:46:15 +00:00
Bhaskar Chowdhury
c00f4f2598
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>
2021-03-17 13:10:46 +00:00
Mark Brown
081634599b
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
2021-03-16 17:55:39 +00:00
Mark Brown
f9dc51cc66
Merge series "Do not handle MCLK device clock in simple-card-utils" from Sameer Pujar <spujar@nvidia.com>:
With commit 1e30f642cf ("ASoC: simple-card-utils: Fix device module clock")
simple-card-utils can control MCLK clock for rate updates or enable/disable.
But this is breaking some platforms where it is expected that codec drivers
would actually handle the MCLK clock. One such example is following platform.
  - "arch/arm64/boot/dts/freescale/fsl-ls1028a-kontron-sl28-var3-ads2.dts"

In above case codec, wm8904, is using internal PLL and configures sysclk
based on fixed MCLK input. In such cases it is expected that, required PLL
output or sysclk, is just passed via set_sysclk() callback and card driver
need not actually update MCLK rate. Instead, codec can take ownership of
this clock and do the necessary configuration.

So the original commit is reverted and codec driver for rt5659 is updated
to fix my board which has this codec.

Sameer Pujar (2):
  ASoC: simple-card-utils: Do not handle device clock
  ASoC: rt5659: Update MCLK rate in set_sysclk()

 sound/soc/codecs/rt5659.c             |  5 +++++
 sound/soc/generic/simple-card-utils.c | 13 +++++++------
 2 files changed, 12 insertions(+), 6 deletions(-)

--
2.7.4
2021-03-16 17:55:37 +00:00
Yang Li
2e2bf6d479
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>
2021-03-16 13:29:38 +00:00
Mikhail Durnev
19c6a63ced
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>
2021-03-16 13:29:37 +00:00
Viorel Suman
6ad864ed6a
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>
2021-03-16 13:29:35 +00:00
Guennadi Liakhovetski
97f53046d7
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>
2021-03-16 13:25:46 +00:00
Guennadi Liakhovetski
72c35856b5
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>
2021-03-16 13:25:45 +00:00
Guennadi Liakhovetski
11fd6d8e09
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>
2021-03-16 13:25:44 +00:00
Bard Liao
899b12542b
ASoC: rt711: add snd_soc_component remove callback
We do some IO operations in the snd_soc_component_set_jack callback
function and snd_soc_component_set_jack() will be called when soc
component is removed. However, we should not access SoundWire registers
when the bus is suspended.
So set regcache_cache_only(regmap, true) to avoid accessing in the
soc component removal process.

Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Reviewed-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Reviewed-by: Rander Wang <rander.wang@intel.com>
Link: https://lore.kernel.org/r/20210316005254.29699-1-yung-chuan.liao@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-03-16 13:24:15 +00:00
Sameer Pujar
dbf54a9534
ASoC: rt5659: Update MCLK rate in set_sysclk()
Simple-card/audio-graph-card drivers do not handle MCLK clock when it
is specified in the codec device node. The expectation here is that,
the codec should actually own up the MCLK clock and do necessary setup
in the driver.

Suggested-by: Mark Brown <broonie@kernel.org>
Suggested-by: Michael Walle <michael@walle.cc>
Signed-off-by: Sameer Pujar <spujar@nvidia.com>
Link: https://lore.kernel.org/r/1615829492-8972-3-git-send-email-spujar@nvidia.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-03-16 13:24:13 +00:00
Sameer Pujar
8ca88d5335
ASoC: simple-card-utils: Do not handle device clock
This reverts commit 1e30f642cf ("ASoC: simple-card-utils: Fix device
module clock"). The original patch ended up breaking following platform,
which depends on set_sysclk() to configure internal PLL on wm8904 codec
and expects simple-card-utils to not update the MCLK rate.
 - "arch/arm64/boot/dts/freescale/fsl-ls1028a-kontron-sl28-var3-ads2.dts"

It would be best if codec takes care of setting MCLK clock via DAI
set_sysclk() callback.

Reported-by: Michael Walle <michael@walle.cc>
Suggested-by: Mark Brown <broonie@kernel.org>
Suggested-by: Michael Walle <michael@walle.cc>
Fixes: 1e30f642cf ("ASoC: simple-card-utils: Fix device module clock")
Signed-off-by: Sameer Pujar <spujar@nvidia.com>
Tested-by: Michael Walle <michael@walle.cc>
Link: https://lore.kernel.org/r/1615829492-8972-2-git-send-email-spujar@nvidia.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-03-16 13:24:12 +00:00
Mark Brown
54d796b86e
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
2021-03-12 22:54:34 +00:00
Mark Brown
6e35f4281c
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
2021-03-12 22:54:33 +00:00
Robin Gong
ee427ea4f1
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>
2021-03-12 20:48:05 +00:00
Hans de Goede
9f47c9c8bd
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>
2021-03-12 20:47:19 +00:00
Hans de Goede
40e4046913
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>
2021-03-12 20:47:18 +00:00
Pierre-Louis Bossart
f7b61287cf
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>
2021-03-12 20:45:41 +00:00
Pierre-Louis Bossart
d58970da32
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: 8d1513cef5 ("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>
2021-03-12 20:45:40 +00:00
Jack Yu
464b489a78
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>
2021-03-12 18:23:49 +00:00
Hans de Goede
b7c7203a1f
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>
2021-03-12 18:23:48 +00:00
Mark Brown
c00af5f32c
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
2021-03-12 18:05:09 +00:00
Pierre-Louis Bossart
14667403a5
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>
2021-03-12 14:29:54 +00:00
Pierre-Louis Bossart
d9cdc13356
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>
2021-03-12 14:29:53 +00:00
Pierre-Louis Bossart
57f1379e77
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>
2021-03-12 14:29:52 +00:00
Pierre-Louis Bossart
2e5e57f085
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>
2021-03-12 14:29:51 +00:00
Kuninori Morimoto
531590bb40
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>
2021-03-12 14:26:32 +00:00
Kuninori Morimoto
20048a9a40
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>
2021-03-12 14:26:31 +00:00
Kuninori Morimoto
1db19c1518
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>
2021-03-12 14:26:30 +00:00
Kuninori Morimoto
c393281a3c
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>
2021-03-12 14:26:29 +00:00
Kuninori Morimoto
68cbc55737
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>
2021-03-12 14:26:28 +00:00
Kuninori Morimoto
56e749ba75
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>
2021-03-12 14:26:27 +00:00
Kuninori Morimoto
6fb8944cd2
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>
2021-03-12 14:26:26 +00:00
Kuninori Morimoto
f8fc9ec56f
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>
2021-03-12 14:26:25 +00:00
Jiaxin Yu
8d06b9633a
ASoC: mediatek: mt8192: fix tdm out data is valid on rising edge
This patch correct tdm out bck inverse register to AUDIO_TOP_CON3[3].

Signed-off-by: Jiaxin Yu <jiaxin.yu@mediatek.com>
Link: https://lore.kernel.org/r/1615516005-781-1-git-send-email-jiaxin.yu@mediatek.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-03-12 14:25:32 +00:00
Srinivasa Rao Mandadapu
9922f50f71
ASoC: qcom: lpass-cpu: Fix lpass dai ids parse
The max boundary check while parsing dai ids makes
sound card registration fail after common up dai ids.

Fixes: cd3484f7f1 ("ASoC: qcom: Fix broken support to MI2S TERTIARY and QUATERNARY")

Signed-off-by: Srinivasa Rao Mandadapu <srivasam@codeaurora.org>
Link: https://lore.kernel.org/r/20210311154557.24978-1-srivasam@codeaurora.org
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-03-11 16:21:11 +00:00
Mark Brown
0befe3a0c6
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
2021-03-11 16:16:35 +00:00
Mark Brown
6f2cd36f78
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
2021-03-11 16:16:34 +00:00
Pierre-Louis Bossart
c68fded79a
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: c014170408 ("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>
2021-03-11 13:25:09 +00:00
Tzung-Bi Shih
9dc21a066b
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>
2021-03-11 13:25:07 +00:00
Pierre-Louis Bossart
8ea9e29cc7
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>
2021-03-11 13:24:19 +00:00
Pierre-Louis Bossart
492df5b074
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>
2021-03-11 13:24:18 +00:00
Pierre-Louis Bossart
ea80d4991b
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>
2021-03-11 13:24:17 +00:00
Pierre-Louis Bossart
b564fdb756
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>
2021-03-11 13:24:16 +00:00
Pierre-Louis Bossart
729d42a4ab
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>
2021-03-11 13:24:15 +00:00
Pierre-Louis Bossart
d28a9dfeb8
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>
2021-03-11 13:24:14 +00:00
Pierre-Louis Bossart
13119a311a
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>
2021-03-11 13:24:13 +00:00
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
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
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
Pierre-Louis Bossart
17de60946a
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>
2021-03-10 13:10:08 +00:00
Pierre-Louis Bossart
17d78e9311
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>
2021-03-10 13:10:07 +00:00
Pierre-Louis Bossart
ca1107d305
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>
2021-03-10 13:10:06 +00:00
Pierre-Louis Bossart
9fd72391ae
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>
2021-03-10 13:10:05 +00:00
Pierre-Louis Bossart
bb133ec21f
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>
2021-03-10 13:10:05 +00:00
Pierre-Louis Bossart
9b9adc5b74
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>
2021-03-10 13:10:04 +00:00
Pierre-Louis Bossart
33eaffe370
ASoC: rt5651: 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-12-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-03-10 13:10:03 +00:00
Pierre-Louis Bossart
fa0eb20cb3
ASoC: rt5645: clarify expression
cppcheck warning:

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

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20210302212527.55158-11-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-03-10 13:10:02 +00:00
Pierre-Louis Bossart
5864cf7f26
ASoC: rt5645: use logical OR
cppcheck warning:

sound/soc/codecs/rt5645.c:693:37: style:inconclusive: Boolean
expression 'reg>=420&&reg<=461' is used in bitwise operation. Did you
mean '||'? [bitwiseOnBoolean]
 if ((reg >= 0x1a4 && reg <= 0x1cd) | (reg >= 0x1e5 && reg <= 0x1f8) |
                                    ^
sound/soc/codecs/rt5645.c:693:70: style:inconclusive: Boolean
expression 'reg==177' is used in bitwise operation. Did you mean '||'?
[bitwiseOnBoolean]
 if ((reg >= 0x1a4 && reg <= 0x1cd) | (reg >= 0x1e5 && reg <= 0x1f8) |
                                                                     ^

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20210302212527.55158-10-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-03-10 13:10:01 +00:00
Pierre-Louis Bossart
4fbd297894
ASoC: rt5640: clarify expression
cppcheck warning:

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

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20210302212527.55158-9-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-03-10 13:10:00 +00:00
Pierre-Louis Bossart
1dd9cca701
ASoC: rt1308: clarify expression
cppcheck warning:

sound/soc/codecs/rt1308.c:676:40: style: Boolean result is used in
bitwise operation. Clarify expression with
parentheses. [clarifyCondition]
  pll_code.k_code << RT1308_PLL1_K_SFT |
                                       ^

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20210302212527.55158-8-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-03-10 13:09:59 +00:00
Pierre-Louis Bossart
9e884eed54
ASoC: rt1305: clarify expression
cppcheck warning:

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

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20210302212527.55158-7-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-03-10 13:09:58 +00:00
Pierre-Louis Bossart
a426017ed5
ASoC: rt1016: clarify expression
cppcheck warning:

sound/soc/codecs/rt1016.c:503:61: style: Boolean result is used in
bitwise operation. Clarify expression with
parentheses. [clarifyCondition]
  (pll_code.m_bp ? 0 : pll_code.m_code) << RT1016_PLL_M_SFT |
                                                            ^
sound/soc/codecs/rt1016.c:506:40: style: Boolean result is used in
bitwise operation. Clarify expression with
parentheses. [clarifyCondition]
  pll_code.k_bp << RT1016_PLL_K_BP_SFT |
                                       ^

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20210302212527.55158-6-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-03-10 13:09:57 +00:00
Pierre-Louis Bossart
4354ad55cd
ASoC: rt1015: clarify expression
cppcheck warning:

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

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20210302212527.55158-5-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-03-10 13:09:56 +00:00
Pierre-Louis Bossart
5a24299265
ASoC: rt1011: clarify expression
cppcheck warning:

sound/soc/codecs/rt1011.c:1781:63: style: Boolean result is used in
bitwise operation. Clarify expression with
parentheses. [clarifyCondition]

  (pll_code.m_bp ? 0 : pll_code.m_code) << RT1011_PLL1_QM_SFT |
                                                              ^

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20210302212527.55158-4-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-03-10 13:09:55 +00:00
Pierre-Louis Bossart
7e66f16251
ASoC: rt1011: remove redundant test
cppcheck warning:

sound/soc/codecs/rt1011.c:1994:6: style: Condition 'tx_slotnum' is
always true [knownConditionTrueFalse]
 if (tx_slotnum)
     ^
sound/soc/codecs/rt1011.c:1895:24: note: Assuming that condition
'!tx_slotnum' is not redundant
 if (tx_slotnum > 2 || !tx_slotnum) {
                       ^
sound/soc/codecs/rt1011.c:1994:6: note: Condition 'tx_slotnum' is
always true
if (tx_slotnum)
     ^

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20210302212527.55158-3-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-03-10 13:09:54 +00:00
Pierre-Louis Bossart
f7c5c16875
ASoC: rt1011: use logical OR
cppcheck complains a lot about mixing booleans and bitwise operations.

There is no good reason to use && and |, fix with ||

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20210302212527.55158-2-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-03-10 13:09:53 +00:00
Mark Brown
7942bf0671
Merge series "ASoC: Intel: soc-acpi: remove unused TigerLake configurations" from Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>:
Remove two machine descriptors which were added for development on
Intel RVPs but are no longer used or productized. This will not have
any impact on end-users. The corresponding cleanup was applied in the
SOF topologies.

Pierre-Louis Bossart (2):
  ASoC: Intel: soc-acpi: remove unused TGL table with rt5682 only
  ASoC: Intel: soc-acpi: remove TGL RVP mixed SoundWire/TDM config

 .../intel/common/soc-acpi-intel-tgl-match.c   | 23 -------------------
 1 file changed, 23 deletions(-)

--
2.25.1
2021-03-10 13:09:52 +00:00
Mark Brown
842860f45d
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:09:38 +00:00
Ranjani Sridharan
e443858258
ASoC: SOF: Intel: hda: enable async suspend
The skylake driver disabled async suspend to prevent disabling
the DSP before the card was suspended during system suspend.
This code was carried over to the SOF driver. But, there is no
risk of the DSP getting disabled before the card is suspended
with the SOF driver. Therefore, it is safe to enable async suspend
and thereby optimize the system resume time.

Reviewed-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Link: https://lore.kernel.org/r/20210301170157.36584-1-ranjani.sridharan@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-03-10 13:08:49 +00:00
Fabio Estevam
ee00e0bf7e
ASoC: wm8524: Do not print probe defer error
On an imx8mq-evk the following error is seen:

[    1.375809] wm8524-codec audio-codec: Failed to get mute line: -517

It happens because the codec driver may probe prior to the imx gpio
driver, which causes a probe defer.

Change to dev_err_probe() to avoid printing this error.

Reported-by: Chris Healy <cphealy@gmail.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Link: https://lore.kernel.org/r/20210301193328.2123511-1-festevam@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-03-10 13:08:48 +00:00
Pierre-Louis Bossart
7810ea4c8f
ASoC: Intel: atom: fix kernel-doc
v5.12-rc1 flags new warnings with make W=1, fix missing or broken
function descriptors.

sound/soc/intel/atom/sst/sst_loader.c:85: warning: expecting prototype
for sst_start_merrifield(). Prototype was for sst_start_mrfld()
instead

sound/soc/intel/atom/sst/sst_acpi.c:339: warning: expecting prototype
for intel_sst_remove(). Prototype was for sst_acpi_remove() instead

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20210301165349.114952-3-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-03-10 13:08:47 +00:00
Pierre-Louis Bossart
2fb8711095
ASoC: soc-dai: fix kernel-doc
v5.12-rc1 flags new warnings with make W=1, fix missing or broken
function descriptors.

sound/soc/soc-dai.c:167: warning: expecting prototype for
snd_soc_xlate_tdm_slot(). Prototype was for
snd_soc_xlate_tdm_slot_mask() instead

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20210301174659.117122-1-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-03-10 13:08:46 +00:00
Pierre-Louis Bossart
075d7da7d6
ASoC: codecs: nau8825: fix kernel-doc
v5.12-rc1 flags new warnings with make W=1, fix missing or broken
function descriptors.

sound/soc/codecs/nau8825.c:298: warning: wrong kernel-doc identifier
on line:
 * Ramp up the headphone volume change gradually to target level.

sound/soc/codecs/nau8825.c:358: warning: expecting prototype for This
func(). Prototype was for nau8825_intlog10_dec3() instead

sound/soc/codecs/nau8825.c:411: warning: wrong kernel-doc identifier
on line:
 * computes cross talk suppression sidetone gain.

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20210301174639.117017-1-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-03-10 13:08:45 +00:00
Pierre-Louis Bossart
5ed26a834b
ASoC: Intel: soc-acpi: remove TGL RVP mixed SoundWire/TDM config
The TGL RVP can be configured in many ways. We initially supported a
mixed configuration with RT711 in SoundWire mode and RT1308 in
TDM mode.

However Intel teams no longer have any hardware with this
configuration and there are no commercially-available devices using it
either, so let's remove this entry. The corresponding topology will
also be removed from the SOF tree.

This patch partially reverts Commit d985d208bf ("ASoC: Intel: common: add match tables for TGL w/ SoundWire")

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Reviewed-by: Bard Liao <bard.liao@intel.com>
Reviewed-by: Rander Wang <rander.wang@intel.com>
Link: https://lore.kernel.org/r/20210301235637.1177525-3-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-03-10 13:08:43 +00:00
Pierre-Louis Bossart
4e8d9fe7f0
ASoC: Intel: soc-acpi: remove unused TGL table with rt5682 only
This patch partially reverts Commit 095ee71907 ("ASoC: Intel: common: add match table for TGL RT5682 SoundWire driver").

This commit was added as an enabling patch before the Maxim98373 codec
driver was available. This codec is now fully functional and the
topology with only RT5682 no longer maintained or used.

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Reviewed-by: Bard Liao <bard.liao@intel.com>
Reviewed-by: Rander Wang <rander.wang@intel.com>
Link: https://lore.kernel.org/r/20210301235637.1177525-2-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-03-10 13:08:42 +00:00
Codrin Ciubotariu
16135d6630
ASoC: mchp-i2s-mcc: Add FIFOs support
I2S-MCC found on SAMA7G5 includes 2 FIFOs (capture and playback). When
FIFOs are enabled, bits I2SMCC_ISRA.TXLRDYx and I2SMCC_ISRA.TXRRDYx must
not be used. Bits I2SMCC_ISRB.TXFFRDY and I2SMCC_ISRB.RXFFRDY must be used
instead.

Signed-off-by: Codrin Ciubotariu <codrin.ciubotariu@microchip.com>
Link: https://lore.kernel.org/r/20210301170905.835091-7-codrin.ciubotariu@microchip.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-03-10 13:08:39 +00:00
Codrin Ciubotariu
bfdca48975
ASoC: mchp-i2s-mcc: Add support to select TDM pins
SAMA7G5's I2S-MCC has 4 pairs of DIN/DOUT pins. Since TDM only uses a
single pair of pins for synchronous capture and playback, the controller
needs to be told which of the pair is connected. This can be mentioned
using the "microchip,tdm-data-pair" property from DT. The property is
optional, useful only if TDM is used. If it's missing, DIN/DOUT 0 pins
will be used by default.

Signed-off-by: Codrin Ciubotariu <codrin.ciubotariu@microchip.com>
Link: https://lore.kernel.org/r/20210301170905.835091-6-codrin.ciubotariu@microchip.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-03-10 13:08:38 +00:00
Codrin Ciubotariu
13c1629d75
ASoC: mchp-i2s-mcc: Add multi-channel support for I2S and LEFT_J formats
The latest I2S-MCC available in SAMA7G5 supports multi-channel for I2S and
Left-Justified formats. For this, the new version uses 8 (4 * 2) input and
output pins, with each pin being responsible for 2 channels. This sums up
to a total of 8 channels for synchronous capture and playback.

Signed-off-by: Codrin Ciubotariu <codrin.ciubotariu@microchip.com>
Link: https://lore.kernel.org/r/20210301170905.835091-4-codrin.ciubotariu@microchip.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-03-10 13:08:37 +00:00
Codrin Ciubotariu
99ac2f8d15
ASoC: mchp-i2s-mcc: Add compatible for SAMA7G5
Microchip's new SAMA7G5 includes an updated I2S-MCC compatible with the
previous version found on SAM9X60. The new controller includes 8 (4 * 2)
input and output data pins for up to 8 channels for I2S and Left-Justified
formats.

Signed-off-by: Codrin Ciubotariu <codrin.ciubotariu@microchip.com>
Link: https://lore.kernel.org/r/20210301170905.835091-3-codrin.ciubotariu@microchip.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-03-10 13:08:36 +00:00
Mark Brown
fa576ff64f
Merge series "ASoC: rsnd: cleanup ppcheck warning for Renesas sound driver" from Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>:
Hi Mark, Pierre-Louis

These patches are based on below patch-set which from Pierre-Louis,
and cleanup cppcheck warnings for Rensas sound driver.
[3/5] has Reported-by Pierre-Louis tag.

	Subject: [PATCH 0/8] ASoC: sh: remove cppcheck warnings
	Date: Fri, 19 Feb 2021 17:16:27 -0600

Kuninori Morimoto (5):
  ASoC: rsnd: cleanup ppcheck warning for ssiu.c
  ASoC: rsnd: cleanup ppcheck warning for ssi.c
  ASoC: rsnd: cleanup ppcheck warning for core.c
  ASoC: rsnd: cleanup ppcheck warning for cmd.c
  ASoC: rsnd: cleanup ppcheck warning for adg.c

 sound/soc/sh/rcar/adg.c  | 15 +++++++-------
 sound/soc/sh/rcar/cmd.c  | 15 +++++++-------
 sound/soc/sh/rcar/core.c | 32 +++++++++++++---------------
 sound/soc/sh/rcar/ssi.c  | 45 ++++++++++++++++++++--------------------
 sound/soc/sh/rcar/ssiu.c | 22 +++++++++++---------
 5 files changed, 64 insertions(+), 65 deletions(-)

--
2.25.1
2021-03-10 13:08:35 +00:00
Mark Brown
ef1ed5b855
Merge series "drop unneeded snd_soc_dai_set_drvdata" from Julia Lawall <Julia.Lawall@inria.fr>:
snd_soc_dai_set_drvdata is not needed when the set data comes from
snd_soc_dai_get_drvdata or dev_get_drvdata.

---

 sound/soc/fsl/fsl_micfil.c  |    2 --
 sound/soc/fsl/fsl_sai.c     |    2 --
 sound/soc/fsl/fsl_xcvr.c    |    1 -
 sound/soc/mxs/mxs-saif.c    |   10 ----------
 sound/soc/pxa/mmp-sspa.c    |    1 -
 sound/soc/sunxi/sun4i-i2s.c |    2 --
 6 files changed, 18 deletions(-)
2021-03-10 13:08:34 +00:00
Mark Brown
3766623b5c
Merge series "ASoC: sh: remove cppcheck warnings" from Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>:
No functional changes except for patch 4 where a missing error check
was added for consistency.

Pierre-Louis Bossart (8):
  ASoC: sh: dma-sh7760: remove unused variable
  ASoC: sh: rcar: align function prototypes
  ASoC: sh: rcar: simplify return
  ASoC: sh: rcar: core: rename shadowing variables
  ASoC: sh: rcar: ctu: add  missing error check
  ASoC: sh: rcar: ssi: remove redundant assignment
  ASoC: sh: siu_pcm: remove useless assignment
  ASoC: sh: siu_pcm: remove unused variable

 sound/soc/sh/dma-sh7760.c |  1 -
 sound/soc/sh/rcar/core.c  | 14 +++++++-------
 sound/soc/sh/rcar/ctu.c   |  2 ++
 sound/soc/sh/rcar/rsnd.h  |  6 +++---
 sound/soc/sh/rcar/ssi.c   |  1 -
 sound/soc/sh/siu_pcm.c    |  6 +-----
 6 files changed, 13 insertions(+), 17 deletions(-)

--
2.25.1
2021-03-10 13:08:33 +00:00
Mark Brown
d59748076b
Merge series "ASoC: core: remove cppcheck warnings" from Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>:
This is the first batch of cleanups to make cppcheck more usable,
currently we have way too many warnings that drown real issues.

Pierre-Louis Bossart (6):
  ASoC: soc-ops: remove useless assignment
  ASoC: soc-pcm: remove redundant assignment
  ASoC: soc-pcm: remove shadowing variable
  ASoC: soc-pcm: add error log
  ASoC: soc-topology: clarify expression
  ASoC: generic: simple-card-utils: remove useless assignment

 sound/soc/generic/simple-card-utils.c |  2 +-
 sound/soc/soc-ops.c                   |  2 +-
 sound/soc/soc-pcm.c                   |  4 ++--
 sound/soc/soc-topology.c              | 16 ++++++++--------
 4 files changed, 12 insertions(+), 12 deletions(-)

--
2.25.1
2021-03-10 13:08:32 +00:00
Mark Brown
260fe5535b
Merge series "ASoC: samsung: remove cppcheck warnings" from Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>:
No functional changes except for patch 2 and 3 where missing error
checks were added for consistency.

Pierre-Louis Bossart (6):
  ASoC: samsung: i2s: remove unassigned variable
  ASoC: samsung: s3c24xx_simtec: add missing error check
  ASoC: samsung: smdk_wm8994: add missing return
  ASoC: samsung: snow: remove useless test
  ASoC: samsung: tm2_wm5110: check of_parse return value
  ASoC: samsung: tm2_wm5510: remove shadowing variable

 sound/soc/samsung/i2s.c            | 3 +--
 sound/soc/samsung/s3c24xx_simtec.c | 5 +++++
 sound/soc/samsung/smdk_wm8994.c    | 1 +
 sound/soc/samsung/snow.c           | 5 +----
 sound/soc/samsung/tm2_wm5110.c     | 3 +--
 5 files changed, 9 insertions(+), 8 deletions(-)

--
2.25.1
2021-03-10 13:08:31 +00:00
Mark Brown
4ea62149dc
Merge series "soc-pcm: tidyup snd_pcm_hardware setup for FE/BE" from Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>:
Hi Mark

These patches tidyup snd_pcm_hardware setup for FE/BE.
[1/5] changes behavior, but I think it is bug-fix.

Kuninori Morimoto (5):
  ASoC: soc-pcm: remove strange format storing
  ASoC: soc-pcm: unpack dpcm_init_runtime_hw()
  ASoC: soc-pcm: add dpcm_runtime_setup_fe()
  ASoC: soc-pcm: add dpcm_runtime_setup()
  ASoC: soc-pcm: unpack dpcm_set_fe_runtime()

 sound/soc/soc-pcm.c | 79 +++++++++++++++++++++------------------------
 1 file changed, 36 insertions(+), 43 deletions(-)

--
2.25.1
2021-03-10 13:08:30 +00:00
Mark Brown
029448a856
Merge series "ASoC: fsl: remove cppcheck warnings" from Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>:
Nothing critical and no functional changes.

The only change that needs attention if the 'fsl_ssi: remove
unnecessary tests' patch, where variables are to zero, then tested to
set register fields. Either the tests are indeed redundant or the
entire programming sequence is incorrect.

Pierre-Louis Bossart (9):
  ASoC: fsl: fsl_asrc: remove useless assignment
  ASoC: fsl: fsl_dma: remove unused variable
  ASoC: fsl: fsl_easrc: remove useless assignments
  ASoC: fsl: fsl_esai: clarify expression
  ASoC: fsl: fsl_ssi: remove unnecessary tests
  ASoC: fsl: imx-hdmi: remove unused structure members
  ASoC: fsl: mpc5200: signed parameter in snprintf format
  ASoC: fsl: mpc8610: remove useless assignment
  ASoC: fsl: p1022_ds: remove useless assignment

 sound/soc/fsl/fsl_asrc.c     | 2 +-
 sound/soc/fsl/fsl_dma.c      | 3 ---
 sound/soc/fsl/fsl_easrc.c    | 6 +++---
 sound/soc/fsl/fsl_esai.c     | 2 +-
 sound/soc/fsl/fsl_ssi.c      | 5 ++---
 sound/soc/fsl/imx-hdmi.c     | 4 ----
 sound/soc/fsl/mpc5200_dma.c  | 2 +-
 sound/soc/fsl/mpc8610_hpcd.c | 2 +-
 sound/soc/fsl/p1022_ds.c     | 2 +-
 9 files changed, 10 insertions(+), 18 deletions(-)

--
2.25.1
2021-03-10 13:08:29 +00:00
Mark Brown
7817317e2f
Merge series "ASoC: rt*: Constify static structs" from Rikard Falkeborn <rikard.falkeborn@gmail.com>:
Constify a number of static structs that are never modified in RealTek
codecs. The most important patches are the first two, which constifies
snd_soc_dai_ops and sdw_slave_ops, both which contain function pointers.
The other two patches are for good measure, since I was already touching
the code there.

When doing this, I discovered sound/soc/codecs/rt1016.c is not in a
Makefile, so there is not really any way to build it (I added locally to
the Makefile to compile-test my changes). Is this expected or an oversight?

Rikard Falkeborn (4):
  ASoC: rt*: Constify static struct sdw_slave_ops
  ASoC: rt*: Constify static struct snd_soc_dai_ops
  ASoC: rt*: Constify static struct acpi_device_id
  ASoc: rt5631: Constify static struct coeff_clk_div

 sound/soc/codecs/rt1011.c     | 2 +-
 sound/soc/codecs/rt1015.c     | 4 ++--
 sound/soc/codecs/rt1016.c     | 4 ++--
 sound/soc/codecs/rt1305.c     | 2 +-
 sound/soc/codecs/rt1308-sdw.c | 2 +-
 sound/soc/codecs/rt1308.c     | 2 +-
 sound/soc/codecs/rt5631.c     | 2 +-
 sound/soc/codecs/rt5682-sdw.c | 4 ++--
 sound/soc/codecs/rt700-sdw.c  | 2 +-
 sound/soc/codecs/rt700.c      | 2 +-
 sound/soc/codecs/rt711-sdw.c  | 2 +-
 sound/soc/codecs/rt711.c      | 2 +-
 sound/soc/codecs/rt715-sdw.c  | 2 +-
 sound/soc/codecs/rt715.c      | 2 +-
 14 files changed, 17 insertions(+), 17 deletions(-)

--
2.30.1
2021-03-10 13:07:24 +00:00
Mark Brown
893bc891d3
Merge series "ASoC: qcom: remove cppcheck warnings" from Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>:
Second batch of cleanups for Qualcomm SOCs and codecs. The only
functional change is the addition of a missing error check in the last
patch.

Pierre-Louis Bossart (10):
  ASoC: qcom: lpass-hdmi: remove useless return
  ASoC: qcom: lpass-platform: remove useless assignment
  ASoC: qcom: q6dsp-dai: clarify expression
  ASoC: qcom: q6afe: remove useless assignments
  ASoC: qcom: q6afe: align function prototype
  ASoC: qcom: q6asm: align function prototypes
  ASoC: wcd-clsh-v2: align function prototypes
  ASoC: wcd9335: clarify return value
  ASoC: wcd934x: remove useless return
  ASoC: lpass-wsa-macro: add missing test

 sound/soc/codecs/lpass-wsa-macro.c | 2 ++
 sound/soc/codecs/wcd-clsh-v2.h     | 6 +++---
 sound/soc/codecs/wcd9335.c         | 2 +-
 sound/soc/codecs/wcd934x.c         | 2 --
 sound/soc/qcom/lpass-hdmi.c        | 4 ----
 sound/soc/qcom/lpass-platform.c    | 2 +-
 sound/soc/qcom/qdsp6/q6afe-dai.c   | 2 +-
 sound/soc/qcom/qdsp6/q6afe.c       | 5 ++---
 sound/soc/qcom/qdsp6/q6afe.h       | 2 +-
 sound/soc/qcom/qdsp6/q6asm.h       | 6 +++---
 10 files changed, 14 insertions(+), 19 deletions(-)

--
2.25.1
2021-03-10 13:07:23 +00:00