Commit Graph

21320 Commits

Author SHA1 Message Date
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 764aafdb98
ASoC: simple-card-utils: Support configure pin_name for asoc_simple_init_jack
Currently the pin_name is fixed in asoc_simple_init_jack, but some driver
may use a different pin_name. So add a new parameter in
asoc_simple_init_jack for configuring pin_name.

If this parameter is NULL, then the default pin_name is used.

Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com>
Acked-by: Nicolin Chen <nicoleotsuka@gmail.com>
Link: https://lore.kernel.org/r/1594822179-1849-2-git-send-email-shengjiu.wang@nxp.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-07-16 23:24:12 +01:00
Kuninori Morimoto 50891431aa
ASoC: codecs: ak*: merge .digital_mute() into .mute_stream()
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/87pn95wiwa.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-07-16 23:06:20 +01:00
Kuninori Morimoto 03c0f1b5e1
ASoC: codecs: cs*: merge .digital_mute() into .mute_stream()
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/87r1tlwiwe.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-07-16 23:06:19 +01:00
Kuninori Morimoto f39c0540d6
ASoC: codecs: da*: merge .digital_mute() into .mute_stream()
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>
Reviewed-by: Adam Thomson <Adam.Thomson.Opensource@diasemi.com>
Link: https://lore.kernel.org/r/87sge1wiwi.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-07-16 23:06:18 +01:00
Kuninori Morimoto 8667d948a6
ASoC: codecs: es*: merge .digital_mute() into .mute_stream()
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/87tuyhwiwm.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-07-16 23:06:17 +01:00
Kuninori Morimoto 26d3c16e62
ASoC: codecs: wm*: merge .digital_mute() into .mute_stream()
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>
Acked-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Link: https://lore.kernel.org/r/87v9ixwiwr.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-07-16 23:06:16 +01:00
Kuninori Morimoto 4c66c2fc10
ASoC: codecs: alc*: merge .digital_mute() into .mute_stream()
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/87wo3dwiwv.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-07-16 23:06:15 +01:00
Kuninori Morimoto 18e028e22e
ASoC: codecs: max*: merge .digital_mute() into .mute_stream()
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/87y2ntwix0.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-07-16 23:06:14 +01:00
Kuninori Morimoto 1eb2c43d26
ASoC: codecs: pcm*: merge .digital_mute() into .mute_stream()
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/87zh89wix5.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-07-16 23:06:13 +01:00
Kuninori Morimoto bd63ed7689
ASoC: codecs: ssm*: merge .digital_mute() into .mute_stream()
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/871rllxxhp.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-07-16 23:06:13 +01:00
Kuninori Morimoto 38803ce7b5
ASoC: codecs: tas*: merge .digital_mute() into .mute_stream()
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/873661xxhu.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-07-16 23:06:12 +01:00
Kuninori Morimoto 960af79d31
ASoC: codecs: tlv*: merge .digital_mute() into .mute_stream()
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/874kqhxxhz.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-07-16 23:06:11 +01:00
Kuninori Morimoto 54b5927067
ASoC: codecs: merge .digital_mute() into .mute_stream()
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/875zaxxxi4.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-07-16 23:06:09 +01:00
Kuninori Morimoto f795ff78e2
ASoC: meson: merge .digital_mute() into .mute_stream()
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/878sftxxie.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-07-16 23:06:09 +01:00
Kuninori Morimoto 1ff123965b
ASoC: spear: merge .digital_mute() into .mute_stream()
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/87a709xxij.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-07-16 23:06:08 +01:00
Kuninori Morimoto 059374fe9e
ASoC: ti: merge .digital_mute() into .mute_stream()
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-16 23:06:07 +01:00
Kuninori Morimoto d789710fb2
ASoC: hdmi-codec: merge .digital_mute() into .mute_stream()
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);
		...
	}

For hdmi-codec, we need to update struct hdmi_codec_ops,
and all its users in the same time.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Reviewed-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
Link: https://lore.kernel.org/r/87d055xxj2.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-07-16 23:06:06 +01:00
Kuninori Morimoto 350d993510
ASoC: soc-dai.c: add .no_capture_mute support
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);
		...
	}

To prepare merging mute_stream()/digital_mute(),
this patch adds .no_capture_mute support to emulate .digital_mute().

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/87eeplxxj7.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-07-16 23:06:05 +01:00
Kuninori Morimoto e07e49c0d1
ASoC: hdmi-codec: return -ENOTSUPP for digital_mute
snd_soc_dai_digital_mute() will return -ENOTSUPP if driver doesn't
support mute.
In hdmi-codec case, hdmi_codec_digital_mute() will be used for it,
and each driver has .digital_mute() callback.
hdmi_codec_digital_mute() want to return -ENOTSUPP to follow it.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/87fta1xxjc.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-07-16 23:06:04 +01:00
Oder Chiou fe0a53044b
ASoC: rt5682: Report the button event in the headset type only
The irq work will be manipulated by resume function, and it will report
the wrong jack type while the jack type is headphone in the button event.

Signed-off-by: Oder Chiou <oder_chiou@realtek.com>
Link: https://lore.kernel.org/r/20200716030123.27122-1-oder_chiou@realtek.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-07-16 20:29:09 +01:00
Jing Xiangfeng b3df80ab6d
ASoC: Intel: bytcht_es8316: Add missed put_device()
snd_byt_cht_es8316_mc_probe() misses to call put_device() in an error
path. Add the missed function call to fix it.

Fixes: ba49cf6f8e ("ASoC: Intel: bytcht_es8316: Add quirk for inverted jack detect")
Signed-off-by: Jing Xiangfeng <jingxiangfeng@huawei.com>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Acked-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20200714080918.148196-1-jingxiangfeng@huawei.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-07-16 20:29:08 +01:00
Eric Biggers 9d4cafa5a0 ASoC: cros_ec_codec: use sha256() instead of open coding
Now that there's a function that calculates the SHA-256 digest of a
buffer in one step, use it instead of sha256_init() + sha256_update() +
sha256_final().

Also simplify the code by inlining calculate_sha256() into its caller
and switching a debug log statement to use %*phN instead of bin2hex().

Acked-by: Tzung-Bi Shih <tzungbi@google.com>
Reviewed-by: Ard Biesheuvel <ardb@kernel.org>
Cc: alsa-devel@alsa-project.org
Cc: Ard Biesheuvel <ardb@kernel.org>
Cc: Cheng-Yi Chiang <cychiang@chromium.org>
Cc: Enric Balletbo i Serra <enric.balletbo@collabora.com>
Cc: Guenter Roeck <groeck@chromium.org>
Cc: Tzung-Bi Shih <tzungbi@google.com>
Signed-off-by: Eric Biggers <ebiggers@google.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
2020-07-16 21:49:05 +10:00
Kuninori Morimoto 0498b5bff8
ASoC: ssi: don't use discriminatory terms for debug log
ssi is using discriminatory terms for debug log.
This patch changes it to "secondary"

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/87blkj3qq9.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-07-14 16:38:24 +01:00
Kuninori Morimoto f363459f24
ASoC: siu: don't use discriminatory terms for parameter
siu is using discriminatory terms for function parameter.
This patch changes it to "secondary"

One note here is that it do nothing to DMA related naming
for now, because it needs framework level modification.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/87d04z3qqg.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-07-14 16:38:23 +01:00
Kuninori Morimoto cf01245db8
ASoC: fsi: don't use discriminatory terms for comment
fsi is using discriminatory terms for comment.
This patch removes it.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/87eepf3qqs.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-07-14 16:38:22 +01:00
Kuninori Morimoto f7c7a24b7d
ASoC: rsnd: don't use discriminatory terms for comment
rsnd is using discriminatory terms for comment.
This patch removes it.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/87ft9v3qr1.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-07-14 16:38:21 +01:00
Kuninori Morimoto 25b384b8ea
ASoC: rsnd: don't use discriminatory terms for function names
rsnd is using discriminatory terms for function names.
This patch changes it to "secondary"

One note here is that it do nothing to DMA related naming
for now, because it needs framework level modification.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/87h7ub3qra.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-07-14 16:38:20 +01:00
derek.fang fa291331cb
ASoC: rt5682: Enable Vref2 under using PLL2
Enable Vref2 under long term using PLL2 to avoid clock unstable.

Signed-off-by: derek.fang <derek.fang@realtek.com>
Link: https://lore.kernel.org/r/1594721600-29994-1-git-send-email-derek.fang@realtek.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-07-14 15:54:03 +01:00
Sugar Zhang f50d67f9ef
ASoC: rockchip: spdif: Handle clk by pm runtime
This patch handle the clk by pm runtime mechanism to simplify
the clk management.

Signed-off-by: Sugar Zhang <sugar.zhang@rock-chips.com>
Link: https://lore.kernel.org/r/1594635960-67855-1-git-send-email-sugar.zhang@rock-chips.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-07-13 17:53:46 +01:00
Mark Brown 1c62ec5f1a
Merge series "ASoC: mediatek: mt8183: support DP audio" from Tzung-Bi Shih <tzungbi@google.com>:
This series is a follow up for a long time ago series
(https://patchwork.kernel.org/cover/11204303/).

The old series bound too much on the patches of DRM bridge and ASoC
machine driver.  And unluckily, the dependencies
(https://lore.kernel.org/patchwork/patch/1126819/) have not applied.

Revewing the ASoC patches in the old series, I found that they could be
decoupled from the DRM bridge patches.  And they are harmless as it is
an optional attribute ("hdmi-codec") in DTS.

This series arranges and rebases the harmless ASoC patches for
mt8183-mt6358-ts3a227-max98357 and mt8183-da7219-max98357.

The 1st and 4th patch add an optional DT property.  The 1st patch was
acked long time ago (https://patchwork.kernel.org/patch/11204321/).

The 2nd and 5th patch add DAI link for using hdmi-codec.

The 3rd and 6th patch support the HDMI jack reporting.

Tzung-Bi Shih (6):
  ASoC: dt-bindings: mt8183: add a property "mediatek,hdmi-codec"
  ASoC: mediatek: mt8183: use hdmi-codec
  ASoC: mediatek: mt8183: support HDMI jack reporting
  ASoC: dt-bindings: mt8183-da7219: add a property "mediatek,hdmi-codec"
  ASoC: mediatek: mt8183-da7219: use hdmi-codec
  ASoC: mediatek: mt8183-da7219: support HDMI jack reporting

 .../bindings/sound/mt8183-da7219-max98357.txt |  4 +++
 .../sound/mt8183-mt6358-ts3a227-max98357.txt  |  2 ++
 sound/soc/mediatek/Kconfig                    |  2 ++
 .../mediatek/mt8183/mt8183-da7219-max98357.c  | 29 +++++++++++++++++--
 .../mt8183/mt8183-mt6358-ts3a227-max98357.c   | 29 +++++++++++++++++--
 5 files changed, 60 insertions(+), 6 deletions(-)

--
2.27.0.383.g050319c2ae-goog
2020-07-10 16:06:46 +01:00
Mark Brown 3689eb0bbd
Merge series "ASoC: Clean-up W=1 build warnings​ - part2" from Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>:
Both Lee Jones and I submitted separate series, this is the second
part of the merged result, for which no feedback was provided.

I picked Lee's patches for rt5659 and ak4458 and added the pxa and
ux500 that I didn't fix. The rest is largely identical between our
respective series, with the exception of the sunxi which I documented
and Lee removed. I don't have any specific preference and will go with
the flow on this.

Changes since v3:
Improved commit subjects from 'fix kernel-doc' as suggested by Lee
Jones. In a couple of cases I just reverted to Lee's patches when the
code was identical.
Added a couple of CC: tags from Lee's patches.
Added Arnaud Pouliquen's Acked-by tag in first patch.

Lee Jones (6):
  ASoC: sunxi: sun4i-spdif: Fix misspelling of 'reg_dac_txdata' in
    kernel-doc
  ASoC: pxa: pxa-ssp: Demote seemingly unintentional kerneldoc header
  ASoC: ux500: ux500_msp_i2s: Remove unused variables 'reg_val_DR' and
    'reg_val_TSTDR'
  ASoC: codecs: rt5659: Remove many unused const variables
  ASoC: codecs: tlv320aic26: Demote seemingly unintentional kerneldoc
    header
  ASoC: codecs: ak4458: Remove set but never checked variable 'ret'

Pierre-Louis Bossart (4):
  ASoC: sti: uniperif: fix 'defined by not used' warning
  ASoC: qcom: qdsp6: q6asm: Provide documentation for 'codec_profile'
  ASoC: sunxi: sun4i-i2s: add missing clock and format arguments in
    kernel-doc
  ASoC: codecs: rt5631: fix spurious kernel-doc start and missing
    arguments

 sound/soc/codecs/ak4458.c       |  6 +++---
 sound/soc/codecs/rt5631.c       |  8 +++++--
 sound/soc/codecs/rt5659.c       | 37 ---------------------------------
 sound/soc/codecs/tlv320aic26.c  |  2 +-
 sound/soc/pxa/pxa-ssp.c         |  2 +-
 sound/soc/qcom/qdsp6/q6asm.c    |  2 +-
 sound/soc/sti/uniperif.h        |  2 +-
 sound/soc/sunxi/sun4i-i2s.c     | 10 ++++++++-
 sound/soc/sunxi/sun4i-spdif.c   |  2 +-
 sound/soc/ux500/ux500_msp_i2s.c |  8 +++----
 10 files changed, 27 insertions(+), 52 deletions(-)

base-commit: 6940701c71
--
2.25.1
2020-07-10 16:06:45 +01:00
Mark Brown 93ba7c8d79
Merge series "ASoC: fsl_spdif: Clear the validity bit for TX" from Shengjiu Wang <shengjiu.wang@nxp.com>:
Clear the validity bit for TX
Add kctl for configuring TX validity bit

Shengjiu Wang (2):
  ASoC: fsl_spdif: Clear the validity bit for TX
  ASoC: fsl_spdif: Add kctl for configuring TX validity bit

 sound/soc/fsl/fsl_spdif.c | 51 ++++++++++++++++++++++++++++++++++++---
 1 file changed, 47 insertions(+), 4 deletions(-)

--
2.21.0
2020-07-10 16:06:44 +01:00
Hans de Goede 984b2cadd9
ASoC: Intel: cht_bsw_rt5672: Improve dai-set-fmt comment in cht_codec_fixup()
As Pierre-Louis Bossart pointed out, saying that the default mode for the
SSP is TDM 4 slot is not entirely accurate.

There really are 2 default modes:
The default mode for the SSP configuration is TDM 4 slot for the
cpu-dai (hard-coded in DSP firmware),
The default mode for the SSP configuration is I2S for the codec-dai
(hard-coded in the 'SSP2-Codec" .dai_fmt masks, so far unused).

This commit updates the comment in cht_codec_fixup() to properly reflect
this.

Suggested-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/20200703103840.333732-1-hdegoede@redhat.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-07-10 16:06:43 +01:00
Tzung-Bi Shih e25f8afd88
ASoC: mediatek: mt8183-da7219: support HDMI jack reporting
Supports HDMI jack reporting.

Signed-off-by: Tzung-Bi Shih <tzungbi@google.com>
Link: https://lore.kernel.org/r/20200710052505.3664118-7-tzungbi@google.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-07-10 15:57:55 +01:00
Tzung-Bi Shih 5bdbe97711
ASoC: mediatek: mt8183-da7219: use hdmi-codec
Adds DAI link to use hdmi-codec.

Signed-off-by: Tzung-Bi Shih <tzungbi@google.com>
Link: https://lore.kernel.org/r/20200710052505.3664118-6-tzungbi@google.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-07-10 15:57:54 +01:00
Tzung-Bi Shih 88abbf627a
ASoC: mediatek: mt8183: support HDMI jack reporting
Supports HDMI jack reporting.

Signed-off-by: Tzung-Bi Shih <tzungbi@google.com>
Link: https://lore.kernel.org/r/20200710052505.3664118-4-tzungbi@google.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-07-10 15:57:52 +01:00
Tzung-Bi Shih f2024dc55f
ASoC: mediatek: mt8183: use hdmi-codec
Adds DAI link to use hdmi-codec.

Signed-off-by: Tzung-Bi Shih <tzungbi@google.com>
Link: https://lore.kernel.org/r/20200710052505.3664118-3-tzungbi@google.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-07-10 15:57:52 +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
Lee Jones cc3cceedcb
ASoC: codecs: ak4458: Remove set but never checked variable 'ret'
Looks as though the result of snd_soc_update_bits() has never been checked.

Fixes the following W=1 kernel build warning(s):

sound/soc/codecs/ak4458.c: In function ‘ak4458_set_dai_mute’:
sound/soc/codecs/ak4458.c:408:16: warning: variable ‘ret’ set but not
used [-Wunused-but-set-variable]

Signed-off-by: Lee Jones <lee.jones@linaro.org>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Cc: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Cc: Junichi Wakasugi <wakasugi.jb@om.asahi-kasei.co.jp>
Cc: Mihai Serban <mihai.serban@nxp.com>
Link: https://lore.kernel.org/r/20200709162328.259586-11-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-07-10 15:13:52 +01:00
Lee Jones c90a67458e
ASoC: codecs: tlv320aic26: Demote seemingly unintentional kerneldoc header
This is the only use of kerneldoc in the sourcefile and no
descriptions are provided.

Fixes the following W=1 kernel build warning(s):

sound/soc/codecs/tlv320aic26.c:138: warning: Function parameter or
member 'dai' not described in 'aic26_mute'
sound/soc/codecs/tlv320aic26.c:138: warning: Function parameter or
member 'mute' not described in 'aic26_mute'

Signed-off-by: Lee Jones <lee.jones@linaro.org>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Cc: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Cc: Grant Likely <grant.likely@secretlab.ca>
Link: https://lore.kernel.org/r/20200709162328.259586-10-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-07-10 15:13:51 +01:00
Lee Jones e57f0e4d4a
ASoC: codecs: rt5659: Remove many unused const variables
Looks as though they've never been used.

Fixes the following W=1 kernel build warning(s):

 In file included from  sound/soc/codecs/rt5659.c:25:
 In file included from sound/soc/codecs/rt5659.c:25:
 sound/soc/codecs/rt5659.c:1232:2: warning: ‘rt5659_ad_monor_asrc_enum’ defined but not used [-Wunused-const-variable=]
 1232 | rt5659_ad_monor_asrc_enum, RT5659_ASRC_3, RT5659_AD_MONO_R_T_SFT, 0x7,
 | ^~~~~~~~~~~~~~~~~~~~~~~~~
 include/sound/soc.h:359:24: note: in definition of macro ‘SOC_VALUE_ENUM_DOUBLE_DECL’
 359 | const struct soc_enum name = SOC_VALUE_ENUM_DOUBLE(xreg, xshift_l, xshift_r, xmask, | ^~~~
 sound/soc/codecs/rt5659.c:1231:8: note: in expansion of macro ‘SOC_VALUE_ENUM_SINGLE_DECL’
 1231 | static SOC_VALUE_ENUM_SINGLE_DECL(
 | ^~~~~~~~~~~~~~~~~~~~~~~~~~
 sound/soc/codecs/rt5659.c:1228:2: warning: ‘rt5659_ad_monol_asrc_enum’ defined but not used [-Wunused-const-variable=]
 1228 | rt5659_ad_monol_asrc_enum, RT5659_ASRC_3, RT5659_AD_MONO_L_T_SFT, 0x7,
 | ^~~~~~~~~~~~~~~~~~~~~~~~~
 include/sound/soc.h:359:24: note: in definition of macro ‘SOC_VALUE_ENUM_DOUBLE_DECL’
 359 | const struct soc_enum name = SOC_VALUE_ENUM_DOUBLE(xreg, xshift_l, xshift_r, xmask, | ^~~~
 sound/soc/codecs/rt5659.c:1227:8: note: in expansion of macro ‘SOC_VALUE_ENUM_SINGLE_DECL’
 1227 | static SOC_VALUE_ENUM_SINGLE_DECL(
 | ^~~~~~~~~~~~~~~~~~~~~~~~~~
 sound/soc/codecs/rt5659.c:1224:2: warning: ‘rt5659_ad_sto2_asrc_enum’ defined but not used [-Wunused-const-variable=]
 1224 | rt5659_ad_sto2_asrc_enum, RT5659_ASRC_3, RT5659_AD_STO2_T_SFT, 0x7,
 | ^~~~~~~~~~~~~~~~~~~~~~~~
 include/sound/soc.h:359:24: note: in definition of macro ‘SOC_VALUE_ENUM_DOUBLE_DECL’
 359 | const struct soc_enum name = SOC_VALUE_ENUM_DOUBLE(xreg, xshift_l, xshift_r, xmask, | ^~~~
 sound/soc/codecs/rt5659.c:1223:8: note: in expansion of macro ‘SOC_VALUE_ENUM_SINGLE_DECL’
 1223 | static SOC_VALUE_ENUM_SINGLE_DECL(
 | ^~~~~~~~~~~~~~~~~~~~~~~~~~
 sound/soc/codecs/rt5659.c:1220:2: warning: ‘rt5659_ad_sto1_asrc_enum’ defined but not used [-Wunused-const-variable=]
 1220 | rt5659_ad_sto1_asrc_enum, RT5659_ASRC_2, RT5659_AD_STO1_T_SFT, 0x7,
 | ^~~~~~~~~~~~~~~~~~~~~~~~
 include/sound/soc.h:359:24: note: in definition of macro ‘SOC_VALUE_ENUM_DOUBLE_DECL’
 359 | const struct soc_enum name = SOC_VALUE_ENUM_DOUBLE(xreg, xshift_l, xshift_r, xmask, | ^~~~
 sound/soc/codecs/rt5659.c:1219:8: note: in expansion of macro ‘SOC_VALUE_ENUM_SINGLE_DECL’
 1219 | static SOC_VALUE_ENUM_SINGLE_DECL(
 | ^~~~~~~~~~~~~~~~~~~~~~~~~~
 sound/soc/codecs/rt5659.c:1216:2: warning: ‘rt5659_da_monor_asrc_enum’ defined but not used [-Wunused-const-variable=]
 1216 | rt5659_da_monor_asrc_enum, RT5659_ASRC_2, RT5659_DA_MONO_R_T_SFT, 0x7,
 | ^~~~~~~~~~~~~~~~~~~~~~~~~
 include/sound/soc.h:359:24: note: in definition of macro ‘SOC_VALUE_ENUM_DOUBLE_DECL’
 359 | const struct soc_enum name = SOC_VALUE_ENUM_DOUBLE(xreg, xshift_l, xshift_r, xmask, | ^~~~
 sound/soc/codecs/rt5659.c:1215:8: note: in expansion of macro ‘SOC_VALUE_ENUM_SINGLE_DECL’
 1215 | static SOC_VALUE_ENUM_SINGLE_DECL(
 | ^~~~~~~~~~~~~~~~~~~~~~~~~~
 sound/soc/codecs/rt5659.c:1212:2: warning: ‘rt5659_da_monol_asrc_enum’ defined but not used [-Wunused-const-variable=]
 1212 | rt5659_da_monol_asrc_enum, RT5659_ASRC_2, RT5659_DA_MONO_L_T_SFT, 0x7,
 | ^~~~~~~~~~~~~~~~~~~~~~~~~
 include/sound/soc.h:359:24: note: in definition of macro ‘SOC_VALUE_ENUM_DOUBLE_DECL’
 359 | const struct soc_enum name = SOC_VALUE_ENUM_DOUBLE(xreg, xshift_l, xshift_r, xmask, | ^~~~
 sound/soc/codecs/rt5659.c:1211:8: note: in expansion of macro ‘SOC_VALUE_ENUM_SINGLE_DECL’
 1211 | static SOC_VALUE_ENUM_SINGLE_DECL(
 | ^~~~~~~~~~~~~~~~~~~~~~~~~~
 sound/soc/codecs/rt5659.c:1208:2: warning: ‘rt5659_da_sto_asrc_enum’ defined but not used [-Wunused-const-variable=]
 1208 | rt5659_da_sto_asrc_enum, RT5659_ASRC_2, RT5659_DA_STO_T_SFT, 0x7,
 | ^~~~~~~~~~~~~~~~~~~~~~~
 include/sound/soc.h:359:24: note: in definition of macro ‘SOC_VALUE_ENUM_DOUBLE_DECL’
 359 | const struct soc_enum name = SOC_VALUE_ENUM_DOUBLE(xreg, xshift_l, xshift_r, xmask, | ^~~~
 sound/soc/codecs/rt5659.c:1207:8: note: in expansion of macro ‘SOC_VALUE_ENUM_SINGLE_DECL’
 1207 | static SOC_VALUE_ENUM_SINGLE_DECL(
 | ^~~~~~~~~~~~~~~~~~~~~~~~~~

Signed-off-by: Lee Jones <lee.jones@linaro.org>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Cc: Oder Chiou <oder_chiou@realtek.com>
Link: https://lore.kernel.org/r/20200709162328.259586-9-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-07-10 15:13:50 +01:00
Pierre-Louis Bossart 762a3d4313
ASoC: codecs: rt5631: fix spurious kernel-doc start and missing arguments
Fixes the following W=1 kernel build warning(s):

sound/soc/codecs/rt5631.c:72: warning: Function parameter or member
'component' not described in 'rt5631_write_index'
sound/soc/codecs/rt5631.c:72: warning: Function parameter or member
'reg' not described in 'rt5631_write_index'
sound/soc/codecs/rt5631.c:72: warning: Function parameter or member
'value' not described in 'rt5631_write_index'
sound/soc/codecs/rt5631.c:82: warning: Function parameter or member
'component' not described in 'rt5631_read_index'
sound/soc/codecs/rt5631.c:82: warning: Function parameter or member
'reg' not described in 'rt5631_read_index'
sound/soc/codecs/rt5631.c:367: warning: Function parameter or member
'component' not described in 'onebit_depop_power_stage'
sound/soc/codecs/rt5631.c:405: warning: Function parameter or member
'component' not described in 'onebit_depop_mute_stage'
sound/soc/codecs/rt5631.c:443: warning: Function parameter or member
'component' not described in 'depop_seq_power_stage'
sound/soc/codecs/rt5631.c:515: warning: Function parameter or member
 'component' not described in 'depop_seq_mute_stage'

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20200709162328.259586-8-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-07-10 15:13:49 +01:00
Lee Jones 79b094c9dc
ASoC: ux500: ux500_msp_i2s: Remove unused variables 'reg_val_DR' and 'reg_val_TSTDR'
Looks like these have been unchecked since the driver's inception in 2012.

Fixes the following W=1 kernel build warning(s):

sound/soc/ux500/ux500_msp_i2s.c: In function ‘flush_fifo_rx’:
sound/soc/ux500/ux500_msp_i2s.c:398:6: warning: variable ‘reg_val_DR’
set but not used [-Wunused-but-set-variable]
sound/soc/ux500/ux500_msp_i2s.c: In function ‘flush_fifo_tx’:
sound/soc/ux500/ux500_msp_i2s.c:415:6: warning: variable
‘reg_val_TSTDR’ set but not used [-Wunused-but-set-variable]

Signed-off-by: Lee Jones <lee.jones@linaro.org>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Cc: zhong jiang <zhongjiang@huawei.com>
Cc: Ola Lilja <ola.o.lilja@stericsson.com>
Cc: Roger Nilsson <roger.xr.nilsson@stericsson.com>
Cc: Sandeep Kaushik <sandeep.kaushik@st.com>
Link: https://lore.kernel.org/r/20200709162328.259586-7-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-07-10 15:13:48 +01:00
Lee Jones 701f4727f7
ASoC: pxa: pxa-ssp: Demote seemingly unintentional kerneldoc header
This is the only use of kerneldoc in the sourcefile and full
descriptions are not provided.

Fixes the following W=1 kernel build warning(s):

sound/soc/pxa/pxa-ssp.c:186: warning: Function parameter or member
'ssp' not described in 'pxa_ssp_set_scr'

Signed-off-by: Lee Jones <lee.jones@linaro.org>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Cc: Daniel Mack <daniel@zonque.org>
Cc: Haojian Zhuang <haojian.zhuang@gmail.com>
Cc: Robert Jarzmik <robert.jarzmik@free.fr>
Link: https://lore.kernel.org/r/20200709162328.259586-6-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-07-10 15:13:48 +01:00
Lee Jones c7202a19cf
ASoC: sunxi: sun4i-spdif: Fix misspelling of 'reg_dac_txdata' in kernel-doc
Property name descriptions need to match exactly.

Fixes the following W=1 kernel build warning(s):

sound/soc/sunxi/sun4i-spdif.c:178: warning: Function parameter or
member 'reg_dac_txdata' not described in 'sun4i_spdif_quirks'

Signed-off-by: Lee Jones <lee.jones@linaro.org>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Cc: Maxime Ripard <mripard@kernel.org>
Cc: Chen-Yu Tsai <wens@csie.org>
Cc: Philipp Zabel <p.zabel@pengutronix.de>
Cc: Andrea Venturi <be17068@iperbole.bo.it>
Cc: Marcus Cooper <codekipper@gmail.com>
Link: https://lore.kernel.org/r/20200709162328.259586-5-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-07-10 15:13:47 +01:00
Pierre-Louis Bossart 643e305e9b
ASoC: sunxi: sun4i-i2s: add missing clock and format arguments in kernel-doc
Fix W=1 warnings - missing fields in description

sound/soc/sunxi/sun4i-i2s.c:160: warning: Function parameter or
 member 'bclk_dividers' not described in 'sun4i_i2s_quirks'
sound/soc/sunxi/sun4i-i2s.c:160: warning: Function parameter or member
'num_bclk_dividers' not described in 'sun4i_i2s_quirks'
sound/soc/sunxi/sun4i-i2s.c:160: warning: Function parameter or member
'mclk_dividers' not described in 'sun4i_i2s_quirks'
sound/soc/sunxi/sun4i-i2s.c:160: warning: Function parameter or member
'num_mclk_dividers' not described in 'sun4i_i2s_quirks'
sound/soc/sunxi/sun4i-i2s.c:160: warning: Function parameter or member
'get_bclk_parent_rate' not described in 'sun4i_i2s_quirks'
sound/soc/sunxi/sun4i-i2s.c:160: warning: Function parameter or member
'get_sr' not described in 'sun4i_i2s_quirks'
sound/soc/sunxi/sun4i-i2s.c:160: warning: Function parameter or member
'get_wss' not described in 'sun4i_i2s_quirks'
sound/soc/sunxi/sun4i-i2s.c:160: warning: Function parameter or member
'set_chan_cfg' not described in 'sun4i_i2s_quirks'
sound/soc/sunxi/sun4i-i2s.c:160: warning: Function parameter or member
'set_fmt' not described in 'sun4i_i2s_quirks'

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Cc: Maxime Ripard <mripard@kernel.org>
Cc: Chen-Yu Tsai <wens@csie.org>
Cc: Philipp Zabel <p.zabel@pengutronix.de>
Cc: Andrea Venturi <be17068@iperbole.bo.it>
Link: https://lore.kernel.org/r/20200709162328.259586-4-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-07-10 15:13:46 +01:00
Pierre-Louis Bossart d463350421
ASoC: qcom: qdsp6: q6asm: Provide documentation for 'codec_profile'
Fixes the following W=1 kernel build warning(s):

sound/soc/qcom/qdsp6/q6asm.c:924: warning: Function parameter or
member 'codec_profile' not described in 'q6asm_open_write'

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Cc: Patrick Lai <plai@codeaurora.org>
Cc: Banajit Goswami <bgoswami@codeaurora.org>
Cc: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Cc: Vinod Koul <vkoul@kernel.org>
Link: https://lore.kernel.org/r/20200709162328.259586-3-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-07-10 15:13:45 +01:00
Pierre-Louis Bossart 97d73032a8
ASoC: sti: uniperif: fix 'defined by not used' warning
Fix W=1 warning. The table uni_tdm_hw is declared in a header included
by multiple C file. This isn't really a good practice but for now
using __maybe_unused makes the following warning go away.

sound/soc/sti/sti_uniperif.c:12:
sound/soc/sti/uniperif.h:1351:38: warning: ‘uni_tdm_hw’ defined but
not used [-Wunused-const-variable=]
 1351 | static const struct snd_pcm_hardware uni_tdm_hw = {
      |                                      ^~~~~~~~~~

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Acked-by: Arnaud Pouliquen <arnaud.pouliquen@st.com>
Link: https://lore.kernel.org/r/20200709162328.259586-2-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-07-10 15:13:44 +01:00
Mark Brown 0382437646
Merge series "ASoC: mediatek: mt8183-da7219: support machine driver for rt1015" from Tzung-Bi Shih <tzungbi@google.com>:
This series tries to reuse mt8183-da7219-max98357.c for supporting machine
driver with rt1015 speaker amplifier.

The first 3 patches refactor the code for easier to change for subsequent
patches.

The 4th patch adds document for the new proposed compatible string.

The 5th patch changes the machine driver to support either "MAX98357A" or
"RT1015" codecs.

Tzung-Bi Shih (5):
  ASoC: mediatek: mt8183-da7219: sort header inclusions in alphabetical
  ASoC: mediatek: mt8183-da7219: remove forward declaration of
    headset_init
  ASoC: mediatek: mt8183-da7219: extract codec and DAI names
  ASoC: mediatek: mt8183-da7219: add compatible string for using rt1015
  ASoC: mediatek: mt8183-da7219: support machine driver with rt1015

 .../bindings/sound/mt8183-da7219-max98357.txt |   5 +-
 sound/soc/mediatek/Kconfig                    |   5 +-
 .../mediatek/mt8183/mt8183-da7219-max98357.c  | 244 ++++++++++++++----
 3 files changed, 197 insertions(+), 57 deletions(-)

--
2.27.0.383.g050319c2ae-goog
2020-07-09 22:20:35 +01:00
Mark Brown 1c6579b5ec
Merge series "ASoC: codecs: add MAX98373 Soundwire driver" from Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>:
V3:
Rebased on top of two fixes already merged from the v2 patchset - no
code changes
Added explicit commit reference in last commit message

V2 with a number of cleanups:
split between I2C and SoundWire modes, as done for rt5682, and updated
Kconfigs.
removed useless initializations common to both modes
removed idle_bias on
fixed register classified as volatile in error
fixed SPDX comments

Pierre-Louis Bossart (2):
  ASoC: codecs: max98373: split I2C and common parts
  ASoC: Intel: sof-sdw: add MAX98373 I2C dependencies

Ryan Lee (1):
  ASoC: codecs: max98373: add SoundWire support

randerwang (1):
  ASoC: Intel: sdw_max98373: add card_late_probe support

 sound/soc/codecs/Kconfig                  |  20 +-
 sound/soc/codecs/Makefile                 |   4 +
 sound/soc/codecs/max98373-i2c.c           | 612 +++++++++++++++
 sound/soc/codecs/max98373-sdw.c           | 887 ++++++++++++++++++++++
 sound/soc/codecs/max98373-sdw.h           |  72 ++
 sound/soc/codecs/max98373.c               | 611 +--------------
 sound/soc/codecs/max98373.h               |  17 +-
 sound/soc/intel/boards/Kconfig            |   7 +-
 sound/soc/intel/boards/sof_sdw.c          |  19 +-
 sound/soc/intel/boards/sof_sdw_common.h   |   6 +
 sound/soc/intel/boards/sof_sdw_max98373.c |  12 +
 11 files changed, 1668 insertions(+), 599 deletions(-)
 create mode 100644 sound/soc/codecs/max98373-i2c.c
 create mode 100644 sound/soc/codecs/max98373-sdw.c
 create mode 100644 sound/soc/codecs/max98373-sdw.h

base-commit: 6940701c71
--
2.25.1
2020-07-09 22:20:34 +01:00
Mark Brown a834238961
Merge series "ASoC: Clean-up W=1 build warnings​ - part1" from Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>:
Both Lee Jones and I submitted separate series, this is the first part
of the merged result, which includes all previously reviewed patches
or suggested changes along with trivial ones for CONFIG_ACPI.

Lee Jones (2):
  ASoC: codecs: jz4770: Remove defined but never used variable
    'mic_boost_tlv'
  ASoC: ti: omap-mcbsp-st: Remove set, but unused variable 'w'

Pierre-Louis Bossart (11):
  ASoC: atmel: fix kernel-doc
  ASoC: samsung: spdif: fix kernel-doc
  ASoC: samsung: pcm: fix kernel-doc
  ASoC: tegra: tegra20_das: remove always-true comparison
  ASoC: uniphier: aio-core: fix kernel-doc
  ASoC: codecs: da7210: fix kernel-doc
  ASoC: codecs: da7219: fix 'defined but not used' warning
  ASoC: codecs: cros_ec_codec: fix 'defined but not used' warning
  ASoC: codecs: es8316: fix 'defined but not used' warning
  ASoC: codecs: max98390: fix 'defined but not used' warning
  ASoC: codecs: rt*: fix 'defined but not used' warning

 sound/soc/atmel/atmel-pcm-dma.c  |  2 +-
 sound/soc/atmel/atmel_ssc_dai.c  |  1 +
 sound/soc/codecs/cros_ec_codec.c |  2 ++
 sound/soc/codecs/da7210.c        | 12 +++++++-----
 sound/soc/codecs/da7219.c        |  2 ++
 sound/soc/codecs/es8316.c        |  2 ++
 sound/soc/codecs/jz4770.c        |  1 -
 sound/soc/codecs/max98390.c      |  8 --------
 sound/soc/codecs/rt274.c         |  2 ++
 sound/soc/codecs/rt286.c         |  2 ++
 sound/soc/codecs/rt298.c         |  2 ++
 sound/soc/codecs/rt5660.c        |  2 ++
 sound/soc/codecs/rt5677-spi.c    |  2 ++
 sound/soc/samsung/pcm.c          |  5 +++++
 sound/soc/samsung/spdif.c        |  6 +++---
 sound/soc/tegra/tegra20_das.c    |  3 +--
 sound/soc/ti/omap-mcbsp-st.c     |  3 ---
 sound/soc/uniphier/aio-core.c    |  7 +++----
 18 files changed, 37 insertions(+), 27 deletions(-)

--
2.25.1
2020-07-09 22:20:32 +01:00
Gustavo A. R. Silva 3e146b55a4
ASoC: codecs: Use fallthrough pseudo-keyword
Replace the existing /* fall through */ comments and its variants with
the new pseudo-keyword macro fallthrough[1].

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

Signed-off-by: Gustavo A. R. Silva <gustavoars@kernel.org>
Link: https://lore.kernel.org/r/20200709010359.GA18971@embeddedor
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-07-09 22:20:31 +01:00
Dan Murphy 336c129139
ASoC: tlv320adcx140: Add tx offset slot programming
Add the TX offset slot programming.  There is no RX offset slot
register.

Since there is no RX offset the check for slot symmetry can be removed.

Signed-off-by: Dan Murphy <dmurphy@ti.com>
Link: https://lore.kernel.org/r/20200709185129.10505-2-dmurphy@ti.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-07-09 22:20:30 +01:00
Dan Murphy 91cb940c2c
ASoC: tlv320adcx140: Add ASI enable for channel 5-8
Add the ALSA controls to enable the ASI for channels 5-8

Signed-off-by: Dan Murphy <dmurphy@ti.com>
Link: https://lore.kernel.org/r/20200709185129.10505-1-dmurphy@ti.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-07-09 22:20:29 +01:00
Codrin Ciubotariu f3c668074a
ASoC: atmel-pdmic: remove codec component
The CPU and the codec both are represented now as components, so for
PDMIC we are registering two componenets with the same name. Since
there is no actual codec, we will merge the codec component into the
CPU one and use a dummy codec instead, for the DAI link.
As a bonus, debugfs will no longer report an error when will try to
create entries for both componenets with the same name.

Signed-off-by: Codrin Ciubotariu <codrin.ciubotariu@microchip.com>
Link: https://lore.kernel.org/r/20200708163359.2698696-1-codrin.ciubotariu@microchip.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-07-09 22:20:29 +01:00
Codrin Ciubotariu 1dfdbe73cc
ASoC: atmel-classd: remove codec component
The CPU and the codec both are represented now as components, so for
CLASS-D we are registering two componenets with the same name. Since
there is no actual codec, we will merge the codec component into the
CPU one and use a dummy codec instead, for the DAI link.
As a bonus, debugfs will no longer report an error when will try to
create entries for both componenets with the same name.

Signed-off-by: Codrin Ciubotariu <codrin.ciubotariu@microchip.com>
Link: https://lore.kernel.org/r/20200708101249.2626560-1-codrin.ciubotariu@microchip.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-07-09 22:20:28 +01:00
Pierre-Louis Bossart 56bbfbfdab
ASoC: codecs: rt*: fix 'defined but not used' warning
Fix W=1 warning when ACPI is not defined

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20200707190612.97799-14-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-07-09 21:56:50 +01:00
Pierre-Louis Bossart ce7ed845eb
ASoC: codecs: max98390: fix 'defined but not used' warning
Fix W=1 warning and removed unused table. In this case this a
duplicate of

static const struct of_device_id max98390_of_match[] = {
	{ .compatible = "maxim,max98390", },
	{}
};
MODULE_DEVICE_TABLE(of, max98390_of_match);

already used in the rest of the code.

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20200707190612.97799-13-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-07-09 21:56:49 +01:00
Pierre-Louis Bossart 07ac670981
ASoC: codecs: es8316: fix 'defined but not used' warning
Fix W=1 warning

sound/soc/codecs/es8316.c:842:36: warning: 'es8316_acpi_match' defined
but not used [-Wunused-const-variable=]
  842 | static const struct acpi_device_id es8316_acpi_match[] = {
      |                                    ^~~~~~~~~~~~~~~~~

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20200707190612.97799-12-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-07-09 21:56:48 +01:00
Pierre-Louis Bossart fbcde4ffa5
ASoC: codecs: cros_ec_codec: fix 'defined but not used' warning
fix W=1 warning

sound/soc/codecs/cros_ec_codec.c:1056:36: warning:
'cros_ec_codec_acpi_id' defined but not used
[-Wunused-const-variable=]
 1056 | static const struct acpi_device_id cros_ec_codec_acpi_id[] = {
      |                                    ^~~~~~~~~~~~~~~~~~~~~

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20200707190612.97799-11-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-07-09 21:56:47 +01:00
Lee Jones 0a29243965
ASoC: ti: omap-mcbsp-st: Remove set, but unused variable 'w'
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-09 21:56:46 +01:00
Lee Jones a7997d67f6
ASoC: codecs: jz4770: Remove defined but never used variable 'mic_boost_tlv'
Fixes the following W=1 kernel build warning(s):

 In file included from include/sound/tlv.h:10,
 from sound/soc/codecs/jz4770.c:19:
 sound/soc/codecs/jz4770.c:306:35: warning: ‘mic_boost_tlv’ defined but not used [-Wunused-const-variable=]
 306 | static const DECLARE_TLV_DB_SCALE(mic_boost_tlv, 0, 400, 0);
 | ^~~~~~~~~~~~~
 include/uapi/sound/tlv.h:64:15: note: in definition of macro ‘SNDRV_CTL_TLVD_DECLARE_DB_SCALE’
 64 | unsigned int name[] = { | ^~~~
 sound/soc/codecs/jz4770.c:306:14: note: in expansion of macro ‘DECLARE_TLV_DB_SCALE’
 306 | static const DECLARE_TLV_DB_SCALE(mic_boost_tlv, 0, 400, 0);
 | ^~~~~~~~~~~~~~~~~~~~

Signed-off-by: Lee Jones <lee.jones@linaro.org>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Paul Cercueil <paul@crapouillou.net>
Cc: ter Huurne <maarten@treewalker.org>
Link: https://lore.kernel.org/r/20200707190612.97799-9-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-07-09 21:56:46 +01:00
Pierre-Louis Bossart 14310a9644
ASoC: codecs: da7219: fix 'defined but not used' warning
fix W=1 warning

sound/soc/codecs/da7219.c:1711:36: warning: 'da7219_acpi_match'
defined but not used [-Wunused-const-variable=]
 1711 | static const struct acpi_device_id da7219_acpi_match[] = {
      |                                    ^~~~~~~~~~~~~~~~~

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Adam Thomson <Adam.Thomson.Opensource@diasemi.com>
Link: https://lore.kernel.org/r/20200707190612.97799-8-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-07-09 21:56:45 +01:00
Pierre-Louis Bossart d3d0502ae5
ASoC: codecs: da7210: fix kernel-doc
Fix W=1 warning, the kernel-doc syntax was probably from Doxygen?

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/20200707190612.97799-7-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-07-09 21:56:44 +01:00
Pierre-Louis Bossart 891ba284df
ASoC: uniphier: aio-core: fix kernel-doc
Fix W=1 warning - wrong parameter description and bad format

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Link: https://lore.kernel.org/r/20200707190612.97799-6-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-07-09 21:56:43 +01:00
Pierre-Louis Bossart cf3804dbd3
ASoC: tegra: tegra20_das: remove always-true comparison
Fix W=1 warning:

sound/soc//tegra/tegra20_das.c:101:11: warning:
comparison of unsigned expression >= 0 is always true [-Wtype-limits]
  101 |  if ((reg >= TEGRA20_DAS_DAP_CTRL_SEL) &&
      |           ^~

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Jon Hunter <jonathanh@nvidia.com>
Link: https://lore.kernel.org/r/20200707190612.97799-5-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-07-09 21:56:42 +01:00
Pierre-Louis Bossart b023cc4c4e
ASoC: samsung: pcm: fix kernel-doc
Fix W=1 warnings - missing fields in structure

Credits to Sylwester Nawrocki for the pclk and cclk descriptions.

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Link: https://lore.kernel.org/r/20200707190612.97799-4-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-07-09 21:56:41 +01:00
Pierre-Louis Bossart 53c512d89f
ASoC: samsung: spdif: fix kernel-doc
Fix W=1 warnings - typos with structure fields

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Link: https://lore.kernel.org/r/20200707190612.97799-3-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-07-09 21:56:40 +01:00
Pierre-Louis Bossart 0bdaef8a9c
ASoC: atmel: fix kernel-doc
Fix W=1 warning

Kernel-doc is not used in one file and missing argument in the second.

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Acked-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Link: https://lore.kernel.org/r/20200707190612.97799-2-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-07-09 21:56:39 +01:00
randerwang be3afa120c
ASoC: Intel: sdw_max98373: add card_late_probe support
Disable Left and Right Spk pin after boot so that sof can get
suspended.

This follows the same logic added to another machine driver with
commit 94d2d08974 ("ASoC: Intel: Boards: tgl_max98373: add dai_trigger function")

Signed-off-by: randerwang <rander.wang@linux.intel.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Link: https://lore.kernel.org/r/20200708203215.231776-5-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-07-09 21:01:28 +01:00
Pierre-Louis Bossart cb468cd5b9
ASoC: Intel: sof-sdw: add MAX98373 I2C dependencies
Reflect Kconfig changes and add both SoundWire and I2C modes

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Rander Wang <rander.wang@linux.intel.com>
Reviewed-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Link: https://lore.kernel.org/r/20200708203215.231776-4-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-07-09 21:01:27 +01:00
Ryan Lee 56a5b7910e
ASoC: codecs: max98373: add SoundWire support
Add SoundWire specific parts and extend common ones already split from
I2C.

Signed-off-by: Ryan Lee <ryans.lee@maximintegrated.com>
Signed-off-by: Naveen Manohar <naveen.m@intel.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Rander Wang <rander.wang@linux.intel.com>
Reviewed-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Link: https://lore.kernel.org/r/20200708203215.231776-3-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-07-09 21:01:26 +01:00
Pierre-Louis Bossart d7ee0c7221
ASoC: codecs: max98373: split I2C and common parts
To prepare support for SoundWire, let's first split the I2C and common
parts. No new functionality, just indents and formatting to make
checkpatch happy.

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Rander Wang <rander.wang@linux.intel.com>
Reviewed-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Link: https://lore.kernel.org/r/20200708203215.231776-2-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-07-09 21:01:25 +01:00
Tzung-Bi Shih 9e30251fb2
ASoC: mediatek: mt8183-da7219: support machine driver with rt1015
Supports machine driver with rt1015 ("mt8183-da7219-rt1015").  Embeds in
existing mt8183-da7219-max98357.c because they share most of the code.

Signed-off-by: Tzung-Bi Shih <tzungbi@google.com>
Link: https://lore.kernel.org/r/20200709122445.1584497-6-tzungbi@google.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-07-09 20:34:36 +01:00
Tzung-Bi Shih e5d4bdffc8
ASoC: mediatek: mt8183-da7219: extract codec and DAI names
Extracts codec and DAI names of DA7219.

Signed-off-by: Tzung-Bi Shih <tzungbi@google.com>
Link: https://lore.kernel.org/r/20200709122445.1584497-4-tzungbi@google.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-07-09 20:34:34 +01:00
Tzung-Bi Shih cbafb2cc5f
ASoC: mediatek: mt8183-da7219: remove forward declaration of headset_init
In headset_init(), it can access card by component->card.  Removes the
forward declaration.

Signed-off-by: Tzung-Bi Shih <tzungbi@google.com>
Link: https://lore.kernel.org/r/20200709122445.1584497-3-tzungbi@google.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-07-09 20:34:34 +01:00
Tzung-Bi Shih 31add0d56e
ASoC: mediatek: mt8183-da7219: sort header inclusions in alphabetical
Sorts header inclusions in alphabetical.

Signed-off-by: Tzung-Bi Shih <tzungbi@google.com>
Link: https://lore.kernel.org/r/20200709122445.1584497-2-tzungbi@google.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-07-09 20:34:33 +01:00
Shuming Fan 12eb3ad063
ASoC: rt286: fix unexpected interrupt happens
The HV/VREF should not turn off if the headphone jack plug-in.
This patch could solve the unexpected interrupt issue in some devices.

Signed-off-by: Shuming Fan <shumingf@realtek.com>
Tested-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20200709101345.11449-1-shumingf@realtek.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-07-09 19:55:28 +01:00
Puyou Lu 01283d56f0
ASoC: wm8974: remove unsupported clock mode
In DSP_A mode, BIT7 of IFACE should bit 0 according to datasheet (ie.
inverted frame clock is not support in this mode).

Signed-off-by: Puyou Lu <puyou.lu@gmail.com>
Acked-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Link: https://lore.kernel.org/r/1593657056-4989-1-git-send-email-puyou.lu@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-07-09 19:55:28 +01:00
Puyou Lu 574ea5c80e
ASoC: wm8974: fix Boost Mixer Aux Switch
Clear BIT6 of INPPGA means not muted (Switch On).

Signed-off-by: Puyou Lu <puyou.lu@gmail.com>
Acked-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Link: https://lore.kernel.org/r/1593657025-4903-1-git-send-email-puyou.lu@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-07-09 19:55:27 +01:00
Linus Torvalds 63e1968a2c sound fixes for 5.8-rc5
A collection of small, mostly device-specific fixes.
 The significant one is the regression fix for USB-audio implicit
 feedback devices due to the incorrect frame size calculation, which
 landed in 5.8 and stable trees.  In addition, a few usual HD-audio
 and USB-audio quirks, Intel HDMI fixes, ASoC fsl and rt5682 fixes,
 as well as the fix in compress-offload partial drain operation.
 -----BEGIN PGP SIGNATURE-----
 
 iQJCBAABCAAsFiEEIXTw5fNLNI7mMiVaLtJE4w1nLE8FAl8EhgkOHHRpd2FpQHN1
 c2UuZGUACgkQLtJE4w1nLE9Vgg/8CsHDhio415pxnrz/KtbcHhFyjUz5Uh0VoLs2
 OJzO78BP0rL5C9RhqZN0oa88bjo/fQcRBhdvnsE7OyoM+Jm+icg3k/to41S8TWQ7
 3GBViwu9C9RTMfU4yQ6KeGP5vk5KfZ5xTTkBQqscVRrolMevvgc0iSHen/J5lEQ4
 O+QnRKdqL0Hv2zaBKgmkGymMR7lXa9x4TQ3X0Cm69G7G5XRdaX4RqfoUmB62PjXt
 09wH7V7kc6Zqn+C2M95q4uEno6I/WF+2cJ+QjbYXinnQIK3HQkAzAPthTYgP0Thl
 uM6AmwAWkuE6H1vScl5a/MlXeHGJjseBrjxtfZgVEE6TPFjxYlXzWrm/gtISSvbk
 bZ111cRyW3c1ouphJvHIWvBj5rr3C1VgpQ0FwWK9t1RICN6csP/eTmKPICpCOy2O
 OPOhcZRKvl9dBsfqPOmXkDBUHTbLlSJ/8fHVWgK0H+F2t2IkSP6Q2lBhhb3MDQTZ
 8LL4YdBBNgbiTFXp4zG3ngRhmO8PCDs0oUrIzMDFk/7w50C8CjFG+l6tpKH9g/UL
 KlihbKocy0kFTUvD93WumgTvjHgmNvCn2oOECAZQ3h7Vcxu5W1L8AA0AsxufQ9xE
 8j3XXBCCiECYuJ7WUUy6teqngTosmMiZFHO9aE8nsr3K3HMiQuz7cv34n1zCJPnc
 FdJkgKk=
 =gDdf
 -----END PGP SIGNATURE-----

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

Pull sound fixes from Takashi Iwai:
 "A collection of small, mostly device-specific fixes.

  The significant one is the regression fix for USB-audio implicit
  feedback devices due to the incorrect frame size calculation, which
  landed in 5.8 and stable trees.

  In addition, a few usual HD-audio and USB-audio quirks, Intel HDMI
  fixes, ASoC fsl and rt5682 fixes, as well as the fix in
  compress-offload partial drain operation"

* tag 'sound-5.8-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound:
  ALSA: compress: fix partial_drain completion state
  ALSA: usb-audio: Add implicit feedback quirk for RTX6001
  ALSA: usb-audio: add quirk for MacroSilicon MS2109
  ALSA: hda/realtek: Enable headset mic of Acer Veriton N4660G with ALC269VC
  ALSA: hda/realtek: Enable headset mic of Acer C20-820 with ALC269VC
  ALSA: hda/realtek - Enable audio jacks of Acer vCopperbox with ALC269VC
  ALSA: hda/realtek - Fix Lenovo Thinkpad X1 Carbon 7th quirk subdevice id
  ALSA: hda/hdmi: improve debug traces for stream lookups
  ALSA: hda/hdmi: fix failures at PCM open on Intel ICL and later
  ALSA: opl3: fix infoleak in opl3
  ALSA: usb-audio: Replace s/frame/packet/ where appropriate
  ALSA: usb-audio: Fix packet size calculation
  AsoC: amd: add missing snd- module prefix to the acp3x-rn driver kernel module
  ALSA: hda - let hs_mic be picked ahead of hp_mic
  ASoC: rt5682: fix the pop noise while OMTP type headset plugin
  ASoC: fsl_mqs: Fix unchecked return value for clk_prepare_enable
  ASoC: fsl_mqs: Don't check clock is NULL before calling clk API
2020-07-08 11:07:09 -07:00
Mark Brown 6940701c71
Merge series "ASoC: mediatek: mt8183: support machine driver for rt1015" from Tzung-Bi Shih <tzungbi@google.com>:
This series tries to reuse mt8183-mt6358-ts3a227-max98357.c for supporting
machine driver with rt1015 speaker amplifier.

The 1st patch is straightforward: re-order the header inclusions.

The 2nd patch adds document for the new proposed compatible string.

The 3rd patch changes the machine driver to support either "MAX98357A" or
"RT1015" codecs.

Tzung-Bi Shih (3):
  ASoC: mediatek: mt8183: sort header inclusions in alphabetical
  dt-bindings: mt8183: add compatible string for using rt1015
  ASoC: mediatek: mt8183: support machine driver with rt1015

 .../sound/mt8183-mt6358-ts3a227-max98357.txt  |   5 +-
 sound/soc/mediatek/Kconfig                    |   5 +-
 .../mt8183/mt8183-mt6358-ts3a227-max98357.c   | 171 +++++++++++++++---
 3 files changed, 153 insertions(+), 28 deletions(-)

--
2.27.0.383.g050319c2ae-goog
2020-07-08 16:50:37 +01:00
Mark Brown 76c49909a6
Merge series "ASoC: topology: fix error handling flow" from Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>:
While experimenting and introducing errors in Baytrail topology files
until I got them right, I encountered multiple kernel oopses and
memory leaks. This is a first batch to harden the code, but we should
probably think of a tool to fuzz the topology...

Pierre-Louis Bossart (5):
  ASoC: topology: fix kernel oops on route addition error
  ASoC: topology: fix tlvs in error handling for widget_dmixer
  ASoC: topology: use break on errors, not continue
  ASoC: topology: factor kfree(se) in error handling
  ASoC: topology: add more logs when topology load fails.

 sound/soc/soc-topology.c | 97 ++++++++++++++++++++++++----------------
 1 file changed, 58 insertions(+), 39 deletions(-)

base-commit: a5911ac579
--
2.25.1
2020-07-08 16:50:36 +01:00
Mark Brown 81e7d4ce8b
Merge series "ASoC: qdsp6: add gapless compressed audio support" from Srinivas Kandagatla <srinivas.kandagatla@linaro.org>:
This patchset adds gapless compressed audio support on q6asm.
Gapless on q6asm is implemented using 2 streams in a single asm session.

First few patches are enhacements done to q6asm interface to allow
stream id per each command, gapless flags and silence meta data.
Along with this there are few trivial changes which I thought are necessary!
Last patch implements copy callback to allow finer control over buffer offsets,
specially in partial drain cases.

This patchset is tested on RB3 aka DB845c platform.

Thanks,
srini

Srinivas Kandagatla (11):
  ASoC: q6asm: add command opcode to timeout error report
  ASoC: q6asm: rename misleading session id variable
  ASoC: q6asm: make commands specific to streams
  ASoC: q6asm: use flags directly from asm-dai
  ASoC: q6asm: add length to write command token
  ASoC: q6asm: add support to remove intial and trailing silence
  ASoC: q6asm: add support to gapless flag in asm open
  ASoC: q6asm-dai: add next track metadata support
  ASoC: qdsp6: use dev_err instead of pr_err
  ASoC: qdsp6-dai: add gapless support
  ASoC: q6asm-dai: add support to copy callback

 sound/soc/qcom/qdsp6/q6asm-dai.c | 397 +++++++++++++++++++++++--------
 sound/soc/qcom/qdsp6/q6asm.c     | 173 +++++++++-----
 sound/soc/qcom/qdsp6/q6asm.h     |  48 ++--
 3 files changed, 458 insertions(+), 160 deletions(-)

--
2.21.0
2020-07-08 16:50:34 +01:00
Vijendar Mukunda ee3d133972
ASoC: amd: fixed kernel warnings
This patch will fix unused variables kernel warnings when
CONFIG_ACPI is disabled.

Reported-by: Randy Dunlap <rdunlap@infradead.org>
Signed-off-by: Vijendar Mukunda <Vijendar.Mukunda@amd.com>
Link: https://lore.kernel.org/r/1594147044-25582-1-git-send-email-Vijendar.Mukunda@amd.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-07-08 16:50:33 +01:00
Tzung-Bi Shih f4fb4fef49
ASoC: mediatek: mt8183: support machine driver with rt1015
Supports machine driver with rt1015 ("mt8183-mt6358-ts3a227-rt1015").
Embeds in 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/20200708113233.3994206-4-tzungbi@google.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-07-08 16:29:40 +01:00
Tzung-Bi Shih 4dae01c2e5
ASoC: mediatek: mt8183: sort header inclusions in alphabetical
Sorts header inclusions in alphabetical.

Signed-off-by: Tzung-Bi Shih <tzungbi@google.com>
Link: https://lore.kernel.org/r/20200708113233.3994206-2-tzungbi@google.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-07-08 16:29:39 +01:00
Srinivas Kandagatla 0579ece8f4
ASoC: qdsp6: use dev_err instead of pr_err
Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Link: https://lore.kernel.org/r/20200707163641.17113-10-srinivas.kandagatla@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-07-08 15:57:26 +01:00
Srinivas Kandagatla b6198097b8
ASoC: q6asm: add command opcode to timeout error report
Make the error reporting more useful by adding opcode to it.
Without this its almost impossible to say which command actually
timed out.

Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Link: https://lore.kernel.org/r/20200707163641.17113-2-srinivas.kandagatla@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-07-08 15:57:25 +01:00
Mark Brown 37d65a26c9
Merge series "ASoC: more fixes for dpcm checks" from Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>:
This is hopefully the last set of fixes to avoid probe errors due to
stricter checks of DAI capabilities introduced late in the 5.8 cycle.

Daniel Baluta (1):
  ASoC: SOF: imx: add min/max channels for SAI/ESAI on i.MX8/i.MX8M

Pierre-Louis Bossart (2):
  ASoC: soc-dai: set dai_link dpcm_ flags with a helper
  ASoC: Intel: bdw-rt5677: fix non BE conversion

 include/sound/soc-dai.h              |  1 +
 sound/soc/generic/audio-graph-card.c |  4 +--
 sound/soc/generic/simple-card.c      |  4 +--
 sound/soc/intel/boards/bdw-rt5677.c  |  1 +
 sound/soc/soc-dai.c                  | 38 ++++++++++++++++++++++++++++
 sound/soc/sof/imx/imx8.c             |  8 ++++++
 sound/soc/sof/imx/imx8m.c            |  8 ++++++
 7 files changed, 60 insertions(+), 4 deletions(-)

base-commit: a5911ac579
--
2.25.1
2020-07-08 15:02:06 +01:00
Mark Brown 1e9c7ce7ad
Merge series "ASoC: topology: fix error handling flow" from Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>:
While experimenting and introducing errors in Baytrail topology files
until I got them right, I encountered multiple kernel oopses and
memory leaks. This is a first batch to harden the code, but we should
probably think of a tool to fuzz the topology...

Pierre-Louis Bossart (5):
  ASoC: topology: fix kernel oops on route addition error
  ASoC: topology: fix tlvs in error handling for widget_dmixer
  ASoC: topology: use break on errors, not continue
  ASoC: topology: factor kfree(se) in error handling
  ASoC: topology: add more logs when topology load fails.

 sound/soc/soc-topology.c | 97 ++++++++++++++++++++++++----------------
 1 file changed, 58 insertions(+), 39 deletions(-)

base-commit: a5911ac579
--
2.25.1
2020-07-08 15:02:04 +01:00
Mark Brown 5f886d7d2c
Merge series "ASoC: codecs: add MAX98373 Soundwire driver" from Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>:
V2 with a number of cleanups:
split between I2C and SoundWire modes, as done for rt5682, and updated
Kconfigs.
removed useless initializations common to both modes
removed idle_bias on
fixed register classified as volatile in error
fixed SPDX comments

Pierre-Louis Bossart (2):
  ASoC: codecs: max98373: split I2C and common parts
  ASoC: Intel: sof-sdw: add MAX98373 I2C dependencies

Ryan Lee (2):
  ASoC: codecs: max98373: Removed superfluous volume control from chip
    default
  ASoC: codecs: max98373: add SoundWire support

randerwang (2):
  ASoc: codecs: max98373: remove Idle_bias_on to let codec suspend
  ASoC: Intel: sdw_max98373: add card_late_probe support

 sound/soc/codecs/Kconfig                  |  20 +-
 sound/soc/codecs/Makefile                 |   4 +
 sound/soc/codecs/max98373-i2c.c           | 612 +++++++++++++++
 sound/soc/codecs/max98373-sdw.c           | 887 ++++++++++++++++++++++
 sound/soc/codecs/max98373-sdw.h           |  72 ++
 sound/soc/codecs/max98373.c               | 619 +--------------
 sound/soc/codecs/max98373.h               |  17 +-
 sound/soc/intel/boards/Kconfig            |   7 +-
 sound/soc/intel/boards/sof_sdw.c          |  19 +-
 sound/soc/intel/boards/sof_sdw_common.h   |   6 +
 sound/soc/intel/boards/sof_sdw_max98373.c |  12 +
 11 files changed, 1668 insertions(+), 607 deletions(-)
 create mode 100644 sound/soc/codecs/max98373-i2c.c
 create mode 100644 sound/soc/codecs/max98373-sdw.c
 create mode 100644 sound/soc/codecs/max98373-sdw.h

base-commit: a5911ac579
--
2.25.1
2020-07-08 15:02:03 +01:00
Ranjani Sridharan eceb5437ed
ASoC: SOF: core: fix null-ptr-deref bug during device removal
The DSP should be notified for device removal only if the
probe was successful. Fixes the following KASAN bug:
BUG: KASAN: null-ptr-deref in sof_ipc_tx_message+0x80/0x160 [snd_sof]

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Link: https://lore.kernel.org/r/20200707204027.114169-1-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-07-08 15:02:02 +01:00
randerwang 0fd3935ef8
ASoc: codecs: max98373: remove Idle_bias_on to let codec suspend
Idle_bias_on is used to decide bias on/off in standby state by dapm.
When Idle_bias_on is set to one, dapm will keep max98373 active at
idle time. Max98373 is doing nothing in this state, so remove
idle_bias_on setting to let max98373 get suspended when it is idle.

Signed-off-by: randerwang <rander.wang@linux.intel.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Ryan Lee <ryans.lee@maximintegrated.com>
Reviewed-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Link: https://lore.kernel.org/r/20200707205740.114927-4-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-07-08 14:47:17 +01:00
Ryan Lee a53bacc04d
ASoC: codecs: max98373: Removed superfluous volume control from chip default
Volume control in probe function is not necessary.

Signed-off-by: Ryan Lee <ryans.lee@maximintegrated.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Rander Wang <rander.wang@linux.intel.com>
Reviewed-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Link: https://lore.kernel.org/r/20200707205740.114927-3-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-07-08 14:47:16 +01:00
Pierre-Louis Bossart 8bf9475fe4
ASoC: topology: add more logs when topology load fails.
Add more dev_err() logs to help trace topology load failures, since we
have multiple error causes (e.g. invalid header or header that could
not be loaded).

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: Rander Wang <rander.wang@linux.intel.com>
Link: https://lore.kernel.org/r/20200707203749.113883-6-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-07-08 14:25:22 +01:00
Pierre-Louis Bossart 952bd9377e
ASoC: topology: factor kfree(se) in error handling
No need to repeat the same thing multiple times when it can be done in
one location.

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>
Link: https://lore.kernel.org/r/20200707203749.113883-5-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-07-08 14:25:21 +01:00
Pierre-Louis Bossart 129fc2ba01
ASoC: topology: use break on errors, not continue
Since the beginning of the topology, the code continues to the next
object even when an error is detected.

The topology should be handled with an all-or-nothing design, loading
a partially valid topology is a sure way to get bug reports that are
difficult to deal with.

Changing the behavior may break previous solutions and expose problems
in topology files delivered in the past, so it's probably not wise to
add this patch to stable branches without revalidation.

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>
Link: https://lore.kernel.org/r/20200707203749.113883-4-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-07-08 14:25:20 +01:00
Pierre-Louis Bossart 8edac489e7
ASoC: topology: fix tlvs in error handling for widget_dmixer
we need to free all allocated tlvs, not just the one allocated in
the loop before releasing kcontrols - other the tlvs references will
leak.

Fixes: 9f90af3a99 ('ASoC: topology: Consolidate and fix asoc_tplg_dapm_widget_*_create flow')
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>
Link: https://lore.kernel.org/r/20200707203749.113883-3-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-07-08 14:25:19 +01:00
Pierre-Louis Bossart 6f0307df83
ASoC: topology: fix kernel oops on route addition error
When errors happens while loading graph components, the kernel oopses
while trying to remove all topology components. This can be
root-caused to a list pointing to memory that was already freed on
error.

remove_route() is already called on errors and will perform the
required cleanups so there's no need to free the route memory in
soc_tplg_dapm_graph_elems_load() if the route was added to the
list. We do however want to free the routes allocated but not added to
the list.

Fixes: 7df04ea7a3 ('ASoC: topology: modify dapm route loading routine and add dapm route unloading')
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>
Link: https://lore.kernel.org/r/20200707203749.113883-2-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-07-08 14:25:18 +01:00
Daniel Baluta 4e7f8cac11
ASoC: SOF: imx: add min/max channels for SAI/ESAI on i.MX8/i.MX8M
This is identical with change for Intel platforms done with
commit 8c05246c0b ("ASoC: SOF: Intel: add min/max channels for SSP on Baytrail/Broadwell")
and fixes a regression on i.MX8/i.MX8M:

[   25.705750]  esai-Codec: ASoC: no backend playback stream
[   27.923378]  esai-Codec: ASoC: no users playback at close - state

This is root-caused to the introduction of the DAI capability checks
with snd_soc_dai_stream_valid(). Its use in soc-pcm.c makes it a
requirement for all DAIs to report at least a non-zero min_channels
field.

Fixes: 9b5db05936 ("ASoC: soc-pcm: dpcm: Only allow playback/capture if supported")
Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Link: https://lore.kernel.org/r/20200707210439.115300-4-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-07-08 13:51:37 +01:00
Pierre-Louis Bossart fffebe8a83
ASoC: Intel: bdw-rt5677: fix non BE conversion
When SOF is used, the normal links are converted into DPCM ones. This
generates an error

[ 58.276668] bdw-rt5677 bdw-rt5677: CPU DAI spi-RT5677AA:00 for rtd
Wake on Voice does not support playback
[ 58.276676] bdw-rt5677 bdw-rt5677: ASoC: can't create pcm Wake on
Voice :-22

Fix by forcing the capture direction.

Fixes: b73287f0b0 ('ASoC: soc-pcm: dpcm: fix playback/capture checks')
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
Reviewed-by: Curtis Malainey <curtis@malainey.com>
Link: https://lore.kernel.org/r/20200707210439.115300-3-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-07-08 13:51:36 +01:00
Pierre-Louis Bossart 25612477d2
ASoC: soc-dai: set dai_link dpcm_ flags with a helper
Add a helper to walk through all the DAIs and set dpcm_playback and
dpcm_capture flags based on the DAIs capabilities, and use this helper
to avoid setting these flags arbitrarily in generic cards.

The commit referenced in the Fixes tag did not introduce the
configuration issue but will prevent the card from probing when
detecting invalid configurations.

Fixes: b73287f0b0 ('ASoC: soc-pcm: dpcm: fix playback/capture checks')
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Reviewed-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
Link: https://lore.kernel.org/r/20200707210439.115300-2-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-07-08 13:51:35 +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
Mark Brown ce1d4d26b8
Merge series "ASoC: amd: remove warnings with make W=1" from Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>:
Yet another cleanup series, with good findings of variables not used
for anything.

Pierre-Louis Bossart (6):
  ASoC: amd: acp-da7219-max98357a: fix 'defined but not used' warning
  ASoC: amd: acp-rt5645: fix 'defined but not used' warning
  ASoC: amd: raven: acp3x-pcm-dma: fix 'set but not used' warning
  ASoC: amd: raven: acp3x-i2s: fix 'set but not used' warning
  ASoC: amd: raven: acp3x-pcm-dma: remove unused-but-set variable
  ASoC: amd: raven: acp3x-i2s: remove unused-but-set variable

 sound/soc/amd/acp-da7219-max98357a.c | 2 ++
 sound/soc/amd/acp-rt5645.c           | 2 ++
 sound/soc/amd/raven/acp3x-i2s.c      | 4 ----
 sound/soc/amd/raven/acp3x-pcm-dma.c  | 4 ----
 4 files changed, 4 insertions(+), 8 deletions(-)

--
2.25.1
2020-07-07 13:03:23 +01:00
Sebastian Reichel 5146b6a92c
ASoC: da7213: add default clock handling
This adds default clock/PLL configuration to the driver
for usage with generic drivers like simple-card for usage
with a fixed rate clock.

Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
Reviewed-by: Adam Thomson <Adam.Thomson.Opensource@diasemi.com>
Link: https://lore.kernel.org/r/20200626164623.87894-1-sebastian.reichel@collabora.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-07-07 13:03:22 +01:00
Vijendar Mukunda 68d1abe186
ASoC: amd: add ACPI dependency check
Add ACPI dependency for evaluating DMIC hardware
runtime.

Signed-off-by: Vijendar Mukunda <Vijendar.Mukunda@amd.com>
Link: https://lore.kernel.org/r/1594118813-18689-1-git-send-email-Vijendar.Mukunda@amd.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-07-07 13:03:22 +01:00
Pierre-Louis Bossart 343403e2da
ASoC: amd: raven: acp3x-i2s: remove unused-but-set variable
Fix W=1 warning. The variable prtd is set but not used.

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20200702164433.162815-7-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-07-07 12:37:34 +01:00
Pierre-Louis Bossart 16607237f3
ASoC: amd: raven: acp3x-pcm-dma: remove unused-but-set variable
Fix W=1 warning. The variable prtd is not used, remove.

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20200702164433.162815-6-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-07-07 12:37:33 +01:00
Pierre-Louis Bossart fadecf947a
ASoC: amd: raven: acp3x-i2s: fix 'set but not used' warning
Fix W=1 warning. the card variable is useless here

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20200702164433.162815-5-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-07-07 12:37:33 +01:00
Pierre-Louis Bossart 5ec2978f1e
ASoC: amd: raven: acp3x-pcm-dma: fix 'set but not used' warning
Fix W=1 warning. the card variable is useless here.

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20200702164433.162815-4-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-07-07 12:37:32 +01:00
Pierre-Louis Bossart 41e4a5b32a
ASoC: amd: acp-rt5645: fix 'defined but not used' warning
Fix W=1 warning

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20200702164433.162815-3-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-07-07 12:37:31 +01:00
Pierre-Louis Bossart dc1aff7f0d
ASoC: amd: acp-da7219-max98357a: fix 'defined but not used' warning
Fix W=1 warning

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20200702164433.162815-2-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-07-07 12:37:30 +01:00
Maxime Ripard 58f30150ff
ASoC: core: Remove only the registered component in devm functions
The ASoC devm_ functions that register a component
(devm_snd_soc_register_component and devm_snd_dmaengine_pcm_register) will
clean their component by running snd_soc_unregister_component.

snd_soc_unregister_component will then remove all the components for the
device that was used to register the component in the first place.

However, some drivers register several components (such as a DAI and a
dmaengine PCM) on the same device, and if the dmaengine PCM is registered
first, then the DAI will be cleaned up first and
snd_dmaengine_pcm_unregister will be called next.

snd_dmaengine_pcm_unregister will then lookup the dmaengine PCM component
on the device, and if there's one unregister that component and release its
dmaengine channels. That doesn't happen in practice though since the first
call to snd_soc_unregister_component removed all the components, so we
never get the chance to release the dmaengine channels.

In order to fix this, instead of removing all the components for a given
device, we can simply remove the component that was registered in the first
place. We should have the same number of component registration than we
have components, so it should work just fine.

Signed-off-by: Maxime Ripard <maxime@cerno.tech>
Link: https://lore.kernel.org/r/20200707074237.287171-1-maxime@cerno.tech
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-07-07 11:55:46 +01:00
Pierre-Louis Bossart 2cb7802b50
ASoC: codecs: wm8400: remove unused variables
Fix W=1 warning by removing unused variables

Suggested-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20200702163633.162508-1-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-07-06 14:59:59 +01:00
Mark Brown a9b6f702ed
Merge series "ASoC: fsl: fix kernel-doc" from Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>:
This cleanup patchset is only about kernel-doc, mostly trivial edits
and format correction.

v2: added Nicolin Chen's Acked-by tags and included the three
suggested edits.

Pierre-Louis Bossart (6):
  ASoC: fsl: fsl_ssi_dbg: remove spurious kernel-doc comment start
  ASoC: fsl: fsl_ssi: fix kernel-doc
  ASoC: fsl: fsl-asoc-card: fix kernel-doc
  ASoC: fsl: fsl_spdif: fix kernel-doc
  ASoC: fsl: fsl_asrc: fix kernel-doc
  ASoC: fsl: fsl_esai: fix kernel-doc

 sound/soc/fsl/fsl-asoc-card.c | 21 +++++------
 sound/soc/fsl/fsl_asrc.c      | 57 +++++++++++++++++++---------
 sound/soc/fsl/fsl_esai.c      | 32 +++++++++-------
 sound/soc/fsl/fsl_spdif.c     |  5 ++-
 sound/soc/fsl/fsl_ssi.c       | 70 ++++++++++++++++++++++-------------
 sound/soc/fsl/fsl_ssi_dbg.c   |  4 +-
 6 files changed, 115 insertions(+), 74 deletions(-)

--
2.25.1
2020-07-03 17:33:50 +01:00
Mark Brown 4096d0a541
Merge series "ASoC: rt5670: 2 small cleanups" from Hans de Goede <hdegoede@redhat.com>:
Hi All,

Here is in essence a resend of my 2 cleanup patches for the rt5670 ASoC
codec code, rebased on top of broonie/sound/for-5.9 with
broonie/sound/for-5.8 merged in.

Regards,

Hans

p.s.

I'll also send out the patch improving the comment in
cht_bsw_rt5672.c cht_codec_fixup() which Pierre-Louis requested soon.
2020-07-03 17:33:49 +01:00
Pierre-Louis Bossart 45e039d9a6
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 17:33:48 +01:00
Pierre-Louis Bossart 6ababfc062
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 17:33:47 +01:00
Pierre-Louis Bossart 8182fa9afc
ASoC: soc-ac97: fix kernel-doc
Fix W=1 warning. Add missing arguments

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20200702172800.164986-1-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-07-03 17:33:46 +01:00
Vijendar Mukunda 9e0d21e121
ASoC: amd: add logic to check dmic hardware runtime
Add logic to check DMIC hardware exists or not on
the platform at runtime.

Add module param for overriding DMIC hardware check
at runtime.

Signed-off-by: Vijendar Mukunda <Vijendar.Mukunda@amd.com>
Link: https://lore.kernel.org/r/1593710826-1106-1-git-send-email-Vijendar.Mukunda@amd.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-07-03 17:33:45 +01:00
Wei Yongjun 59b44649a8
ASoC: ti: j721e-evm: Fix missing unlock on error in j721e_audio_hw_params()
Add the missing unlock before return from function j721e_audio_hw_params()
in the error handling case.

Fixes: 6748d05590 ("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-03 17:33:44 +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
Hans de Goede 883330c11f
ASoC: rt5670: Rename dev_gpio to gpio1_is_irq
Rename the not really descriptive dev_gpio quirk / setting to
gpio1_is_irq, which describes what it actually does.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20200703100823.258033-3-hdegoede@redhat.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-07-03 15:29:50 +01:00
Hans de Goede c14f61a89c
ASoC: rt5670: Remove struct rt5670_platform_data
platform_data is an obsolete concept, instead device_properties,
set through e.g. device-tree, should be used.

struct rt5670_platform_data is only used internally by the rt5670 codec
driver, so lets remove it before someone starts relying on it.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20200703100823.258033-2-hdegoede@redhat.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-07-03 15:29:49 +01:00
Colin Ian King c950e9fcc7
ASoC: Intel: bxt-da7219-max98357a: return -EINVAL on unrecognized speaker amplifier
Currently if the ctx->spkamp is not recognized an error message is
reported but the code continues to set up the device with uninitialized
variables such as the number of widgets.  Fix this by returning -EINVAL
for unrecognized speaker amplifier types.

Fixes: e1435a1feb ("ASoC: Intel: bxt-da7219-max98357a: support MAX98390 speaker amp")
Signed-off-by: Colin Ian King <colin.king@canonical.com>
Acked-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Addresses-Coverity: ("Uninitialized scalar variable")
Link: https://lore.kernel.org/r/20200702114835.37889-1-colin.king@canonical.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-07-02 17:18:50 +01:00
Mark Brown c8e22990d2
Merge series "ASoC: codecs: wm/cs: fix kernel-doc and W=1 warnings" from Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>:
I've been doing a lot of cleanups to get to zero warnings with W=1,
here's the first batch for Cirrus/Wolfson codecs.

Pierre-Louis Bossart (7):
  ASoC: codecs: cs4270: fix kernel-doc
  ASoC: codecs: cs42l42: remove always-true comparisons
  ASoC: codecs: wm8986: fix missing kernel-doc arguments
  ASoC: codecs: wm8960: fix kernel-doc
  ASoC: codecs: wm9713: remove spurious kernel-doc comment start
  ASoC: codecs: wm8994: fix kernel-doc
  ASoC: codecs: wm8400: add _maybe_unused as needed

 sound/soc/codecs/cs4270.c  | 4 ++--
 sound/soc/codecs/cs42l42.c | 9 +++------
 sound/soc/codecs/wm8400.c  | 6 +++---
 sound/soc/codecs/wm8960.c  | 2 +-
 sound/soc/codecs/wm8994.c  | 4 ++++
 sound/soc/codecs/wm8996.c  | 3 +++
 sound/soc/codecs/wm9713.c  | 2 +-
 7 files changed, 17 insertions(+), 13 deletions(-)

base-commit: a2b782d59c
--
2.25.1
2020-07-02 14:55:34 +01:00
Pierre-Louis Bossart 7c4084e112
ASoC: codecs: wm8994: fix kernel-doc
Fix W=1 warning

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/20200701181320.80848-7-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-07-02 14:55:33 +01:00
Pierre-Louis Bossart 442950a3dc
ASoC: codecs: wm9713: remove spurious kernel-doc comment start
Fix W=1 warning

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/20200701181320.80848-6-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-07-02 14:55:32 +01:00
Pierre-Louis Bossart 419eac3cff
ASoC: codecs: wm8960: fix kernel-doc
Fix W=1 warning

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/20200701181320.80848-5-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-07-02 14:55:31 +01:00
Pierre-Louis Bossart 824186fbf7
ASoC: codecs: wm8986: fix missing kernel-doc arguments
Fix W=1 warning

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/20200701181320.80848-4-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-07-02 14:55:30 +01:00
Pierre-Louis Bossart 5502ce4ea2
ASoC: codecs: cs42l42: remove always-true comparisons
Fix W=1 warnings:

cs42l42.c: In function 'cs42l42_handle_device_data':
cs42l42.c:1661:12: warning: comparison of unsigned expression >= 0 is
always true [-Wtype-limits]
 1661 |   if ((val >= CS42L42_BTN_DET_INIT_DBNCE_MIN) &&
      |            ^~
cs42l42.c:1679:12: warning: comparison of unsigned expression >= 0 is
always true [-Wtype-limits]
 1679 |   if ((val >= CS42L42_BTN_DET_EVENT_DBNCE_MIN) &&
      |            ^~
cs42l42.c:1698:23: warning: comparison of unsigned expression >= 0 is
always true [-Wtype-limits]
 1698 |    if ((thresholds[i] >= CS42L42_HS_DET_LEVEL_MIN) &&
      |                       ^~

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20200701181320.80848-3-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-07-02 14:55:29 +01:00
Pierre-Louis Bossart 7fdc151209
ASoC: codecs: cs4270: fix kernel-doc
Fix W=1 warnings

cs4270.c:508: warning: Function parameter or member 'component' not
described in 'cs4270_probe'
cs4270.c:508: warning: Excess function parameter 'pdev' description in
'cs4270_probe'
cs4270.c:548: warning: Function parameter or member 'component' not
described in 'cs4270_remove'
cs4270.c:548: warning: Excess function parameter 'pdev' description in
'cs4270_remove'

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20200701181320.80848-2-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-07-02 14:55:28 +01:00
Mark Brown 8a78439ab1
Merge series "ASoC: Intel: atom: fix kernel-doc and W=1 warnings" from Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>:
Yet another series to fix broken kernel-doc and mark unused variables
as such.

Pierre-Louis Bossart (2):
  ASoC: Intel: atom: fix kernel-doc
  ASoC: Intel: atom: fix 'defined but not used' warning

 sound/soc/intel/atom/sst-atom-controls.c | 65 ++++++++++++++++--------
 sound/soc/intel/atom/sst/sst_loader.c    |  4 ++
 sound/soc/intel/atom/sst/sst_stream.c    | 43 +++++++++-------
 3 files changed, 74 insertions(+), 38 deletions(-)

base-commit: a2b782d59c
--
2.25.1
2020-07-01 21:14:24 +01:00
Pierre-Louis Bossart 5635181b71
ASoC: SOF: sof-acpi-dev: fix 'defined but unused' warning
Fix W=1 warning

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20200701183913.83455-1-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-07-01 21:14:23 +01:00
Pierre-Louis Bossart 544079abf6
ASoC: Intel: atom: fix 'defined but not used' warning
Fix W=1 warning. The VOIP controls were not used in the mainline but
in special versions of Android. Keep and use __maybe_used to make
warning go away.

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20200701183716.83314-3-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-07-01 20:58:30 +01:00
Pierre-Louis Bossart 1101388402
ASoC: Intel: atom: fix kernel-doc
Fix W=1 warnings. The kernel-doc format was probably never supported,
fix information as needed.

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20200701183716.83314-2-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-07-01 20:58:29 +01:00
Brent Lu e1435a1feb
ASoC: Intel: bxt-da7219-max98357a: support MAX98390 speaker amp
Support MAX98390 speaker amplifier on cometlake platform. Driver now
detects amplifier type in the probe function and installs corresponding
controls and DAPM widgets/routes in the late_probe function.

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/1593596211-28344-1-git-send-email-brent.lu@intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-07-01 19:28:28 +01:00
Mark Brown a2b782d59c
Merge series "ASoC: ti: Add support for audio on J721e EVM" from Peter Ujfalusi <peter.ujfalusi@ti.com>:
Hi,

Changes since v3:
- Fix the single clock source handling and typo

Changes since v2:
- DT binding:
 - use proper (?) patch subject for the binding docuemtn patch
 - drop pll4 and pll15 from DT - driver should check the rate via
   clk_get_parent. If it is not available (as it is not currently) then use the
   match_data provided rates.
 - add simple explanation for the clocking setup
 - Use descriptive names for clocks: cpb/ivi-mcasp-auxclk and cpb/ivi-codec-scki
 - dt_binding_check shows no errors/warnings
- ASoC machine driver:
 - Try to read the PLL4/15 rate with clk API (parent of the two clock divider)
   if it is not available then use the match_data provided numbers.
 - Support for single PLL setup

Changes since v1:
- Fixed DT binding documentation errors
- Rebased on ASoC head and updated the driver to compile and work

This series adds support for the analog audio setup on the j721e EVM.
The audio setup of the EVM is:
Common Processor Board (CPB): McASP10 <-> pcm3168a
Infotainment Expansion Board (IVI): McASP0 <-> 2x pcm3168a

Both CPB and IVI wired in parallel serializer setup.

The first patch adds the stream_name for McASP driver as it is needed in
multicodec (and would be needed in DPCM) setup for proper DAPM handling.

The second patch adds two DT schema, one for the cpb and one for the cpb+ivi
card.

Regards,
Peter
---
Peter Ujfalusi (3):
  ASoC: ti: davinci-mcasp: Specify stream_name for playback/capture
  ASoC: dt-bindings: Add documentation for TI j721e EVM (CPB and IVI)
  ASoC: ti: Add custom machine driver for j721e EVM (CPB and IVI)

 .../bindings/sound/ti,j721e-cpb-audio.yaml    |  95 ++
 .../sound/ti,j721e-cpb-ivi-audio.yaml         | 150 +++
 sound/soc/ti/Kconfig                          |   8 +
 sound/soc/ti/Makefile                         |   2 +
 sound/soc/ti/davinci-mcasp.c                  |   3 +
 sound/soc/ti/j721e-evm.c                      | 896 ++++++++++++++++++
 6 files changed, 1154 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/sound/ti,j721e-cpb-audio.yaml
 create mode 100644 Documentation/devicetree/bindings/sound/ti,j721e-cpb-ivi-audio.yaml
 create mode 100644 sound/soc/ti/j721e-evm.c

--
Peter

Texas Instruments Finland Oy, Porkkalankatu 22, 00180 Helsinki.
Y-tunnus/Business ID: 0615521-4. Kotipaikka/Domicile: Helsinki
2020-07-01 17:21:09 +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
Akshu Agrawal 820d7fcb23
ASoC: amd: Enable interrupt in dma_open
Fixes interrupt enable condition check with which now
interrupt gets enabled in dma_open.
Prior to this patch it was getting enabled in runtime_resume only.

Signed-off-by: Akshu Agrawal <akshu.agrawal@amd.com>
Link: https://lore.kernel.org/r/20200630183754.20641-1-akshu.agrawal@amd.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-07-01 17:21:06 +01:00
Nathan Chancellor 9a7794bd4a
ASoC: Intel: KeemBay: Fix header guard
Clang warns:

 In file included from sound/soc/intel/keembay/kmb_platform.c:14:
 sound/soc/intel/keembay/kmb_platform.h:9:9: warning: 'KMB_PLATFORM_H_'
 is used as a header guard here, followed by #define of a different
 macro [-Wheader-guard]
 #ifndef KMB_PLATFORM_H_
         ^~~~~~~~~~~~~~~
 sound/soc/intel/keembay/kmb_platform.h:10:9: note: 'KMB_PLATFORMP_H_'
 is defined here; did you mean 'KMB_PLATFORM_H_'?
 #define KMB_PLATFORMP_H_
         ^~~~~~~~~~~~~~~~
         KMB_PLATFORM_H_
 1 warning generated.

Fix the typo so that the header guard works as intended.

Fixes: c5477e9667 ("ASoC: Intel: Add KeemBay platform driver")
Signed-off-by: Nathan Chancellor <natechancellor@gmail.com>
Reviewed-by: Nick Desaulniers <ndesaulniers@google.com>
Cc: Sia, Jee Heng <jee.heng.sia@intel.com>; alsa-devel@alsa-project.org; linux-kernel@vger.kernel.org; clang-built-linux@googlegroups.com; Nathan Chancellor <natechancellor@gmail.com>
Link: https://github.com/ClangBuiltLinux/linux/issues/1053
To: Rojewski, Cezary <cezary.rojewski@intel.com>; Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>; Liam Girdwood <liam.r.girdwood@linux.intel.com>; Jie Yang <yang.jie@linux.intel.com>; Mark Brown <broonie@kernel.org>
Link: https://lore.kernel.org/r/20200617010232.23222-1-natechancellor@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-07-01 17:21:04 +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
Peter Ujfalusi 6748d05590
ASoC: ti: Add custom machine driver for j721e EVM (CPB and IVI)
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-01 15:13:46 +01:00
Peter Ujfalusi ef3ab250aa
ASoC: ti: davinci-mcasp: Specify stream_name for playback/capture
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-07-01 15:13:44 +01:00
Yu-Hsuan Hsu 1eb96c198a
ASoC: rockchip: add format and rate constraints on rk3399
S8 and S24 formats does not work on this machine driver so force to use
S16_LE instead.

In addition, add constraint to limit the max value of rate because the
rate higher than 96000(172000, 192000) is not stable either.

Signed-off-by: Yu-Hsuan Hsu <yuhsuan@chromium.org>
Link: https://lore.kernel.org/r/20200630091615.4020059-1-yuhsuan@chromium.org
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-07-01 14:20:01 +01:00
Ravulapati Vishnu vardhan rao ad922ca199
ASoC: amd: Rectifying Unbalanced pm_runtime_enable! issue
When snd_pci_acp3x driver loads we see:

WARNING kernel:snd_pci_acp3x 0000:04:00.5: Unbalanced pm_runtime_enable!
at boot time.
same can be observed in /var/log/messages/.

Modifying pm runtime sequence for fixing unbalanced pm issue.

Signed-off-by: Ravulapati Vishnu vardhan rao <Vishnuvardhanrao.Ravulapati@amd.com>
Link: https://lore.kernel.org/r/20200630092242.7799-1-Vishnuvardhanrao.Ravulapati@amd.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-07-01 14:20:00 +01:00
Oder Chiou bc4be65647
ASoC: rt5682: cancel jack_detect_work if hs_jack is set to null even soundwire mode
Base on https://patchwork.kernel.org/patch/11237953/
Soundwire mode also should follow it.

Signed-off-by: Oder Chiou <oder_chiou@realtek.com>
Link: https://lore.kernel.org/r/20200701071645.32061-1-oder_chiou@realtek.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-07-01 14:20:00 +01:00
Takashi Iwai d02b105909 ASoC: Fixes for v5.8
A few small driver specific fixes, nothing particularly dramatic.
 -----BEGIN PGP SIGNATURE-----
 
 iQFHBAABCgAxFiEEreZoqmdXGLWf4p/qJNaLcl1Uh9AFAl76FkETHGJyb29uaWVA
 a2VybmVsLm9yZwAKCRAk1otyXVSH0C2UB/4hVzPlmLN90tzg35/FwX+IVlqqZFcd
 jzM9jqpb63E4SCsr/JmGOm5wQcj6t2lDo4G4ZO5OzaFAEBahd+e4zeyN2yc9cGFf
 Yg79xln3amuOGV9OaQNdh/rwLjMm9USWJ+zNqZwA5lPr5n2jzU7BfgpkEihhAH0u
 wyeFr17WAJprvm8DDQPTaG6s/IEYG4xdrkUYLY4X+q9UL7AowAWyhUZ08fj6QTFe
 V4YWet/Zv6RFnWTpqAda76oKBTtzzZNuCFkjwRNRCq/sEJw0uGEEfRTKwWs9RdEN
 /l7ye17WLgG6R5vsUlgd9k9iZdw4+mdyrGBVyTCQXSH19eBLDpgrWPSB
 =4sMX
 -----END PGP SIGNATURE-----

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

ASoC: Fixes for v5.8

A few small driver specific fixes, nothing particularly dramatic.
2020-06-30 19:49:38 +02: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
Hans de Goede 3f31f7d9b5
ASoC: rt5670: Fix dac- and adc- vol-tlv values being off by a factor of 10
The adc_vol_tlv volume-control has a range from -17.625 dB to +30 dB,
not -176.25 dB to + 300 dB. This wrong scale is esp. a problem in userspace
apps which translate the dB scale to a linear scale. With the logarithmic
dB scale being of by a factor of 10 we loose all precision in the lower
area of the range when apps translate things to a linear scale.

E.g. the 0 dB default, which corresponds with a value of 47 of the
0 - 127 range for the control, would be shown as 0/100 in alsa-mixer.

Since the centi-dB values used in the TLV struct cannot represent the
0.375 dB step size used by these controls, change the TLV definition
for them to specify a min and max value instead of min + stepsize.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Link: https://lore.kernel.org/r/20200628155231.71089-5-hdegoede@redhat.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-06-29 20:37:21 +01:00
Hans de Goede 85ca6b17e2
ASoC: rt5670: Add new gpio1_is_ext_spk_en quirk and enable it on the Lenovo Miix 2 10
The Lenovo Miix 2 10 has a keyboard dock with extra speakers in the dock.
Rather then the ACL5672's GPIO1 pin being used as IRQ to the CPU, it is
actually used to enable the amplifier for these speakers
(the IRQ to the CPU comes directly from the jack-detect switch).

Add a quirk for having an ext speaker-amplifier enable pin on GPIO1
and replace the Lenovo Miix 2 10's dmi_system_id table entry's wrong
GPIO_DEV quirk (which needs to be renamed to GPIO1_IS_IRQ) with the
new RT5670_GPIO1_IS_EXT_SPK_EN quirk, so that we enable the external
speaker-amplifier as necessary.

Also update the ident field for the dmi_system_id table entry, the
Miix models are not Thinkpads.

Fixes: 67e03ff3f3 ("ASoC: codecs: rt5670: add Thinkpad Tablet 10 quirk")
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
BugLink: https://bugzilla.redhat.com/show_bug.cgi?id=1786723
Link: https://lore.kernel.org/r/20200628155231.71089-4-hdegoede@redhat.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-06-29 20:37:20 +01:00
Hans de Goede 5cacc6f576
ASoC: rt5670: Correct RT5670_LDO_SEL_MASK
The RT5670_PWR_ANLG1 register has 3 bits to select the LDO voltage,
so the correct mask is 0x7 not 0x3.

Because of this wrong mask we were programming the ldo bits
to a setting of binary 001 (0x05 & 0x03) instead of binary 101
when moving to SND_SOC_BIAS_PREPARE.

According to the datasheet 001 is a reserved value, so no idea
what it did, since the driver was working fine before I guess we
got lucky and it does something which is ok.

Fixes: 5e8351de74 ("ASoC: add RT5670 CODEC driver")
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Cc: stable@vger.kernel.org
Link: https://lore.kernel.org/r/20200628155231.71089-3-hdegoede@redhat.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-06-29 20:37:19 +01:00
Hans de Goede 0ceb8a36d0
ASoC: Intel: cht_bsw_rt5672: Change bus format to I2S 2 channel
The default mode for SSP configuration is TDM 4 slot and so far we were
using this for the bus format on cht-bsw-rt56732 boards.

One board, the Lenovo Miix 2 10 uses not 1 but 2 codecs connected to SSP2.
The second piggy-backed, output-only codec is inside the keyboard-dock
(which has extra speakers). Unlike the main rt5672 codec, we cannot
configure this codec, it is hard coded to use 2 channel 24 bit I2S.

Using 4 channel TDM leads to the dock speakers codec (which listens in on
the data send from the SSP to the rt5672 codec) emiting horribly distorted
sound.

Since we only support 2 channels anyways, there is no need for TDM on any
cht-bsw-rt5672 designs. So we can simply use I2S 2ch everywhere.

This commit fixes the Lenovo Miix 2 10 dock speakers issue by changing
the bus format set in cht_codec_fixup() to I2S 2 channel.

This change has been tested on the following devices with a rt5672 codec:

Lenovo Miix 2 10
Lenovo Thinkpad 8
Lenovo Thinkpad 10 (gen 1)

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Cc: stable@vger.kernel.org
BugLink: https://bugzilla.redhat.com/show_bug.cgi?id=1786723
Link: https://lore.kernel.org/r/20200628155231.71089-2-hdegoede@redhat.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-06-29 20:37:18 +01:00
Dan Murphy 09ed395b05
ASoC: tas2562: Add voltage sense slot configuration
Add Vsense slot configuration based on the device tree.  Adding this
property enables the slot programming to be moved to the tdm_set_slot
callback.  This in affect sets the slots for the Isense and Vsense and
enabling this these modes are now based on whether these features were
powered on or not.

Signed-off-by: Dan Murphy <dmurphy@ti.com>
Link: https://lore.kernel.org/r/20200626154143.20351-3-dmurphy@ti.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-06-29 18:48:54 +01:00
Dan Murphy d7bd40ae55
ASoC: tas2562: Add right and left channel slot programming
Add programming for the tdm slots for the right and left. This also
requires configuring the RX/TX offsets for the DAI format type.

Signed-off-by: Dan Murphy <dmurphy@ti.com>
Link: https://lore.kernel.org/r/20200626154143.20351-1-dmurphy@ti.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-06-29 18:48:53 +01:00
Rohit kumar abc17b2974
asoc: Update supported rate and format for dummy dai
Add support for 384KHz sample rate and S24_3LE
bitwidth for dummy dai.

Signed-off-by: Rohit kumar <rohitkr@codeaurora.org>
Link: https://lore.kernel.org/r/1593265030-1451-1-git-send-email-rohitkr@codeaurora.org
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-06-29 18:48:51 +01:00
Geert Uytterhoeven b6aa06de77
ASoC: qcom: Drop HAS_DMA dependency to fix link failure
When building on allyesconfig kernel for a NO_DMA=y platform (e.g.
Sun-3), CONFIG_SND_SOC_QCOM_COMMON=y, but CONFIG_SND_SOC_QDSP6_AFE=n,
leading to a link failure:

    sound/soc/qcom/common.o: In function `qcom_snd_parse_of':
    common.c:(.text+0x2e2): undefined reference to `q6afe_is_rx_port'

While SND_SOC_QDSP6 depends on HAS_DMA, SND_SOC_MSM8996 and SND_SOC_SDM845
don't, so the following warning is seen:

    WARNING: unmet direct dependencies detected for SND_SOC_QDSP6
      Depends on [n]: SOUND [=y] && !UML && SND [=y] && SND_SOC [=y] && QCOM_APR [=y] && HAS_DMA [=n]
      Selected by [y]:
      - SND_SOC_MSM8996 [=y] && SOUND [=y] && !UML && SND [=y] && SND_SOC [=y] && QCOM_APR [=y]
      - SND_SOC_SDM845 [=y] && SOUND [=y] && !UML && SND [=y] && SND_SOC [=y] && QCOM_APR [=y] && CROS_EC [=y] && I2C [=y] && SOUNDWIRE [=y]

Until recently, this warning was harmless (from a compile-testing
point-of-view), but the new user of q6afe_is_rx_port() turned this into
a hard failure.

As the QDSP6 driver itself builds fine if NO_DMA=y, and it depends on
QCOM_APR (which in turns depends on ARCH_QCOM || COMPILE_TEST), it is
safe to increase compile testing coverage.  Hence fix the link failure
by dropping the HAS_DMA dependency of SND_SOC_QDSP6.

Fixes: a212008925 ("ASoC: qcom: common: set correct directions for dailinks")
Fixes: 6b1687bf76 ("ASoC: qcom: add sdm845 sound card support")
Fixes: a6f933f63f ("ASoC: qcom: apq8096: Add db820c machine driver")
Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
Link: https://lore.kernel.org/r/20200629122443.21736-1-geert@linux-m68k.org
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-06-29 17:52:22 +01:00
Naveen Manohar be82e88895
ASoC: Intel: sof_sdw: Add MAX98373 support
Add max98373-sdw helper function, which configures 2x MAX98373 codecs to
Link1. This patch shares code between the I2S and SoundWire modes of
MAX98373 and adds the trigger already added for I2S.

Signed-off-by: Rander Wang <rander.wang@linux.intel.com>
Signed-off-by: Naveen Manohar <naveen.m@intel.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
Link: https://lore.kernel.org/r/20200625192620.4312-1-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-06-26 16:10:59 +01:00
Masanari Iida f6de798eca
ASoC: samsung: Fix a typo in Kconfig
This patch fixes a spelling typo in samsung/Kconfig.

Signed-off-by: Masanari Iida <standby24x7@gmail.com>
Link: https://lore.kernel.org/r/20200626142958.253614-1-standby24x7@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-06-26 16:10:58 +01:00
Naveen Manohar 55caf37031
ASoC: Intel: common: add match table for TGL MAX98373 + RT5682 SoundWire driver
RT5682 is in Soundwire mode on Link0 & 2x MAX98373 on link1.

Signed-off-by: Naveen Manohar <naveen.m@intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
Reviewed-by: Rander Wang <rander.wang@linux.intel.com>
Link: https://lore.kernel.org/r/20200625192708.4416-1-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-06-26 16:10:57 +01:00
Fred Oh ec0d0f6342
ASoc: Intel: cml_rt1011_rt5682: explicitly access first codec
dailink.codecs is pointer to a codec array. Explicitly access
first codec's dai_name.

Signed-off-by: Fred Oh <fred.oh@linux.intel.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Reviewed-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
Link: https://lore.kernel.org/r/20200625192458.4148-1-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-06-26 16:10:56 +01:00
Mark Brown b0a31a78a0
Merge series "ASoC: Intel: machine driver updates for 5.9" from Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>:
This patchset adds:

a) fixes for missing .owner = THIS_MODULE initializations for
snd_soc_card structures

b) extensions for TigerLake and JasperLake reusing the same machine
drivers.

c) Max98373 support for SoundWire machine driver.

d) cleanups (use-after-free, quirks, etc).

Bard Liao (1):
  ASoC: intel: cml_rt1011_rt5682: use for_each_card_prelinks

Dharageswari R (3):
  ASoC: Intel: Boards: tgl_max98373: add dai_trigger function
  ASoC: Intel: Boards: tgl_max98373: Fix the comment for
    max_98373_components
  ASoC: Intel: Boards: tgl_max98373: Update TDM configuration in
    hw_params

Fred Oh (3):
  ASoC: Intel: Boards: cml_rt1011_rt5682: reduce log level for printing
    quirk
  ASoC: Intel: Boards: cml_rt1011_rt5682: use statically define codec
    config
  ASoc: Intel: cml_rt1011_rt5682: explicitly access first codec

Naveen Manohar (2):
  ASoC: Intel: sof_sdw: Add MAX98373 support
  ASoC: Intel: common: add match table for TGL MAX98373 + RT5682
    SoundWire driver

Pierre-Louis Bossart (6):
  ASoC: SOF: nocodec: add missing .owner field
  ASoC: Intel: cml_rt1011_rt5682: add missing .owner field
  ASoC: Intel: sof_sdw: add missing .owner field
  ASoC: Intel: bxt_rt298: add missing .owner field
  ASoC: Intel: sof_sdw: add quirk override with kernel parameter
  ASoC: Intel: boards: byt*.c: remove cast in dev_info quirk log

Yong Zhi (1):
  ASoC: intel: sof_rt5682: Add support for jsl-max98360a-rt5682

randerwang (1):
  ASoC: Intel: sdw_max98373: add card_late_probe support

 sound/soc/intel/boards/Kconfig                |  3 +-
 sound/soc/intel/boards/Makefile               |  2 +
 sound/soc/intel/boards/bxt_rt298.c            |  2 +
 sound/soc/intel/boards/bytcht_es8316.c        |  5 +-
 sound/soc/intel/boards/bytcr_rt5640.c         |  4 +-
 sound/soc/intel/boards/bytcr_rt5651.c         |  4 +-
 sound/soc/intel/boards/cml_rt1011_rt5682.c    | 90 ++++++-------------
 sound/soc/intel/boards/sof_maxim_common.c     | 55 ++++++++++--
 sound/soc/intel/boards/sof_maxim_common.h     |  3 +
 sound/soc/intel/boards/sof_rt5682.c           | 32 +++++++
 sound/soc/intel/boards/sof_sdw.c              | 72 ++++++++++++++-
 sound/soc/intel/boards/sof_sdw_common.h       | 15 ++++
 sound/soc/intel/boards/sof_sdw_max98373.c     | 86 ++++++++++++++++++
 .../intel/common/soc-acpi-intel-jsl-match.c   | 13 +++
 .../intel/common/soc-acpi-intel-tgl-match.c   | 25 ++++++
 sound/soc/sof/nocodec.c                       |  1 +
 16 files changed, 332 insertions(+), 80 deletions(-)
 create mode 100644 sound/soc/intel/boards/sof_sdw_max98373.c

base-commit: 6f81e520b2
--
2.20.1
2020-06-26 14:43:48 +01:00
Colton Lewis b6d6e9ea8f
snd/soc: correct trivial kernel-doc inconsistency
Silence documentation build warning by correcting kernel-doc comment
for snd_soc_runtime_action.

./sound/soc/soc-pcm.c:220: warning: Function parameter or member 'action' not described in 'snd_soc_runtime_action'

Signed-off-by: Colton Lewis <colton.w.lewis@protonmail.com>
Link: https://lore.kernel.org/r/20200626053953.68797-1-colton.w.lewis@protonmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-06-26 14:43:47 +01:00
Dharageswari R bc7477fc2a
ASoC: Intel: Boards: tgl_max98373: Update TDM configuration in hw_params
This patch updates tx_mask, so that (0-3)slots are reserved for
Maxim amps to feedback data.

V0->slot0,
I0->slot1,
V1->slot2,
I1->slot3.

also update slot_width in tdm configuration to 24 as the BE
configuration is 24 in topology.

Signed-off-by: Dharageswari R <dharageswari.r@intel.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Link: https://lore.kernel.org/r/20200625191308.3322-14-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-06-26 13:35:22 +01:00
Bard Liao 5ac7c1b293
ASoC: intel: cml_rt1011_rt5682: use for_each_card_prelinks
for_each_card_prelinks() is a common API to walk through each prelink
in the card.

Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Link: https://lore.kernel.org/r/20200625191308.3322-13-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-06-26 13:35:21 +01:00
Fred Oh 8a473c39ae
ASoC: Intel: Boards: cml_rt1011_rt5682: use statically define codec config
When the cml_rt1011_rt5682_dailink[].codecs pointer is overridden by
a quirk with a devm allocated structure and the probe is deferred,
in the next probe we will see an use-after-free condition
(verified with KASAN). This can be avoided by using statically allocated
configurations - which simplifies the code quite a bit as well.

KASAN issue fixed.
[   23.301373] cml_rt1011_rt5682 cml_rt1011_rt5682: sof_rt1011_quirk = f
[   23.301875] ==================================================================
[   23.302018] BUG: KASAN: use-after-free in snd_cml_rt1011_probe+0x23a/0x3d0 [snd_soc_cml_rt1011_rt5682]
[   23.302178] Read of size 8 at addr ffff8881ec6acae0 by task kworker/0:2/105
[   23.302320] CPU: 0 PID: 105 Comm: kworker/0:2 Not tainted 5.7.0-rc7-test+ #3
[   23.302322] Hardware name: Google Helios/Helios, BIOS  01/21/2020
[   23.302329] Workqueue: events deferred_probe_work_func
[   23.302331] Call Trace:
[   23.302339]  dump_stack+0x76/0xa0
[   23.302345]  print_address_description.constprop.0.cold+0xd3/0x43e
[   23.302351]  ? _raw_spin_lock_irqsave+0x7b/0xd0
[   23.302355]  ? _raw_spin_trylock_bh+0xf0/0xf0
[   23.302362]  ? snd_cml_rt1011_probe+0x23a/0x3d0 [snd_soc_cml_rt1011_rt5682]
[   23.302365]  __kasan_report.cold+0x37/0x86
[   23.302371]  ? snd_cml_rt1011_probe+0x23a/0x3d0 [snd_soc_cml_rt1011_rt5682]
[   23.302375]  kasan_report+0x38/0x50
[   23.302382]  snd_cml_rt1011_probe+0x23a/0x3d0 [snd_soc_cml_rt1011_rt5682]
[   23.302389]  platform_drv_probe+0x66/0xc0

Fixes: 629ba12e99 ("ASoC: Intel: boards: split woofer and tweeter support")
Suggested-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Signed-off-by: Fred Oh <fred.oh@linux.intel.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Link: https://lore.kernel.org/r/20200625191308.3322-12-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-06-26 13:35:20 +01:00
Fred Oh e1a31c092f
ASoC: Intel: Boards: cml_rt1011_rt5682: reduce log level for printing quirk
Change dev_info to dev_dbg to reduce noise during multiple deferred
probes.

Signed-off-by: Fred Oh <fred.oh@linux.intel.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Link: https://lore.kernel.org/r/20200625191308.3322-11-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-06-26 13:35:20 +01:00
Yong Zhi 719e8179ce
ASoC: intel: sof_rt5682: Add support for jsl-max98360a-rt5682
Add support for max98360a speaker amp on SSP1 and ALC5682 on SSP0
for jsl+ platform.

Signed-off-by: Yong Zhi <yong.zhi@intel.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Link: https://lore.kernel.org/r/20200625191308.3322-10-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-06-26 13:35:19 +01:00
Dharageswari R c8090048da
ASoC: Intel: Boards: tgl_max98373: Fix the comment for max_98373_components
MAX_98373_DEV0_NAME is the Right speaker and MAX_98373_DEV1_NAME is the
Left speaker, hence updating the comments for max98373 dailink components
accordingly.

Signed-off-by: Dharageswari R <dharageswari.r@intel.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Link: https://lore.kernel.org/r/20200625191308.3322-9-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-06-26 13:35:18 +01:00
Dharageswari R 94d2d08974
ASoC: Intel: Boards: tgl_max98373: add dai_trigger function
Speaker amplifier feedback is not modeled as being dependent on any
active output. Even when there is no playback happening, parts of the
graph, specifically the IV sense->speaker protection->output remains
active and this prevents the DSP from entering low-power states.

This patch suggests a machine driver level approach where the speaker
pins are enabled/disabled dynamically depending on stream start/stop
events. DPAM graph representations show the feedback loop is indeed
disabled and low-power states can be reached.

Signed-off-by: Dharageswari R <dharageswari.r@intel.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Link: https://lore.kernel.org/r/20200625191308.3322-8-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-06-26 13:35:17 +01:00
Pierre-Louis Bossart 2697f3af42
ASoC: Intel: boards: byt*.c: remove cast in dev_info quirk log
We don't need an explicit cast, using the right format is simple
enough.

Suggested-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Reviewed-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Link: https://lore.kernel.org/r/20200625191308.3322-7-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-06-26 13:35:16 +01:00
Pierre-Louis Bossart 2555ebe94d
ASoC: Intel: sof_sdw: add quirk override with kernel parameter
During the bring-up of new platforms, or to take care of specific
hardware reworks, it's useful to add a kernel parameter to override
the default DMI-based quirks.

For example, adding the following line in a .conf file in
/etc/modprobe.d/ will change the default quirk and log the changes if
dynamic debug is enabled.

options snd_soc_sof_sdw quirk=0x802

[  735.025785] sof_sdw sof_sdw: Overriding quirk 0x10 => 0x802
[  735.025787] sof_sdw sof_sdw: quirk realtek,jack-detect-source 2
[  735.025790] sof_sdw sof_sdw: quirk SOF_RT715_DAI_ID_FIX enabled

Tested on ICL RVP with add-on board instead of default codec.

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Reviewed-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Link: https://lore.kernel.org/r/20200625191308.3322-6-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-06-26 13:35:15 +01:00
Pierre-Louis Bossart 88cee34b77
ASoC: Intel: bxt_rt298: add missing .owner field
This field is required for ASoC cards. Not setting it will result in a
module->name pointer being NULL and generate problems such as

cat /proc/asound/modules
 0 (efault)

Fixes: 76016322ec ('ASoC: Intel: Add Broxton-P machine driver')
Reported-by: Jaroslav Kysela <perex@perex.cz>
Suggested-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Link: https://lore.kernel.org/r/20200625191308.3322-5-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-06-26 13:35:14 +01:00
Pierre-Louis Bossart fb4b42f689
ASoC: Intel: sof_sdw: add missing .owner field
This field is required for ASoC cards. Not setting it will result in a
module->name pointer being NULL and generate problems such as

cat /proc/asound/modules
 0 (efault)

Fixes: 52db12d193 ('ASoC: Intel: boards: add sof_sdw machine driver')
Reported-by: Jaroslav Kysela <perex@perex.cz>
Suggested-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Link: https://lore.kernel.org/r/20200625191308.3322-4-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-06-26 13:35:13 +01:00
Pierre-Louis Bossart 2991209288
ASoC: Intel: cml_rt1011_rt5682: add missing .owner field
This field is required for ASoC cards. Not setting it will result in a
module->name pointer being NULL and generate problems such as

cat /proc/asound/modules
 0 (efault)

Fixes: 17fe95d6df ('ASoC: Intel: boards: Add CML m/c using RT1011 and RT5682')
Reported-by: Jaroslav Kysela <perex@perex.cz>
Suggested-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Link: https://lore.kernel.org/r/20200625191308.3322-3-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-06-26 13:35:12 +01:00
Pierre-Louis Bossart 8753889e27
ASoC: SOF: nocodec: add missing .owner field
This field is required for ASoC cards. Not setting it will result in a
module->name pointer being NULL and generate problems such as

cat /proc/asound/modules
 0 (efault)

Fixes: 8017b8fd37 ('ASoC: SOF: Add Nocodec machine driver support')
Reported-by: Jaroslav Kysela <perex@perex.cz>
Suggested-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Link: https://lore.kernel.org/r/20200625191308.3322-2-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-06-26 13:35:11 +01:00
Tzung-Bi Shih 72ac4a4bef
ASoC: rt1015: add missing header inclusion
To fix compilation error:

error: implicit declaration of function 'ACPI_PTR'
[-Werror,-Wimplicit-function-declaration]
                .acpi_match_table = ACPI_PTR(rt1015_acpi_match),
		                    ^

Adds the missing header "acpi.h" inclusion and sorts in alphabetical.

Signed-off-by: Tzung-Bi Shih <tzungbi@google.com>
Link: https://lore.kernel.org/r/20200625153543.85039-4-tzungbi@google.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-06-25 19:21:02 +01:00
Linus Torvalds a4d3712b51 sound fixes for 5.8-rc3
A collection of small fixes gathered in the last two weeks.
 
 The major changes here are fixes for the recent DPCM regressions found
 on i.MX and Qualcomm platforms and fixes for resource leaks in ASoC
 DAI registrations.
 
 Other than those are mostly device-specific fixes including the usual
 USB- and HD-audio quirks, and a fix for syzkaller case and ID updates
 for new Intel platforms.
 -----BEGIN PGP SIGNATURE-----
 
 iQJCBAABCAAsFiEEIXTw5fNLNI7mMiVaLtJE4w1nLE8FAl70i2wOHHRpd2FpQHN1
 c2UuZGUACgkQLtJE4w1nLE+B/A//R0mLji5hm94CaEJhX7qzOkYpH7hVHXfZfkb3
 tinAoO5uP3BRz7LilupKReluy7uyMxK1M+28HSOWSl76TjEnajBjYFTj62aCS43q
 7a4luLB2mrYeK2vd7N9y8v4tbasinQrmWeYKONk4yCnh6pbmUlaO07zqLB4LfplG
 2FO9y7c2L+8MG1fbXEvYovX6F5EagTwPKJ6J8gWGlNIvwP2NXJAS4h9jgJOXbztR
 HStSQ+CUCrkWM0WN1aaPBR+bbK40J4cChmUtRnqzWJIsZW+AwltCV7mxwfqe0p4O
 bQyxKRZf/823sgqGgM/0H/eDkKUaIppqkoJmhoSPF1QKkd0UUnDEJzVHGSgObgRp
 B5/xbzsIMdsVEyAVsTkyWVUZaYngqghbGacJpLAVQqU2sksLDxZOpksV/HWe7rfU
 S9lHQWzRVspKfneohaXsR6fs8uhg1pF+SsEXtBqeX5TlnxboM1MBHz/TmJX1+bg0
 Ucc3HiIo1tLXgnQxVYN97LEkvAclHFB8vP3wJqhAHol6TyXlsp9JwvQkiAJo6RJb
 IUSy/lCA7Wa0winbI8ExRiNElS/4MnmCotal8aIk1ltTSsOlIVDyPYyg6+dLEE8G
 +eWgingIYb3Y5AazFMbnuYOfsx4Z/bG2tnAPOP7qLBpVuGbB9Q2PfGZAFP7PpsH3
 Uke6lwI=
 =QatL
 -----END PGP SIGNATURE-----

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

Pull sound fixes from Takashi Iwai:
 "A collection of small fixes gathered in the last two weeks.

  The major changes here are fixes for the recent DPCM regressions found
  on i.MX and Qualcomm platforms and fixes for resource leaks in ASoC
  DAI registrations.

  Other than those are mostly device-specific fixes including the usual
  USB- and HD-audio quirks, and a fix for syzkaller case and ID updates
  for new Intel platforms"

* tag 'sound-5.8-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound: (32 commits)
  ALSA: usb-audio: Fix OOB access of mixer element list
  ALSA: usb-audio: add quirk for Samsung USBC Headset (AKG)
  ALSA: usb-audio: Add registration quirk for Kingston HyperX Cloud Flight S
  ASoC: rockchip: Fix a reference count leak.
  ASoC: amd: closing specific instance.
  ALSA: hda: Intel: add missing PCI IDs for ICL-H, TGL-H and EKL
  ASoC: hdac_hda: fix memleak with regmap not freed on remove
  ASoC: SOF: Intel: add PCI IDs for ICL-H and TGL-H
  ASoC: SOF: Intel: add PCI ID for CometLake-S
  ASoC: Intel: SOF: merge COMETLAKE_LP and COMETLAKE_H
  ALSA: hda/realtek: Add mute LED and micmute LED support for HP systems
  ALSA: usb-audio: Fix potential use-after-free of streams
  ALSA: hda/realtek - Add quirk for MSI GE63 laptop
  ASoC: fsl_ssi: Fix bclk calculation for mono channel
  ASoC: SOF: Intel: hda: Clear RIRB status before reading WP
  ASoC: rt1015: Update rt1015 default register value according to spec modification.
  ASoC: qcom: common: set correct directions for dailinks
  ASoc: q6afe: add support to get port direction
  ASoC: soc-pcm: fix checks for multi-cpu FE dailinks
  ASoC: rt5682: Let dai clks be registered whether mclk exists or not
  ...
2020-06-25 09:15:24 -07:00
Dan Murphy c8294da2ed
ASoC: tas2562: Fix format issue for extra space before a comma
Fix the issue found that there is an extra space before a comma in the
volume control.

Fixes: bf726b1c86 ("ASoC: tas2562: Add support for digital volume control")
Signed-off-by: Dan Murphy <dmurphy@ti.com>
Link: https://lore.kernel.org/r/20200624174932.9604-4-dmurphy@ti.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-06-25 16:21:42 +01:00
Dan Murphy bc07b54459
ASoC: tas2562: Update shutdown GPIO property
Update the shutdown GPIO property to be shutdown from shut-down.

Fixes: c173dba44c ("ASoC: tas2562: Introduce the TAS2562 amplifier")
Signed-off-by: Dan Murphy <dmurphy@ti.com>
Link: https://lore.kernel.org/r/20200624174932.9604-3-dmurphy@ti.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-06-25 16:21:41 +01:00
Jaroslav Kysela bc5c7f55f5
AsoC: amd: add missing snd- module prefix to the acp3x-rn driver kernel module
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
Acked-by: Alex Deucher <alexander.deucher@amd.com>
Cc: Mark Brown <broonie@kernel.org>
Cc: vijendar.mukunda@amd.com
Cc: Alexander.Deucher@amd.com
Link: https://lore.kernel.org/r/20200625115829.791750-1-perex@perex.cz
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-06-25 15:06:56 +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
Shuming Fan 9bc5fd71b6
ASoC: rt5682: fix the pop noise while OMTP type headset plugin
To turn the headphone output switch off during jack type detection, it
could avoid the pop noise when jack type switches to OMTP type.

Signed-off-by: Shuming Fan <shumingf@realtek.com>
Link: https://lore.kernel.org/r/20200623125312.27896-1-shumingf@realtek.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-06-24 15:30:03 +01:00
Mark Brown c3d89fd7a8
Merge series "ASoC: add dailink .exit() callback" from Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>:
While looking at reboot issues and module load/unload tests, I found
out some resources allocated in the dailink .init() callback are not
properly released - there is no existing mechanism in the soc-core to
do so.

The addition of a dailink .exit() callback seems to be the simplest
solution overall. It can be argued that the existing machine platform
device .remove() callback can also perform the necessary cleanups,
however as shown in the last two examples this might require a loop to
identify components whereas the dailink .exit() already has all the
necessary information to revert the actions done in the .init() step.

Changes since RFC:
Better commit messages and explanations
rt5682 cases with snd_soc_component_set_jack() called in the .exit()

Fred Oh (2):
  ASoC: intel: sof_rt5682: move disabling jack to dai link's exit()
  ASoC: intel: cml_rt1011_rt5682: disable jack in dailink .exit()

Pierre-Louis Bossart (3):
  ASoC: soc-link: introduce exit() callback
  ASoC: Intel: bdw-rt5677: fix module load/unload issues
  ASoC: Intel: kbl-rt5660: use .exit() dailink callback to release gpiod

 include/sound/soc-link.h                   |  1 +
 include/sound/soc.h                        |  3 +++
 sound/soc/intel/boards/bdw-rt5677.c        | 18 ++++++++++++++--
 sound/soc/intel/boards/cml_rt1011_rt5682.c |  8 ++++++++
 sound/soc/intel/boards/kbl_rt5660.c        | 17 +++++++++++++--
 sound/soc/intel/boards/sof_rt5682.c        | 24 ++++++++--------------
 sound/soc/soc-core.c                       |  3 +++
 sound/soc/soc-link.c                       |  6 ++++++
 8 files changed, 60 insertions(+), 20 deletions(-)

base-commit: 39853b1438
--
2.20.1
2020-06-23 12:54:12 +01:00
Fred Oh ee8a41cd30
ASoC: rt1011: fix KASAN out-of-bounds bug in find_next_bit()
KASAN throws the following warning in rt1011.c:
[ 170.777603] BUG: KASAN: stack-out-of-bounds in _find_next_bit.constprop.0+0x3e/0xf0

find_next_bit() relies on unsigned long pointer arguments, but this driver
uses a type cast that generates the KASAN warning. Replace find_next_bit()
and find_last_bit() with __ffs() and __fls() to pass the value and avoid
casting pointers to make the warning go away.

Signed-off-by: Fred Oh <fred.oh@linux.intel.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
Link: https://lore.kernel.org/r/20200622151348.28063-1-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-06-23 12:54:11 +01:00
Tzung-Bi Shih b1647f9f4f
ASoC: mediatek: mt8183-da7219: set playback and capture constraints
Sets playback and capture constraints to S16_LE, stereo, 48kHz.

Signed-off-by: Tzung-Bi Shih <tzungbi@google.com>
Link: https://lore.kernel.org/r/20200623055130.159718-1-tzungbi@google.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-06-23 12:54:10 +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
Fred Oh 4fcc922cb3
ASoC: intel: cml_rt1011_rt5682: disable jack in dailink .exit()
When removing the machine driver, the rt5682 jack handler will oops if jack
detection is not disabled. The jack can be disabled in the dai link's exit().

This is symmetrical change as jack is enabled in init().

Signed-off-by: Fred Oh <fred.oh@linux.intel.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
Link: https://lore.kernel.org/r/20200622154241.29053-6-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-06-23 12:25:41 +01:00
Fred Oh b0c96fc1ab
ASoC: intel: sof_rt5682: move disabling jack to dai link's exit()
Move disabling jack from platform driver's remove() to dai link's exit().
This is symmetrical change as jack is enabled in init().

Signed-off-by: Fred Oh <fred.oh@linux.intel.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
Link: https://lore.kernel.org/r/20200622154241.29053-5-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-06-23 12:25:40 +01:00
Pierre-Louis Bossart e56054e753
ASoC: Intel: kbl-rt5660: use .exit() dailink callback to release gpiod
The gpiod handling is inspired from the bdw-rt5677 code. Apply same
fix to avoid reference count issue while removing modules for
consistency.

Suggested-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
Reviewed-by: Curtis Malainey <curtis@malainey.com>
Link: https://lore.kernel.org/r/20200622154241.29053-4-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-06-23 12:25:39 +01:00
Pierre-Louis Bossart bcb43fdae1
ASoC: Intel: bdw-rt5677: fix module load/unload issues
The mainline code currently prevents modules from being removed.

The BE dailink .init() function calls devm_gpiod_get() using the codec
component device as argument. When the machine driver is removed, the
references to the gpiod are not released, and it's not possible to
remove the codec driver module - which is the only entity which could
free the gpiod.

This conceptual deadlock can be avoided by invoking gpiod_get() in the
.init() callback, and calling gpiod_put() in the exit() callback.

Tested on SAMUS Chromebook with SOF driver.

Suggested-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
Reviewed-by: Curtis Malainey <curtis@malainey.com>
Link: https://lore.kernel.org/r/20200622154241.29053-3-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-06-23 12:25:38 +01:00
Pierre-Louis Bossart 21a00fb337
ASoC: soc-link: introduce exit() callback
Some machine drivers allocate or request resources with
snd_soc_link_init() phase of the card probe. These resources need to
be properly released when removing a card, and this patch suggests a
dual exit() callback.

The exit() is invoked in soc_remove_pcm_runtime(), which is not
completely symmetric with the init() invoked in soc_init_pcm_runtime().

Alternate solutions were considered, e.g. adding a .remove() callback
for the platform driver, but that's not symmetrical at all and would
be difficult to handle if there are more than one dailink implementing
an .init(). We looked also into using .remove_dai_link() callback, but
that would also be imbalanced.

Note that because of the error handling in snd_soc_bind_card(), which
jumps to probe_end, there is no way to guarantee the exit() is invoked
with resources allocated in the init(). Prior to releasing those
resources, implementations of the exit() callback shall check the
resources are valid.

Suggested-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
Reviewed-by: Curtis Malainey <curtis@malainey.com>
Link: https://lore.kernel.org/r/20200622154241.29053-2-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-06-23 12:25:37 +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
Mark Brown 39853b1438
Merge series "ASoC: merge snd_soc_component_read() and snd_soc_component_read32()" from Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>:
Hi Mark

Because we can use "read" function which is using
"regmap" or "driver", current ALSA SoC drivers are using both
	snd_soc_component_read()    // for regmap
	snd_soc_component_read32()  // for driver callback
These are similar but needs different parameter.

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

New read doesn't return error if it failed,
thus, it can't keep compatibility,
but assuming it is not a big problem.
Because 1) it will indicate error message,
2) it can do nothing anyway if it fails "read".

[02/16] patch is not directly connected to read function merging,
but need to be apply after [01/16].

Kuninori Morimoto (16):
  ASoC: soc-component: merge snd_soc_component_read() and snd_soc_component_read32()
  ASoC: soc-component: use io_mutex correctly
  ASoC: pxa: rename to snd_soc_component_read()
  ASoC: atmel: rename to snd_soc_component_read()
  ASoC: codecs: rename to snd_soc_component_read()
  ASoC: codecs: wcd*: rename to snd_soc_component_read()
  ASoC: codecs: tlv*: rename to snd_soc_component_read()
  ASoC: codecs: max*: rename to snd_soc_component_read()
  ASoC: codecs: msm*: rename to snd_soc_component_read()
  ASoC: codecs: alc*: rename to snd_soc_component_read()
  ASoC: codecs: wm*: rename to snd_soc_component_read()
  ASoC: codecs: rt*: rename to snd_soc_component_read()
  ASoC: codecs: da*: rename to snd_soc_component_read()
  ASoC: codecs: cs*: rename to snd_soc_component_read()
  ASoC: codecs: ak*: rename to snd_soc_component_read()
  ASoC: remove snd_soc_component_read32()

 include/sound/soc-component.h          |  4 +-
 sound/soc/atmel/atmel-pdmic.c          |  4 +-
 sound/soc/codecs/88pm860x-codec.c      | 14 ++---
 sound/soc/codecs/ab8500-codec.c        |  8 +--
 sound/soc/codecs/ad1980.c              |  4 +-
 sound/soc/codecs/ak4458.c              |  2 +-
 sound/soc/codecs/ak4535.c              |  4 +-
 sound/soc/codecs/ak4613.c              |  4 +-
 sound/soc/codecs/ak4671.c              |  8 +--
 sound/soc/codecs/alc5623.c             |  6 +-
 sound/soc/codecs/alc5632.c             |  6 +-
 sound/soc/codecs/arizona.c             | 18 +++---
 sound/soc/codecs/cs4270.c              | 10 +--
 sound/soc/codecs/cs42l42.c             |  2 +-
 sound/soc/codecs/cs42l51.c             |  8 +--
 sound/soc/codecs/cs42l73.c             |  4 +-
 sound/soc/codecs/cs47l35.c             | 10 +--
 sound/soc/codecs/cs47l85.c             | 10 +--
 sound/soc/codecs/da7210.c              | 24 ++++----
 sound/soc/codecs/da7213.c              | 24 ++++----
 sound/soc/codecs/da7218.c              | 34 +++++------
 sound/soc/codecs/da7219-aad.c          | 16 ++---
 sound/soc/codecs/da7219.c              | 20 +++---
 sound/soc/codecs/da732x.c              | 18 +++---
 sound/soc/codecs/da9055.c              | 14 ++---
 sound/soc/codecs/inno_rk3036.c         |  6 +-
 sound/soc/codecs/madera.c              | 49 +++------------
 sound/soc/codecs/max98088.c            | 12 ++--
 sound/soc/codecs/max98090.c            | 20 +++---
 sound/soc/codecs/max98095.c            | 16 ++---
 sound/soc/codecs/max9850.c             |  2 +-
 sound/soc/codecs/msm8916-wcd-analog.c  | 14 ++---
 sound/soc/codecs/msm8916-wcd-digital.c | 16 ++---
 sound/soc/codecs/nau8822.c             |  6 +-
 sound/soc/codecs/rt1305.c              |  2 +-
 sound/soc/codecs/rt298.c               |  2 +-
 sound/soc/codecs/rt5616.c              |  2 +-
 sound/soc/codecs/rt5631.c              | 32 +++++-----
 sound/soc/codecs/rt5640.c              | 10 +--
 sound/soc/codecs/rt5645.c              | 16 ++---
 sound/soc/codecs/rt5651.c              |  6 +-
 sound/soc/codecs/rt5659.c              | 14 ++---
 sound/soc/codecs/rt5660.c              |  2 +-
 sound/soc/codecs/rt5663.c              | 34 +++++------
 sound/soc/codecs/rt5665.c              | 16 ++---
 sound/soc/codecs/rt5668.c              | 16 ++---
 sound/soc/codecs/rt5670.c              | 18 +++---
 sound/soc/codecs/rt5682-i2c.c          |  2 +-
 sound/soc/codecs/rt5682.c              | 19 +++---
 sound/soc/codecs/sgtl5000.c            | 16 ++---
 sound/soc/codecs/sta32x.c              |  4 +-
 sound/soc/codecs/tas2552.c             |  4 +-
 sound/soc/codecs/tas5720.c             |  4 +-
 sound/soc/codecs/tda7419.c             |  9 +--
 sound/soc/codecs/tlv320aic23.c         | 14 ++---
 sound/soc/codecs/tlv320aic26.c         |  4 +-
 sound/soc/codecs/tlv320aic32x4.c       | 16 ++---
 sound/soc/codecs/tlv320aic3x.c         | 14 ++---
 sound/soc/codecs/tscs42xx.c            |  4 +-
 sound/soc/codecs/tscs454.c             | 24 ++------
 sound/soc/codecs/wcd-clsh-v2.c         |  2 +-
 sound/soc/codecs/wcd9335.c             | 48 +++++++--------
 sound/soc/codecs/wcd934x.c             | 52 ++++++++--------
 sound/soc/codecs/wm2200.c              |  4 +-
 sound/soc/codecs/wm5100.c              | 18 +++---
 sound/soc/codecs/wm5110.c              |  6 +-
 sound/soc/codecs/wm8350.c              | 32 +++++-----
 sound/soc/codecs/wm8400.c              | 50 +++++++--------
 sound/soc/codecs/wm8510.c              | 28 ++++-----
 sound/soc/codecs/wm8523.c              |  6 +-
 sound/soc/codecs/wm8580.c              | 12 ++--
 sound/soc/codecs/wm8711.c              |  8 +--
 sound/soc/codecs/wm8728.c              | 10 +--
 sound/soc/codecs/wm8731.c              |  6 +-
 sound/soc/codecs/wm8750.c              |  8 +--
 sound/soc/codecs/wm8753.c              | 42 ++++++-------
 sound/soc/codecs/wm8770.c              |  2 +-
 sound/soc/codecs/wm8776.c              |  2 +-
 sound/soc/codecs/wm8804.c              |  2 +-
 sound/soc/codecs/wm8900.c              | 22 +++----
 sound/soc/codecs/wm8903.c              | 20 +++---
 sound/soc/codecs/wm8904.c              | 16 ++---
 sound/soc/codecs/wm8940.c              | 32 +++++-----
 sound/soc/codecs/wm8955.c              |  2 +-
 sound/soc/codecs/wm8958-dsp2.c         | 18 +++---
 sound/soc/codecs/wm8960.c              | 20 +++---
 sound/soc/codecs/wm8961.c              | 58 +++++++++---------
 sound/soc/codecs/wm8962.c              | 31 +++++-----
 sound/soc/codecs/wm8971.c              |  8 +--
 sound/soc/codecs/wm8974.c              | 24 ++++----
 sound/soc/codecs/wm8978.c              | 12 ++--
 sound/soc/codecs/wm8983.c              |  8 +--
 sound/soc/codecs/wm8985.c              |  8 +--
 sound/soc/codecs/wm8988.c              | 12 ++--
 sound/soc/codecs/wm8990.c              | 18 +++---
 sound/soc/codecs/wm8991.c              | 38 ++++++------
 sound/soc/codecs/wm8993.c              | 28 ++++-----
 sound/soc/codecs/wm8994.c              | 60 +++++++++---------
 sound/soc/codecs/wm8995.c              | 16 ++---
 sound/soc/codecs/wm8996.c              | 30 ++++-----
 sound/soc/codecs/wm8998.c              |  8 +--
 sound/soc/codecs/wm9081.c              | 36 +++++------
 sound/soc/codecs/wm9090.c              |  4 +-
 sound/soc/codecs/wm9713.c              |  2 +-
 sound/soc/codecs/wm_hubs.c             | 30 ++++-----
 sound/soc/fsl/fsl_audmix.c             | 10 +--
 sound/soc/fsl/fsl_easrc.c              |  5 +-
 sound/soc/meson/aiu-encoder-i2s.c      |  3 +-
 sound/soc/meson/aiu-fifo-i2s.c         |  3 +-
 sound/soc/meson/aiu-fifo.c             |  3 +-
 sound/soc/pxa/mioa701_wm9713.c         |  8 +--
 sound/soc/soc-ac97.c                   |  7 +--
 sound/soc/soc-component.c              | 84 ++++++++++++++------------
 sound/soc/soc-dapm.c                   | 31 ++++------
 sound/soc/soc-ops.c                    | 43 +++----------
 115 files changed, 854 insertions(+), 963 deletions(-)

--
2.25.1
2020-06-22 15:36:06 +01:00
Vlad Karpovich d6fea46e08
ASoC: wm_adsp: Add controls for calibration and diagnostic FW
Exposed additional mixer controls to select calibration or diagnostic
firmware.

'Calibration' --> chip-dsp<id>-spk-cali.wmfw (.bin)
'Diagnostic'  --> chip-dsp<id>-spk-diag.wmfw (.bin)

Signed-off-by: Vlad Karpovich <Vlad.Karpovich@cirrus.com>
Signed-off-by: David Rhodes <david.rhodes@cirrus.com>
Acked-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Link: https://lore.kernel.org/r/20200619212651.2739-1-david.rhodes@cirrus.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-06-22 15:36:05 +01:00
Kuninori Morimoto 8a6fc33ba6
ASoC: codecs: ak*: rename to snd_soc_component_read()
We need to use snd_soc_component_read()
instead of     snd_soc_component_read32()

This patch renames _read32() to _read()

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/878sgn4mc0.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-06-22 15:13:49 +01:00
Kuninori Morimoto a11f8a1c33
ASoC: codecs: cs*: rename to snd_soc_component_read()
We need to use snd_soc_component_read()
instead of     snd_soc_component_read32()

This patch renames _read32() to _read()

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/87a7134mc4.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-06-22 15:13:48 +01:00
Kuninori Morimoto 2925b58209
ASoC: codecs: da*: rename to snd_soc_component_read()
We need to use snd_soc_component_read()
instead of     snd_soc_component_read32()

This patch renames _read32() to _read()

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Acked-by: Adam Thomson <Adam.Thomson.Opensource@diasemi.com>
Link: https://lore.kernel.org/r/87bllj4mc8.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-06-22 15:13:47 +01:00
Kuninori Morimoto 467a2553dd
ASoC: codecs: rt*: rename to snd_soc_component_read()
We need to use snd_soc_component_read()
instead of     snd_soc_component_read32()

This patch renames _read32() to _read()

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/87d05z4mce.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-06-22 15:13:46 +01:00
Kuninori Morimoto 6d75dfc3e8
ASoC: codecs: wm*: rename to snd_soc_component_read()
We need to use snd_soc_component_read()
instead of     snd_soc_component_read32()

This patch renames _read32() to _read()

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/87eeqf4mcl.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-06-22 15:13:45 +01:00
Kuninori Morimoto e896c1ed67
ASoC: codecs: alc*: rename to snd_soc_component_read()
We need to use snd_soc_component_read()
instead of     snd_soc_component_read32()

This patch renames _read32() to _read()

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/87ftav4md9.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-06-22 15:13:44 +01:00
Kuninori Morimoto a6f80d99b9
ASoC: codecs: msm*: rename to snd_soc_component_read()
We need to use snd_soc_component_read()
instead of     snd_soc_component_read32()

This patch renames _read32() to _read()

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/87h7vb4mdf.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-06-22 15:13:43 +01:00
Kuninori Morimoto 1227f601ba
ASoC: codecs: max*: rename to snd_soc_component_read()
We need to use snd_soc_component_read()
instead of     snd_soc_component_read32()

This patch renames _read32() to _read()

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/87imfr4mdl.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-06-22 15:13:43 +01:00
Kuninori Morimoto e348cf5434
ASoC: codecs: tlv*: rename to snd_soc_component_read()
We need to use snd_soc_component_read()
instead of     snd_soc_component_read32()

This patch renames _read32() to _read()

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/87k1074mds.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-06-22 15:13:42 +01:00
Kuninori Morimoto eaf2767cad
ASoC: codecs: wcd*: rename to snd_soc_component_read()
We need to use snd_soc_component_read()
instead of     snd_soc_component_read32()

This patch renames _read32() to _read()

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Reviewed-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Link: https://lore.kernel.org/r/87lfkn4mdy.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-06-22 15:13:41 +01:00
Kuninori Morimoto 981abdfe99
ASoC: codecs: rename to snd_soc_component_read()
We need to use snd_soc_component_read()
instead of     snd_soc_component_read32()

This patch renames _read32() to _read()

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/87mu534me5.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-06-22 15:13:40 +01:00
Kuninori Morimoto f0daed1a49
ASoC: atmel: rename to snd_soc_component_read()
We need to use snd_soc_component_read()
instead of     snd_soc_component_read32()

This patch renames _read32() to _read()

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/87o8pj4mef.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-06-22 15:13:39 +01:00
Kuninori Morimoto 2f86f20baf
ASoC: pxa: rename to snd_soc_component_read()
We need to use snd_soc_component_read()
instead of     snd_soc_component_read32()

This patch renames _read32() to _read()

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/87pn9z4men.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-06-22 15:13:38 +01:00
Kuninori Morimoto e8712315c4
ASoC: soc-component: use io_mutex correctly
component has io_mutex, but it had been used at
snd_soc_component_update_bits_legacy() only which does read and write.

	static int snd_soc_component_update_bits_legacy(...)
	{
		...
=>		mutex_lock(&component->io_mutex);
		...
		old = snd_soc_component_read(...);
		...
		ret = snd_soc_component_write(...);
		...
=>		mutex_unlock(&component->io_mutex);
		...
	}

It is pointless if it is not used with both read and write functions.
This patch uses io_mutex correctly with read/write.
Here, xxx_no_lock() is local functions.

	static int snd_soc_component_read(...)
	{
		...
=>		mutex_lock(&component->io_mutex);
		val = soc_component_read_no_lock(...);
=>		mutex_unlock(&component->io_mutex);
		...
	}

	static int snd_soc_component_write(...)
	{
		...
=>		mutex_lock(&component->io_mutex);
		ret = soc_component_write_no_lock(...);
=>		mutex_unlock(&component->io_mutex);
		...
	}

	static int snd_soc_component_update_bits_legacy(...)
	{
		...
=>		mutex_lock(&component->io_mutex);
		...
		old = soc_component_read_no_lock(...);
		...
		ret = soc_component_write_no_lock(...);
		...
=>		mutex_unlock(&component->io_mutex);
		...
	}

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/87r1uf4mfa.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-06-22 15:13:37 +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
Takashi Iwai 91ef3d9f9f ASoC: Fixes for v5.8
This is a collection of mostly small fixes, mostly fixing fallout from
 some of the DPCM changes that went in last time around which shook out
 some issues on i.MX and Qualcomm platforms.  The addition of a managed
 version of snd_soc_register_dai() is to fix resource leaks.
 
 There's also a few new device IDs for x86 systems.
 -----BEGIN PGP SIGNATURE-----
 
 iQFHBAABCgAxFiEEreZoqmdXGLWf4p/qJNaLcl1Uh9AFAl7wlcQTHGJyb29uaWVA
 a2VybmVsLm9yZwAKCRAk1otyXVSH0K9NB/0e4qOoGEyxmf6rbAnT1zvBu0vQu2qR
 ABkcCztt/tS/QJ1BSDHX/hALj9jr6RuAtn1pL4ynVGxJ86TByrrwLX1WhtKTk+DW
 TEgiPrFAKLlCwLVxgFdF0LORicv5zZEehi9+zP1HKt31Zsv2KNvTtwaF1WymIEd5
 LYVvYhtAKMmpjPN2WjlDSuita+fc/e5dm26n8hi3DJKIBVsLBbSxd1s1kwlqqnPh
 KbJjVrp5sWNhCyKu2hW8Sv1ovh40WbZ1TnzlDTiLinz0TCyqUyqEatuJ4RgRLmsW
 G3IAvm0rNjqyIF8TbQvYvvMZ0BZe/2SHdNXBtOXjXUYxhmnLvfAXocTf
 =FNgB
 -----END PGP SIGNATURE-----

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

ASoC: Fixes for v5.8

This is a collection of mostly small fixes, mostly fixing fallout from
some of the DPCM changes that went in last time around which shook out
some issues on i.MX and Qualcomm platforms.  The addition of a managed
version of snd_soc_register_dai() is to fix resource leaks.

There's also a few new device IDs for x86 systems.
2020-06-22 13:49:14 +02:00
John Stultz 3bd057c821
ASoC: qcom: Kconfig: Tweak dependencies on SND_SOC_SDM845
CROS_EC isn't strictly required for audio to work
on other SDM845 platforms (like the Dragonboard 845c).

So lets remove the dependency and select the related
CROS_EC options via imply.

Signed-off-by: John Stultz <john.stultz@linaro.org>
Reviewed-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Cc: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Cc: Rohit kumar <rohitkr@codeaurora.org>
Cc: Patrick Lai <plai@codeaurora.org>
Cc: Banajit Goswami <bgoswami@codeaurora.org>
Cc: Liam Girdwood <lgirdwood@gmail.com>
Cc: Mark Brown <broonie@kernel.org>
Cc: Jaroslav Kysela <perex@perex.cz>
Cc: Takashi Iwai <tiwai@suse.com>
Cc: alsa-devel@alsa-project.org
Link: https://lore.kernel.org/r/20200619031407.116140-1-john.stultz@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-06-19 12:07:01 +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
Qiushi Wu f141a42215
ASoC: rockchip: Fix a reference count leak.
Calling pm_runtime_get_sync increments the counter even in case of
failure, causing incorrect ref count if pm_runtime_put is not called in
error handling paths. Call pm_runtime_put if pm_runtime_get_sync fails.

Fixes: fc05a5b222 ("ASoC: rockchip: add support for pdm controller")
Signed-off-by: Qiushi Wu <wu000273@umn.edu>
Reviewed-by: Heiko Stuebner <heiko@sntech.de>
Link: https://lore.kernel.org/r/20200613205158.27296-1-wu000273@umn.edu
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-06-18 17:21:58 +01:00
Ravulapati Vishnu vardhan rao 3499f9ad5d
ASoC: amd: Removing unnecessary instance initialization
In trigger we already get the selected instance details
from runtime->private_data.So, removing the local
initialization which may corrupt the instance selected
details and this leads to corrupt data.

Signed-off-by: Ravulapati Vishnu vardhan rao <Vishnuvardhanrao.Ravulapati@amd.com>
Link: https://lore.kernel.org/r/20200618072624.27047-1-Vishnuvardhanrao.Ravulapati@amd.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-06-18 13:14:25 +01:00
Ravulapati Vishnu vardhan rao 9f7041b71a
ASoC: amd: closing specific instance.
The steps to reproduce:

Record from the internal mic :
(arecord -D hw:1,2 -f dat /dev/null -V stereos)

Record from the headphone mic:
(arecord -D hw:1,0 -f dat /dev/null -V stereos)

Kill the recording from internal mic.
We can see the recording from the headphone mic is broken.

This patch rectifies the issue reported.

Signed-off-by: Ravulapati Vishnu vardhan rao <Vishnuvardhanrao.Ravulapati@amd.com>
Link: https://lore.kernel.org/r/20200618072653.27103-1-Vishnuvardhanrao.Ravulapati@amd.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-06-18 12:51:57 +01:00
Pierre-Louis Bossart a5f610c0fa
ASoC: Intel: broadwell: simplify card names for SOF uses
Blindly adding an sof- prefix to the card name is not user friendly
and causes UCM issues with a driver name truncated to 16 characters.

Simplify to use "sof-bdw <codec_name>" pattern for all Broadwell
machine drivers. The sof- prefix is added by the core. A generic "SOF"
driver name is used, and UCMv2 will detect the configuration for this
driver by testing the card name.

Legacy uses are unmodified.

Suggested-by: Jaroslav Kysela <perex@perex.cz>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Link: https://lore.kernel.org/r/20200617165616.18511-4-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-06-17 20:58:32 +01:00
Pierre-Louis Bossart 7bfbddfc98
ASoC: Intel: cht*: simplify card names for SOF uses
Blindly adding an sof- prefix to the card name is not user friendly
and causes UCM issues with a driver name truncated to 16 characters.

Simplify to use "sof-bytcht <codec_name>" pattern for all cht* machine
drivers. The sof- prefix is added by the core. A generic "SOF" driver
name is used, and UCMv2 will detect the configuration for this driver
by testing the card name.

Legacy uses are unmodified.

Suggested-by: Jaroslav Kysela <perex@perex.cz>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Reviewed-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Link: https://lore.kernel.org/r/20200617165616.18511-3-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-06-17 20:58:31 +01:00
Pierre-Louis Bossart b4ecd58b01
ASoC: Intel: byt*: simplify card names for SOF uses
Blindly adding an sof- prefix to the card name is not user friendly
and causes UCM issues with a driver name truncated to 16 characters.

Simplify to use "sof-bytcht <codec_name>" pattern for all byt* machine
drivers. The sof- prefix is added by the core. A generic "SOF" driver
name is used, and UCMv2 will detect the configuration for this driver
by testing the card name.

Legacy uses are unmodified.

Suggested-by: Jaroslav Kysela <perex@perex.cz>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Link: https://lore.kernel.org/r/20200617165616.18511-2-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-06-17 20:58:30 +01:00
Mark Brown dcb231e86a
Merge series "ASoC: SOF: Intel: update PCI IDs" from Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>:
Clean-up CometLake and add missing PCI IDs. Changes for the legacy
driver are sent separately.

Pierre-Louis Bossart (3):
  ASoC: Intel: SOF: merge COMETLAKE_LP and COMETLAKE_H
  ASoC: SOF: Intel: add PCI ID for CometLake-S
  ASoC: SOF: Intel: add PCI IDs for ICL-H and TGL-H

 sound/hda/intel-dsp-config.c   |  4 +---
 sound/soc/intel/boards/Kconfig |  4 ++--
 sound/soc/sof/intel/Kconfig    | 29 ++++++++---------------------
 sound/soc/sof/sof-pci-dev.c    | 24 ++++++++++++++----------
 4 files changed, 25 insertions(+), 36 deletions(-)

--
2.20.1
2020-06-17 20:28:31 +01:00
Pierre-Louis Bossart a94eaccefe
ASoC: hdac_hda: fix memleak with regmap not freed on remove
kmemleak throws error reports on module load/unload tests, add
snd_hdac_regmap_exit() in .remove().

While we are at it, also fix the error handling flow in .probe() to
use snd_hdac_regmap_exit() if needed.

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Daniel Baluta <daniel.baluta@gmail.com>
Reviewed-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Reviewed-by: Rander Wang <rander.wang@linux.intel.com>
Reviewed-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Link: https://lore.kernel.org/r/20200617164144.17859-1-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-06-17 20:28:30 +01:00
Pierre-Louis Bossart c8d2e2bfae
ASoC: SOF: Intel: add PCI IDs for ICL-H and TGL-H
Usually the DSP is not traditionally enabled on H skews but this might
be used moving forward.

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
Reviewed-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Link: https://lore.kernel.org/r/20200617164755.18104-4-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-06-17 20:01:02 +01:00
Pierre-Louis Bossart 258fb4f4c3
ASoC: SOF: Intel: add PCI ID for CometLake-S
Mirror ID added for legacy HDaudio

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
Reviewed-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Link: https://lore.kernel.org/r/20200617164755.18104-3-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-06-17 20:01:01 +01:00
Pierre-Louis Bossart 4228668eb9
ASoC: Intel: SOF: merge COMETLAKE_LP and COMETLAKE_H
We already have two configurations for CometLake, and a third one
coming. On other platforms, we used a single Kconfig option, so we
should follow the same trend by merging the two cases in a backwards
compatible way.

The backwards compatibility is handled by overloading the COMETLAKE_LP
kconfig as COMETLAKE. In practice we've never seen a case where
COMETLAKE_H is not selected along with COMETLAKE_LP, so keeping one
of the two is enough.

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
Reviewed-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Link: https://lore.kernel.org/r/20200617164755.18104-2-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-06-17 20:01:00 +01:00
Jerome Brunet e50186e1da
ASoC: meson: imply acodec glue on axg sound card
When axg card driver support is enabled, lets enable the related
internal DAC glue by default.

Signed-off-by: Jerome Brunet <jbrunet@baylibre.com>
Link: https://lore.kernel.org/r/20200617155047.1187256-1-jbrunet@baylibre.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-06-17 17:34:59 +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
Qiushi Wu deca195383
ASoC: tegra: Fix reference count leaks.
Calling pm_runtime_get_sync increments the counter even in case of
failure, causing incorrect ref count if pm_runtime_put is not called in
error handling paths. Call pm_runtime_put if pm_runtime_get_sync fails.

Signed-off-by: Qiushi Wu <wu000273@umn.edu>
Reviewed-by: Jon Hunter <jonathanh@nvidia.com>
Link: https://lore.kernel.org/r/20200613204422.24484-1-wu000273@umn.edu
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-06-17 14:04:02 +01:00
Jack Yu 668b1508cf
ASoC: rt1015: Flush DAC data before playback.
Flush DAC data before playback.

Signed-off-by: Jack Yu <jack.yu@realtek.com>
Link: https://lore.kernel.org/r/20200616023644.4523-1-jack.yu@realtek.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-06-16 12:39:33 +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
Gustavo A. R. Silva ceaf7191b9 ASoC: SOF: Replace zero-length array with flexible-array
There is a regular need in the kernel to provide a way to declare having a
dynamically sized set of trailing elements in a structure. Kernel code should
always use “flexible array members”[1] for these cases. The older style of
one-element or zero-length arrays should no longer be used[2].

[1] https://en.wikipedia.org/wiki/Flexible_array_member
[2] https://github.com/KSPP/linux/issues/21

Signed-off-by: Gustavo A. R. Silva <gustavoars@kernel.org>
2020-06-15 23:08:32 -05:00
Mark Brown 1cdd255a58
Merge series "ASoC: fsl_easrc: Fix several warnings" from Shengjiu Wang <shengjiu.wang@nxp.com>:
Fix several warnings with "make W=1"

Shengjiu Wang (3):
  ASoC: fsl_easrc: Fix -Wmissing-prototypes warning
  ASoC: fsl_easrc: Fix -Wunused-but-set-variable
  ASoC: fsl_easrc: Fix "Function parameter not described" warnings

 sound/soc/fsl/fsl_easrc.c | 42 +++++++++++++++++----------------------
 1 file changed, 18 insertions(+), 24 deletions(-)

--
2.21.0
2020-06-15 21:43:55 +01:00
Mark Brown d8bc1b052e
Merge series "ASoC: Intel: Add KeemBay ASoC platform driver" from Sia Jee Heng <jee.heng.sia@intel.com>:
The below series of patches support the KeemBay ASoC platform driver.
The platform driver initialize the i2s to capture and playback the
pcm data on the ARM. The i2s is running in polling mode.

There is no DSP in the KeemBay SoC. Users are rely on the Gstreamer plugin
to perform Audio preprocessing.

Audio graph card is used to connect the platform driver with the
tlv320aic3204 codec.

Change History:
v5:
- Remove OF dependency from Kconfig as OF is shifted to audio graph card.

v4:
- Reduce if-otology at the tx/rx function.
- Fix indentation.
- specify .rate directly

v3:
- Adjusted header format.
- Use Audio graph card instead of custom sound card.
- Use if-else instead of conditional operator.
- Enabled .set_fmt to configure master clock.

v2:
- Corrected I2S naming for DT binding.

v1:
- Initial version.

Sia Jee Heng (3):
  ASoC: Intel: Add KeemBay platform driver
  ASoC: Intel: Add makefiles and kconfig changes for KeemBay
  dt-bindings: sound: Add documentation for KeemBay i2s

 .../bindings/sound/intel,keembay-i2s.yaml          |  68 +++
 sound/soc/intel/Kconfig                            |   7 +
 sound/soc/intel/Makefile                           |   1 +
 sound/soc/intel/keembay/Makefile                   |   4 +
 sound/soc/intel/keembay/kmb_platform.c             | 654 +++++++++++++++++++++
 sound/soc/intel/keembay/kmb_platform.h             | 145 +++++
 6 files changed, 879 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/sound/intel,keembay-i2s.yaml
 create mode 100644 sound/soc/intel/keembay/Makefile
 create mode 100644 sound/soc/intel/keembay/kmb_platform.c
 create mode 100644 sound/soc/intel/keembay/kmb_platform.h

--
1.9.1
2020-06-15 21:43:54 +01:00
Mark Brown 674b928986
Merge series "ASoC: improve core dmesg logs and verbosity" from Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>:
Try to both reduce useless verbosity and keep useful error reports.

Pierre-Louis Bossart (3):
  ASoC: soc-core: reduce verbosity of BE override message
  ASoC: soc-pcm: improve error messages in soc_pcm_new()
  ASoC: soc-pcm/compress: reduce verbosity on mapping ok messages

 sound/soc/soc-compress.c |  4 ++--
 sound/soc/soc-core.c     |  4 ++--
 sound/soc/soc-pcm.c      | 13 +++++++------
 3 files changed, 11 insertions(+), 10 deletions(-)

--
2.20.1
2020-06-15 20:58:46 +01:00
Mark Brown c42d8c17a9
Merge series "ASoC: max98357a: support MAX98360A in OF" from Tzung-Bi Shih <tzungbi@google.com>:
Commit 1a0f2433d7 ("ASoC: max98357a: Add ACPI HID MAX98360A") supports
MAX98360A in ACPI world.  This series supports MAX98360A in OF world.

Tzung-Bi Shih (2):
  ASoC: max98357a: add compatible string for MAX98360A
  ASoC: dt-bindings: add compatible string for MAX98360A

 .../devicetree/bindings/sound/max98357a.txt          | 12 +++++++++---
 sound/soc/codecs/max98357a.c                         |  1 +
 2 files changed, 10 insertions(+), 3 deletions(-)

--
2.27.0.278.ge193c7cf3a9-goog
2020-06-15 20:58:44 +01:00
Mark Brown ba05f17965
Merge series "ASoC: mediatek: mt6358: support DMIC one-wire mode" from Jiaxin Yu <jiaxin.yu@mediatek.com>:
v2 changes:
	1. Uses a DT property to select DMIC mode instead of a mixer control.

v1 changes:
	1. Uses a mixer control to select DMIC mode.
	2. patchwork list:
		https://patchwork.kernel.org/patch/11578309

Jiaxin Yu (2):
  ASoC: mediatek: mt6358: support DMIC one-wire mode
  ASoC: dt-bindings: mediatek: mt6358: add dmic-mode property

 Documentation/devicetree/bindings/sound/mt6358.txt |  6 ++++++
 sound/soc/codecs/mt6358.c                          | 23 +++++++++++++++++++++-
 2 files changed, 28 insertions(+), 1 deletion(-)

--
1.8.1.1.dirty
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
2020-06-15 20:58:43 +01:00
Mark Brown 13919056bf
Merge series "ASoC: soc-component: collect component functions" from Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>:
Hi Mark

We have soc-component.c now, but still many component related
functions are implemented many place.
This patch-set collect these into soc-component.c.

v1 -> v2
	- remove soc-compress.c exchange
	  (But I have plan to repost it)
	- fixup loop break issue on some functions
	- direct return on some functions

Link: https://lore.kernel.org/r/87a71nzhy2.wl-kuninori.morimoto.gx@renesas.com

Kuninori Morimoto (12):
  ASoC: soc-component: add soc_component_pin() and share code
  ASoC: soc-component: move snd_soc_component_xxx_regmap() to soc-component
  ASoC: soc-component: move snd_soc_component_initialize() to soc-component.c
  ASoC: soc-component: add soc_component_err()
  ASoC: soc-component: add snd_soc_pcm_component_prepare()
  ASoC: soc-component: add snd_soc_pcm_component_hw_params()
  ASoC: soc-component: add snd_soc_pcm_component_hw_free()
  ASoC: soc-component: add snd_soc_pcm_component_trigger()
  ASoC: soc-component: add snd_soc_component_init()
  ASoC: soc-component: merge soc-io.c into soc-component.c
  ASoC: soc-component: merge soc_pcm_trigger_start/stop()
  ASoC: soc-component: tidyup Copyright

 include/sound/soc-component.h |  29 +-
 sound/soc/Makefile            |   2 +-
 sound/soc/soc-component.c     | 666 ++++++++++++++++++++++++----------
 sound/soc/soc-core.c          | 102 +-----
 sound/soc/soc-io.c            | 202 -----------
 sound/soc/soc-pcm.c           | 114 ++----
 6 files changed, 531 insertions(+), 584 deletions(-)
 delete mode 100644 sound/soc/soc-io.c

--
2.17.1
2020-06-15 20:58:42 +01:00
Akshu Agrawal b7a742cff3
ASoC: AMD: Use mixer control to switch between DMICs
Having mixer control to switch between DMICs prevents user to
initiate capture simultaneously on both the DMIcs.
Earlier 2 separate devices, one for each DMIC, gave an option of
using them simultaneously, which is not supported.

Signed-off-by: Akshu Agrawal <akshu.agrawal@amd.com>
Link: https://lore.kernel.org/r/20200530095519.24324-1-akshu.agrawal@amd.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-06-15 20:58:41 +01:00
Steve Lee 9ba4af79c9
ASoC: max98390: Add Amp init common setting func.
Add amp common init function to gather common init setting and finaize.
  - add max98390_init_regs func
  - move amp setting to max98390_init_regs func.
  - removed unneceary setting and finalize common register values.

Signed-off-by: Steve Lee <steves.lee@maximintegrated.com>
Link: https://lore.kernel.org/r/20200611094718.18371-1-steves.lee@maximintegrated.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-06-15 20:58:40 +01:00
derek.fang fde418b61d
ASoC: rt5682: DAI wclk supports 44100 Hz output
DAI Wclk of rt5682 only supports 48000Hz output so far,
this patch lets it support 44100Hz.

Signed-off-by: derek.fang <derek.fang@realtek.com>
Link: https://lore.kernel.org/r/1591938925-1070-4-git-send-email-derek.fang@realtek.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-06-15 20:58:38 +01:00