summaryrefslogtreecommitdiffstats
path: root/sound/soc/ti
AgeCommit message (Collapse)Author
2020-08-23treewide: Use fallthrough pseudo-keywordGustavo A. R. Silva
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-07-23Merge series "ASoC: add asoc_substream_to_rtd() macro" from Kuninori ↵Mark Brown
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-23ASoC: ti: fix SND_SOC_J721E_EVM warnings & errorsRandy Dunlap
SND_SOC_J721E_EVM should not select SND_SOC_PCM3168A_I2C when I2C is not enabled. That causes build errors, so make this driver's symbol depend on I2C. WARNING: unmet direct dependencies detected for SND_SOC_PCM3168A_I2C Depends on [n]: SOUND [=m] && !UML && SND [=m] && SND_SOC [=m] && I2C [=n] Selected by [m]: - SND_SOC_J721E_EVM [=m] && SOUND [=m] && !UML && SND [=m] && SND_SOC [=m] && (DMA_OMAP [=y] || TI_EDMA [=m] || TI_K3_UDMA [=n] || COMPILE_TEST [=y]) && (ARCH_K3_J721E_SOC [=n] || COMPILE_TEST [=y]) ../sound/soc/codecs/pcm3168a-i2c.c:59:1: warning: data definition has no type or storage class module_i2c_driver(pcm3168a_i2c_driver); ^~~~~~~~~~~~~~~~~ ../sound/soc/codecs/pcm3168a-i2c.c:59:1: error: type defaults to ‘int’ in declaration of ‘module_i2c_driver’ [-Werror=implicit-int] ../sound/soc/codecs/pcm3168a-i2c.c:59:1: warning: parameter names (without types) in function declaration ../sound/soc/codecs/pcm3168a-i2c.c:49:26: warning: ‘pcm3168a_i2c_driver’ defined but not used [-Wunused-variable] static struct i2c_driver pcm3168a_i2c_driver = { ^~~~~~~~~~~~~~~~~~~ cc1: some warnings being treated as errors Fixes: 6748d0559059 ("ASoC: ti: Add custom machine driver for j721e EVM (CPB and IVI)") Signed-off-by: Randy Dunlap <rdunlap@infradead.org> Acked-by: Peter Ujfalusi <peter.ujfalusi@ti.com> Cc: Peter Ujfalusi <peter.ujfalusi@ti.com> Cc: Mark Brown <broonie@kernel.org> Link: https://lore.kernel.org/r/e74c690c-c7f8-fd42-e461-4f33571df4ef@infradead.org Signed-off-by: Mark Brown <broonie@kernel.org>
2020-07-23ASoC: omap: Replace HTTP links with HTTPS onesAlexander A. Klimov
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/20200718112403.13709-1-grandmaster@al2klimov.de Signed-off-by: Mark Brown <broonie@kernel.org>
2020-07-23ASoC: ti: Replace HTTP links with HTTPS onesAlexander A. Klimov
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/20200718110857.11520-1-grandmaster@al2klimov.de Signed-off-by: Mark Brown <broonie@kernel.org>
2020-07-23ASoC: ti: use asoc_substream_to_rtd()Kuninori Morimoto
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/87tuy30yv5.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Mark Brown <broonie@kernel.org>
2020-07-16ASoC: ti: merge .digital_mute() into .mute_stream()Kuninori Morimoto
snd_soc_dai_digital_mute() is internally using both mute_stream() (1) or digital_mute() (2), but the difference between these 2 are only handling direction. We can merge digital_mute() into mute_stream int snd_soc_dai_digital_mute(xxx, int direction) { ... else if (dai->driver->ops->mute_stream) (1) return dai->driver->ops->mute_stream(xxx, direction); else if (direction == SNDRV_PCM_STREAM_PLAYBACK && dai->driver->ops->digital_mute) (2) return dai->driver->ops->digital_mute(xxx); ... } Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Reviewed-by: Peter Ujfalusi <peter.ujfalusi@ti.com> Link: https://lore.kernel.org/r/87blkpxxip.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Mark Brown <broonie@kernel.org>
2020-07-09ASoC: ti: omap-mcbsp-st: Remove set, but unused variable 'w'Lee Jones
Looks like 'w' has remained unchecked since the driver's inception. Fixes the following W=1 kernel build warning(s): sound/soc/ti/omap-mcbsp-st.c: In function ‘omap_mcbsp_st_chgain’: sound/soc/ti/omap-mcbsp-st.c:145:6: warning: variable ‘w’ set but not used [-Wunused-but-set-variable] Peter suggested that the whole read can be removed, so that's been done too. Signed-off-by: Lee Jones <lee.jones@linaro.org> Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Acked-by: Peter Ujfalusi <peter.ujfalusi@ti.com> Cc: Peter Ujfalusi <peter.ujfalusi@ti.com> Cc: Jarkko Nikula <jarkko.nikula@bitmer.com> Cc: Samuel Ortiz <samuel.ortiz@nokia.com> Cc: linux-omap@vger.kernel.org Link: https://lore.kernel.org/r/20200707190612.97799-10-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown <broonie@kernel.org>
2020-07-03ASoC: ti: j721e-evm: Fix missing unlock on error in j721e_audio_hw_params()Wei Yongjun
Add the missing unlock before return from function j721e_audio_hw_params() in the error handling case. Fixes: 6748d0559059 ("ASoC: ti: Add custom machine driver for j721e EVM (CPB and IVI)") Reported-by: Hulk Robot <hulkci@huawei.com> Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com> Acked-by: Peter Ujfalusi <peter.ujfalusi@ti.com> Link: https://lore.kernel.org/r/20200703030910.75047-1-weiyongjun1@huawei.com Signed-off-by: Mark Brown <broonie@kernel.org>
2020-07-01ASoC: ti: Add custom machine driver for j721e EVM (CPB and IVI)Peter Ujfalusi
The audio support on the board is using pcm3168a codec connected to McASP10 serializers in parallel setup. The pcm3168a SCKI clock is coming via the j721e AUDIO_REFCLK2 pin. In order to support 48KHz and 44.1KHz family of sampling rates the parent clock for AUDIO_REFCLK2 needs to be changed between PLL4 (for 48KHz) and PLL15 (for 44.1KHz). The same PLLs are used for McASP10's AUXCLK clock via different HSDIVIDER. Generic card can not be used for the board as we need to switch between clock paths for different sampling rate families and also need to change the slot_width between 16 and 24 bit audio. The audio support on the Infotainment Expansion Board consists of McASP0 connected to two pcm3168a codecs with dedicated set of serializers to each. The SCKI for pcm3168a is sourced from j721e AUDIO_REFCLK0 pin. It is extending the audio support on the CPB. Due to the fact that the same PLL4/15 is used by both domains (CPB/IVI) there are cross restriction on sampling rates. The IVI side is represented as multicodec setup. PCMs available on a plain CPB (no IVI addon): hw:0,0 - cpb playback (8 channels) hw:0,1 - cpb capture (6 channels) When the IVI addon is present, additional two PCMs will be present: hw:0,2 - ivi multicodec playback (16 channels) hw:0,3 - ivi multicodec capture (12 channels) Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com> Link: https://lore.kernel.org/r/20200630125843.11561-4-peter.ujfalusi@ti.com Signed-off-by: Mark Brown <broonie@kernel.org>
2020-07-01ASoC: ti: davinci-mcasp: Specify stream_name for playback/capturePeter Ujfalusi
In order to dai stream widgets to be created the stream_name must be set. Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com> Link: https://lore.kernel.org/r/20200630125843.11561-2-peter.ujfalusi@ti.com Signed-off-by: Mark Brown <broonie@kernel.org>
2020-05-26ASoC: ti: Fix runtime PM imbalance in omap2_mcbsp_set_clks_srcDinghao Liu
When clk_set_parent() returns an error code, a pairing runtime PM usage counter increment is needed to keep the counter balanced. Signed-off-by: Dinghao Liu <dinghao.liu@zju.edu.cn> Acked-by: Peter Ujfalusi <peter.ujfalusi@ti.com> Link: https://lore.kernel.org/r/20200525085848.4227-1-dinghao.liu@zju.edu.cn Signed-off-by: Mark Brown <broonie@kernel.org>
2020-05-18ASoC: ti: use snd_soc_xxx_active()Kuninori Morimoto
We have snd_soc_dai/dai_stream/component_active() macro This patch uses it. Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com> Acked-by: Peter Ujfalusi <peter.ujfalusi@ti.com> Link: https://lore.kernel.org/r/87mu6a58i3.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Mark Brown <broonie@kernel.org>
2020-05-12ASoC: ti: omap-mcbsp: Fix an error handling path in 'asoc_mcbsp_probe()'Christophe JAILLET
If an error occurs after the call to 'omap_mcbsp_init()', the reference to 'mcbsp->fclk' must be decremented, as already done in the remove function. This can be achieved easily by using the devm_ variant of 'clk_get()' when the reference is taken in 'omap_mcbsp_init()' This fixes the leak in the probe and has the side effect to simplify both the error handling path of 'omap_mcbsp_init()' and the remove function. Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr> Acked-by: Peter Ujfalusi <peter.ujflausi@ti.com> Link: https://lore.kernel.org/r/20200512134325.252073-1-christophe.jaillet@wanadoo.fr Signed-off-by: Mark Brown <broonie@kernel.org>
2020-05-12Merge branch 'for-5.7' of ↵Mark Brown
https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound into asoc-5.8
2020-04-28ASoC: davinci-mcasp: Fix dma_chan refcnt leak when getting dma typeXiyu Yang
davinci_mcasp_get_dma_type() invokes dma_request_chan(), which returns a reference of the specified dma_chan object to "chan" with increased refcnt. When davinci_mcasp_get_dma_type() returns, local variable "chan" becomes invalid, so the refcount should be decreased to keep refcount balanced. The reference counting issue happens in one exception handling path of davinci_mcasp_get_dma_type(). When chan device is NULL, the function forgets to decrease the refcnt increased by dma_request_chan(), causing a refcnt leak. Fix this issue by calling dma_release_channel() when chan device is NULL. Signed-off-by: Xiyu Yang <xiyuyang19@fudan.edu.cn> Signed-off-by: Xin Tan <tanxin.ctf@gmail.com> Acked-by: Peter Ujfalusi <peter.ujfalusi@ti.com> Link: https://lore.kernel.org/r/1587818916-38730-1-git-send-email-xiyuyang19@fudan.edu.cn Signed-off-by: Mark Brown <broonie@kernel.org>
2020-04-27ASoC: ti: remove comparison to bool in omap_mcbsp_dai_set_dai_fmt()Jason Yan
Fix the following coccicheck warning: sound/soc/ti/omap-mcbsp.c:1188:5-11: WARNING: Comparison to bool Signed-off-by: Jason Yan <yanaijie@huawei.com> Acked-by: Jarkko Nikula <jarkko.nikula@bitmer.com> Link: https://lore.kernel.org/r/20200426094238.23914-1-yanaijie@huawei.com Signed-off-by: Mark Brown <broonie@kernel.org>
2020-04-02Merge tag 'sound-5.7-rc1' of ↵Linus Torvalds
git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound Pull sound updates from Takashi Iwai: "This became again a busy development cycle. There are few ALSA core updates (merely API cleanups and sparse fixes), with the majority of other changes are found in ASoC scene. Here are some highlights: ALSA core: - More helper macros for sparse warning fixes (e.g. bitwise types) - Slight optimization of PCM OSS locks - Make common handling for PCM / compress buffers (for SOF) ASoC: - Lots of code refactoring and modernization for (still ongoing) componentization works - Conversion of SND_SOC_ALL_CODECS to use imply - Continued refactoring and fixing of the Intel SOF/SST support, including the initial (but still incomplete) SoundWire support - SoundWire and more advanced clocking support for Realtek RT5682 - Support for amlogic GX, Meson 8, Meson 8B and T9015 DAC, Broadcom DSL/PON, Ingenic JZ4760 and JZ4770, Realtek RL6231, and TI TAS2563 and TLV320ADCX140 HD-audio: - Optimizations in HDMI jack handling - A few new quirks and fixups for Realtek codecs USB-audio: - Delayed registration support - New quirks for Motu, Kingston, Presonus" * tag 'sound-5.7-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound: (415 commits) ALSA: usb-audio: Fix case when USB MIDI interface has more than one extra endpoint descriptor Revert "ALSA: uapi: Drop asound.h inclusion from asoc.h" ALSA: hda/realtek - Remove now-unnecessary XPS 13 headphone noise fixups ALSA: hda/realtek - Set principled PC Beep configuration for ALC256 ALSA: doc: Document PC Beep Hidden Register on Realtek ALC256 ALSA: hda/realtek - a fake key event is triggered by running shutup ALSA: hda: default enable CA0132 DSP support ASoC: amd: acp3x-pcm-dma: clean up two indentation issues ASoC: tlv320adcx140: Remove undocumented property ASoC: Intel: sof_sdw: Add Volteer support with RT5682 SNDW helper function ASoC: Intel: common: add match table for TGL RT5682 SoundWire driver ASoC: Intel: boards: add sof_sdw machine driver ASoC: Intel: soc-acpi: update topology and driver name for SoundWire platforms ASoC: rt5682: move DAI clock registry to I2S mode ASoC: pxa: magician: convert to use i2c_new_client_device() ASoC: SOF: Intel: hda-ctrl: add reset cycle before parsing capabilities Asoc: SOF: Intel: hda: check SoundWire wakeen interrupt in irq thread ASoC: SOF: Intel: hda: add WAKEEN interrupt support for SoundWire ASoC: SOF: Intel: hda: add parameter to control SoundWire clock stop quirks ASoC: SOF: Intel: hda: merge IPC, stream and SoundWire interrupt handlers ...
2020-03-27ASoC: ti: use asoc_rtd_to_cpu() / asoc_rtd_to_codec() macro for DAI pointerKuninori Morimoto
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Tested-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Link: https://lore.kernel.org/r/875zevir3p.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Mark Brown <broonie@kernel.org>
2020-02-14sound: Call cpu_latency_qos_*() instead of pm_qos_*()Rafael J. Wysocki
Call cpu_latency_qos_add/update/remove_request() and cpu_latency_qos_request_active() instead of pm_qos_add/update/remove_request() and pm_qos_request_active(), respectively, because the latter are going to be dropped. No intentional functional impact. Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com> Reviewed-by: Ulf Hansson <ulf.hansson@linaro.org> Acked-by: Mark Brown <broonie@kernel.org> Acked-by: Takashi Iwai <tiwai@suse.de> Reviewed-by: Amit Kucheria <amit.kucheria@linaro.org> Tested-by: Amit Kucheria <amit.kucheria@linaro.org>
2020-02-11ASoC: ti: davinci-mcasp: remove redundant assignment to variable retColin Ian King
The assignment to ret is redundant as it is not used in the error return path and hence can be removed. Addresses-Coverity: ("Unused value") Signed-off-by: Colin Ian King <colin.king@canonical.com> Acked-by: Peter Ujfalusi <peter.ujfalusi@ti.com> Link: https://lore.kernel.org/r/20200210092423.327499-1-colin.king@canonical.com Signed-off-by: Mark Brown <broonie@kernel.org>
2020-02-11ASoC: ti: davinci-mcasp: Add support for platforms using UDMAPeter Ujfalusi
k3 devices including am654 and j721e are using UDMA Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com> Link: https://lore.kernel.org/r/20200210140950.11090-3-peter.ujfalusi@ti.com Signed-off-by: Mark Brown <broonie@kernel.org>
2020-02-11ASoC: ti: Add udma-pcm platform driver for UDMAPeter Ujfalusi
Platform driver glue for platforms using UDMA (am654 and j721e). Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com> Link: https://lore.kernel.org/r/20200210140950.11090-2-peter.ujfalusi@ti.com Signed-off-by: Mark Brown <broonie@kernel.org>
2020-01-21ASoC: ti: omap-mcpdm: move .suspend/.resume to componentKuninori Morimoto
There is no big difference at implementation for .suspend/.resume between DAI driver and Component driver. But because some driver is using DAI version, thus ALSA SoC needs to keep supporting it, hence, framework becoming verbose. If we can switch all DAI driver .suspend/.resume to Component driver, we can remove verbose code from ALSA SoC. Driver is getting its private data via dai->dev. But dai->dev and component->dev are same dev, thus, we can convert these. For same reason, we can convert dai->active to component->active if necessary. This patch moves DAI driver .suspend/.resume to Component driver Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Acked-by: Peter Ujfalusi <peter.ujfalusi@ti.com> Link: https://lore.kernel.org/r/871rrvym3p.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Mark Brown <broonie@kernel.org>
2019-12-16ASoC: ti: rx51: use snd_soc_dai_link_component for codec_confKuninori Morimoto
We can use snd_soc_dai_link_component to specify codec_conf. Let's use it. Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Link: https://lore.kernel.org/r/8736dp59ih.wl-kuninori.morimoto.gx@renesas.com Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2019-12-09ASoC: ti: davinci-mcasp: Improve the sysclk selectionPeter Ujfalusi
When McASP is master the bclk can be generated from two main source: AUXCLK: functional clock for McASP or AHCLK: from external source or internal mux in dra7x family With this patch it is possible to select between the two source. The patch is not breaking existing machine drivers since historically the clk_id was ignored and left as 0 in all cases. When output clock is configured - which can be only the AHCLK, we select the AUXCLK as source for the internal HCLK. In this case the HCLK rate is the same as the output clock. Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com> Link: https://lore.kernel.org/r/20191204192005.31210-1-peter.ujfalusi@ti.com Signed-off-by: Mark Brown <broonie@kernel.org>
2019-11-15ASoC: ti: davinci-mcasp: Use dma_request_chan() directly for channel requestPeter Ujfalusi
dma_request_slave_channel_reason() is: #define dma_request_slave_channel_reason(dev, name) \ dma_request_chan(dev, name) Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com> Link: https://lore.kernel.org/r/20191113095445.3211-3-peter.ujfalusi@ti.com Signed-off-by: Mark Brown <broonie@kernel.org>
2019-11-06Merge branch 'for-5.4' of ↵Mark Brown
https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound into asoc-5.5
2019-10-28ASoC: ti: sdma-pcm: Add back the flags parameter for non standard dma namesPeter Ujfalusi
When non standard names are used it is possible that one of the directions are not provided, thus the flags needs to be present to tell the core that we have half duplex setup. Fixes: 642aafea8889 ("ASoC: ti: remove compat dma probing") Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com> Link: https://lore.kernel.org/r/20191028115207.5142-1-peter.ujfalusi@ti.com Signed-off-by: Mark Brown <broonie@kernel.org>
2019-09-23Merge tag 'asoc-fix-v5.4-rc1' of ↵Takashi Iwai
https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound into for-linus ASoC: Fixes for v5.4 A small smattering of ASoC fixes for v5.4 - nothing too exciting here, all small standalone things.
2019-09-20ASoC: ti: fix SND_SOC_DM365_VOICE_CODEC dependenciesArnd Bergmann
SND_SOC_DM365_VOICE_CODEC is a 'bool' option in a choice statement, meaning it cannot be set to =m, but it selects two other drivers that we may want to be loadable modules after all: WARNING: unmet direct dependencies detected for SND_SOC_CQ0093VC Depends on [m]: SOUND [=m] && !UML && SND [=m] && SND_SOC [=m] Selected by [y]: - SND_SOC_DM365_VOICE_CODEC [=y] && <choice> Selected by [m]: - SND_SOC_ALL_CODECS [=m] && SOUND [=m] && !UML && SND [=m] && SND_SOC [=m] && COMPILE_TEST [=y] Add an intermediate symbol that sets SND_SOC_CQ0093VC and MFD_DAVINCI_VOICECODEC to =m if SND_SOC=m. Signed-off-by: Arnd Bergmann <arnd@arndb.de> Link: https://lore.kernel.org/r/20190920075046.3210393-1-arnd@arndb.de Signed-off-by: Mark Brown <broonie@kernel.org>
2019-09-09Merge branch 'asoc-5.4' into asoc-nextMark Brown
2019-09-09Merge branch 'asoc-5.3' into asoc-linusMark Brown
2019-09-09ASoC: ams-delta: Take control over audio mute GPIO pinsJanusz Krzysztofik
Since commit 1137ceee76ba ("ARM: OMAP1: ams-delta: Don't request unused GPIOs"), on-board audio has appeared muted. It has been discovered that believed to be unused GPIO pins "hookflash1" and "hookflash2" need to be set low for audible sound in handsfree and handset mode respectively. According to Amstrad E3 wiki, the purpose of both pins hasn't been clearly identified. Original Amstrad software used to produce a high pulse on them when the phone was taken off hook or recall was pressed. With the current findings, we can assume the pins provide a kind of audio mute function, separately for handset and handsfree operation modes. Commit 2afdb4c41d78 ("ARM: OMAP1: ams-delta: Fix audio permanently muted") attempted to fix the issue temporarily by hogging the GPIO pin "hookflash1" renamed to "audio_mute", however the fix occurred incomplete as it restored audible sound only for handsfree mode. Stop hogging that pin, rename the pins to "handsfree_mute" and "handset_mute" respectively and implement appropriate DAPM event callbacks for "Speaker" and "Earpiece" DAPM widgets. Fixes: 1137ceee76ba ("ARM: OMAP1: ams-delta: Don't request unused GPIOs") Signed-off-by: Janusz Krzysztofik <jmkrzyszt@gmail.com> Reviewed-by: Peter Ujfalusi <peter.ujfalusi@ti.com> Link: https://lore.kernel.org/r/20190907111650.15440-1-jmkrzyszt@gmail.com Signed-off-by: Mark Brown <broonie@kernel.org>
2019-08-30ASoC: ti: davinci-evm: Do not fail if the dai_set_sysclk returns -ENOTSUPPPeter Ujfalusi
The davinci McBSP (davinci-i2s) driver does not implement the set_sysclk callback, which is fine and should not be treated as error. Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com> Link: https://lore.kernel.org/r/20190830103841.25128-5-peter.ujfalusi@ti.com Signed-off-by: Mark Brown <broonie@kernel.org>
2019-08-30ASoC: ti: edma-pcm: Fix for legacy dma_slave_map based channel lookupPeter Ujfalusi
Most of the daVinci devices does not boot with DT. In this case the DMA channel is looked up with dma_slave_map and for that the chan_names[] must be configured. Both McASP and ASP/McBSP uses "tx" and "rx" as channel names, so we can just do this when the dev->of_node is not valid. Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com> Link: https://lore.kernel.org/r/20190830103841.25128-4-peter.ujfalusi@ti.com Signed-off-by: Mark Brown <broonie@kernel.org>
2019-08-30ASoC: ti: davinci-i2s: Add S32_LE as support formatPeter Ujfalusi
ASP/McBSP can support 8/16/20/24/32 bits word in theory. I have only tested S16_LE and S32_LE, the other formats might not work so only extend the supported formats with S32_LE for now. Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com> Link: https://lore.kernel.org/r/20190830103841.25128-2-peter.ujfalusi@ti.com Signed-off-by: Mark Brown <broonie@kernel.org>
2019-08-30ASoC: ti: davinci-i2s: Move the XSYNCERR workaround to .prepare callbackPeter Ujfalusi
Currently the driver uses snd_soc_rtdcom_lookup() in it's mcbsp_start function to try to stop/restart the DMA as the initial XSYNCERR workaround need to be done before the DMA is armed. There are couple of things wrong with this: - the driver crashes with NULL pointer dereference as the component->driver->ops is actually NULL - the driver should not use snd_soc_rtdcom_lookup() in the first place - Fiddling with DMA is never a good thing Move the workaround handling to .prepare which is called before the DMA is armed, so it complies with the requirements. Reported-by (usage of snd_soc_rtdcom_lookup): Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com> Link: https://lore.kernel.org/r/20190830103841.25128-3-peter.ujfalusi@ti.com Signed-off-by: Mark Brown <broonie@kernel.org>
2019-08-13ASoC: ti: Fix typos in ti/KconfigMasanari Iida
This patch fixes some spelling typo in Kconfig. Signed-off-by: Masanari Iida <standby24x7@gmail.com> Acked-by: Peter Ujfalusi <peter.ujfalusi@ti.com> Link: https://lore.kernel.org/r/20190813034235.30673-1-standby24x7@gmail.com Signed-off-by: Mark Brown <broonie@kernel.org>
2019-08-09ASoC: ti: rx51: use snd_soc_dai_link_component for aux_devKuninori Morimoto
We can use snd_soc_dai_link_component to specify aux_dev. Let's use it. Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Acked-by: Peter Ujfalusi <peter.ujfalusi@ti.com> Link: https://lore.kernel.org/r/87imr86w96.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Mark Brown <broonie@kernel.org>
2019-08-06Merge tag 'asoc-fix-v5.3-rc3' of ↵Takashi Iwai
https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound into for-linus ASoC: Fixes for v5.3 A relatively large batch of mostly unremarkable fixes here, a couple of small core fixes for fairly obscure issues, more comment/email updates with no code impact than usual and a bunch of small driver fixes. The support for new sample rates in the max98373 driver is a fix for the fact that the driver declared support for those rates but would in fact return an error if these rates were selected.
2019-07-31ASoC: ti: Mark expected switch fall-throughsGustavo A. R. Silva
Mark switch cases where we are expecting to fall through. This patch fixes the following warning (Building: arm): sound/soc/ti/n810.c: In function ‘n810_ext_control’: sound/soc/ti/n810.c:48:10: warning: this statement may fall through [-Wimplicit-fallthrough=] line1l = 1; ~~~~~~~^~~ sound/soc/ti/n810.c:49:2: note: here case N810_JACK_HP: ^~~~ sound/soc/ti/rx51.c: In function ‘rx51_ext_control’: sound/soc/ti/rx51.c:57:6: warning: this statement may fall through [-Wimplicit-fallthrough=] hs = 1; ~~~^~~ sound/soc/ti/rx51.c:58:2: note: here case RX51_JACK_HP: ^~~~ Signed-off-by: Gustavo A. R. Silva <gustavo@embeddedor.com> Acked-by: Jarkko Nikula <jarkko.nikula@bitmer.com> Link: https://lore.kernel.org/r/20190729221534.GA18696@embeddedor Signed-off-by: Mark Brown <broonie@kernel.org>
2019-07-26ASoC: ti: davinci-mcasp: Support for correct symmetric sample bitsPeter Ujfalusi
Implement custom snd_pcm_hw_rule to filter the available formats for the second stream to make it symmetric and allow only formats which require the same amount of bits on the bus as the running stream. A simple constraint is not working correctly because for example: the first stream is started with S24_LE If we place 24 as constraint for the SAMPLE_BITS then the second stream can not use S24_LE as it is physically 32bits. If we would place 32 as constraint (physical width) then S32_LE would have been allowed, but S24_3LE is not. Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com> Link: https://lore.kernel.org/r/20190726064244.3762-3-peter.ujfalusi@ti.com Signed-off-by: Mark Brown <broonie@kernel.org>
2019-07-26Merge branch 'asoc-5.3' into asoc-5.4Mark Brown
2019-07-26ASoC: ti: davinci-mcasp: Correct slot_width posed constraintPeter Ujfalusi
The slot_width is a property for the bus while the constraint for SNDRV_PCM_HW_PARAM_SAMPLE_BITS is for the in memory format. Applying slot_width constraint to sample_bits works most of the time, but it will blacklist valid formats in some cases. With slot_width 24 we can support S24_3LE and S24_LE formats as they both look the same on the bus, but a a 24 constraint on sample_bits would not allow S24_LE as it is stored in 32bits in memory. Implement a simple hw_rule function to allow all formats which require less or equal number of bits on the bus as slot_width (if configured). Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com> Link: https://lore.kernel.org/r/20190726064244.3762-2-peter.ujfalusi@ti.com Signed-off-by: Mark Brown <broonie@kernel.org>
2019-07-26ASoC: ti: davinci-mcasp: Fix clk PDIR handling for i2s master modePeter Ujfalusi
When running McASP as master capture alone will not record any audio unless a parallel playback stream is running. As soon as the playback stops the captured data is going to be silent again. In McASP master mode we need to set the PDIR for the clock pins and fix the mcasp_set_axr_pdir() to skip the bits in the PDIR registers above AMUTE. This went unnoticed as most of the boards uses McASP as slave and neither of these issues are visible (audible) in those setups. Fixes: ca3d9433349e ("ASoC: davinci-mcasp: Update PDIR (pin direction) register handling") Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com> Link: https://lore.kernel.org/r/20190725083423.7321-1-peter.ujfalusi@ti.com Signed-off-by: Mark Brown <broonie@kernel.org>
2019-07-25ASoC: ti: davinci-mcasp: Improve serializer handling in multi AXR setupsPeter Ujfalusi
When multiple serializers are used we need to track the number of serializers used by the other stream direction to avoid killing data lines when the first stream used more serializers than the second would need. We are still protected against the case when the second stream uses more serializers which had affected the running stream as well. To take advantage of the improved serializer logic we need to modify the channel constraints rule as well to allow the use of multiple serializers for the second stream as additional ones will not affect the FS/BCLK on the bus. Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com> Link: https://lore.kernel.org/r/20190725083432.7419-1-peter.ujfalusi@ti.com Signed-off-by: Mark Brown <broonie@kernel.org>
2019-07-25ASoC: ti: davinci-mcasp: Add support for RIGHT_J formatPeter Ujfalusi
The formater unit's rotation needs to be programmed differently for right aligned bus format to have the data moved to the correct place. Take the opportunity and simplify the formater unit setup code. Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com> Link: https://lore.kernel.org/r/20190725083411.7211-1-peter.ujfalusi@ti.com Signed-off-by: Mark Brown <broonie@kernel.org>
2019-07-06Merge branch 'asoc-5.3' into asoc-nextMark Brown
2019-07-06Merge branch 'asoc-5.2' into asoc-linusMark Brown