Commit graph

1097 commits

Author SHA1 Message Date
Linus Torvalds 86edf52e7c sound fixes for 5.9-rc4
A collection of small changes, nothing intrusive:
 
 * Remaining tasklet API conversions, now all sound stuff have been
   converted
 * A few HD-audio and USB-audio quirks and minor fixes
 * FireWire Tascam and Digi00xx fixes
 * Drop of kernel WARNING from PCM OSS for syzkaller
 -----BEGIN PGP SIGNATURE-----
 
 iQJCBAABCAAsFiEEIXTw5fNLNI7mMiVaLtJE4w1nLE8FAl9R8ckOHHRpd2FpQHN1
 c2UuZGUACgkQLtJE4w1nLE+Dtg//ShtXFp622T5NiMvDF5sG8AlbvGLf1dUdja62
 6sF2kba9vhncI9ejjGSJBCdfun3dtNkjsffacKOzTbnSHbwsBjU7J68zP1dru+d2
 88WXb4h8iAxAPcPHSgblpdi+ifeKGEYsAr7tbVa5KIpFKDxW7qLw5ntXu0G0vuW3
 +ao/p3TB/LT5I42bu0UmXsfuO7dVoyyzOSDdlse0mFNNeNSLVslAkaqqYSosmp1/
 I2gPyP814OwqrPITGvlnDWLfCnuTVDQodtAYb6sADPpplBTGu4uVfJUD+w6xVNDX
 2byY6Q2TYYolrBUSvsPxUSXAfogvGQFppOnpbxnZftIrDoFC8WN048vWEfYZ2CWn
 bVDQmErqAk8+l3r8kllW6IXhJxF2CMivv92Ht+8VA4sw29RVGtUXw6Gm7aJvoqP3
 zewF7RZh6vNJVsjAv4KEpYTyNLQi9eYCygeB9INA7dWBZeyaolchX1Ptrd4fhyo7
 ko20Fbu+vuk18B9zNE5yIpBKNpqDVNyTCnZSU9kzCicVZ/OD15fw/sUXUVo3wx5X
 ZRLBdJrccXni+LlbYHT6tJPtnQtBHITffN2/zvGPPXlViLexz88jtqWaTayy4J1u
 L63BIA3L8IfAW1ln22CfNlKbwN+Ku1uJwJnPHiUPDABXH6Uk2oeCxI5BRLzyTieB
 oe1jrcs=
 =CwOB
 -----END PGP SIGNATURE-----

Merge tag 'sound-5.9-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound

Pull sound fixes from Takashi Iwai:
 "A collection of small changes, nothing intrusive:

   - remaining tasklet API conversions, now all sound stuff have been
     converted

   - a few HD-audio and USB-audio quirks and minor fixes

   - FireWire Tascam and Digi00xx fixes

   - drop a kernel WARNING from PCM OSS for syzkaller"

* tag 'sound-5.9-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound: (29 commits)
  ALSA: hda/realtek - Improved routing for Thinkpad X1 7th/8th Gen
  ALSA: hda: use consistent HDAudio spelling in comments/docs
  ALSA: hda: add dev_dbg log when driver is not selected
  ALSA: hda: fix a runtime pm issue in SOF when integrated GPU is disabled
  ALSA: hda: hdmi - add Rocketlake support
  ALSA: ua101: convert tasklets to use new tasklet_setup() API
  ALSA: usb-audio: convert tasklets to use new tasklet_setup() API
  ASoC: txx9: convert tasklets to use new tasklet_setup() API
  ASoC: siu: convert tasklets to use new tasklet_setup() API
  ASoC: fsl_esai: convert tasklets to use new tasklet_setup() API
  ALSA: hdsp: convert tasklets to use new tasklet_setup() API
  ALSA: riptide: convert tasklets to use new tasklet_setup() API
  ALSA: pci/asihpi: convert tasklets to use new tasklet_setup() API
  ALSA: firewire: convert tasklets to use new tasklet_setup() API
  ALSA: core: convert tasklets to use new tasklet_setup() API
  ALSA: pcm: oss: Remove superfluous WARN_ON() for mulaw sanity check
  ALSA: hda - Fix silent audio output and corrupted input on MSI X570-A PRO
  ALSA: hda/hdmi: always check pin power status in i915 pin fixup
  ALSA: hda/realtek: Add quirk for Samsung Galaxy Book Ion NT950XCJ-X716A
  ALSA: usb-audio: Add basic capture support for Pioneer DJ DJM-250MK2
  ...
2020-09-04 12:05:25 -07:00
Allen Pais b07e4a3fb2 ASoC: fsl_esai: convert tasklets to use new tasklet_setup() API
In preparation for unconditionally passing the
struct tasklet_struct pointer to all tasklet
callbacks, switch to using the new tasklet_setup()
and from_tasklet() to pass the tasklet pointer explicitly.

Signed-off-by: Romain Perier <romain.perier@gmail.com>
Signed-off-by: Allen Pais <allen.lkml@gmail.com>
Acked-by: Mark Brown <broonie@kernel.org>
Link: https://lore.kernel.org/r/20200902040221.354941-7-allen.lkml@gmail.com
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2020-09-02 13:25:51 +02:00
Gustavo A. R. Silva df561f6688 treewide: Use fallthrough pseudo-keyword
Replace the existing /* fall through */ comments and its variants with
the new pseudo-keyword macro fallthrough[1]. Also, remove unnecessary
fall-through markings when it is the case.

[1] https://www.kernel.org/doc/html/v5.7/process/deprecated.html?highlight=fallthrough#implicit-switch-case-fall-through

Signed-off-by: Gustavo A. R. Silva <gustavoars@kernel.org>
2020-08-23 17:36:59 -05:00
Takashi Iwai 9e96716026 ASoC: Fixes for v5.9
A bunch of fixes that came in during the merge window, mostly for issues
 that were uncovered by the changes to report errors on invalid register
 access plus one important fix in that code itself.
 -----BEGIN PGP SIGNATURE-----
 
 iQFHBAABCgAxFiEEreZoqmdXGLWf4p/qJNaLcl1Uh9AFAl88HrYTHGJyb29uaWVA
 a2VybmVsLm9yZwAKCRAk1otyXVSH0JA2B/900+o6U6GH+uqk0HfHPt+Kj0cFHHE5
 AS88HxKDNQztj2MQwGKQMzbPCUyHLhlzgaqYXx1++9pWmfJ7DOs646UhQ2VenKB8
 nVxpkv9FZbdIDiLuEHPL+i+nzcIzPBYR7Hxcn37pqaYzG+DvNAl8VuSufZueQkXi
 qVfVT2sCyNDNMnLl/HZ2RwE/sbS43nqn8LH4+Y4dDcIRR9wdVyMWEGBJ4WYlMFOv
 3tjg6b9PlRo40RT5CCTcPeTIFniIv8c76TTpUwtvb+fjVMWYnLh9BbDNEa903AGP
 AU8CaM3ZEw15NZ008G9Bs04z6WqS/ZCeJTaXK8heKEsSjdsceKDEaicC
 =cmGI
 -----END PGP SIGNATURE-----

Merge tag 'asoc-fix-v5.9-rc1' of https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound into for-linus

ASoC: Fixes for v5.9

A bunch of fixes that came in during the merge window, mostly for issues
that were uncovered by the changes to report errors on invalid register
access plus one important fix in that code itself.
2020-08-19 08:03:04 +02:00
Takashi Iwai 9493755d7c
ASoC: fsl: Fix unused variable warning
The variable rtd was left unused in psc_dma_free(), even unnoticed
during conversion to a new style:
  sound/soc/fsl/mpc5200_dma.c:342:30: warning: unused variable 'rtd' [-Wunused-variable]

Drop the superfluous one.

Fixes: 6d1048bc11 ("ASoC: fsl: mpc5200_dma: remove snd_pcm_ops")
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Link: https://lore.kernel.org/r/20200803144630.9615-1-tiwai@suse.de
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-08-03 16:25:48 +01:00
Shengjiu Wang f36e8edb95
ASoC: fsl-asoc-card: Remove fsl_asoc_card_set_bias_level function
With this case:
aplay -Dhw:x 16khz.wav 24khz.wav
There is sound distortion for 24khz.wav. The reason is that setting
PLL of WM8962 with set_bias_level function, the bias level is not
changed when 24khz.wav is played, then the PLL won't be reset, the
clock is not correct, so distortion happens.

The resolution of this issue is to remove fsl_asoc_card_set_bias_level.
Move PLL configuration to hw_params and hw_free.

After removing fsl_asoc_card_set_bias_level, also test WM8960 case,
it can work.

Fixes: 708b4351f0 ("ASoC: fsl: Add Freescale Generic ASoC Sound Card with ASRC support")
Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com>
Acked-by: Nicolin Chen <nicoleotsuka@gmail.com>
Link: https://lore.kernel.org/r/1596420811-16690-1-git-send-email-shengjiu.wang@nxp.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-08-03 14:17:32 +01:00
Mark Brown 84569f329f
Merge remote-tracking branch 'asoc/for-5.9' into asoc-next 2020-07-31 19:54:03 +01:00
Shengjiu Wang 5aef1ff239
ASoC: fsl_sai: Fix value of FSL_SAI_CR1_RFW_MASK
The fifo_depth is 64 on i.MX8QM/i.MX8QXP, 128 on i.MX8MQ, 16 on
i.MX7ULP.

Original FSL_SAI_CR1_RFW_MASK value 0x1F is not suitable for
these platform, the FIFO watermark mask should be updated
according to the fifo_depth.

Fixes: a860fac420 ("ASoC: fsl_sai: Add support for imx7ulp/imx8mq")
Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com>
Reviewed-by: Fabio Estevam <festevam@gmail.com>
Link: https://lore.kernel.org/r/1596176895-28724-1-git-send-email-shengjiu.wang@nxp.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-07-31 19:06:53 +01:00
Mark Brown d1e2a97b36
Merge series "ASoC: add asoc_substream_to_rtd() macro" from Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>:
Hi Mark

Many ASoC drivers are getting rtd from substream by

	rtd = substream->private_data

OTOH, we have snd_pcm_substream_chip() macro for it.

	#define snd_pcm_substream_chip(substream) ((substream)->private_data)

But, both are not understandable for reader.
This patch adds new asoc_substream_to_rtd() which is easy to understand.

These are not important, but for readable code.

Kuninori Morimoto (29):
  ASoC: soc-xxx: add asoc_substream_to_rtd()
  ASoC: ux500: use asoc_substream_to_rtd()
  ASoC: ti: use asoc_substream_to_rtd()
  ASoC: tegra: use asoc_substream_to_rtd()
  ASoC: sunxi: use asoc_substream_to_rtd()
  ASoC: stm: use asoc_substream_to_rtd()
  ASoC: sof: use asoc_substream_to_rtd()
  ASoC: sh: use asoc_substream_to_rtd()
  ASoC: samsung: use asoc_substream_to_rtd()
  ASoC: pxa: use asoc_substream_to_rtd()
  ASoC: cirrus: use asoc_substream_to_rtd()
  ASoC: rockchip: use asoc_substream_to_rtd()
  ASoC: amd: use asoc_substream_to_rtd()
  ASoC: fsl: use asoc_substream_to_rtd()
  ASoC: mediatek: use asoc_substream_to_rtd()
  ASoC: atmel: use asoc_substream_to_rtd()
  ASoC: qcom: use asoc_substream_to_rtd()
  ASoC: dwc: use asoc_substream_to_rtd()
  ASoC: intel: use asoc_substream_to_rtd()
  ASoC: meson: use asoc_substream_to_rtd()
  ASoC: au1x: use asoc_substream_to_rtd()
  ASoC: bcm: use asoc_substream_to_rtd()
  ASoC: codecs: use asoc_substream_to_rtd()
  ASoC: generic: use asoc_substream_to_rtd()
  ASoC: sprd: use asoc_substream_to_rtd()
  ASoC: kirkwood: use asoc_substream_to_rtd()
  ASoC: xtensa: use asoc_substream_to_rtd()
  ASoC: mxs: use asoc_substream_to_rtd()
  ASoC: uniphier: use asoc_substream_to_rtd()

 include/sound/soc.h                           |  2 +
 sound/soc/amd/acp-da7219-max98357a.c          | 12 ++--
 sound/soc/amd/acp-pcm-dma.c                   |  2 +-
 sound/soc/amd/acp-rt5645.c                    |  2 +-
 sound/soc/amd/acp3x-rt5682-max9836.c          |  8 +--
 sound/soc/amd/raven/acp3x-i2s.c               |  2 +-
 sound/soc/amd/raven/acp3x-pcm-dma.c           |  6 +-
 sound/soc/atmel/atmel-classd.c                |  8 +--
 sound/soc/atmel/atmel-pcm-dma.c               |  4 +-
 sound/soc/atmel/atmel-pcm-pdc.c               |  2 +-
 sound/soc/atmel/atmel-pdmic.c                 | 10 +--
 sound/soc/atmel/atmel_wm8904.c                |  2 +-
 sound/soc/au1x/db1200.c                       |  2 +-
 sound/soc/au1x/dbdma2.c                       |  2 +-
 sound/soc/au1x/dma.c                          |  2 +-
 sound/soc/bcm/bcm63xx-pcm-whistler.c          | 12 ++--
 sound/soc/bcm/cygnus-pcm.c                    | 16 ++---
 sound/soc/cirrus/edb93xx.c                    |  2 +-
 sound/soc/cirrus/snappercl15.c                |  2 +-
 sound/soc/codecs/rt5677-spi.c                 |  4 +-
 sound/soc/dwc/dwc-pcm.c                       |  2 +-
 sound/soc/fsl/eukrea-tlv320.c                 |  2 +-
 sound/soc/fsl/fsl-asoc-card.c                 |  2 +-
 sound/soc/fsl/fsl_asrc_dma.c                  |  4 +-
 sound/soc/fsl/fsl_dma.c                       |  2 +-
 sound/soc/fsl/fsl_spdif.c                     | 10 +--
 sound/soc/fsl/fsl_ssi.c                       |  8 +--
 sound/soc/fsl/imx-audmix.c                    |  6 +-
 sound/soc/fsl/imx-mc13783.c                   |  2 +-
 sound/soc/fsl/mpc5200_dma.c                   |  8 +--
 sound/soc/fsl/mpc5200_psc_i2s.c               |  2 +-
 sound/soc/fsl/mpc8610_hpcd.c                  |  2 +-
 sound/soc/fsl/mx27vis-aic32x4.c               |  2 +-
 sound/soc/fsl/p1022_ds.c                      |  2 +-
 sound/soc/fsl/p1022_rdk.c                     |  2 +-
 sound/soc/fsl/wm1133-ev1.c                    |  2 +-
 sound/soc/generic/simple-card-utils.c         |  6 +-
 sound/soc/intel/atom/sst-mfld-platform-pcm.c  |  6 +-
 sound/soc/intel/baytrail/sst-baytrail-pcm.c   | 16 ++---
 sound/soc/intel/boards/bdw-rt5650.c           |  2 +-
 sound/soc/intel/boards/bdw-rt5677.c           |  4 +-
 sound/soc/intel/boards/broadwell.c            |  2 +-
 sound/soc/intel/boards/bxt_rt298.c            |  2 +-
 sound/soc/intel/boards/byt-rt5640.c           |  2 +-
 sound/soc/intel/boards/bytcht_da7213.c        |  4 +-
 sound/soc/intel/boards/bytcr_rt5640.c         |  2 +-
 sound/soc/intel/boards/bytcr_rt5651.c         |  2 +-
 sound/soc/intel/boards/cht_bsw_max98090_ti.c  |  2 +-
 sound/soc/intel/boards/cht_bsw_nau8824.c      |  2 +-
 sound/soc/intel/boards/cht_bsw_rt5645.c       |  2 +-
 sound/soc/intel/boards/cht_bsw_rt5672.c       |  2 +-
 sound/soc/intel/boards/cml_rt1011_rt5682.c    |  4 +-
 sound/soc/intel/boards/ehl_rt5660.c           |  2 +-
 sound/soc/intel/boards/glk_rt5682_max98357a.c |  2 +-
 sound/soc/intel/boards/haswell.c              |  2 +-
 sound/soc/intel/boards/kbl_da7219_max98927.c  |  8 +--
 sound/soc/intel/boards/kbl_rt5660.c           |  2 +-
 sound/soc/intel/boards/kbl_rt5663_max98927.c  |  4 +-
 .../intel/boards/kbl_rt5663_rt5514_max98927.c |  4 +-
 .../soc/intel/boards/skl_nau88l25_max98357a.c |  2 +-
 sound/soc/intel/boards/skl_nau88l25_ssm4567.c |  2 +-
 sound/soc/intel/boards/skl_rt286.c            |  2 +-
 sound/soc/intel/boards/sof_da7219_max98373.c  |  2 +-
 sound/soc/intel/boards/sof_maxim_common.c     |  4 +-
 sound/soc/intel/boards/sof_pcm512x.c          |  4 +-
 sound/soc/intel/boards/sof_rt5682.c           |  4 +-
 sound/soc/intel/boards/sof_sdw_rt1308.c       |  2 +-
 sound/soc/intel/boards/sof_wm8804.c           |  2 +-
 sound/soc/intel/haswell/sst-haswell-pcm.c     | 12 ++--
 sound/soc/intel/keembay/kmb_platform.c        |  2 +-
 sound/soc/intel/skylake/skl-pcm.c             |  8 +--
 sound/soc/kirkwood/armada-370-db.c            |  2 +-
 sound/soc/mediatek/common/mtk-afe-fe-dai.c    | 12 ++--
 .../mediatek/common/mtk-afe-platform-driver.c |  2 +-
 sound/soc/mediatek/mt2701/mt2701-afe-pcm.c    |  2 +-
 sound/soc/mediatek/mt2701/mt2701-cs42448.c    |  2 +-
 sound/soc/mediatek/mt2701/mt2701-wm8960.c     |  2 +-
 sound/soc/mediatek/mt6797/mt6797-afe-pcm.c    |  4 +-
 sound/soc/mediatek/mt8173/mt8173-afe-pcm.c    |  2 +-
 sound/soc/mediatek/mt8173/mt8173-max98090.c   |  2 +-
 .../mediatek/mt8173/mt8173-rt5650-rt5514.c    |  2 +-
 .../mediatek/mt8173/mt8173-rt5650-rt5676.c    |  2 +-
 sound/soc/mediatek/mt8173/mt8173-rt5650.c     |  2 +-
 sound/soc/mediatek/mt8183/mt8183-afe-pcm.c    |  4 +-
 .../mediatek/mt8183/mt8183-da7219-max98357.c  |  8 +--
 .../mt8183/mt8183-mt6358-ts3a227-max98357.c   | 12 ++--
 sound/soc/meson/axg-card.c                    |  2 +-
 sound/soc/meson/gx-card.c                     |  2 +-
 sound/soc/meson/meson-card-utils.c            |  2 +-
 sound/soc/meson/meson-codec-glue.c            |  2 +-
 sound/soc/mxs/mxs-sgtl5000.c                  |  2 +-
 sound/soc/pxa/brownstone.c                    |  2 +-
 sound/soc/pxa/corgi.c                         |  4 +-
 sound/soc/pxa/hx4700.c                        |  2 +-
 sound/soc/pxa/imote2.c                        |  2 +-
 sound/soc/pxa/magician.c                      |  6 +-
 sound/soc/pxa/mmp-pcm.c                       |  2 +-
 sound/soc/pxa/poodle.c                        |  4 +-
 sound/soc/pxa/pxa2xx-i2s.c                    |  2 +-
 sound/soc/pxa/spitz.c                         |  4 +-
 sound/soc/pxa/tosa.c                          |  2 +-
 sound/soc/pxa/z2.c                            |  2 +-
 sound/soc/pxa/zylonite.c                      |  2 +-
 sound/soc/qcom/apq8096.c                      |  2 +-
 sound/soc/qcom/lpass-platform.c               | 14 ++---
 sound/soc/qcom/qdsp6/q6asm-dai.c              |  6 +-
 sound/soc/qcom/qdsp6/q6routing.c              |  2 +-
 sound/soc/qcom/sdm845.c                       | 14 ++---
 sound/soc/qcom/storm.c                        |  2 +-
 sound/soc/rockchip/rk3288_hdmi_analog.c       |  2 +-
 sound/soc/rockchip/rk3399_gru_sound.c         |  8 +--
 sound/soc/rockchip/rockchip_i2s.c             |  2 +-
 sound/soc/rockchip/rockchip_max98090.c        |  2 +-
 sound/soc/rockchip/rockchip_rt5645.c          |  2 +-
 sound/soc/samsung/aries_wm8994.c              |  4 +-
 sound/soc/samsung/arndale.c                   |  4 +-
 sound/soc/samsung/h1940_uda1380.c             |  2 +-
 sound/soc/samsung/i2s.c                       |  2 +-
 sound/soc/samsung/jive_wm8750.c               |  2 +-
 sound/soc/samsung/littlemill.c                |  2 +-
 sound/soc/samsung/neo1973_wm8753.c            |  8 +--
 sound/soc/samsung/odroid.c                    |  6 +-
 sound/soc/samsung/pcm.c                       |  4 +-
 sound/soc/samsung/rx1950_uda1380.c            |  2 +-
 sound/soc/samsung/s3c-i2s-v2.c                |  2 +-
 sound/soc/samsung/s3c24xx_simtec.c            |  2 +-
 sound/soc/samsung/s3c24xx_uda134x.c           |  6 +-
 sound/soc/samsung/smartq_wm8987.c             |  2 +-
 sound/soc/samsung/smdk_spdif.c                |  2 +-
 sound/soc/samsung/smdk_wm8580.c               |  2 +-
 sound/soc/samsung/smdk_wm8994.c               |  2 +-
 sound/soc/samsung/smdk_wm8994pcm.c            |  2 +-
 sound/soc/samsung/snow.c                      |  2 +-
 sound/soc/samsung/spdif.c                     |  6 +-
 sound/soc/samsung/tm2_wm5110.c                |  8 +--
 sound/soc/sh/dma-sh7760.c                     | 12 ++--
 sound/soc/sh/fsi.c                            |  2 +-
 sound/soc/sh/migor.c                          |  4 +-
 sound/soc/sh/rcar/core.c                      |  4 +-
 sound/soc/soc-component.c                     | 20 +++---
 sound/soc/soc-dai.c                           |  8 +--
 sound/soc/soc-dapm.c                          |  6 +-
 sound/soc/soc-generic-dmaengine-pcm.c         |  4 +-
 sound/soc/soc-link.c                          | 12 ++--
 sound/soc/soc-pcm.c                           | 62 +++++++++----------
 sound/soc/soc-utils.c                         |  2 +-
 sound/soc/sof/intel/hda-dai.c                 | 10 +--
 sound/soc/sof/intel/hda-dsp.c                 |  2 +-
 sound/soc/sof/intel/hda-pcm.c                 |  2 +-
 sound/soc/sof/pcm.c                           | 18 +++---
 sound/soc/sprd/sprd-pcm-dma.c                 |  2 +-
 sound/soc/stm/stm32_adfsdm.c                  | 12 ++--
 sound/soc/stm/stm32_sai_sub.c                 |  2 +-
 sound/soc/sunxi/sun4i-codec.c                 | 12 ++--
 sound/soc/sunxi/sun4i-spdif.c                 |  2 +-
 sound/soc/tegra/tegra_alc5632.c               |  2 +-
 sound/soc/tegra/tegra_max98090.c              |  2 +-
 sound/soc/tegra/tegra_rt5640.c                |  2 +-
 sound/soc/tegra/tegra_rt5677.c                |  2 +-
 sound/soc/tegra/tegra_sgtl5000.c              |  2 +-
 sound/soc/tegra/tegra_wm8753.c                |  2 +-
 sound/soc/tegra/tegra_wm8903.c                |  2 +-
 sound/soc/tegra/trimslice.c                   |  2 +-
 sound/soc/ti/davinci-evm.c                    |  6 +-
 sound/soc/ti/davinci-vcif.c                   |  4 +-
 sound/soc/ti/j721e-evm.c                      |  6 +-
 sound/soc/ti/n810.c                           |  4 +-
 sound/soc/ti/omap-abe-twl6040.c               |  4 +-
 sound/soc/ti/omap-mcbsp.c                     |  4 +-
 sound/soc/ti/omap-twl4030.c                   |  2 +-
 sound/soc/ti/omap3pandora.c                   |  2 +-
 sound/soc/ti/osk5912.c                        |  2 +-
 sound/soc/ti/rx51.c                           |  4 +-
 sound/soc/uniphier/aio-dma.c                  |  6 +-
 sound/soc/ux500/mop500_ab8500.c               |  8 +--
 sound/soc/ux500/ux500_pcm.c                   |  2 +-
 sound/soc/xtensa/xtfpga-i2s.c                 |  2 +-
 177 files changed, 397 insertions(+), 395 deletions(-)

--
2.25.1
2020-07-23 19:52:30 +01:00
Shengjiu Wang 08b54b5e38
ASoC: fsl-asoc-card: Support configuring dai fmt from DT
Support same propeties as simple card for configuring fmt
from DT.
In order to make this change compatible with old DT, these
properties are optional.

Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com>
Acked-by: Nicolin Chen <nicoleotsuka@gmail.com>
Link: https://lore.kernel.org/r/1595302910-19688-1-git-send-email-shengjiu.wang@nxp.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-07-23 19:52:27 +01:00
Shengjiu Wang c8361757a7
ASoC: fsl_esai: add IRQF_SHARED for devm_request_irq
ESAI interfaces may share same interrupt line with EDMA on
some platforms (e.g. i.MX8QXP, i.MX8QM).
Add IRQF_SHARED flag to allow sharing the irq among several
devices

Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com>
Signed-off-by: Viorel Suman <viorel.suman@nxp.com>
Acked-by: Nicolin Chen <nicoleotsuka@gmail.com>
Link: https://lore.kernel.org/r/1595476808-28927-1-git-send-email-shengjiu.wang@nxp.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-07-23 19:52:26 +01:00
Alexander A. Klimov 1ce8f643ed
ASoC: fsl: Replace HTTP links with HTTPS ones
Rationale:
Reduces attack surface on kernel devs opening the links for MITM
as HTTPS traffic is much harder to manipulate.

Deterministic algorithm:
For each file:
  If not .svg:
    For each line:
      If doesn't contain `\bxmlns\b`:
        For each link, `\bhttp://[^# \t\r\n]*(?:\w|/)`:
	  If neither `\bgnu\.org/license`, nor `\bmozilla\.org/MPL\b`:
            If both the HTTP and HTTPS versions
            return 200 OK and serve the same content:
              Replace HTTP with HTTPS.

Signed-off-by: Alexander A. Klimov <grandmaster@al2klimov.de>
Link: https://lore.kernel.org/r/20200718111209.11760-1-grandmaster@al2klimov.de
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-07-23 19:52:22 +01:00
Kuninori Morimoto 9f5f078aed
ASoC: fsl: use asoc_substream_to_rtd()
Now we can use asoc_substream_to_rtd() macro,
let's use it.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/87eep70ytr.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-07-23 19:07:31 +01:00
Mark Brown 5f52d4dda5
Merge series "ASoC: fsl-asoc-card: Support hp and mic detection" from Shengjiu Wang <shengjiu.wang@nxp.com>:
Support hp and mic detection.
Add a parameter for asoc_simple_init_jack.

Shengjiu Wang (3):
  ASoC: simple-card-utils: Support configure pin_name for
    asoc_simple_init_jack
  ASoC: bindings: fsl-asoc-card: Support hp-det-gpio and mic-det-gpio
  ASoC: fsl-asoc-card: Support Headphone and Microphone Jack detection

changes in v2:
- Add more comments in third commit
- Add Acked-by Nicolin.

 .../bindings/sound/fsl-asoc-card.txt          |  3 +
 include/sound/simple_card_utils.h             |  6 +-
 sound/soc/fsl/Kconfig                         |  1 +
 sound/soc/fsl/fsl-asoc-card.c                 | 77 ++++++++++++++++++-
 sound/soc/generic/simple-card-utils.c         |  7 +-
 5 files changed, 86 insertions(+), 8 deletions(-)

--
2.27.0
2020-07-16 23:51:52 +01:00
Lee Jones 1b58214113
ASoC: fsl: fsl-asoc-card: Trivial: Fix misspelling of 'exists'
Signed-off-by: Lee Jones <lee.jones@linaro.org>
Cc: Timur Tabi <timur@kernel.org>
Cc: Nicolin Chen <nicoleotsuka@gmail.com>
Cc: Xiubo Li <Xiubo.Lee@gmail.com>
Cc: Fabio Estevam <festevam@gmail.com>
Cc: linuxppc-dev@lists.ozlabs.org
Link: https://lore.kernel.org/r/20200715150009.407442-1-lee.jones@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-07-16 23:51:46 +01:00
Shengjiu Wang 3b17119449
ASoC: fsl-asoc-card: Support Headphone and Microphone Jack detection
Use asoc_simple_init_jack function from simple card to implement
the Headphone and Microphone detection.
Register notifier to disable Speaker when Headphone is plugged in
and enable Speaker when Headphone is unplugged.
Register notifier to disable Digital Microphone when Analog Microphone
is plugged in and enable DMIC when Analog Microphone is unplugged.

Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com>
Acked-by: Nicolin Chen <nicoleotsuka@gmail.com>
Link: https://lore.kernel.org/r/1594822179-1849-4-git-send-email-shengjiu.wang@nxp.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-07-16 23:24:14 +01:00
Shengjiu Wang aa3fce5cd4
ASoC: fsl_spdif: Add kctl for configuring TX validity bit
Add one kctl for configuring TX validity bit from user
space.

The type of this kctl is boolean:
on - Outgoing validity always set
off - Outgoing validity always clear

Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com>
Link: https://lore.kernel.org/r/1594112066-31297-3-git-send-email-shengjiu.wang@nxp.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-07-10 15:29:49 +01:00
Shengjiu Wang 055b082156
ASoC: fsl_spdif: Clear the validity bit for TX
In IEC958 spec, "The validity bit is logical "0" if the
information in the main data field is reliable, and it
is logical "1" if it is not".

The default value of "ValCtrl" is zero, which means
"Outgoing Validity always set", then all the data is not
reliable, then some spdif sink device will drop the data.

So set "ValCtrl" to 1, that is to clear "Outgoing Validity"
in default.

Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com>
Link: https://lore.kernel.org/r/1594112066-31297-2-git-send-email-shengjiu.wang@nxp.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-07-10 15:29:48 +01:00
Liao Pingfang a5911ac579
ASoC: fsl: mpc8610_hpcd: Add missing of_node_put()
After finishing using device node got from of_find_compatible_node(),
of_node_put() needs to be called.

Signed-off-by: Liao Pingfang <liao.pingfang@zte.com.cn>
Link: https://lore.kernel.org/r/1594122467-11615-1-git-send-email-wang.yi59@zte.com.cn
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-07-07 13:31:05 +01:00
Pierre-Louis Bossart 3bae1719b3
ASoC: fsl: fsl_esai: fix kernel-doc
Fix W=1 warnings. Fix kernel-doc syntax and add missing parameters.

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Acked-by: Nicolin Chen <nicoleotsuka@gmail.com>
Link: https://lore.kernel.org/r/20200702192141.168018-7-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-07-03 16:09:28 +01:00
Pierre-Louis Bossart 4674bf0622
ASoC: fsl: fsl_asrc: fix kernel-doc
Fix W=1 warnings. fix kernel doc and describe arguments.

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Acked-by: Nicolin Chen <nicoleotsuka@gmail.com>
Link: https://lore.kernel.org/r/20200702192141.168018-6-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-07-03 16:09:27 +01:00
Pierre-Louis Bossart 28fd6ff158
ASoC: fsl: fsl_spdif: fix kernel-doc
Fix W=1 warnings. kernel-doc syntax was not followed and missing parameter

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Acked-by: Nicolin Chen <nicoleotsuka@gmail.com>
Link: https://lore.kernel.org/r/20200702192141.168018-5-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-07-03 16:09:27 +01:00
Pierre-Louis Bossart 31deacffcd
ASoC: fsl: fsl-asoc-card: fix kernel-doc
Fix W=1 warnings. Kernel-doc syntax was not properly used.

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Acked-by: Nicolin Chen <nicoleotsuka@gmail.com>
Link: https://lore.kernel.org/r/20200702192141.168018-4-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-07-03 16:09:26 +01:00
Pierre-Louis Bossart e3b741918f
ASoC: fsl: fsl_ssi: fix kernel-doc
Fix W=1 warnings. The kernel-doc support is partial, add more
descriptions and follow proper syntax

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Acked-by: Nicolin Chen <nicoleotsuka@gmail.com>
Link: https://lore.kernel.org/r/20200702192141.168018-3-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-07-03 16:09:25 +01:00
Pierre-Louis Bossart 2f98139175
ASoC: fsl: fsl_ssi_dbg: remove spurious kernel-doc comment start
Fix W=1 warnings. There is no kernel-doc here.

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Acked-by: Nicolin Chen <nicoleotsuka@gmail.com>
Link: https://lore.kernel.org/r/20200702192141.168018-2-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-07-03 16:09:24 +01:00
Shengjiu Wang d0250cf4f2
ASoC: fsl_asrc: Add an option to select internal ratio mode
The ASRC not only supports ideal ratio mode, but also supports
internal ratio mode.

For internal rato mode, the rate of clock source should be divided
with no remainder by sample rate, otherwise there is sound
distortion.

Add function fsl_asrc_select_clk() to find proper clock source for
internal ratio mode, if the clock source is available then internal
ratio mode will be selected.

With change, the ideal ratio mode is not the only option for user.

Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com>
Reviewed-by: Nicolin Chen <nicoleotsuka@gmail.com>
Reviewed-by: Fabio Estevam <festevam@gmail.com>
Link: https://lore.kernel.org/r/1593525367-23221-1-git-send-email-shengjiu.wang@nxp.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-07-01 17:21:07 +01:00
Shengjiu Wang d8d702e19e
ASoC: fsl_sai: Refine regcache usage with pm runtime
When there is dedicated power domain bound with device, after probing
the power will be disabled, then registers are not accessible in
fsl_sai_dai_probe(), so regcache only need to be enabled in end of
probe() and regcache_mark_dirty should be moved to pm runtime resume
callback function.

Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com>
Acked-by: Nicolin Chen <nicoleotsuka@gmail.com>
Link: https://lore.kernel.org/r/1593412953-10897-1-git-send-email-shengjiu.wang@nxp.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-07-01 17:21:02 +01:00
Mark Brown 351cf7445f
Merge branch 'for-5.8' of https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound into asoc-5.9 2020-06-29 20:47:01 +01:00
Shengjiu Wang 3cd9902674
ASoC: fsl-asoc-card: Add WM8524 support
WM8524 only supports playback mode, and only works at
slave mode.

Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com>
Acked-by: Nicolin Chen <nicoleotsuka@gmail.com>
Link: https://lore.kernel.org/r/1592895167-30483-1-git-send-email-shengjiu.wang@nxp.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-06-24 16:15:05 +01:00
Shengjiu Wang 5748f4eb01
ASoC: fsl_easrc: Fix uninitialized scalar variable in fsl_easrc_set_ctx_format
The "ret" in fsl_easrc_set_ctx_format is not initialized, then
the unknown value maybe returned by this function.

Fixes: 955ac62405 ("ASoC: fsl_easrc: Add EASRC ASoC CPU DAI drivers")
Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com>
Acked-by: Nicolin Chen <nicoleotsuka@gmail.com>
Link: https://lore.kernel.org/r/1592816611-16297-1-git-send-email-shengjiu.wang@nxp.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-06-23 12:54:09 +01:00
Shengjiu Wang 15217d170a
ASoC: fsl_mqs: Fix unchecked return value for clk_prepare_enable
Fix unchecked return value for clk_prepare_enable, add error
handler in fsl_mqs_runtime_resume.

Fixes: 9e28f6532c ("ASoC: fsl_mqs: Add MQS component driver")
Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com>
Acked-by: Nicolin Chen <nicoleotsuka@gmail.com>
Link: https://lore.kernel.org/r/5edd68d03def367d96268f1a9a00bd528ea5aaf2.1592888591.git.shengjiu.wang@nxp.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-06-23 11:14:22 +01:00
Shengjiu Wang adf46113a6
ASoC: fsl_mqs: Don't check clock is NULL before calling clk API
Because clk_prepare_enable and clk_disable_unprepare should
check input clock parameter is NULL or not internally, then
we don't need to check them before calling the function.

Fixes: 9e28f6532c ("ASoC: fsl_mqs: Add MQS component driver")
Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com>
Acked-by: Nicolin Chen <nicoleotsuka@gmail.com>
Link: https://lore.kernel.org/r/743be216bd504c26e8d45d5ce4a84561b67a122b.1592888591.git.shengjiu.wang@nxp.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-06-23 11:14:22 +01:00
Kuninori Morimoto cf6e26c71b
ASoC: soc-component: merge snd_soc_component_read() and snd_soc_component_read32()
We had read/write function for Codec, Platform, etc,
but these has been merged into snd_soc_component_read/write().

Internally, it is using regmap or driver function.
In read case, each styles are like below

regmap
	ret = regmap_read(..., reg, &val);

driver function
	val = xxx->read(..., reg);

Because of this kind of different style, to keep same read style,
when we merged each read function into snd_soc_component_read(),
we created snd_soc_component_read32(), like below.
commit 738b49efe6 ("ASoC: add snd_soc_component_read32")

(1)	val = snd_soc_component_read32(component, reg);

(2)	ret = snd_soc_component_read(component, reg, &val);

Many drivers are using snd_soc_component_read32(), and
some drivers are using snd_soc_component_read() today.

In generally, we don't check read function successes,
because, we will have many other issues at initial timing
if read function didn't work.

Now we can use soc_component_err() when error case.
This means, it is easy to notice if error occurred.

This patch aggressively merge snd_soc_component_read() and _read32(),
and makes snd_soc_component_read/write() as generally style.

This patch do
	1) merge snd_soc_component_read() and snd_soc_component_read32()
	2) it uses soc_component_err() when error case (easy to notice)
	3) keeps read32 for now by #define
	4) update snd_soc_component_read() for all drivers

Because _read() user drivers are not too many, this patch changes
all user drivers.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Reviewed-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Link: https://lore.kernel.org/r/87sgev4mfl.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-06-22 15:13:36 +01:00
Shengjiu Wang 9cb2b3796e
ASoC: fsl_spdif: Add pm runtime function
Add pm runtime support and move clock handling there.
Close the clocks at suspend to reduce the power consumption.

fsl_spdif_suspend is replaced by pm_runtime_force_suspend.
fsl_spdif_resume is replaced by pm_runtime_force_resume.

Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com>
Acked-by: Nicolin Chen <nicoleotsuka@gmail.com>
Link: https://lore.kernel.org/r/579c0d71e976f34f23f40daa9f1aa06c4baca2f1.1592552389.git.shengjiu.wang@nxp.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-06-19 12:07:00 +01:00
Shengjiu Wang f61b9273c3
ASoC: fsl_spdif: Add support for imx6sx platform
The one difference on imx6sx platform is that the root clock
is shared with ASRC module, so we add a new flags
"shared_root_clock" which means the root clock is not independent,
then we will not do the clk_set_rate and clk_round_rate to avoid
impact ASRC module usage.

As add a new flags, we include the soc specific data struct.

Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com>
Reviewed-by: Nicolin Chen <nicoleotsuka@gmail.com>
Link: https://lore.kernel.org/r/7a343edd5f8487abad248a0b862f45fd95067751.1592376770.git.shengjiu.wang@nxp.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-06-17 14:04:06 +01:00
Shengjiu Wang 039652a5b9
ASoC: fsl-asoc-card: Add MQS support
The MQS codec isn't an i2c device, so use of_find_device_by_node
to get platform device pointer.

Because MQS only support playback, then add a new audio map.

And there maybe "model" property or no "audio-routing" property in
devicetree, so add some enhancement for these two property.

Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com>
Reviewed-by: Nicolin Chen <nicoleotsuka@gmail.com>
Link: https://lore.kernel.org/r/918505decb7f757f12c38059c590984f28d2f3a4.1592369271.git.shengjiu.wang@nxp.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-06-17 14:04:04 +01:00
Shengjiu Wang ed1220df6e
ASoC: fsl_ssi: Fix bclk calculation for mono channel
For mono channel, SSI will switch to Normal mode.

In Normal mode and Network mode, the Word Length Control bits
control the word length divider in clock generator, which is
different with I2S Master mode (the word length is fixed to
32bit), it should be the value of params_width(hw_params).

The condition "slots == 2" is not good for I2S Master mode,
because for Network mode and Normal mode, the slots can also
be 2. Then we need to use (ssi->i2s_net & SSI_SCR_I2S_MODE_MASK)
to check if it is I2S Master mode.

So we refine the formula for mono channel, otherwise there
will be sound issue for S24_LE.

Fixes: b0a7043d5c ("ASoC: fsl_ssi: Caculate bit clock rate using slot number and width")
Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com>
Reviewed-by: Nicolin Chen <nicoleotsuka@gmail.com>
Link: https://lore.kernel.org/r/034eff1435ff6ce300b6c781130cefd9db22ab9a.1592276147.git.shengjiu.wang@nxp.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-06-16 12:14:51 +01:00
Shengjiu Wang d73d682a9e
ASoC: fsl_easrc: Fix "Function parameter not described" warnings
Obtained with:
$ make W=1

sound/soc/fsl/fsl_easrc.c:403: warning: Function parameter or member 'easrc' not described in 'fsl_easrc_normalize_filter'
sound/soc/fsl/fsl_easrc.c:403: warning: Function parameter or member 'infilter' not described in 'fsl_easrc_normalize_filter'
sound/soc/fsl/fsl_easrc.c:403: warning: Function parameter or member 'outfilter' not described in 'fsl_easrc_normalize_filter'
sound/soc/fsl/fsl_easrc.c:403: warning: Function parameter or member 'shift' not described in 'fsl_easrc_normalize_filter'

Fixes: 955ac62405 ("ASoC: fsl_easrc: Add EASRC ASoC CPU DAI drivers")
Reported-by: kbuild test robot <lkp@intel.com>
Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com>
Acked-by: Nicolin Chen <nicoleotsuka@gmail.com>
Link: https://lore.kernel.org/r/d166b868e6d294de47a89857be03758ec82a0a61.1591155860.git.shengjiu.wang@nxp.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-06-15 18:51:04 +01:00
Shengjiu Wang 633a2c7d6e
ASoC: fsl_easrc: Fix -Wunused-but-set-variable
Obtained with:
$ make W=1

  unsigned int int_bits;
               ^
  struct device *dev;
                 ^
  struct device *dev;
                 ^

Fixes: 955ac62405 ("ASoC: fsl_easrc: Add EASRC ASoC CPU DAI drivers")
Reported-by: kbuild test robot <lkp@intel.com>
Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com>
Acked-by: Nicolin Chen <nicoleotsuka@gmail.com>
sound/soc/fsl/fsl_easrc.c: In function 'fsl_easrc_set_rs_ratio':
sound/soc/fsl/fsl_easrc.c:182:15: warning: variable 'int_bits' set but not used [-Wunused-but-set-variable]
sound/soc/fsl/fsl_easrc.c: In function 'fsl_easrc_set_ctx_organziation':
sound/soc/fsl/fsl_easrc.c:1204:17: warning: variable 'dev' set but not used [-Wunused-but-set-variable]
sound/soc/fsl/fsl_easrc.c: In function 'fsl_easrc_release_context':
sound/soc/fsl/fsl_easrc.c:1294:17: warning: variable 'dev' set but not used [-Wunused-but-set-variable]
Link: https://lore.kernel.org/r/91ceb59e3bce31c9e93abba06f5156692ff5c71e.1591155860.git.shengjiu.wang@nxp.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-06-15 18:51:03 +01:00
Shengjiu Wang e4cc0aaac3
ASoC: fsl_easrc: Fix -Wmissing-prototypes warning
Obtained with:
$ make W=1

sound/soc/fsl/fsl_easrc.c:967:5: warning: no previous prototype for function 'fsl_easrc_config_context' [-Wmissing-prototypes]
int fsl_easrc_config_context(struct fsl_asrc *easrc, unsigned int ctx_id)
    ^
sound/soc/fsl/fsl_easrc.c:967:1: note: declare 'static' if the function is not intended to be used outside of this translation unit
int fsl_easrc_config_context(struct fsl_asrc *easrc, unsigned int ctx_id)
^
static
sound/soc/fsl/fsl_easrc.c:1128:5: warning: no previous prototype for function 'fsl_easrc_set_ctx_format' [-Wmissing-prototypes]
int fsl_easrc_set_ctx_format(struct fsl_asrc_pair *ctx,
    ^
sound/soc/fsl/fsl_easrc.c:1128:1: note: declare 'static' if the function is not intended to be used outside of this translation unit
int fsl_easrc_set_ctx_format(struct fsl_asrc_pair *ctx,
^
static
sound/soc/fsl/fsl_easrc.c:1201:5: warning: no previous prototype for function 'fsl_easrc_set_ctx_organziation' [-Wmissing-prototypes]
int fsl_easrc_set_ctx_organziation(struct fsl_asrc_pair *ctx)
    ^
sound/soc/fsl/fsl_easrc.c:1201:1: note: declare 'static' if the function is not intended to be used outside of this translation unit
int fsl_easrc_set_ctx_organziation(struct fsl_asrc_pair *ctx)
^
static
sound/soc/fsl/fsl_easrc.c:1245:5: warning: no previous prototype for function 'fsl_easrc_request_context' [-Wmissing-prototypes]
int fsl_easrc_request_context(int channels, struct fsl_asrc_pair *ctx)
    ^
sound/soc/fsl/fsl_easrc.c:1245:1: note: declare 'static' if the function is not intended to be used outside of this translation unit
int fsl_easrc_request_context(int channels, struct fsl_asrc_pair *ctx)
^
static
sound/soc/fsl/fsl_easrc.c:1290:6: warning: no previous prototype for function 'fsl_easrc_release_context' [-Wmissing-prototypes]
void fsl_easrc_release_context(struct fsl_asrc_pair *ctx)
     ^
sound/soc/fsl/fsl_easrc.c:1290:1: note: declare 'static' if the function is not intended to be used outside of this translation unit
void fsl_easrc_release_context(struct fsl_asrc_pair *ctx)
^
static
sound/soc/fsl/fsl_easrc.c:1317:5: warning: no previous prototype for function 'fsl_easrc_start_context' [-Wmissing-prototypes]
int fsl_easrc_start_context(struct fsl_asrc_pair *ctx)
    ^
sound/soc/fsl/fsl_easrc.c:1317:1: note: declare 'static' if the function is not intended to be used outside of this translation unit
int fsl_easrc_start_context(struct fsl_asrc_pair *ctx)
^
static
sound/soc/fsl/fsl_easrc.c:1335:5: warning: no previous prototype for function 'fsl_easrc_stop_context' [-Wmissing-prototypes]
int fsl_easrc_stop_context(struct fsl_asrc_pair *ctx)
    ^
sound/soc/fsl/fsl_easrc.c:1335:1: note: declare 'static' if the function is not intended to be used outside of this translation unit
int fsl_easrc_stop_context(struct fsl_asrc_pair *ctx)
^
static
sound/soc/fsl/fsl_easrc.c:1382:18: warning: no previous prototype for function 'fsl_easrc_get_dma_channel' [-Wmissing-prototypes]
struct dma_chan *fsl_easrc_get_dma_channel(struct fsl_asrc_pair *ctx,
                 ^
sound/soc/fsl/fsl_easrc.c:1382:1: note: declare 'static' if the function is not intended to be used outside of this translation unit
struct dma_chan *fsl_easrc_get_dma_channel(struct fsl_asrc_pair *ctx,
^
static

Fixes: 955ac62405 ("ASoC: fsl_easrc: Add EASRC ASoC CPU DAI drivers")
Reported-by: kbuild test robot <lkp@intel.com>
Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com>
Acked-by: Nicolin Chen <nicoleotsuka@gmail.com>
Link: https://lore.kernel.org/r/ab1b83a56c71f4159a98e6da5602c2c36fe59f4d.1591155860.git.shengjiu.wang@nxp.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-06-15 18:51:02 +01:00
Shengjiu Wang b287a6d972
ASoC: fsl_asrc_dma: Fix data copying speed issue with EDMA
With EDMA, there is two dma channels can be used for dev_to_dev,
one is from ASRC, one is from another peripheral (ESAI or SAI).

If we select the dma channel of ASRC, there is an issue for ideal
ratio case, the speed of copy data is faster than sample
frequency, because ASRC output data is very fast in ideal ratio
mode.

So it is reasonable to use the dma channel of Back-End peripheral.
then copying speed of DMA is controlled by data consumption
speed in the peripheral FIFO,

Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com>
Reviewed-by: Nicolin Chen <nicoleotsuka@gmail.com>
Link: https://lore.kernel.org/r/424ed6c249bafcbe30791c9de0352821c5ea67e2.1591947428.git.shengjiu.wang@nxp.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-06-12 14:18:04 +01:00
Shengjiu Wang 706e2c8811
ASoC: fsl_asrc_dma: Reuse the dma channel if available in Back-End
The dma channel has been requested by Back-End cpu dai driver already.
If fsl_asrc_dma requests dma chan with same dma:tx symlink, then
there will be below warning with SDMA.

[   48.174236] fsl-esai-dai 2024000.esai: Cannot create DMA dma:tx symlink

So if we can reuse the dma channel of Back-End, then the issue can be
fixed.

In order to get the dma channel which is already requested in Back-End.
we use the exported two functions (snd_soc_lookup_component_nolocked
and soc_component_to_pcm). If we can get the dma channel, then reuse it,
if can't, then request a new one.

Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com>
Reviewed-by: Nicolin Chen <nicoleotsuka@gmail.com>
Link: https://lore.kernel.org/r/3a79f0442cb4930c633cf72145cfe95a45b9c78e.1591947428.git.shengjiu.wang@nxp.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-06-12 14:18:03 +01:00
Shengjiu Wang e396dec46c
ASoC: fsl-asoc-card: Defer probe when fail to find codec device
Defer probe when fail to find codec device, because the codec
device maybe probed later than machine driver.

Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com>
Link: https://lore.kernel.org/r/1591251930-4111-1-git-send-email-shengjiu.wang@nxp.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-06-04 14:42:30 +01:00
Xiyu Yang 36124fb19f
ASoC: fsl_asrc_dma: Fix dma_chan leak when config DMA channel failed
fsl_asrc_dma_hw_params() invokes dma_request_channel() or
fsl_asrc_get_dma_channel(), which returns a reference of the specified
dma_chan object to "pair->dma_chan[dir]" with increased refcnt.

The reference counting issue happens in one exception handling path of
fsl_asrc_dma_hw_params(). When config DMA channel failed for Back-End,
the function forgets to decrease the refcnt increased by
dma_request_channel() or fsl_asrc_get_dma_channel(), causing a refcnt
leak.

Fix this issue by calling dma_release_channel() when config DMA channel
failed.

Signed-off-by: Xiyu Yang <xiyuyang19@fudan.edu.cn>
Signed-off-by: Xin Tan <tanxin.ctf@gmail.com>
Link: https://lore.kernel.org/r/1590415966-52416-1-git-send-email-xiyuyang19@fudan.edu.cn
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-05-29 13:30:07 +01:00
Shengjiu Wang 393dc21d0f
ASoC: fsl_asrc: Merge suspend/resume function to runtime_suspend/resume
With dedicated power domain for asrc, power can be disabled after
probe and pm runtime suspend, then the value of all registers need to
be restored in pm runtime resume. So we can merge suspend/resume function
to runtime_suspend/resume function and enable regcache only in end of
probe.

Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com>
Acked-by: Nicolin Chen <nicoleotsuka@gmail.com>
Link: https://lore.kernel.org/r/1590141444-28668-1-git-send-email-shengjiu.wang@nxp.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-05-25 15:31:11 +01:00
Tang Bin 085c02d355
ASoC: fsl: imx-audmix: Fix unused assignment to variable 'ret'
Omit unused initialized value, because 'ret' will be assigined
by the function snd_soc_component_read().

Signed-off-by: Zhang Shengju <zhangshengju@cmss.chinamobile.com>
Signed-off-by: Tang Bin <tangbin@cmss.chinamobile.com>
Link: https://lore.kernel.org/r/20200513111408.11452-1-tangbin@cmss.chinamobile.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-05-25 15:31:10 +01:00
shengjiu wang cff1f8b4f8
ASoC: fsl_asrc: Fix -Wmissing-prototypes warning
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=x86_64

sound/soc/fsl/fsl_asrc.c:557:18: warning: no previous prototype for function 'fsl_asrc_get_dma_channel' [-Wmissing-prototypes]
struct dma_chan *fsl_asrc_get_dma_channel(struct fsl_asrc_pair *pair, bool dir)
                 ^
sound/soc/fsl/fsl_asrc.c:557:1: note: declare 'static' if the function is not intended to be used outside of this translation unit
struct dma_chan *fsl_asrc_get_dma_channel(struct fsl_asrc_pair *pair, bool dir)
^
static

Fixes: be7bd03f02 ("ASoC: fsl_asrc: Move common definition to fsl_asrc_common")
Reported-by: kbuild test robot <lkp@intel.com>
Signed-off-by: shengjiu wang <shengjiu.wang@nxp.com>
Link: https://lore.kernel.org/r/1590397412-12966-1-git-send-email-shengjiu.wang@nxp.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-05-25 15:31:09 +01:00
Fabio Estevam a62ed9606a
ASoC: fsl_micfil: Do not pass irq numbers in comments
The IRQ numbers may change depending on the SoC, so do not pass the IRQ
numbers in the comments.

Signed-off-by: Fabio Estevam <festevam@gmail.com>
Link: https://lore.kernel.org/r/20200518185448.6116-2-festevam@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-05-19 14:18:52 +01:00
Fabio Estevam 1a90a65986
ASoC: fsl_micfil: Remove unneeded ifdef's
There is no need to use ifdef's around the power managament
related functions, as they are already using the __maybe_unused
notation.

Signed-off-by: Fabio Estevam <festevam@gmail.com>
Link: https://lore.kernel.org/r/20200518185448.6116-1-festevam@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-05-19 14:18:51 +01:00
Shengjiu Wang f8953043e6
ASoC: fsl_asrc: Set ASR76K and ASR56K based on processing clock
The processing clock is different for platforms, so it is better
to set ASR76K and ASR56K based on processing clock, rather than
hard coding the value for them.

Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com>
Signed-off-by: Mihai Serban <mihai.serban@nxp.com>
Link: https://lore.kernel.org/r/1589278979-31008-1-git-send-email-shengjiu.wang@nxp.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-05-19 14:18:51 +01:00