Commit graph

24614 commits

Author SHA1 Message Date
Bernard Zhao
e733ab7e3e
sound/soc: remove useless bool conversion to bool variable
This patch remove useless bool conversion to bool variable

Signed-off-by: Bernard Zhao <bernard@vivo.com>
Link: https://lore.kernel.org/r/20211206021100.321170-1-bernard@vivo.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-12-06 13:49:25 +00:00
Trevor Wu
c9d57a25de
ASoC: mediatek: mt8195: add headset codec rt5682s support
mt8195 machine driver adds rt5682s support in this patch.
Card name can be specified from dts by model property, and driver makes
use of the name to distinguish which headset codec is on the board.

Signed-off-by: Trevor Wu <trevor.wu@mediatek.com>
Link: https://lore.kernel.org/r/20211129141057.12422-2-trevor.wu@mediatek.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-12-06 13:49:20 +00:00
Ariel D'Alessandro
b6ce5d85b1
ASoC: fsl-asoc-card: Add missing Kconfig option for tlv320aic31xx
The following commit added support for tlv320aic31xx codec to
fsl-asoc-card, but missed the related Kconfig option. Fix this.

  commit 8c9b9cfb77
  Author: Ariel D'Alessandro <ariel.dalessandro@collabora.com>
  Date:   Fri Nov 19 12:32:48 2021 -0300

      ASoC: fsl-asoc-card: Support fsl,imx-audio-tlv320aic31xx codec

Signed-off-by: Ariel D'Alessandro <ariel.dalessandro@collabora.com>
Signed-off-by: Michael Trimarchi <michael@amarulasolutions.com>
Link: https://lore.kernel.org/r/20211203175018.252641-2-ariel.dalessandro@collabora.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-12-06 13:49:19 +00:00
Trevor Wu
4d408ea028
ASoC: mediatek: mt8195: support reserved memory assignment
For security purpose, restrict the memory assess region of AFE memif.
The specified memory region should be assigned from DTS.

Signed-off-by: Trevor Wu <trevor.wu@mediatek.com>
Link: https://lore.kernel.org/r/20211130053905.28470-2-trevor.wu@mediatek.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-12-06 13:49:16 +00:00
Kai Vehmanen
de7dd9092c
ASoC: SOF: Intel: pci-tgl: add new ADL-P variant
Add a PCI DID for a variant of Intel AlderLake-P.

Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20211203171542.1021399-2-kai.vehmanen@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-12-06 13:49:03 +00:00
Kai Vehmanen
cd57eb3c40
ASoC: SOF: Intel: pci-tgl: add ADL-N support
Add PCI DID for Intel AlderLake-N.

Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20211203171542.1021399-1-kai.vehmanen@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-12-06 13:49:02 +00:00
Christophe JAILLET
d13a8f6d8e ALSA: Fix some typo
Some comments and include guards are not consistent with the name of the
file where they can be found.

This is likely some typo or cut'n'paste issues.

Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Link: https://lore.kernel.org/r/7b2bcbda298f02a34d46d8b6593daaaed9a09a45.1638602790.git.christophe.jaillet@wanadoo.fr
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2021-12-06 10:04:05 +01:00
Lucas Tanure
0695ad92fe
ASoC: cs35l41: Fix undefined reference to core functions
Auto select core driver if i2c or spi bus drivers are
selected

Fixes: a5e0091d62 ("ASoC: cs35l41: Fix link problem")

Signed-off-by: Lucas Tanure <tanureal@opensource.cirrus.com>
Reported-by: kernel test robot <lkp@intel.com>
Link: https://lore.kernel.org/r/20211201180004.1402156-2-tanureal@opensource.cirrus.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-12-02 13:02:45 +00:00
Lucas Tanure
19a628d8f1
ASoC: amd: Fix dependency for SPI master
Set SPI_MASTER as dependency as is using CS35L41 SPI driver

Fixes: 96792fdd77 ("ASoC: amd: enable vangogh platform machine driver build")

Signed-off-by: Lucas Tanure <tanureal@opensource.cirrus.com>
Reported-by: kernel test robot <lkp@intel.com>
Link: https://lore.kernel.org/r/20211201180004.1402156-1-tanureal@opensource.cirrus.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-12-02 13:02:44 +00:00
Oder Chiou
e3dd4424c2
ASoC: rt5640: Fix the wrong state of the JD in the HDA header
The patch fixes the wrong state of the JD with 1M pull up resistor in the
HDA header.

Signed-off-by: Oder Chiou <oder_chiou@realtek.com>
Link: https://lore.kernel.org/r/20211201095629.21818-1-oder_chiou@realtek.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-12-02 13:02:43 +00:00
Srinivas Kandagatla
b80155fe61
ASoC: codecs: wcd934x: remove redundant ret variable
return value form snd_soc_dapm_put_enum_double() directly instead
of taking this in another redundant variable.

Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Link: https://lore.kernel.org/r/20211130160507.22180-3-srinivas.kandagatla@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-12-01 14:15:40 +00:00
Sameer Pujar
0d242698fa
ASoC: tegra: Add master volume/mute control support
The MVC module has a per channel control bit, based on which it decides
to apply channel specific volume/mute settings. When per channel control
bit is enabled (which is the default HW configuration), all MVC channel
volume/mute can be independently controlled. If the control is disabled,
channel-0 volume/mute setting is applied by HW to all remaining channels.
Thus add support to leverage this HW feature by exposing master controls
for volume/mute.

With this, now there are per channel and master volume/mute controls.
Users need to just use controls which are suitable for their applications.
The per channel control enable/disable is mananged in driver and hidden
from users, so that they need to just worry about respective volume/mute
controls.

Signed-off-by: Sameer Pujar <spujar@nvidia.com>
Link: https://lore.kernel.org/r/1638278605-28225-1-git-send-email-spujar@nvidia.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-12-01 14:15:39 +00:00
Mark Brown
67140b64b6
Merge branch 'for-5.16' of https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound into asoc-5.17 so we can apply new Tegra work 2021-12-01 14:15:12 +00:00
Srinivas Kandagatla
3fc27e9a1f
ASoC: codecs: wsa881x: fix return values from kcontrol put
wsa881x_set_port() and wsa881x_put_pa_gain() currently returns zero eventhough
it changes the value. Fix this, so that change notifications are sent
correctly.

Fixes: a0aab9e140 ("ASoC: codecs: add wsa881x amplifier support")
Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Link: https://lore.kernel.org/r/20211130160507.22180-5-srinivas.kandagatla@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-12-01 14:13:53 +00:00
Srinivas Kandagatla
d9be0ff479
ASoC: codecs: wcd934x: return correct value from mixer put
wcd934x_compander_set() currently returns zero eventhough it changes the value.
Fix this, so that change notifications are sent correctly.

Fixes: 1cde8b8223 ("ASoC: wcd934x: add basic controls")
Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Link: https://lore.kernel.org/r/20211130160507.22180-4-srinivas.kandagatla@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-12-01 14:13:50 +00:00
Srinivas Kandagatla
23ba28616d
ASoC: codecs: wcd934x: handle channel mappping list correctly
Currently each channel is added as list to dai channel list, however
there is danger of adding same channel to multiple dai channel list
which endups corrupting the other list where its already added.

This patch ensures that the channel is actually free before adding to
the dai channel list and also ensures that the channel is on the list
before deleting it.

This check was missing previously, and we did not hit this issue as
we were testing very simple usecases with sequence of amixer commands.

Fixes: a70d924575 ("ASoC: wcd934x: add capture dapm widgets")
Fixes: dd9eb19b56 ("ASoC: wcd934x: add playback dapm widgets")
Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Link: https://lore.kernel.org/r/20211130160507.22180-2-srinivas.kandagatla@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-12-01 14:13:49 +00:00
Srinivas Kandagatla
4739d88ad8
ASoC: qdsp6: q6routing: Fix return value from msm_routing_put_audio_mixer
msm_routing_put_audio_mixer() can return incorrect value in various scenarios.

scenario 1:
amixer cset iface=MIXER,name='SLIMBUS_0_RX Audio Mixer MultiMedia1' 1
amixer cset iface=MIXER,name='SLIMBUS_0_RX Audio Mixer MultiMedia1' 0

return value is 0 instead of 1 eventhough value was changed

scenario 2:
amixer cset iface=MIXER,name='SLIMBUS_0_RX Audio Mixer MultiMedia1' 1
amixer cset iface=MIXER,name='SLIMBUS_0_RX Audio Mixer MultiMedia1' 1

return value is 1 instead of 0 eventhough the value was not changed

scenario 3:
amixer cset iface=MIXER,name='SLIMBUS_0_RX Audio Mixer MultiMedia1' 0
return value is 1 instead of 0 eventhough the value was not changed

Fix this by adding checks, so that change notifications are sent correctly.

Fixes: e3a33673e8 ("ASoC: qdsp6: q6routing: Add q6routing driver")
Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Link: https://lore.kernel.org/r/20211130163110.5628-1-srinivas.kandagatla@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-12-01 14:13:48 +00:00
Amadeusz Sławiński
322fa43154 ASoC: Intel: Skylake: Use NHLT API to search for blob
With NHLT enriched with new search functions, remove local code in
favour of them. This also fixes broken behaviour: search should be based
on significant bits count rather than container size.

Signed-off-by: Amadeusz Sławiński <amadeuszx.slawinski@linux.intel.com>
Signed-off-by: Cezary Rojewski <cezary.rojewski@intel.com>
Acked-by: Mark Brown <broonie@kernel.org>
Link: https://lore.kernel.org/r/20211126140355.1042684-4-cezary.rojewski@intel.com
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2021-11-30 16:49:34 +01:00
Mac Chiang
f316c9d9ba
ASoC: Intel: boards: add max98390 2/4 speakers support
support 2 hw boards.
1. SSP2 connects max98390, 2 speakers.
2. SSP1 connects max98390, 2/4 speakers.

2 or 4 speakers playback
add echo reference capture
add bt offload support
add DMI_OEM_STRING for board variants
add ALC5682I-VS support

Signed-off-by: Mark Hsieh <mark_hsieh@wistron.corp-partner.google.com>
Signed-off-by: Mac Chiang <mac.chiang@intel.com>
Signed-off-by: Kieth Tzeng <keith.tzeng@quantatw.com>
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/20211125030453.4382-1-mac.chiang@intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-11-30 13:08:14 +00:00
Colin Ian King
91745b034d
ASoC: mediatek: mt8195: make several arrays static const
Don't populate various arrays on the stack but instead make them
static const. Also makes the object code smaller by a few hundred
bytes.

Signed-off-by: Colin Ian King <colin.i.king@gmail.com>
Link: https://lore.kernel.org/r/20211129224236.506883-1-colin.i.king@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-11-30 13:08:13 +00:00
Rikard Falkeborn
10b155fd41
ASoC: intel: boards: bytcht*: Constify static snd_soc_ops
These are only assigned to the ops fields in the snd_soc_dai_link struct
which is a pointer to const struct snd_soc_ops. Make them const to allow
the compiler to put them in read-only memory.

Signed-off-by: Rikard Falkeborn <rikard.falkeborn@gmail.com>
Acked-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20211127091954.12075-1-rikard.falkeborn@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-11-30 13:08:10 +00:00
Chris Down
11918cdcff
ASoC: Intel: hda_dsp_common: don't multiline PCM topology warning
On my T14s Gen2 I saw the following:

    [   16.057258] skl_hda_dsp_generic skl_hda_dsp_generic: hda_dsp_hdmi_build_controls: no PCM in topology for HDMI converter 3

    [   16.057261] skl_hda_dsp_generic skl_hda_dsp_generic: hda_dsp_hdmi_build_controls: no PCM in topology for HDMI converter 4

    [   16.057263] skl_hda_dsp_generic skl_hda_dsp_generic: hda_dsp_hdmi_build_controls: no PCM in topology for HDMI converter 5

    [...and so on.]

It looks like the double newline is a mistake, so remove one.

Signed-off-by: Chris Down <chris@chrisdown.name>
Acked-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/YaOS0sBueAfApwOx@chrisdown.name
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-11-30 13:08:09 +00:00
Rikard Falkeborn
8752d9a82f
ASoC: mediatek: mt8195: Constify static snd_soc_ops
These are only assigned to the ops field in the snd_soc_dai_link which
is a pointer to const struct snd_soc_ops. Make them const to allow the
compiler to put them in read-only memory.

Signed-off-by: Rikard Falkeborn <rikard.falkeborn@gmail.com>
Link: https://lore.kernel.org/r/20211127093147.17368-1-rikard.falkeborn@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-11-30 13:08:08 +00:00
Hui Wang
046aede2f8
ASoC: SOF: Intel: Retry codec probing if it fails
On the latest Lenovo Thinkstation laptops, we often experience the
speaker failure after rebooting, check the dmesg, we could see:
 sof-audio-pci-intel-tgl 0000:00:1f.3: codec #0 probe error, ret: -5

The analogue codec on the machine is ALC287, then we designed a
testcase to reboot and check the codec probing result repeatedly, we
found the analogue codec probing always failed at least once within
several minutes to several hours (roughly 1 reboot per min). This
issue happens on all laptops of this Thinkstation model, but with
legacy HDA driver, we couldn't reproduce this issue on those laptops.
And so far, this issue is not reproduced on machines which don't
belong to this model.

We tried to make the hda_dsp_ctrl_init_chip() same as
hda_intel_init_chip() which is the controller init routine in the
legacy HDA driver, but it didn't help.

We found when issue happens, the resp is -1, and if we let driver
re-run send_cmd() and get_response(), it will get the correct response
10ec0287, then driver continues the rest work, finally boot to the
desktop and all audio function work well.

Here adding codec probing retries to 3 times, it could fix the issue
on this Thinkstation model, and it doesn't bring impact to other
machines.

Reviewed-by: Bard Liao <bard.liao@intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Hui Wang <hui.wang@canonical.com>
Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Link: https://lore.kernel.org/r/20211130090606.529348-1-kai.vehmanen@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-11-30 13:08:03 +00:00
Dan Carpenter
d5c137f413
ASoC: amd: fix uninitialized variable in snd_acp6x_probe()
The "index" is potentially used without being initialized on the error
path.

Fixes: fc329c1de4 ("ASoC: amd: add platform devices for acp6x pdm driver and dmic driver")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Link: https://lore.kernel.org/r/20211130125633.GA24941@kili
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-11-30 13:08:02 +00:00
Nicolas Frattaroli
53689f7f91
ASoC: rockchip: i2s_tdm: Dup static DAI template
Previously, the DAI template was used directly, which lead to
fun bugs such as "why is my channels_max changing?" when one
instantiated more than one i2s_tdm IP block in a device tree.

This change makes it so that we instead duplicate the template
struct, and then use that.

Fixes: 081068fd64 ("ASoC: rockchip: add support for i2s-tdm controller")
Signed-off-by: Nicolas Frattaroli <frattaroli.nicolas@gmail.com>
Link: https://lore.kernel.org/r/20211125084900.417102-1-frattaroli.nicolas@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-11-30 13:08:01 +00:00
Mark Brown
7be10cef0f
ASoC: soc-pcm: tidyup soc_pcm_pointer()'s delay update method
Merge series from Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>:

	Current soc_pcm_pointer() is checking runtime->delay,
	but it might be updated silently by component's .point callback.
	It is strange and difficult to find/know the issue.  This patch
	adds .delay callback for component, and solve the issue.
2021-11-29 16:43:16 +00:00
Thomas Gleixner
6dd21ad81b ALSA: hda: Make proper use of timecounter
HDA uses a timecounter to read a hardware clock running at 24 MHz. The
conversion factor is set with a mult value of 125 and a shift value of 0,
which is not converting the hardware clock to nanoseconds, it is converting
to 1/3 nanoseconds because the conversion factor from 24Mhz to nanoseconds
is 125/3. The usage sites divide the "nanoseconds" value returned by
timecounter_read() by 3 to get a real nanoseconds value.

There is a lengthy comment in azx_timecounter_init() explaining this
choice. That comment makes blatantly wrong assumptions about how
timecounters work and what can overflow.

The comment says:

     * Applying the 1/3 factor as part of the multiplication
     * requires at least 20 bits for a decent precision, however
     * overflows occur after about 4 hours or less, not a option.

timecounters operate on time deltas between two readouts of a clock and use
the mult/shift pair to calculate a precise nanoseconds value:

    delta_nsec = (delta_clock * mult) >> shift;

The fractional part is also taken into account and preserved to prevent
accumulated rounding errors. For details see cyclecounter_cyc2ns().

The mult/shift pair has to be chosen so that the multiplication of the
maximum expected delta value does not result in a 64bit overflow. As the
counter wraps around on 32bit, the maximum observable delta between two
reads is (1 << 32) - 1 which is about 178.9 seconds.

That in turn means the maximum multiplication factor which fits into an u32
will not cause a 64bit overflow ever because it's guaranteed that:

     ((1 << 32) - 1) ^ 2 < (1 << 64)

The resulting correct multiplication factor is 2796202667 and the shift
value is 26, i.e. 26 bit precision. The overflow of the multiplication
would happen exactly at a clock readout delta of 6597069765 which is way
after the wrap around of the hardware clock at around 274.8 seconds which
is off from the claimed 4 hours by more than an order of magnitude.

If the counter ever wraps around the last read value then the calculation
is off by the number of wrap arounds times 178.9 seconds because the
overflow cannot be observed.

Use clocks_calc_mult_shift(), which calculates the most accurate mult/shift
pair based on the given clock frequency, and remove the bogus comment along
with the divisions at the readout sites.

Fixes: 5d890f591d ("ALSA: hda: support for wallclock timestamps")
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/871r35kwji.ffs@tglx
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2021-11-29 17:42:31 +01:00
Jernej Skrabec
679de7b64f
ASoC: sunxi: sun4i-spdif: Implement IEC958 control
SPDIF core is capable of sending custom status.

Implement IEC958 control handling.

Signed-off-by: Jernej Skrabec <jernej.skrabec@gmail.com>
Link: https://lore.kernel.org/r/20211117194458.2249643-1-jernej.skrabec@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-11-29 12:19:49 +00:00
lvzhaoxiong
425c5fce8a
ASoC: qcom: Add support for ALC5682I-VS codec
Qcom machine driver adds rt5682s support in this patch.
Card name can be specified from dts by model property, and driver makes
use of the name to distinguish which headset codec is on the board.

Signed-off-by: lvzhaoxiong <lvzhaoxiong@huaqin.corp-partner.google.com>
Link: https://lore.kernel.org/r/20211123024329.21998-1-lvzhaoxiong@huaqin.corp-partner.google.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-11-29 12:19:48 +00:00
Samuel Holland
fd03cf7f5b
ASoC: sun8i-codec: Add AIF, ADC, and DAC volume controls
This allows changing the volume of each digital input/output
independently, and provides the only "master volume" for the DAC.
(The ADC also has a gain control on the analog side.)

While the hardware supports digital gain up to +72dB, the controls here
are limited to +24dB maximum, as any gain above that level makes volume
sliders difficult to use, and is extremely likely to cause clipping.

Signed-off-by: Samuel Holland <samuel@sholland.org>
Link: https://lore.kernel.org/r/20211118033645.43524-1-samuel@sholland.org
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-11-29 12:19:47 +00:00
Kuninori Morimoto
dd894f4caf
ASoC: soc-pcm: tidyup soc_pcm_pointer()'s delay update method
No driver directly updates runtime->delay in .pointer.
This patch cleanups its method.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/87zgq4wnkx.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-11-29 12:19:45 +00:00
Kuninori Morimoto
796b64a72d
ASoC: intel: sst-mfld-platform-pcm: add .delay support
Now ALSA SoC supports .delay for component.
This patch uses it, and not update runtime->delay on .pointer
directly / secretly.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/871r3gy25j.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-11-29 12:19:44 +00:00
Kuninori Morimoto
feea640aaf
ASoC: amd: acp-pcm-dma: add .delay support
Now ALSA SoC supports .delay for component.
This patch uses it, and not update runtime->delay on .pointer
directly / secretly.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/8735nwy25o.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-11-29 12:19:42 +00:00
Kuninori Morimoto
403f830e7a
ASoC: soc-component: add snd_soc_pcm_component_delay()
Current soc-pcm.c :: soc_pcm_pointer() is assuming that
component driver might update runtime->delay silently in
snd_soc_pcm_component_pointer() (= A).

	static snd_pcm_uframes_t soc_pcm_pointer(...)
	{
		...

		/* clearing the previous total delay */
=>		runtime->delay = 0;

(A)		offset = snd_soc_pcm_component_pointer(substream);

		/* base delay if assigned in pointer callback */
=>		delay = runtime->delay;
		...
	}

1) The behavior that ".pointer callback secretly updates
   runtime->delay" is strange and confusable.

2) Current snd_soc_pcm_component_pointer() uses 1st found component's
   .pointer callback only, thus it is no problem for now.
   But runtime->delay might be overwrote if it adjusted to multiple
   components in the future.

3) Component delay is updated at .pointer callback timing (secretly).
   But some components which doesn't have .pointer callback might want
   to increase runtime->delay for some reasons.

We already have .delay function for DAI, but not have for Component.
This patch adds new snd_soc_pcm_component_delay() for it.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/874k8cy25t.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-11-29 12:19:41 +00:00
Kuninori Morimoto
8544f08c81
ASoC: soc-dai: update snd_soc_dai_delay() to snd_soc_pcm_dai_delay()
Current soc_pcm_pointer() is manually calculating
both CPU-DAI's   max delay (= A)
and  Codec-DAI's max delay (= B).

	static snd_pcm_uframes_t soc_pcm_pointer(...)
	{
		...
 ^		for_each_rtd_cpu_dais(rtd, i, cpu_dai)
(A)			cpu_delay = max(cpu_delay, ...);
 v		delay += cpu_delay;

 ^		for_each_rtd_codec_dais(rtd, i, codec_dai)
(B)			codec_delay = max(codec_delay, ...);
 v		delay += codec_delay;

		runtime->delay = delay;
		...
	}

Current soc_pcm_pointer() and the total delay calculating
is not readable / difficult to understand.

This patch update snd_soc_dai_delay() to snd_soc_pcm_dai_delay(),
and calcule both CPU/Codec delay in one function.

Link: https://lore.kernel.org/r/87fszl4yrq.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/875yssy25z.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-11-29 12:19:40 +00:00
Mark Brown
335302dbc2
ASoC: SOF: Fixes for Intel HD-Audio DMA stopping
Merge series from Kai Vehmanen <kai.vehmanen@linux.intel.com>:

	Implement an updated programming sequence to handle DMA stop for Intel
	HD-Audio DMA.

	The new flow is only used if the firmware is sufficiently new to
	support the feature. SOF1.9.2 is the first release with the updated
	flow. The kernel changes are backwards compatible with old firmware
	releases. Likewise new firmware releases will work with old kernel.

	Series reviewed originally at:
	https://github.com/thesofproject/linux/pull/3167
2021-11-27 01:27:27 +00:00
Mark Brown
8a724d5f60
Suspend related fixes on Tegra
Merge series from Sameer Pujar <spujar@nvidia.com>:

	This series addresses following problems:
	 * The runtime PM is not balanced in MVC driver, whenever
	   mute or volume mixer controls are set.
	 * Some of the AHUB devices (SFC, MVC, Mixer, AMX and ADX)
	   use late system sleep. Suspend failure is seen on Jetson
	   TX2 platform.
2021-11-27 01:27:20 +00:00
Geert Uytterhoeven
4dcddadf55
ASoC: SOF: mediatek: Use %pR/%pa to print resources/physical addresses
On 32-bit with CONFIG_ARCH_DMA_ADDR_T_64BIT=n:

    sound/soc/sof/mediatek/mt8195/mt8195.c: In function ‘platform_parse_resource’:
    sound/soc/sof/mediatek/mt8195/mt8195.c:51:15: error: format ‘%llx’ expects argument of type ‘long long unsigned int’, but argument 4 has type ‘unsigned int’ [-Werror=format=]
       51 |  dev_dbg(dev, "DMA pbase=0x%llx, size=0x%llx\n",
	  |               ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

    sound/soc/sof/mediatek/mt8195/mt8195.c: In function ‘adsp_memory_remap_init’:
    sound/soc/sof/mediatek/mt8195/mt8195.c:167:15: error: format ‘%llx’ expects argument of type ‘long long unsigned int’, but argument 4 has type ‘phys_addr_t’ {aka ‘unsigned int’} [-Werror=format=]
      167 |  dev_dbg(dev, "adsp->pa_dram %llx, offset %#x\n", adsp->pa_dram, offset);
	  |               ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

    sound/soc/sof/mediatek/mt8195/mt8195.c: In function ‘adsp_shared_base_ioremap’:
    sound/soc/sof/mediatek/mt8195/mt8195.c:196:15: error: format ‘%llx’ expects argument of type ‘long long unsigned int’, but argument 5 has type ‘phys_addr_t’ {aka ‘unsigned int’} [-Werror=format=]
      196 |  dev_dbg(dev, "shared-dram vbase=%p, phy addr :%llx,  size=%#x\n",
	  |               ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Fix the first cases by printing the full resource using %pR.
Fix the other cases by printing the physical addresses using %pa.

Reported-by: noreply@ellerman.id.au
Fixes: 32d7e03d26 ("ASoC: SOF: mediatek: Add mt8195 hardware support")
Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
Link: https://lore.kernel.org/r/20211123103013.73645-1-geert@linux-m68k.org
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-11-26 13:24:32 +00:00
Lucas Tanure
a5e0091d62
ASoC: cs35l41: Fix link problem
Can't link I2C and SPI to the same binary, better
to move CS35L41 to 3 modules approach.
And instead of exposing cs35l41_reg, volatile_reg,
readable_reg and precious_reg arrays, move
cs35l41_regmap_i2c/spi to new module and expose it.

Signed-off-by: Lucas Tanure <tanureal@opensource.cirrus.com>
Link: https://lore.kernel.org/r/20211125143501.7720-1-tanureal@opensource.cirrus.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-11-26 13:24:31 +00:00
Paul Cercueil
0b18939594
ASoC: codecs/jz4770: Add missing gain control after DAC/ADC mixer
The capture and playback paths both have a configurable gain after their
respective mixer, which can be set from -31 dB to 0 dB in 32 steps.

Signed-off-by: Paul Cercueil <paul@crapouillou.net>
Link: https://lore.kernel.org/r/20211125232543.117074-1-paul@crapouillou.net
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-11-26 13:24:30 +00:00
Ye Guojin
f670b274f7
ASoC: imx-hdmi: add put_device() after of_find_device_by_node()
This was found by coccicheck:
./sound/soc/fsl/imx-hdmi.c,209,1-7,ERROR  missing put_device; call
of_find_device_by_node on line 119, but without a corresponding object
release within this function.

Reported-by: Zeal Robot <zealci@zte.com.cn>
Signed-off-by: Ye Guojin <ye.guojin@zte.com.cn>
Link: https://lore.kernel.org/r/20211110002910.134915-1-ye.guojin@zte.com.cn
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-11-26 13:24:28 +00:00
Ranjani Sridharan
69acac5690
ASoC: SOF: Intel: hda: send DAI_CONFIG IPC during pause
For HDA DAI's the DMA must be paused after the RUN bit is cleared by the
host. So, send the DAI_CONFIG IPC with just the SOF_DAI_CONFIG_FLAGS_PAUSE
flag set to indicate this to the firmware.

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Link: https://lore.kernel.org/r/20211125101520.291581-11-kai.vehmanen@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-11-26 13:24:26 +00:00
Ranjani Sridharan
a0f84dfb3f
ASoC: SOF: IPC: dai: Expand DAI_CONFIG IPC flags
Some DAI components, such as HDaudio, need to be stopped in two steps
a) stop the DAI component
b) stop the DAI DMA

This patch enables this two-step stop by expanding the DAI_CONFIG
IPC flags and split them into 2 parts.

The 4 LSB bits indicate when the DAI_CONFIG IPC is sent, ex: hw_params,
hw_free or pause. The 4 MSB bits are used as the quirk flags to be used
along with the command flags. The quirk flag called
SOF_DAI_CONFIG_FLAGS_2_STEP_STOP shall be set along with the HW_PARAMS
command flag, i.e. before the pipeline is started so that the stop/pause
trigger op in the FW can take the appropriate action to either
perform/skip the DMA stop. If set, the DMA stop will be executed when
the DAI_CONFIG IPC is sent during hw_free. In the case of pause, DMA
pause will be handled when the DAI_CONFIG IPC is sent with the PAUSE
command flag.

Along with this, modify the signature for the hda_ctrl_dai_widget_setup/
hda_ctrl_dai_widget_free() functions to take additional flags as an
argument and modify all users to pass the appropriate quirk flags. Only
the HDA DAI's need to pass the SOF_DAI_CONFIG_FLAGS_2_STEP_STOP quirk
flag during hw_params to indicate that it supports two-step stop and
pause.

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Link: https://lore.kernel.org/r/20211125101520.291581-10-kai.vehmanen@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-11-26 13:24:24 +00:00
Ranjani Sridharan
0b639dcd45
ASoC: SOF: align the hw_free sequence with stop
Even though the order of stopping the DMA and freeing the widget list is
not important, align the sequence to match with the stop trigger to
avoid confusion.

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Link: https://lore.kernel.org/r/20211125101520.291581-9-kai.vehmanen@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-11-26 13:24:23 +00:00
Ranjani Sridharan
85d7acd0ef
ASoC: SOF: pcm: move the check for prepared flag
Move the check for the prepared flag inside snd_pcm_dsp_pcm_free() to
avoid having to check it before every invocation of the function.

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Link: https://lore.kernel.org/r/20211125101520.291581-8-kai.vehmanen@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-11-26 13:24:22 +00:00
Ranjani Sridharan
d9a7246534
ASoC: SOF: Add a helper for freeing PCM stream
Add a helper function to free PCM in the FW, stop the DMA and free the
widget list. These actions are performed both during PCM trigger STOP
and when a paused stream is freed during system suspend.

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Link: https://lore.kernel.org/r/20211125101520.291581-7-kai.vehmanen@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-11-26 13:24:21 +00:00
Ranjani Sridharan
47934e0fcb
ASoC: SOF: call platform hw_free for paused streams during suspend
Paused streams must be stopped and platform hw_free should be invoked
during system suspend so they can be restarted properly after system
resume.

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Link: https://lore.kernel.org/r/20211125101520.291581-6-kai.vehmanen@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-11-26 13:24:20 +00:00
Ranjani Sridharan
0dd71a3340
ASoC: SOF: pcm: invoke platform hw_free for STOP/SUSPEND triggers
snd_sof_pcm_platform_hw_params() will be called when the stream is
restarted with a prepare ioctl. This happens in two cases i.e. when a
suspended stream is resumed or when a stream is restarted without
intermediate call to sof_pcm_hw_free(). Make sure to call
snd_sof_pcm_platform_hw_free() in both these cases to keep it balanced.

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Link: https://lore.kernel.org/r/20211125101520.291581-5-kai.vehmanen@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-11-26 13:24:19 +00:00
Ranjani Sridharan
4794601a52
ASoC: SOF: Intel: hda: reset stream before coupling host and link DMA's
The recommended programming sequence for HD-Audio DMA is to reset the
stream before coupling the link and host DMA's.

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Link: https://lore.kernel.org/r/20211125101520.291581-4-kai.vehmanen@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-11-26 13:24:18 +00:00
Ranjani Sridharan
2b1acedccf
ASoC: SOF: Intel: hda: Add a helper function for stream reset
Add a helper function to perform stream reset.

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Link: https://lore.kernel.org/r/20211125101520.291581-3-kai.vehmanen@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-11-26 13:24:17 +00:00
Ranjani Sridharan
e14cddc588
ASoC: SOF: Intel: hda: clear stream before freeing the DAI widget
The DAI_CONFIG IPC that is sent during the STOP trigger is used for
stopping the DMA in the FW. This must be done after the DMA RUN bit is
cleared by the host. So move the call to snd_hdac_ext_link_stream_clear()
before hda_link_dai_widget_update() to follow the correct programming
sequence for DMA stop for HDA DAIs.

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Link: https://lore.kernel.org/r/20211125101520.291581-2-kai.vehmanen@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-11-26 13:24:16 +00:00
Rob Clark
750dc2f622
ASoC: rt5682s: Fix crash due to out of scope stack vars
Move the declaration of temporary arrays to somewhere that won't go out
of scope before the devm_clk_hw_register() call, lest we be at the whim
of the compiler for whether those stack variables get overwritten.

Fixes a crash seen with gcc version 11.2.1 20210728 (Red Hat 11.2.1-1)

Fixes: bdd229ab26 ("ASoC: rt5682s: Add driver for ALC5682I-VS codec")
Signed-off-by: Rob Clark <robdclark@chromium.org>
Reviewed-by: Stephen Boyd <swboyd@chromium.org>
Link: https://lore.kernel.org/r/20211118010453.843286-2-robdclark@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-11-26 13:24:10 +00:00
Rob Clark
4999d703c0
ASoC: rt5682: Fix crash due to out of scope stack vars
Move the declaration of temporary arrays to somewhere that won't go out
of scope before the devm_clk_hw_register() call, lest we be at the whim
of the compiler for whether those stack variables get overwritten.

Fixes a crash seen with gcc version 11.2.1 20210728 (Red Hat 11.2.1-1)

Fixes: edbd24ea1e ("ASoC: rt5682: Drop usage of __clk_get_name()")
Signed-off-by: Rob Clark <robdclark@chromium.org>
Reviewed-by: Stephen Boyd <swboyd@chromium.org>
Link: https://lore.kernel.org/r/20211118010453.843286-1-robdclark@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-11-26 13:24:09 +00:00
Sameer Pujar
cf36de4fc5
ASoC: tegra: Use normal system sleep for ADX
The driver currently subscribes for a late system sleep call.
The initcall_debug log shows that suspend call for ADX device
happens after the parent device (AHUB). This seems to cause
suspend failure on Jetson TX2 platform. Also there is no use
of having late system sleep specifically for ADX device. Fix
the order by using normal system sleep.

Fixes: a99ab6f395 ("ASoC: tegra: Add Tegra210 based ADX driver")
Cc: stable@vger.kernel.org
Signed-off-by: Sameer Pujar <spujar@nvidia.com>
Link: https://lore.kernel.org/r/1637676459-31191-7-git-send-email-spujar@nvidia.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-11-26 13:24:07 +00:00
Sameer Pujar
638c31d542
ASoC: tegra: Use normal system sleep for AMX
The driver currently subscribes for a late system sleep call.
The initcall_debug log shows that suspend call for AMX device
happens after the parent device (AHUB). This seems to cause
suspend failure on Jetson TX2 platform. Also there is no use
of having late system sleep specifically for AMX device. Fix
the order by using normal system sleep.

Fixes: 77f7df346c ("ASoC: tegra: Add Tegra210 based AMX driver")
Cc: stable@vger.kernel.org
Signed-off-by: Sameer Pujar <spujar@nvidia.com>
Link: https://lore.kernel.org/r/1637676459-31191-6-git-send-email-spujar@nvidia.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-11-26 13:24:06 +00:00
Sameer Pujar
b78400e416
ASoC: tegra: Use normal system sleep for Mixer
The driver currently subscribes for a late system sleep call.
The initcall_debug log shows that suspend call for Mixer device
happens after the parent device (AHUB). This seems to cause
suspend failure on Jetson TX2 platform. Also there is no use
of having late system sleep specifically for Mixer device. Fix
the order by using normal system sleep.

Fixes: 05bb3d5ec6 ("ASoC: tegra: Add Tegra210 based Mixer driver")
Cc: stable@vger.kernel.org
Signed-off-by: Sameer Pujar <spujar@nvidia.com>
Link: https://lore.kernel.org/r/1637676459-31191-5-git-send-email-spujar@nvidia.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-11-26 13:24:05 +00:00
Sameer Pujar
c83d263a89
ASoC: tegra: Use normal system sleep for MVC
The driver currently subscribes for a late system sleep call.
The initcall_debug log shows that suspend call for MVC device
happens after the parent device (AHUB). This seems to cause
suspend failure on Jetson TX2 platform. Also there is no use
of having late system sleep specifically for MVC device. Fix
the order by using normal system sleep.

Fixes: e539891f96 ("ASoC: tegra: Add Tegra210 based MVC driver")
Cc: stable@vger.kernel.org
Signed-off-by: Sameer Pujar <spujar@nvidia.com>
Link: https://lore.kernel.org/r/1637676459-31191-4-git-send-email-spujar@nvidia.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-11-26 13:24:04 +00:00
Sameer Pujar
af120d07bb
ASoC: tegra: Use normal system sleep for SFC
The driver currently subscribes for a late system sleep call.
The initcall_debug log shows that suspend call for SFC device
happens after the parent device (AHUB). This seems to cause
suspend failure on Jetson TX2 platform. Also there is no use
of having late system sleep specifically for SFC device. Fix
the order by using normal system sleep.

Fixes: b2f74ec53a ("ASoC: tegra: Add Tegra210 based SFC driver")
Cc: stable@vger.kernel.org
Signed-off-by: Sameer Pujar <spujar@nvidia.com>
Link: https://lore.kernel.org/r/1637676459-31191-3-git-send-email-spujar@nvidia.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-11-26 13:24:01 +00:00
Sameer Pujar
70408f755f
ASoC: tegra: Balance runtime PM count
After successful application of volume/mute settings via mixer control
put calls, the control returns without balancing the runtime PM count.
This makes device to be always runtime active. Fix this by allowing
control to reach pm_runtime_put() call.

Fixes: e539891f96 ("ASoC: tegra: Add Tegra210 based MVC driver")
Cc: stable@vger.kernel.org
Signed-off-by: Sameer Pujar <spujar@nvidia.com>
Link: https://lore.kernel.org/r/1637676459-31191-2-git-send-email-spujar@nvidia.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-11-26 13:24:00 +00:00
Takashi Iwai
dcd46eb7a9 ASoC: Fixes for v5.16
There's a large but repetitive set of fixes here for issues with the
 Tegra kcontrols not correctly reporting changes to userspace, a fix for
 some issues with matching on older x86 platforms introduced during the
 merge window together with a set of smaller fixes and one new system
 quirk.
 -----BEGIN PGP SIGNATURE-----
 
 iQEzBAABCgAdFiEEreZoqmdXGLWf4p/qJNaLcl1Uh9AFAmGfjyoACgkQJNaLcl1U
 h9C4Rgf/fXw9hh2Z/lInp08+RTZ/0NHcluiCk6ku7w0ATF0RsvvDl7kwkg9893ID
 Zm0H+L1kiSMiOXy+uZGyAM2EpXU/m+R4JDi+nKONcJg/PIFeK7t13Tzu/J1NYF3h
 e2r5GXyLpXJC4en8EuA/OJm3w8thdOm0Qrindpw2Sgc13JJCGtlQOw08f6kAidX0
 58kbBMZB5Ofet9L4LMRWNt5fRgMzP25j0GOFQt9ujwddl6Pod0aOz+zfkNF+loCW
 wb1FpqoeJkANfkKEtopYhKu7uK7XsU727jL6tXVnBz7PKkcVrKWCu1Iek3YbT89u
 LAmfbiMtxKI380H9hEHUZ3YgMrRSDg==
 =ngct
 -----END PGP SIGNATURE-----

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

ASoC: Fixes for v5.16

There's a large but repetitive set of fixes here for issues with the
Tegra kcontrols not correctly reporting changes to userspace, a fix for
some issues with matching on older x86 platforms introduced during the
merge window together with a set of smaller fixes and one new system
quirk.
2021-11-25 14:35:24 +01:00
Oder Chiou
2b9c8d2b3c
ASoC: rt5640: Add the HDA header support
The patch adds the HDA header support.

Signed-off-by: Oder Chiou <oder_chiou@realtek.com>
Link: https://lore.kernel.org/r/20211125055812.8911-2-oder_chiou@realtek.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-11-25 11:54:33 +00:00
Lukas Bulwahn
2039cc1da4
ASoC: codecs: wcd938x: add SND_SOC_WCD938_SDW to codec list instead
Commit 0454422288 ("ASoC: codecs: wcd938x: add audio routing and
Kconfig") adds SND_SOC_WCD937X, which does not exist, and
SND_SOC_WCD938X, which seems not really to be the intended config to be
selected, but only a supporting config symbol to the actual config
SND_SOC_WCD938X_SDW for the codec.

Add SND_SOC_WCD938_SDW to the list instead of SND_SOC_WCD93{7,8}X.

The issue was identified with ./scripts/checkkconfigsymbols.py.

Fixes: 0454422288 ("ASoC: codecs: wcd938x: add audio routing and Kconfig")
Signed-off-by: Lukas Bulwahn <lukas.bulwahn@gmail.com>
Link: https://lore.kernel.org/r/20211125095158.8394-3-lukas.bulwahn@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-11-25 11:54:31 +00:00
Lukas Bulwahn
49f893253a
ASoC: uniphier: drop selecting non-existing SND_SOC_UNIPHIER_AIO_DMA
Commit f37fe2f998 ("ASoC: uniphier: add support for UniPhier AIO common
driver") adds configs SND_SOC_UNIPHIER_{LD11,PXS2}, which select the
non-existing config SND_SOC_UNIPHIER_AIO_DMA.

Hence, ./scripts/checkkconfigsymbols.py warns:

  SND_SOC_UNIPHIER_AIO_DMA
  Referencing files: sound/soc/uniphier/Kconfig

Probably, there is actually no further config intended to be selected
here. So, just drop selecting the non-existing config.

Fixes: f37fe2f998 ("ASoC: uniphier: add support for UniPhier AIO common driver")
Signed-off-by: Lukas Bulwahn <lukas.bulwahn@gmail.com>
Link: https://lore.kernel.org/r/20211125095158.8394-2-lukas.bulwahn@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-11-25 11:54:30 +00:00
Yang Yingliang
fc6c62cf1c
ASoC: SOF: mediatek: Add missing of_node_put() in platform_parse_resource()
The node pointer is returned by of_parse_phandle() with
refcount incremented in platform_parse_resource(). Calling
of_node_put() to aovid the refcount leak.

Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: Yang Yingliang <yangyingliang@huawei.com>
Link: https://lore.kernel.org/r/20211125071608.3056715-1-yangyingliang@huawei.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-11-25 11:54:29 +00:00
Jiaxin Yu
faf695517c
ASoC: mediatek: remove unnecessary CONFIG_PM
The unnecessary conditional inclusion caused the following warning.

Such as:
>> sound/soc/mediatek/mt8192/mt8192-afe-pcm.c:2368:32: warning: unused
>> variable 'mt8192_afe_pm_ops' [-Wunused-const-variable]
   static const struct dev_pm_ops mt8192_afe_pm_ops = {

Because runtime_pm already handles the case without CONFIG_PM, we
can remove CONFIG_PM condition.

Signed-off-by: Jiaxin Yu <jiaxin.yu@mediatek.com>
Reported-by: kernel test robot <lkp@intel.com>
Acked-by: Tzung-Bi Shih <tzungbi@google.com>
Link: https://lore.kernel.org/r/20211125042422.2349-1-jiaxin.yu@mediatek.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-11-25 11:54:28 +00:00
Mark Brown
cd2f33e93d
ASoC: SOF: Intel: power optimizations with HDaudio SPIB register
Merge series from Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>:

	The use of the SPIB register helps reduce power consumption - though
	to a smaller degree than DMI_L1. This hardware capability is however
	incompatible with userspace-initiated rewinds typically used by
	PulseAudio.

	In the past (2015..2017) Intel suggested an API extension to let
	applications disable rewinds. At the time the feedback was that such a
	capability was too Intel-specific and SPIB remained unused except for
	loading DSP code. We now see devices with smaller batteries being
	released, and it's time to revisit Linux support for SPIB to extend
	battery life.

	In this update the rewinds are disabled via an opt-in kernel
	parameter. In the previous reviews, there was consensus that a Kconfig
	option was too complicated for distributions to set, and we are
	missing a TBD API to expose such capabilities to user-space.

	The debate on whether or not to use rewinds, and the impact of
	disabling rewinds, will likely be closed when Intel releases the
	'deep-buffer' support, currently under development [2][3]. With this
	solution, rewinds will not be needed, ever. When an application deals
	with content that is not latency-sensitive (e.g. music playback), it
	will be able to reduce power consumption by selecting a different PCM
	device with increased buffering capabilities.  Low-latency streams
	will be handled by the 'regular' path. In other words, the impossible
	compromise between power and latency will be handled with different
	PCM devices/profiles for the same endpoint, and we can push the design
	of capability negotiation to a later time when all the building blocks
	(firmware topology, kernel, userspace) are ready - we still have
	firmware xruns, DPCM race conditions to solve, and a need to describe
	these alternate PCM devices with UCM using 'modifiers'.
2021-11-24 17:33:54 +00:00
Ranjani Sridharan
96da174024
ASoC: SOF: handle paused streams during system suspend
During system suspend, paused streams do not get suspended.
Therefore, we need to explicitly free these PCMs in the DSP
and free the associated DAPM widgets so that they can be set
up again during resume.

Fixes: 5fcdbb2d45 ("ASoC: SOF: Add support for dynamic pipelines")
Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: Paul Olaru <paul.olaru@oss.nxp.com>
Reviewed-by: Bard Liao <bard.liao@intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Link: https://lore.kernel.org/r/20211123171606.129350-3-kai.vehmanen@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-11-24 12:57:25 +00:00
Pierre-Louis Bossart
fb71d03b29
ASoC: SOF: topology: don't use list_for_each_entry_reverse()
It's not clear why we would walk the list backwards. That makes no
difference.

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Link: https://lore.kernel.org/r/20211123171606.129350-2-kai.vehmanen@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-11-24 12:57:24 +00:00
Pierre-Louis Bossart
01429183f4
ASoC: SOF: sof-audio: setup sched widgets during pipeline complete step
Older firmware prior to ABI 3.19 has a dependency where the scheduler
widgets need to be setup last. Moving the call to sof_widget_setup()
before the pipeline_complete() call also helps remove the need for the
'reverse' direction when walking through the widget list - this was
only working because of the topology macros but the topology does not
require any order.

Fixes: 5fcdbb2d45 ("ASoC: SOF: Add support for dynamic pipelines")
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Link: https://lore.kernel.org/r/20211123171606.129350-1-kai.vehmanen@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-11-24 12:57:23 +00:00
Ranjani Sridharan
6c26b5054c
ASoC: SOF: Intel: add .ack support for HDaudio platforms
When we disable rewinds, then the .ack can be used to program SPIB
with the application pointer, which allows the HDaudio DMA to save
power by opportunistically bursting data transfers when the path to
memory is enabled (and conversely to shut it down when there are no
transfer requests).

The SPIB register can only be programmed with incremental values with
wrap-around after the DMA RUN bits are set. For simplicity, we set the
INFO_NO_REWINDS flag in the .open callback when we already need to
program the SNDRV_PCM_INFO_SYNC_APPLPTR flag.

Rewinds are not used by many applications. One notable application
using rewinds is PulseAudio. Practical experiments with
Ubuntu/PulseAudio default settings did not show any audible issues,
but the user may hear volume changes and notification with a delay,
depending on the size of the ring buffer and latency constraints.

The choice of disabling rewinds is exposed as a kernel parameter and
not a Kconfig option to avoid any undesirable side-effects.

Reviewed-by: Péter Ujfalusi <peter.ujfalusi@linux.intel.com>
Reviewed-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Co-developed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Link: https://lore.kernel.org/r/20211119230852.206310-5-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-11-24 12:57:21 +00:00
Ranjani Sridharan
4a39ea3f07
ASoC: SOF: pcm: add .ack callback support
Add the indirections required at the core level for platform-specific
operations on ack.

Note that on errors in the .ack the ALSA core will restore the
previous appl_ptr.

Reviewed-by: Péter Ujfalusi <peter.ujfalusi@linux.intel.com>
Reviewed-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20211119230852.206310-4-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-11-24 12:57:19 +00:00
Ranjani Sridharan
86f74ba3fe
ASoC: SOF: hda: reset DAI widget before reconfiguring it
It is not unusual for ALSA/ASoC hw_params callbacks to be invoked
multiple times. Reset and free the DAI widget before reconfiguring
it to keep the DAI widget use_count balanced.

Fixes: 0acb48dd31 ("ASoC: SOF: Intel: hda: make sure DAI widget is set up before IPC")
Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: Paul Olaru <paul.olaru@oss.nxp.com>
Reviewed-by: Bard Liao <bard.liao@intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Link: https://lore.kernel.org/r/20211123165759.127884-1-kai.vehmanen@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-11-24 12:57:11 +00:00
Lucas Tanure
872fc0b6bd
ASoC: cs35l41: Set the max SPI speed for the whole device
Higher speeds are only supported when PLL is enabled, but
the current driver doesn't enable PLL outside of stream
use cases, so better to set the lowest SPI speed accepted
by the entire device.

Move the current frequency set to the spi sub-driver so
the whole device can benefit from that speed.

spi-max-frequency property could be used, but ACPI systems don't
support it, so by setting it in the spi sub-driver probe
both Device Trees and ACPI systems are supported.

Signed-off-by: Lucas Tanure <tanureal@opensource.cirrus.com>
Reviewed-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Link: https://lore.kernel.org/r/20211123163149.1530535-2-tanureal@opensource.cirrus.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-11-24 12:57:10 +00:00
Pierre-Louis Bossart
8a6cc0ded6
ASoC: Intel: soc-acpi: add entry for ESSX8336 on CML
We have configurations for this codec on APL, GLK, JSL and TGL, somehow the
information that some designs rely on CometLake was not shared.

BugLink: https://github.com/thesofproject/linux/issues/3248
Fixes: 790049fb66 ("ASoC: Intel: soc-acpi: apl/glk/tgl: add entry for devices based on ES8336 codec")
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20211122232356.23505-1-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-11-23 12:08:58 +00:00
Mark Brown
65c16dd294
ASoC: SOF: Add PM support for i.MX8/i.MX8X/i.MX8M
Merge series from Daniel Baluta <daniel.baluta@oss.nxp.com>:

	This patch series adds support for System PM and Runtime PM with
	SOF for i.MX8 platforms.
2021-11-22 23:57:32 +00:00
Mark Brown
6d86bdb391
ASoC: stm32: add pm runtime support
Merge series from Olivier Moysan <olivier.moysan@foss.st.com>:

	Enable support of pm runtime on STM32 SPDIFRX, I2S and DFSDM drivers
	to allow power state monitoring.
2021-11-22 23:56:02 +00:00
Mark Brown
21b159264d
Support BCLK input clock in tlv320aic31xx
Merge series from Ariel D'Alessandro <ariel.dalessandro@collabora.com>:

	This patchset modifies the tlv320aic31xx driver to update its sysclk if
	BCLK is used as the input clock. This allows to be used by the generic
	fsl-asoc-card, without having to add a specific driver.
2021-11-22 23:56:00 +00:00
Mark Brown
277444544f
ASoC: SOF: enable multicore with dynamic pipelines
Merge series from Kai Vehmanen <kai.vehmanen@linux.intel.com>:

	When a pipeline is marked dynamic in the SOF DSP firmware
	topology definition (the tplg file kernel loads from filesystem),
	it means the pipeline resources are not allocated when DSP is
	booted (at driver probe, or at runtime resume), but rather delayed
	until the pipeline is actually used.
2021-11-22 23:55:59 +00:00
Ariel D'Alessandro
8c9b9cfb77
ASoC: fsl-asoc-card: Support fsl,imx-audio-tlv320aic31xx codec
Add entry for fsl,imx-audio-tlv320aic31xx audio codec. This codec is
configured to use BCLK as clock input.

Signed-off-by: Michael Trimarchi <michael@amarulasolutions.com>
Signed-off-by: Ariel D'Alessandro <ariel.dalessandro@collabora.com>
Link: https://lore.kernel.org/r/20211119153248.419802-6-ariel.dalessandro@collabora.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-11-22 15:43:03 +00:00
Ariel D'Alessandro
c5d22d5e12
ASoC: tlv320aic31xx: Handle BCLK set as PLL input configuration
If BCLK is used as PLL input, the sysclk is determined by the hw
params. So it must be updated here to match the input frequency, based
on sample rate, format and channels.

Signed-off-by: Ariel D'Alessandro <ariel.dalessandro@collabora.com>
Signed-off-by: Michael Trimarchi <michael@amarulasolutions.com>
Link: https://lore.kernel.org/r/20211119153248.419802-5-ariel.dalessandro@collabora.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-11-22 15:43:02 +00:00
Ariel D'Alessandro
6e6752a9c7
ASoC: tlv320aic31xx: Add divs for bclk as clk_in
Add divisors for rates needed when the clk_in is set to BCLK.

Signed-off-by: Michael Trimarchi <michael@amarulasolutions.com>
Signed-off-by: Ariel D'Alessandro <ariel.dalessandro@collabora.com>
Link: https://lore.kernel.org/r/20211119153248.419802-4-ariel.dalessandro@collabora.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-11-22 15:43:01 +00:00
Ariel D'Alessandro
2664b24a8c
ASoC: tlv320aic31xx: Add support for pll_r coefficient
When the clock used by the codec is BCLK, the operation parameters need
to be calculated from input sample rate and format. Low frequency rates
required different r multipliers, in order to achieve a higher PLL
output frequency.

Signed-off-by: Michael Trimarchi <michael@amarulasolutions.com>
Signed-off-by: Ariel D'Alessandro <ariel.dalessandro@collabora.com>
Link: https://lore.kernel.org/r/20211119153248.419802-3-ariel.dalessandro@collabora.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-11-22 15:43:00 +00:00
Ariel D'Alessandro
7016fd940a
ASoC: tlv320aic31xx: Fix typo in BCLK clock name
Signed-off-by: Ariel D'Alessandro <ariel.dalessandro@collabora.com>
Link: https://lore.kernel.org/r/20211119153248.419802-2-ariel.dalessandro@collabora.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-11-22 15:42:59 +00:00
Richard Fitzgerald
fdd5352837
ASoC: cs42l42: Report initial jack state
When a jack handler is registered in cs42l42_set_jack() the
initial state should be reported if an attached headphone/headset
has already been detected.

The jack detect sequence takes around 1 second: typically long
enough for the machine driver to probe and register the jack handler
in time to receive the first report from the interrupt handler. So
it is possible on some systems that the correct initial state was seen
simply because of lucky timing. Modular builds were more likely to
miss the reporting of the initial state.

Signed-off-by: Richard Fitzgerald <rf@opensource.cirrus.com>
Fixes: 4ca239f337 ("ASoC: cs42l42: Always enable TS_PLUG and TS_UNPLUG interrupts")
Link: https://lore.kernel.org/r/20211119124854.58939-1-rf@opensource.cirrus.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-11-22 15:40:32 +00:00
Pierre-Louis Bossart
405e52f412
ASoC: SOF: sof-pci-dev: use community key on all Up boards
There are already 3 versions of the Up boards with support for the SOF
community key (ApolloLake, WhiskyLake, TigerLake). Rather than
continue to add quirks for each version, let's add a wildcard.

For WHL and TGL, the authentication supports both the SOF community
key and the firmware signed with the Intel production key. Given two
choices, the community key is the preferred option to allow developers
to sign their own firmware. The firmware signed with production key
can still be selected if needed with a kernel module
option (snd-sof-pci.fw_path="intel/sof")

Tested-by: Péter Ujfalusi <peter.ujfalusi@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: Péter Ujfalusi <peter.ujfalusi@linux.intel.com>
Link: https://lore.kernel.org/r/20211119231327.211946-1-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-11-22 15:40:31 +00:00
Olivier Moysan
ac5e3efd55
ASoC: stm32: spdifrx: add pm_runtime support
Enable support of pm_runtime on STM32 SPDIFRX driver to allow
SPDIFRX power state monitoring.

Signed-off-by: Olivier Moysan <olivier.moysan@foss.st.com>
Link: https://lore.kernel.org/r/20211119104752.13564-4-olivier.moysan@foss.st.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-11-22 15:40:29 +00:00
Olivier Moysan
98e500a12f
ASoC: stm32: dfsdm: add pm_runtime support for audio
Enable support of pm_runtime on STM32 DFSDM audio driver
to allow power state monitoring.

Signed-off-by: Olivier Moysan <olivier.moysan@foss.st.com>
Link: https://lore.kernel.org/r/20211119104752.13564-3-olivier.moysan@foss.st.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-11-22 15:40:28 +00:00
Olivier Moysan
32a956a1fa
ASoC: stm32: i2s: add pm_runtime support
Enable support of pm_runtime on STM32 I2S driver to allow
I2S power state monitoring.

Signed-off-by: Olivier Moysan <olivier.moysan@foss.st.com>
Link: https://lore.kernel.org/r/20211119104752.13564-2-olivier.moysan@foss.st.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-11-22 15:40:27 +00:00
Ranjani Sridharan
05827a1537
ASoC: SOF: Intel: hda: free DAI widget during stop and suspend
To keep the widget use_counts balanced, free the DAI widget
during suspend and also during the stop trigger.

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Link: https://lore.kernel.org/r/20211119192621.4096077-11-kai.vehmanen@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-11-22 15:40:25 +00:00
Ranjani Sridharan
9ea807488c
ASoC: SOF: add support for dynamic pipelines with multi-core
This patch adds support for dynamic pipelines with multi-core
by using the platform-specific core_get/put() ops to
power up/down a core when a widget is set up/freed.

Along with this, a few redundant functions are removed:
1. sof_pipeline_core_enable() is no longer needed as the
pipeline core will be set up when the pipeline widget
is set up
2. sof_core_enable() is replaced with snd_sof_core_get()
4. core_power_up/down() DSP ops are deprecated and replaced with
core get/put ops.
5. Core power down in sof_widget_unload() during topology
removal is also removed as it is not really needed. For dynamic
pipelines, the cores will be powered off when they are not used.
For static pipelines, the cores will be powered off in the device
remove callback.

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Link: https://lore.kernel.org/r/20211119192621.4096077-10-kai.vehmanen@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-11-22 15:40:23 +00:00
Ranjani Sridharan
d416519982
ASoC: SOF: hda: don't use the core op for power up/power down
The core_power_up/down() ops will be deprecated. Use the
HDA platform-specific functions for powering up/down
the cores during probe/suspend/remove. The enabled_cores_mask
and the core ref_count's are manually updated in each of
these functions.

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Link: https://lore.kernel.org/r/20211119192621.4096077-9-kai.vehmanen@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-11-22 15:40:22 +00:00
Ranjani Sridharan
b2ebcf42a4
ASoC: SOF: free widgets in sof_tear_down_pipelines() for static pipelines
Free widgets for static pipelines in sof_tear_down_pipelines().
But this feature is unavailable in older firmware with ABI < 3.19.
Just reset widget use_count's for this case. This would ensure that
the secondary cores enabled required for topology setup are powered
down properly before the primary core is powered off during
system suspend.

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Link: https://lore.kernel.org/r/20211119192621.4096077-8-kai.vehmanen@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-11-22 15:40:21 +00:00
Ranjani Sridharan
7cc7b9ba21
ASoC: SOF: topology: remove sof_load_pipeline_ipc()
Remove the function sof_load_pipeline_ipc() and directly
send the IPC instead. The pipeline core is already enabled
with the call to sof_pipeline_core_enable() in sof_widget_setup().

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Link: https://lore.kernel.org/r/20211119192621.4096077-7-kai.vehmanen@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-11-22 15:40:20 +00:00
Ranjani Sridharan
9cdcbc9f67
ASoC: SOF: Intel: CNL/ICL/APL: set core_get/core_put ops
Set core_get/put ops for CNL/ICL platforms. These platforms
do not support enabling/disabling secondary cores
dynamically. So skip sending the IPC to power off the
cores in the core_put op.

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Link: https://lore.kernel.org/r/20211119192621.4096077-6-kai.vehmanen@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-11-22 15:40:19 +00:00
Ranjani Sridharan
41dd63cccb
ASoC: SOF: Intel: TGL: set core_get/put ops
Set core_get/put() ops for TGL. When core_get()
is requested for a core, its ref_count is incremented
and the PM_CORE_ENABLE IPC sent to the firmware to
power up the core if the current ref_count is 1.
Conversely, the ref_count is decremented in core_put()
and an IPC is sent to the DSP to power off the core
if the ref_count is 0.

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Link: https://lore.kernel.org/r/20211119192621.4096077-5-kai.vehmanen@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-11-22 15:40:18 +00:00
Ranjani Sridharan
c414d5df9d
ASoC: SOF: Add ops for core_get and core_put
Add ops to get/put a core that will be used to power
up/down a core along with incrementing/decrementing
its ref_count.

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Link: https://lore.kernel.org/r/20211119192621.4096077-4-kai.vehmanen@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-11-22 15:40:17 +00:00
Ranjani Sridharan
5974f68432
ASoC: SOF: Introduce num_cores and ref count per core
Add two fields num_cores and dsp_cores_ref_count to
struct snd_sof_dev. These will be used to maintain the
ref count for each core to determine when it should be
powered up or down.

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Link: https://lore.kernel.org/r/20211119192621.4096077-3-kai.vehmanen@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-11-22 15:40:16 +00:00
Ranjani Sridharan
81ed6770ba
ASoC: SOF: Intel: hda: expose get_chip_info()
expose get_chip_info().

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Link: https://lore.kernel.org/r/20211119192621.4096077-2-kai.vehmanen@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-11-22 15:40:15 +00:00
Daniel Baluta
3bf4cd8b74
ASoC: SOF: imx8m: Implement reset callback
Resume common flow (System PM / Runtime PM) is like this:

    sof_resume
      -> specific device resume
      -> snd_sof_load_firmware
         -> snd_sof_dsp_reset (1)
         -> load_modules()
      -> snd_sof_run_firmware (2)

    We need to implement dsp_reset callback (1) that will actually reset
    the DSP but keep it stalled.

    In order to implement this we do the following:
            -> put DSP into reset (assert CoreReset bit from PWRCTL)
            -> stall the DSP using RunStall bit from AudioDSP_REG2 mix
            -> take DSP out of reset (de-assert CoreReset bit from PWRCTL)

    At this moment the DSP is taken out of reset and Stalled! This means
    that we can load the firmware and then start the DSP (2).

    Until now we resetted the DSP by turning down the Audiomix PD. This
    doesn't work for Runtime PM if another IP is keeping Audiomix PD up.

    By introducing dsp_reset() we no longer rely on turning off the
    audiomix to reset the DSP.

Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com>
Reviewed-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/20211119094319.81674-6-daniel.baluta@oss.nxp.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-11-22 15:40:12 +00:00
Daniel Baluta
9ba23717b2
ASoC: SOF: imx8m: Implement DSP start
On i.MX8M DSP is controlled via a set of registers
from Audio MIX. This patches gets a reference (via regmap)
to Audio Mix registers and implements DSP start.

Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20211119094319.81674-5-daniel.baluta@oss.nxp.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-11-22 15:40:11 +00:00
Daniel Baluta
a73b493d8e
ASoC: SOF: imx8m: Add runtime PM / System PM support
We make use of common imx8m_suspend / imx8m_resume functions
for both system PM and runtime PM.

imx8m_suspend:
	- frees the MU channels
	- disables the clocks

imx8m_resume
	- enables the clocks
	- requests the MU channels

On i.MX8MP there is no dedicated functionality to put the DSP in reset.
The only way of doing this is to POWER DOWN the Audiomix domain.

We are able to do this because turning off the clocks and freeing the
channels makes the Audiomix to have no users thus PM kernel core turns
it down.

SOF core will not call system PM suspend handler if the DSP is already
down, but at resume it will call the system PM resume. So, we need to
keep track of the state via snd_sof_dsp_set_power_state

Few insights on how SOF core handles the PM:
 - SOF core uses PM runtime autosuspend (with a timeout of 2 secs)
 - at probe, SOF core boots the DSP and lets the PM runtime suspend to
   turn it off, if there is no activity
 - when someone opens the ALSA sound card (aplay/arecord, etc) ALSA core
   calls PM runtime resume to turn on the DSP
 - when the ALSA sound card is closed SOF core make use of PM subsystem
  to call PM runtime suspend and thus turning off the DSP.

Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20211119094319.81674-4-daniel.baluta@oss.nxp.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-11-22 15:40:10 +00:00
Daniel Baluta
6fc8515806
ASoC: SOF: imx8: Add runtime PM / System PM support
Handle clocks and mailbox channels at runtime suspend/resume
in order to save power.

DSP runtime PM uses a timeout of 2s. If device
is idle for 2s system will enter runtime suspend.

Because SOF state machine assumes that even if the DSP wasn't previously
active at a System resume, will re-load the firmware we need to make sure
that all needed resources are active.

Kernel core will take care of enabling the PD, we need to make sure that
we request the MU channels.

Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20211119094319.81674-3-daniel.baluta@oss.nxp.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-11-22 15:40:09 +00:00
Daniel Baluta
8253aa4700
ASoC: SOF: imx: Add code to manage DSP related clocks
We need at least 3 clocks in order to power up and access
DSP core registers found on i.MX8QM, i.MX8QXP and i.MX8MP
platforms.

Add code to request these clocks and enable them at probe. Next
patches will add PM support which will only activate clocks when
DSP is used.

DSP clocks are already documented in
Documentation/devicetree/bindings/dsp/fsl,dsp.yaml

We choose to add:
	* imx8_parse_clocks
	* imx8_enable_clocks
	* imx8_disable_clocks

wrappers because in the future DSP will need to take care about the
clocks of other related Audio IPs (e.g SAI, ESAI).

Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com>
Reviewed-by: Paul Olaru <paul.olaru@oss.nxp.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20211119094319.81674-2-daniel.baluta@oss.nxp.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-11-22 15:40:08 +00:00
Nicolas Frattaroli
428ee30a05
ASoC: rk817: Add module alias for rk817-codec
Without a module alias, autoloading the driver does not occurr
when it is built as a module.

By adding a module alias, the driver now probes fine automatically
and therefore analog audio output works as it should.

Fixes: 0d6a04da9b ("ASoC: Add Rockchip rk817 audio CODEC support")
Signed-off-by: Nicolas Frattaroli <frattaroli.nicolas@gmail.com>
Link: https://lore.kernel.org/r/20211121150521.159543-1-frattaroli.nicolas@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-11-22 15:40:03 +00:00
Hans de Goede
28c916ade1
ASoC: soc-acpi: Set mach->id field on comp_ids matches
Commit dac7cbd55d ("ASoC: Intel: soc-acpi-byt: shrink tables using
compatible IDs") and commit 959ae8215a ("ASoC: Intel: soc-acpi-cht:
shrink tables using compatible IDs") simplified the match tables in
soc-acpi-intel-byt-match.c and soc-acpi-intel-cht-match.c by merging
identical entries using the new .comp_ids snd_soc_acpi_mach field to
point a single entry to multiple ACPI HIDs and clearing the previously
unique per entry .id field.

But various machine drivers from sound/soc/intel/boards rely on mach->id
in one or more ways, e.g. some drivers contain the following snippets:

	adev = acpi_dev_get_first_match_dev(mach->id, NULL, -1);

	pkg_found = snd_soc_acpi_find_package_from_hid(mach->id, ...

	if (!strncmp(snd_soc_cards[i].codec_id, mach->id, 8)) { ...

All of which are broken by the match table shrinking.

Make the snd_soc_acpi_mach.id field non const (the storage for the tables
already is non const) and on a comps_ids match copy the matching HID to
the id field to fix this.

Fixes: dac7cbd55d ("ASoC: Intel: soc-acpi-byt: shrink tables using compatible IDs")
Fixes: 959ae8215a ("ASoC: Intel: soc-acpi-cht: shrink tables using compatible IDs")
Suggested-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Cc: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Cc: Brent Lu <brent.lu@intel.com>
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/20211118153014.349222-1-hdegoede@redhat.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-11-22 15:40:01 +00:00
Sameer Pujar
8cf72c4e75
ASoC: tegra: Fix kcontrol put callback in Mixer
The kcontrol put callback is expected to return 1 when there is change
in HW or when the update is acknowledged by driver. This would ensure
that change notifications are sent to subscribed applications. Filter
out duplicate updates in Mixer driver.

Fixes: 05bb3d5ec6 ("ASoC: tegra: Add Tegra210 based Mixer driver")
Signed-off-by: Sameer Pujar <spujar@nvidia.com>
Suggested-by: Jaroslav Kysela <perex@perex.cz>
Suggested-by: Mark Brown <broonie@kernel.org>
Reviewed-by: Takashi Iwai <tiwai@suse.de>
Link: https://lore.kernel.org/r/1637219231-406-17-git-send-email-spujar@nvidia.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-11-18 19:02:45 +00:00
Sameer Pujar
3c97881b8c
ASoC: tegra: Fix kcontrol put callback in ADX
The kcontrol put callback is expected to return 1 when there is change
in HW or when the update is acknowledged by driver. This would ensure
that change notifications are sent to subscribed applications. Filter
out duplicate updates in ADX driver.

Fixes: a99ab6f395 ("ASoC: tegra: Add Tegra210 based ADX driver")
Signed-off-by: Sameer Pujar <spujar@nvidia.com>
Suggested-by: Jaroslav Kysela <perex@perex.cz>
Suggested-by: Mark Brown <broonie@kernel.org>
Reviewed-by: Takashi Iwai <tiwai@suse.de>
Link: https://lore.kernel.org/r/1637219231-406-16-git-send-email-spujar@nvidia.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-11-18 19:02:43 +00:00
Sameer Pujar
8db78ace1b
ASoC: tegra: Fix kcontrol put callback in AMX
The kcontrol put callback is expected to return 1 when there is change
in HW or when the update is acknowledged by driver. This would ensure
that change notifications are sent to subscribed applications. Filter
out duplicate updates in AMX driver.

Fixes: 77f7df346c ("ASoC: tegra: Add Tegra210 based AMX driver")
Signed-off-by: Sameer Pujar <spujar@nvidia.com>
Suggested-by: Jaroslav Kysela <perex@perex.cz>
Suggested-by: Mark Brown <broonie@kernel.org>
Reviewed-by: Takashi Iwai <tiwai@suse.de>
Link: https://lore.kernel.org/r/1637219231-406-15-git-send-email-spujar@nvidia.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-11-18 19:02:42 +00:00
Sameer Pujar
b31f8febd1
ASoC: tegra: Fix kcontrol put callback in SFC
The kcontrol put callback is expected to return 1 when there is change
in HW or when the update is acknowledged by driver. This would ensure
that change notifications are sent to subscribed applications. Filter
out duplicate updates in SFC driver.

Fixes: b2f74ec53a ("ASoC: tegra: Add Tegra210 based SFC driver")
Signed-off-by: Sameer Pujar <spujar@nvidia.com>
Suggested-by: Jaroslav Kysela <perex@perex.cz>
Suggested-by: Mark Brown <broonie@kernel.org>
Reviewed-by: Takashi Iwai <tiwai@suse.de>
Link: https://lore.kernel.org/r/1637219231-406-14-git-send-email-spujar@nvidia.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-11-18 19:02:40 +00:00
Sameer Pujar
c7b34b51bb
ASoC: tegra: Fix kcontrol put callback in MVC
The kcontrol put callback is expected to return 1 when there is change
in HW or when the update is acknowledged by driver. This would ensure
that change notifications are sent to subscribed applications. Filter
out duplicate updates in MVC driver.

Fixes: e539891f96 ("ASoC: tegra: Add Tegra210 based MVC driver")
Signed-off-by: Sameer Pujar <spujar@nvidia.com>
Suggested-by: Jaroslav Kysela <perex@perex.cz>
Suggested-by: Mark Brown <broonie@kernel.org>
Reviewed-by: Takashi Iwai <tiwai@suse.de>
Link: https://lore.kernel.org/r/1637219231-406-13-git-send-email-spujar@nvidia.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-11-18 19:02:37 +00:00
Sameer Pujar
a4e37950c9
ASoC: tegra: Fix kcontrol put callback in AHUB
The kcontrol put callback is expected to return 1 when there is change
in HW or when the update is acknowledged by driver. This would ensure
that change notifications are sent to subscribed applications. Update
the AHUB driver accordingly.

Fixes: 16e1bcc2ca ("ASoC: tegra: Add Tegra210 based AHUB driver")
Signed-off-by: Sameer Pujar <spujar@nvidia.com>
Suggested-by: Jaroslav Kysela <perex@perex.cz>
Suggested-by: Mark Brown <broonie@kernel.org>
Reviewed-by: Takashi Iwai <tiwai@suse.de>
Link: https://lore.kernel.org/r/1637219231-406-12-git-send-email-spujar@nvidia.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-11-18 19:02:35 +00:00
Sameer Pujar
d6202a57e7
ASoC: tegra: Fix kcontrol put callback in DSPK
The kcontrol put callback is expected to return 1 when there is change
in HW or when the update is acknowledged by driver. This would ensure
that change notifications are sent to subscribed applications. Update
the DSPK driver accordingly.

Fixes: 327ef64702 ("ASoC: tegra: Add Tegra186 based DSPK driver")
Suggested-by: Jaroslav Kysela <perex@perex.cz>
Suggested-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Sameer Pujar <spujar@nvidia.com>
Reviewed-by: Takashi Iwai <tiwai@suse.de>
Link: https://lore.kernel.org/r/1637219231-406-11-git-send-email-spujar@nvidia.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-11-18 19:02:33 +00:00
Sameer Pujar
a347dfa102
ASoC: tegra: Fix kcontrol put callback in DMIC
The kcontrol put callback is expected to return 1 when there is change
in HW or when the update is acknowledged by driver. This would ensure
that change notifications are sent to subscribed applications. Update
the DMIC driver accordingly.

Fixes: 8c8ff982e9 ("ASoC: tegra: Add Tegra210 based DMIC driver")
Suggested-by: Jaroslav Kysela <perex@perex.cz>
Suggested-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Sameer Pujar <spujar@nvidia.com>
Reviewed-by: Takashi Iwai <tiwai@suse.de>
Link: https://lore.kernel.org/r/1637219231-406-10-git-send-email-spujar@nvidia.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-11-18 19:02:31 +00:00
Sameer Pujar
f21a9df3f7
ASoC: tegra: Fix kcontrol put callback in I2S
The kcontrol put callback is expected to return 1 when there is change
in HW or when the update is acknowledged by driver. This would ensure
that change notifications are sent to subscribed applications. Update
the I2S driver accordingly.

Fixes: c0bfa98349 ("ASoC: tegra: Add Tegra210 based I2S driver")
Suggested-by: Jaroslav Kysela <perex@perex.cz>
Suggested-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Sameer Pujar <spujar@nvidia.com>
Reviewed-by: Takashi Iwai <tiwai@suse.de>
Link: https://lore.kernel.org/r/1637219231-406-9-git-send-email-spujar@nvidia.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-11-18 19:02:29 +00:00
Sameer Pujar
e2b87a18a6
ASoC: tegra: Fix kcontrol put callback in ADMAIF
The kcontrol put callback is expected to return 1 when there is change
in HW or when the update is acknowledged by driver. This would ensure
that change notifications are sent to subscribed applications. Update
the ADMAIF driver accordingly.

Fixes: f74028e159 ("ASoC: tegra: Add Tegra210 based ADMAIF driver")
Suggested-by: Jaroslav Kysela <perex@perex.cz>
Suggested-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Sameer Pujar <spujar@nvidia.com>
Reviewed-by: Takashi Iwai <tiwai@suse.de>
Link: https://lore.kernel.org/r/1637219231-406-8-git-send-email-spujar@nvidia.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-11-18 19:02:25 +00:00
Sameer Pujar
6762965d02
ASoC: tegra: Fix wrong value type in MVC
The enum controls are expected to use enumerated value type.
Update relevant references in control get/put callbacks.

Fixes: e539891f96 ("ASoC: tegra: Add Tegra210 based MVC driver")
Suggested-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Sameer Pujar <spujar@nvidia.com>
Reviewed-by: Takashi Iwai <tiwai@suse.de>
Link: https://lore.kernel.org/r/1637219231-406-7-git-send-email-spujar@nvidia.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-11-18 19:02:23 +00:00
Sameer Pujar
42afca1a65
ASoC: tegra: Fix wrong value type in SFC
The enum controls are expected to use enumerated value type.
Update relevant references in control get/put callbacks.

Fixes: b2f74ec53a ("ASoC: tegra: Add Tegra210 based SFC driver")
Suggested-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Sameer Pujar <spujar@nvidia.com>
Reviewed-by: Takashi Iwai <tiwai@suse.de>
Link: https://lore.kernel.org/r/1637219231-406-6-git-send-email-spujar@nvidia.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-11-18 19:02:22 +00:00
Sameer Pujar
3aa0d5c8bb
ASoC: tegra: Fix wrong value type in DSPK
The enum controls are expected to use enumerated value type.
Update relevant references in control get/put callbacks.

Fixes: 327ef64702 ("ASoC: tegra: Add Tegra186 based DSPK driver")
Suggested-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Sameer Pujar <spujar@nvidia.com>
Reviewed-by: Takashi Iwai <tiwai@suse.de>
Link: https://lore.kernel.org/r/1637219231-406-5-git-send-email-spujar@nvidia.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-11-18 19:02:20 +00:00
Sameer Pujar
559d234569
ASoC: tegra: Fix wrong value type in DMIC
The enum controls are expected to use enumerated value type.
Update relevant references in control get/put callbacks.

Fixes: 8c8ff982e9 ("ASoC: tegra: Add Tegra210 based DMIC driver")
Suggested-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Sameer Pujar <spujar@nvidia.com>
Reviewed-by: Takashi Iwai <tiwai@suse.de>
Link: https://lore.kernel.org/r/1637219231-406-4-git-send-email-spujar@nvidia.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-11-18 19:02:19 +00:00
Sameer Pujar
8a2c2fa0c5
ASoC: tegra: Fix wrong value type in I2S
The enum controls are expected to use enumerated value type.
Update relevant references in control get/put callbacks.

Fixes: c0bfa98349 ("ASoC: tegra: Add Tegra210 based I2S driver")
Suggested-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Sameer Pujar <spujar@nvidia.com>
Reviewed-by: Takashi Iwai <tiwai@suse.de>
Link: https://lore.kernel.org/r/1637219231-406-3-git-send-email-spujar@nvidia.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-11-18 19:02:17 +00:00
Sameer Pujar
884c6cb3b7
ASoC: tegra: Fix wrong value type in ADMAIF
The enum controls are expected to use enumerated value type.
Update relevant references in control get/put callbacks.

Fixes: f74028e159 ("ASoC: tegra: Add Tegra210 based ADMAIF driver")
Suggested-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Sameer Pujar <spujar@nvidia.com>
Reviewed-by: Takashi Iwai <tiwai@suse.de>
Link: https://lore.kernel.org/r/1637219231-406-2-git-send-email-spujar@nvidia.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-11-18 19:02:16 +00:00
Mark Brown
626a3dfbdb
ASoC: SOF: Add support for Mediatek MT8195
Merge series from Daniel Baluta <daniel.baluta@oss.nxp.com>:

This adds sound open firmware driver support for MT8915 platform.
2021-11-18 18:57:42 +00:00
Takashi Iwai
547a4a6a96 ASoC: Fixes for v5.16
A relatively large collection of fixes that came in since the merge
 window, though a lot of this is just a collection of new machine quirks
 for x86 platforms.
 -----BEGIN PGP SIGNATURE-----
 
 iQEzBAABCgAdFiEEreZoqmdXGLWf4p/qJNaLcl1Uh9AFAmGWia4ACgkQJNaLcl1U
 h9AuuAf/TPwNM1j0UZ6koQk5OD9vvUewDvw98ToVJjU4B15CRywVsZScsH4FTWjJ
 u+3NOHM5VKIwJGu2JpLo9r+KHfyA1zbsaNzptuUoJLB7SIqs3/PmV1eyOcgBI8ac
 lTfDUMMuzJyKh34tvOBegUVhWENiUbN+QG1zxtHmW8Cx6/O8RUlu9KdO+08k2HVC
 Vht2NjUOjcQTQjpQvDZijE8/XOROj4XUu0P3WhyMm7gtclX+rofcp0j4yFB7GIua
 IgRMsbQZpJGjN2EJUQ7uOfIWMrgOvByMeqCYcWqsh01LV9cCurRYetBc/L5jtp/c
 IokFW4FcZrhCtDNqBWVLuwgKGummEw==
 =YGth
 -----END PGP SIGNATURE-----

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

ASoC: Fixes for v5.16

A relatively large collection of fixes that came in since the merge
window, though a lot of this is just a collection of new machine quirks
for x86 platforms.
2021-11-18 18:57:41 +01:00
Srinivasa Rao Mandadapu
b38892b5b8
ASoC: codecs: MBHC: Remove useless condition check
Remove redundant conditional check and clean code in special
headset support functions.

Signed-off-by: Srinivasa Rao Mandadapu <srivasam@codeaurora.org>
Co-developed-by: Venkata Prasad Potturu <potturu@codeaurora.org>
Signed-off-by: Venkata Prasad Potturu <potturu@codeaurora.org>
Link: https://lore.kernel.org/r/1637234411-554-1-git-send-email-srivasam@codeaurora.org
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-11-18 13:57:45 +00:00
YC Hung
163fa3a592
ASoC: SOF: mediatek: Add DSP system PM callback for mt8195
Add DSP system PM callback for suspend and resume

Signed-off-by: YC Hung <yc.hung@mediatek.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Daniel Baluta <daniel.baluta@nxp.com>
Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com>
Link: https://lore.kernel.org/r/20211118100749.54628-9-daniel.baluta@oss.nxp.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-11-18 13:57:43 +00:00
YC Hung
424d6d1a9a
ASoC: SOF: mediatek: Add mt8195 dsp clock support
Add adsp clock on/off support on mt8195 platform.

Signed-off-by: YC Hung <yc.hung@mediatek.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Daniel Baluta <daniel.baluta@nxp.com>
Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com>
Link: https://lore.kernel.org/r/20211118100749.54628-8-daniel.baluta@oss.nxp.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-11-18 13:57:42 +00:00
YC Hung
24d75049c5
ASoC: SOF: mediatek: Add dai driver dsp ops callback for mt8195
Add dsp ops callback to register AFE DL2/DL3/UL4/UL5 sof dai's with ALSA

Signed-off-by: YC Hung <yc.hung@mediatek.com>
Reviewed-by: Péter Ujfalusi <peter.ujfalusi@linux.intel.com>
Reviewed-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Reviewed-by: Daniel Baluta <daniel.baluta@nxp.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com>
Link: https://lore.kernel.org/r/20211118100749.54628-7-daniel.baluta@oss.nxp.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-11-18 13:57:41 +00:00
YC Hung
24281bc2bf
ASoC: SOF: Add mt8195 device descriptor
Add SOF device and DT descriptor for Mediatek mt8195 platform.

Signed-off-by: YC Hung <yc.hung@mediatek.com>
Reviewed-by: Péter Ujfalusi <peter.ujfalusi@linux.intel.com>
Reviewed-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: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
Reviewed-by: Daniel Baluta <daniel.baluta@nxp.com>
Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com>
Link: https://lore.kernel.org/r/20211118100749.54628-6-daniel.baluta@oss.nxp.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-11-18 13:57:40 +00:00
YC Hung
b7f6503830
ASoC: SOF: mediatek: Add fw loader and mt8195 dsp ops to load firmware
Add mt8195-loader module with ops callback to load and run firmware
on mt8195 platform.

Signed-off-by: YC Hung <yc.hung@mediatek.com>
Reviewed-by: Péter Ujfalusi <peter.ujfalusi@linux.intel.com>
Reviewed-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: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
Reviewed-by: Daniel Baluta <daniel.baluta@nxp.com>
Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com>
Link: https://lore.kernel.org/r/20211118100749.54628-5-daniel.baluta@oss.nxp.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-11-18 13:57:39 +00:00
YC Hung
b72bfcffcf
ASoC: SOF: topology: Add support for Mediatek AFE DAI
Add new sof dai and config to pass topology file configuration
to SOF firmware running on Mediatek platform DSP core.
Add mediatek audio front end(AFE) to the list of supported sof_dais

Signed-off-by: YC Hung <yc.hung@mediatek.com>
Reviewed-by: Péter Ujfalusi <peter.ujfalusi@linux.intel.com>
Reviewed-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: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
Reviewed-by: Daniel Baluta <daniel.baluta@nxp.com>
Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com>
Link: https://lore.kernel.org/r/20211118100749.54628-4-daniel.baluta@oss.nxp.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-11-18 13:57:37 +00:00
YC Hung
32d7e03d26
ASoC: SOF: mediatek: Add mt8195 hardware support
This patch initialize to support SOF on Mediatek mt8195 platform.
MT8195 has four Cortex A78 cores paired with four Cortex A55 cores.
It also has Cadence HiFi-4 DSP single core. There are shared DRAM and
mailbox interrupt between AP and DSP to use for IPC communication.

Signed-off-by: YC Hung <yc.hung@mediatek.com>
Reviewed-by: Péter Ujfalusi <peter.ujfalusi@linux.intel.com>
Reviewed-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: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
Reviewed-by: Daniel Baluta <daniel.baluta@nxp.com>
Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com>
Link: https://lore.kernel.org/r/20211118100749.54628-2-daniel.baluta@oss.nxp.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-11-18 13:57:35 +00:00
Mark Brown
b6a5f4f055
ASoC: SOF: Platform updates for AMD and Mediatek
Merge series from Daniel Baluta <daniel.baluta@oss.nxp.com>:

This patchseries adds AMD Renoir ACP HW support.
2021-11-17 22:29:46 +00:00
Mark Brown
745a8e7cbe
ASoC: SOF: New debug feature: IPC message injector
Merge series from Daniel Baluta <daniel.baluta@oss.nxp.com>:

Add a test/debug feature allowing IPC messages to the DSP to be injected
via debugfs.
2021-11-17 22:29:45 +00:00
Mark Brown
63eb462623
ASoC: cs42l42: Remove redundant code
Merge series from Richard Fitzgerald <rf@opensource.cirrus.com>:

Cleanups and code clarifications for the cs42l42 driver.
2021-11-17 22:29:44 +00:00
Charles Keepax
f444da38ac
firmware: cs_dsp: Add offset to cs_dsp read/write
Provide a mechanism to access only part of a control through the cs_dsp
interface.

Signed-off-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Link: https://lore.kernel.org/r/20211117132300.1290-9-ckeepax@opensource.cirrus.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-11-17 22:16:27 +00:00
Charles Keepax
56717d72f7
ASoC: wm_adsp: Remove the wmfw_add_ctl helper function
The helper function wmfw_add_ctl is only called from one place and that
place is a function with only 2 lines of code. Merge the helper function
into the work function to simplify the code.

Signed-off-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Link: https://lore.kernel.org/r/20211117132300.1290-1-ckeepax@opensource.cirrus.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-11-17 22:16:19 +00:00
Ajit Kumar Pandey
f063eba3e7
ASoC: SOF: amd: Add support for SOF firmware authentication
Add callback to notify PSP after loading firmware on DSP. PSP will
validate the loaded firmware and set qualifier bit to run firmware
on secured AMD systems.

Signed-off-by: Julian Schroeder <Julian.Schroeder@amd.com>
Signed-off-by: Ajit Kumar Pandey <AjitKumar.Pandey@amd.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: Curtis Malainey <curtis@malainey.com>
Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com>
Link: https://lore.kernel.org/r/20211117093734.17407-14-daniel.baluta@oss.nxp.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-11-17 17:35:56 +00:00
V sujith kumar Reddy
4627421fb8
ASoC: SOF: amd: Add trace logger support
Add trace support and configure trace stream for ACP firmware.

Signed-off-by: Vishnuvardhanrao Ravuapati <vishnuvardhanrao.ravulapati@amd.com>
Signed-off-by: V sujith kumar Reddy <vsreddy@amd.com>
Reviewed-by: Bard Liao <bard.liao@intel.com>
Reviewed-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com>
Link: https://lore.kernel.org/r/20211117093734.17407-13-daniel.baluta@oss.nxp.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-11-17 17:35:55 +00:00
Ajit Kumar Pandey
efb931cdc4
ASoC: SOF: topology: Add support for AMD ACP DAIs
Add new sof dais and config to pass topology file configuration
to SOF firmware running on ACP's DSP core. ACP firmware support
I2S_BT, I2S_SP and DMIC controller hence add three new dais to
the list of supported sof_dais

Signed-off-by: Ajit Kumar Pandey <AjitKumar.Pandey@amd.com>
Reviewed-by: Bard Liao <bard.liao@intel.com>
Reviewed-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com>
Link: https://lore.kernel.org/r/20211117093734.17407-12-daniel.baluta@oss.nxp.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-11-17 17:35:54 +00:00
Ajit Kumar Pandey
63fba90fc8
ASoC: amd: acp-config: Remove legacy acpi based machine struct
We have moved legacy based machine struct into platform driver to
resolve module dependency with non-SOF ALSA build, hence removed
it from acp-config driver module.

Signed-off-by: Ajit Kumar Pandey <AjitKumar.Pandey@amd.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com>
Link: https://lore.kernel.org/r/20211117093734.17407-11-daniel.baluta@oss.nxp.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-11-17 17:35:53 +00:00
Ajit Kumar Pandey
ec25a3b142
ASoC: SOF: amd: Add Renoir PCI driver interface
Add PCI driver module to enable sof pci device support for Renoir.
If machine flag set to FLAG_SOF_ONLY_DMIC this pci driver register
platform device for non dsp based I2S platform device. If machine
flag is not enabled for SOF pci probe will return without invoking
sof device probe and registration

Signed-off-by: Ajit Kumar Pandey <AjitKumar.Pandey@amd.com>
Reviewed-by: Bard Liao <bard.liao@intel.com>
Reviewed-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com>
Link: https://lore.kernel.org/r/20211117093734.17407-10-daniel.baluta@oss.nxp.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-11-17 17:35:52 +00:00
Ajit Kumar Pandey
11ddd4e371
ASoC: SOF: amd: Add machine driver dsp ops for Renoir platform
Add dsp ops callback to select and register machine driver.

Signed-off-by: Ajit Kumar Pandey <AjitKumar.Pandey@amd.com>
Reviewed-by: Bard Liao <bard.liao@intel.com>
Reviewed-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com>
Link: https://lore.kernel.org/r/20211117093734.17407-9-daniel.baluta@oss.nxp.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-11-17 17:35:51 +00:00
Ajit Kumar Pandey
f1bdd8d385
ASoC: amd: Add module to determine ACP configuration
ACP hw block configuration differs across various distributions
and hence it's required to register different drivers module for
distributions. For now we support three ACP drivers:

* ACP without SOF use case
* ACP with SOF use case
* ACP with SOF use case for DMIC and non SOF for I2S endpoints

As all above driver registers with common PCI ID for ACP hw block
we need code to determine ACP configuration and auto select driver
module. This patch expose function that return configuration flag
based on dmi checks for a system. ACP driver module probe register
platform device based on such configuration flag to avoid conflict
with other ACP drivers probed for same PCI ID.

Signed-off-by: Ajit Kumar Pandey <AjitKumar.Pandey@amd.com>
Reviewed-by: Bard Liao <bard.liao@intel.com>
Reviewed-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com>
Link: https://lore.kernel.org/r/20211117093734.17407-8-daniel.baluta@oss.nxp.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-11-17 17:35:50 +00:00
Ajit Kumar Pandey
e8afccf8fb
ASoC: SOF: amd: Add PCM stream callback for Renoir dai's
Add module to support ALSA pcm stream configurations for ACP I2S
and DMIC endpoints

Signed-off-by: Ajit Kumar Pandey <AjitKumar.Pandey@amd.com>
Reviewed-by: Bard Liao <bard.liao@intel.com>
Reviewed-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com>
Link: https://lore.kernel.org/r/20211117093734.17407-7-daniel.baluta@oss.nxp.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-11-17 17:35:49 +00:00
Ajit Kumar Pandey
bda93076d1
ASoC: SOF: amd: Add dai driver dsp ops callback for Renoir
Add dsp ops callback to register I2S and DMIC sof dai's with ALSA

Signed-off-by: Ajit Kumar Pandey <AjitKumar.Pandey@amd.com>
Reviewed-by: Bard Liao <bard.liao@intel.com>
Reviewed-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com>
Link: https://lore.kernel.org/r/20211117093734.17407-6-daniel.baluta@oss.nxp.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-11-17 17:35:48 +00:00
Ajit Kumar Pandey
738a2b5e2c
ASoC: SOF: amd: Add IPC support for ACP IP block
Add IPC module for generic ACP block and exposed ops callback for
to synchronize SOF IPC message between host and DSP

Signed-off-by: Balakishore Pati <Balakishore.pati@amd.com>
Signed-off-by: Ajit Kumar Pandey <AjitKumar.Pandey@amd.com>
Reviewed-by: Bard Liao <bard.liao@intel.com>
Reviewed-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com>
Link: https://lore.kernel.org/r/20211117093734.17407-5-daniel.baluta@oss.nxp.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-11-17 17:35:47 +00:00
Ajit Kumar Pandey
7e51a9e38a
ASoC: SOF: amd: Add fw loader and renoir dsp ops to load firmware
Add acp-loader module with ops callback to load and run firmware
on ACP DSP block on Renoir platform.

Signed-off-by: Ajit Kumar Pandey <AjitKumar.Pandey@amd.com>
Reviewed-by: Bard Liao <bard.liao@intel.com>
Reviewed-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com>
Link: https://lore.kernel.org/r/20211117093734.17407-4-daniel.baluta@oss.nxp.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-11-17 17:35:46 +00:00
Ajit Kumar Pandey
0e44572a28
ASoC: SOF: amd: Add helper callbacks for ACP's DMA configuration
ACP DMA is used for loading SOF firmware into DSP memory and data
transfer from system memory to DSP memory. Add helper callbacks to
initialize and configure ACP DMA block for fw loading.

Signed-off-by: Vijendar Mukunda <Vijendar.Mukunda@amd.com>
Signed-off-by: Ajit Kumar Pandey <AjitKumar.Pandey@amd.com>
Reviewed-by: Bard Liao <bard.liao@intel.com>
Reviewed-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com>
Link: https://lore.kernel.org/r/20211117093734.17407-3-daniel.baluta@oss.nxp.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-11-17 17:35:45 +00:00
Ajit Kumar Pandey
846aef1d7c
ASoC: SOF: amd: Add Renoir ACP HW support
This patch initializes ACP HW block to support SOF on
AMD Renoir platform.

Signed-off-by: Ajit Kumar Pandey <AjitKumar.Pandey@amd.com>
Reviewed-by: Bard Liao <bard.liao@intel.com>
Reviewed-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com>
Link: https://lore.kernel.org/r/20211117093734.17407-2-daniel.baluta@oss.nxp.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-11-17 17:35:44 +00:00
Olivier Moysan
7fabe7fed1
ASoC: stm32: sai: increase channels_max limit
The SAI peripheral supports up to 16 channels in TDM mode (8L+8R).
The driver currently supports TDM over two channels.
Increase SAI DAI playback/record channels_max,
to also allow up to 16 channels in TDM mode.

Signed-off-by: Olivier Moysan <olivier.moysan@st.com>
Link: https://lore.kernel.org/r/20211117110031.19345-1-olivier.moysan@foss.st.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-11-17 13:04:53 +00:00
Peter Ujfalusi
2f0b1b013b
ASoC: SOF: debug: Add support for IPC message injection
In order to stress test the firmware's ability to handle (mis)crafted
IPC messages this patch adds a debugfs interface where a binary file
(message) can be written and the message is sent to the firmware as it is.

Read on the same file will return the reply from the firmware if it is
available as a binary.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
Reviewed-by: Rander Wang <rander.wang@intel.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com>
Link: https://lore.kernel.org/r/20211116152137.52129-5-daniel.baluta@oss.nxp.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-11-17 13:04:51 +00:00
Peter Ujfalusi
0bd2891bda
ASoC: SOF: intel: Use the generic helper to get the reply
Make use of the generic snd_sof_ipc_process_reply() from the core instead
the local implementation.
snd_sof_ipc_process_reply() handles the reply retrieving and the ipc reply

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
Reviewed-by: Rander Wang <rander.wang@intel.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com>
Link: https://lore.kernel.org/r/20211116152137.52129-4-daniel.baluta@oss.nxp.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-11-17 13:04:50 +00:00
Peter Ujfalusi
18c45f2703
ASoC: SOF: imx: Use the generic helper to get the reply
Make use of the generic snd_sof_ipc_process_reply() from the core instead
the local implementation.
snd_sof_ipc_process_reply() handles the reply retrieving and the ipc reply

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
Reviewed-by: Rander Wang <rander.wang@intel.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com>
Link: https://lore.kernel.org/r/20211116152137.52129-3-daniel.baluta@oss.nxp.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-11-17 13:04:49 +00:00
Peter Ujfalusi
8ae77801c8
ASoC: SOF: utils: Add generic function to get the reply for a tx message
The code to get the reply for a tx is identical in all but one place:
imx8_get_reply(), imx8m_get_reply(), atom_get_reply(), bdw_get_reply().

hda_dsp_ipc_get_reply() have additional check in place for PROBES and
special handling of PM messages.

Add a generic implementation to the core which can be used as drop in
replacement.

The reply size check is changed to be able to handle cases when the reply
size is not know beforehand (this is the case for PROBES and
DEBUG_MEM_USAGE for example).

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
Reviewed-by: Rander Wang <rander.wang@intel.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com>
Link: https://lore.kernel.org/r/20211116152137.52129-2-daniel.baluta@oss.nxp.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-11-17 13:04:48 +00:00
Richard Fitzgerald
bbf0e1d365
ASoC: cs42l42: Remove redundant pll_divout member
Now that struct cs42l42_private has pll_config, the current PLL
configuration can be looked up directly in pll_ratio_table. This
makes the pll_divout member of cs42l42_private redundant since it
was only a copy of the value from pll_ratio_table.

Signed-off-by: Richard Fitzgerald <rf@opensource.cirrus.com>
Link: https://lore.kernel.org/r/20211116163901.45390-5-rf@opensource.cirrus.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-11-17 13:04:46 +00:00
Richard Fitzgerald
3edde6de09
ASoC: cs42l42: Simplify reporting of jack unplug
When reporting a jack unplug there's no need to make the reported
flags conditional on which flags were reported during the plug
event. It's perfectly safe to report all flags and buttons as
not-present and let the higher code filter for changes.

There's also no need to make two separate snd_soc_jack_report()
calls for presence flags and button flags. It can all be done in
one report.

Signed-off-by: Richard Fitzgerald <rf@opensource.cirrus.com>
Link: https://lore.kernel.org/r/20211116163901.45390-4-rf@opensource.cirrus.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-11-17 13:04:45 +00:00
Richard Fitzgerald
f2dfbaaa54
ASoC: cs42l42: Remove redundant writes to RS_PLUG/RS_UNPLUG masks
The RS_PLUG and RS_UNPLUG interrupt masks are always written as 1 so
those writes are redundant and can be deleted.

This makes it completely clear in the code that only the TS_PLUG and
TS_UNPLUG masks are being changed.

Signed-off-by: Richard Fitzgerald <rf@opensource.cirrus.com>
Link: https://lore.kernel.org/r/20211116163901.45390-3-rf@opensource.cirrus.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-11-17 13:04:44 +00:00
Richard Fitzgerald
976001b10f
ASoC: cs42l42: Remove redundant writes to DETECT_MODE
There are multiple places where DETECT_MODE is included in a register
write, but in every case it is written as 0. Removing these redundant
writes makes the code less cluttered and also makes it obvious that
DETECT_MODE is never changed.

A single initialization to 0 is added to cs42l42_setup_hs_type_detect().

Signed-off-by: Richard Fitzgerald <rf@opensource.cirrus.com>
Link: https://lore.kernel.org/r/20211116163901.45390-2-rf@opensource.cirrus.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-11-17 13:04:43 +00:00
Olivier Moysan
424fe7edbe
ASoC: stm32: i2s: fix 32 bits channel length without mclk
Fix divider calculation in the case of 32 bits channel
configuration, when no master clock is used.

Fixes: e4e6ec7b12 ("ASoC: stm32: Add I2S driver")

Signed-off-by: Olivier Moysan <olivier.moysan@foss.st.com>
Link: https://lore.kernel.org/r/20211117104404.3832-1-olivier.moysan@foss.st.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-11-17 13:04:38 +00:00
Pierre-Louis Bossart
7548a391c5
ASoC: SOF: i.MX: simplify Kconfig
Follow the Intel example and simplify the Kconfig
a) start from the end-product for 'select' chains
b) use 'depends on' to filter out configurations.
c) use snd-sof-of as a common module without any 'select'

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Daniel Baluta <daniel.baluta@nxp.com>
Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com>
Link: https://lore.kernel.org/r/20211116124131.46414-1-daniel.baluta@oss.nxp.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-11-16 14:29:59 +00:00
Srinivas Kandagatla
5f55c9693a
ASoC: qcom: sdm845: only setup slim ports once
Currently same slim channel map setup for every dai link, which is redundant.
Fix this by adding a flag and conditionally setting these channel maps.

Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Link: https://lore.kernel.org/r/20211116115021.14213-1-srinivas.kandagatla@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-11-16 14:29:58 +00:00
Srinivas Kandagatla
cb04d8cd0b
ASoC: codecs: lpass-rx-macro: fix HPHR setting CLSH mask
For some reason we ended up using snd_soc_component_write_field
for HPHL and snd_soc_component_update_bits for HPHR, so fix this.

Fixes: af3d54b997 ("ASoC: codecs: lpass-rx-macro: add support for lpass rx macro")
Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Link: https://lore.kernel.org/r/20211116114623.11891-4-srinivas.kandagatla@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-11-16 14:29:53 +00:00
Srinivas Kandagatla
006ea27c4e
ASoC: codecs: wcd934x: return error code correctly from hw_params
Error returned from wcd934x_slim_set_hw_params() are not passed to upper layer,
this could be misleading to the user which can start sending stream leading
to unnecessary errors.

Fix this by properly returning the errors.

Fixes: a61f3b4f47 ("ASoC: wcd934x: add support to wcd9340/wcd9341 codec")
Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Link: https://lore.kernel.org/r/20211116114623.11891-3-srinivas.kandagatla@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-11-16 14:29:52 +00:00
Srinivas Kandagatla
ea157c2ba8
ASoC: codecs: wcd938x: fix volatile register range
Interrupt Clear registers WCD938X_INTR_CLEAR_0 -  WCD938X_INTR_CLEAR_2
are not marked as volatile. This has resulted in a missing interrupt bug
while performing runtime pm. regcache_sync() during runtime pm resume path
will write to Interrupt clear registers with previous values which basically
clears the pending interrupt and actual interrupt handler never sees this
interrupt.

This issue is more visible with headset plug-in plug-out case compared to
headset button.

Fix this by adding the Interrupt clear registers to volatile range

Fixes: 8d78602aa8 ("ASoC: codecs: wcd938x: add basic driver")
Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Link: https://lore.kernel.org/r/20211116114623.11891-2-srinivas.kandagatla@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-11-16 14:29:51 +00:00
Takashi Iwai
7e567b5ae0
ASoC: topology: Add missing rwsem around snd_ctl_remove() calls
snd_ctl_remove() has to be called with card->controls_rwsem held (when
called after the card instantiation).  This patch add the missing
rwsem calls around it.

Fixes: 8a9782346d ("ASoC: topology: Add topology core")
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Link: https://lore.kernel.org/r/20211116071812.18109-1-tiwai@suse.de
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-11-16 14:29:50 +00:00
Srinivas Kandagatla
6712c2e18c
ASoC: qdsp6: q6routing: validate port id before setting up route
Validate port id before it starts sending commands to dsp this would
make error handling simpler.

Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Link: https://lore.kernel.org/r/20211116114721.12517-6-srinivas.kandagatla@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-11-16 14:29:49 +00:00
Srinivas Kandagatla
0a270471d6
ASoC: qdsp6: q6adm: improve error reporting
reset value for port is -1 so printing an hex would not give us very
useful debug information, so use %d instead.

Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Link: https://lore.kernel.org/r/20211116114721.12517-5-srinivas.kandagatla@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-11-16 14:29:48 +00:00
Srinivas Kandagatla
721a94b435
ASoC: qdsp6: q6asm: fix q6asm_dai_prepare error handling
Error handling in q6asm_dai_prepare() seems to be completely broken,
Fix this by handling it properly.

Fixes: 2a9e92d371 ("ASoC: qdsp6: q6asm: Add q6asm dai driver")
Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Link: https://lore.kernel.org/r/20211116114721.12517-4-srinivas.kandagatla@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-11-16 14:29:45 +00:00
Srinivas Kandagatla
861afeac79
ASoC: qdsp6: q6routing: Conditionally reset FrontEnd Mixer
Stream IDs are reused across multiple BackEnd mixers, do not reset the
stream mixers if they are not already set for that particular FrontEnd.

Ex:
amixer cset iface=MIXER,name='SLIMBUS_0_RX Audio Mixer MultiMedia1' 1

would set the MultiMedia1 steam for SLIMBUS_0_RX, however doing below
command will reset previously setup MultiMedia1 stream, because both of them
are using MultiMedia1 PCM stream.

amixer cset iface=MIXER,name='SLIMBUS_2_RX Audio Mixer MultiMedia1' 0

reset the FrontEnd Mixers conditionally to fix this issue.

This is more noticeable in desktop setup, where in alsactl tries to restore
the alsa state and overwriting the previous mixer settings.

Fixes: e3a33673e8 ("ASoC: qdsp6: q6routing: Add q6routing driver")
Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Link: https://lore.kernel.org/r/20211116114721.12517-3-srinivas.kandagatla@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-11-16 14:29:44 +00:00
Srinivas Kandagatla
2f20640491
ASoC: qdsp6: qdsp6: q6prm: handle clk disable correctly
Q6PRM clks need to be disabled using PRM_CMD_RELEASE_HW_RSC dsp command
rather then using PRM_CMD_RSP_REQUEST_HW_RSC cmd with rate set to zero.

DSP will throw errors if we try to disable the clock using existing code.

Fix this by properly handling the clk release.

Fixes: 9a0e5d6fb1 ("ASoC: qdsp6: audioreach: add q6prm support")
Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Link: https://lore.kernel.org/r/20211116114721.12517-2-srinivas.kandagatla@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-11-16 14:29:43 +00:00
Srinivasa Rao Mandadapu
3c8a3ad401
ASoC: codecs: MBHC: Add support for special headset
Update MBHC driver to support special headset such as apple
and huwawei headsets.

Signed-off-by: Srinivasa Rao Mandadapu <srivasam@codeaurora.org>
Co-developed-by: Venkata Prasad Potturu <potturu@codeaurora.org>
Signed-off-by: Venkata Prasad Potturu <potturu@codeaurora.org>
Reviewed-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Link: https://lore.kernel.org/r/1636960288-27537-1-git-send-email-srivasam@codeaurora.org
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-11-15 23:33:49 +00:00
Simon Trimmer
a6e849d000
ASoC: wm_adsp: wm_adsp_control_add() error: uninitialized symbol 'ret'
This patch fixes the static analysis warning as it is correctly
indicating a possible code path, it cannot know that for the affected
firmware versions subname would always be NULL.

Reported-by: kernel test robot <lkp@intel.com>
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Simon Trimmer <simont@opensource.cirrus.com>
Acked-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Link: https://lore.kernel.org/r/20211115120154.56782-1-simont@opensource.cirrus.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-11-15 21:33:41 +00:00
Peter Ujfalusi
5b59289bfd
ASoC: SOF: core: Unregister machine driver before IPC and debugfs
To ensure clean unload of the machine driver, components and topology, do
the unregister before we free IPC and debugfs.

It is a possibility that part of the unregister we would have IPC
communication with the firmware.

Suggested-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
Reviewed-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/20211102094756.9317-1-peter.ujfalusi@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-11-15 19:25:27 +00:00
Maíra Canal
5dbec393cd
ASoC: adau1701: Replace legacy gpio interface for gpiod
Considering the current transition of the GPIO subsystem, remove all
dependencies of the legacy GPIO interface (linux/gpio.h and linux
/of_gpio.h) and replace it with the descriptor-based GPIO approach.

Signed-off-by: Maíra Canal <maira.canal@usp.br>
Link: https://lore.kernel.org/r/YXWo/9o7ye9a11aR@fedora
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-11-15 19:25:25 +00:00
Richard Fitzgerald
7ec4a058c1
ASoC: cs42l42: Add control for audio slow-start switch
This adds an ALSA control so that the slow-start audio ramp feature
can be disabled. This is useful for high-definition audio applications.

The register field is unusual in that it is a 3-bit field with only
two valid values, 000=off and 111=on.

Signed-off-by: Richard Fitzgerald <rf@opensource.cirrus.com>
Link: https://lore.kernel.org/r/20211101101006.13092-1-rf@opensource.cirrus.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-11-15 19:25:23 +00:00
Mac Chiang
8d0872f623
ASoC: Intel: add sof-nau8825 machine driver
The machine driver is a generic machine driver for SOF with nau8825
codec w or w/o speaker additionally. Depending on the SOC
HDMI, DMIC, Bluetooth offload support are added dynamically.

Only add information related to SOF since the machine driver was
only tested with SOF.

There are currently 4 i2s machine variants of ADL.
This supports the headphone NUA8825(SSP0) alone or with smart or dumb
speakers.
Board 2,3,4 use SSP2 for Bluetooth offload support except board 1.

Board 1 : NAU8825 + RT1019P(SSP2)
Board 2 : NAU8825 + MAX98373(SSP1)
Board 3 : NAU8825 + MAX98360A(SSP1)
Board 4 : NAU8825

Signed-off-by: David Lin <CTLIN0@nuvoton.com>
Co-developed-by: Mac Chiang <mac.chiang@intel.com>
Signed-off-by: Mac Chiang <mac.chiang@intel.com>
Acked-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20211109133808.8729-1-mac.chiang@intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-11-15 19:25:22 +00:00
Christophe JAILLET
95cead0686
ASoC: codecs: Axe some dead code in 'wcd_mbhc_adc_hs_rem_irq()'
'hphpa_on' is know to be false, so this is just dead code that should be
removed.

Suggested-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Reviewed-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Link: https://lore.kernel.org/r/57a89cc31eb2312addd3c77896d7df8206aef138.1635967035.git.christophe.jaillet@wanadoo.fr
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-11-15 19:25:21 +00:00
David Rhodes
bae9e13fc5
ASoC: cs35l41: DSP Support
Support for HALO DSP and firmware

Signed-off-by: David Rhodes <drhodes@opensource.cirrus.com>
Reviewed-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Link: https://lore.kernel.org/r/20211029214028.401284-2-drhodes@opensource.cirrus.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-11-15 19:25:20 +00:00
Mark Brown
0c61ac2786
Merge series "ASoC: Intel: sof_sdw: Use fixed DAI link id" from Bard Liao <yung-chuan.liao@linux.intel.com>:
This series provides a way to use constant dailink numbers for different
devices. So that we don't need to renumber them in topologies.
Some patches with different purpose are sent together in this series
since they are dependent.

Bard Liao (8):
  ASoC: intel: sof_sdw: return the original error number
  ASoC: intel: sof_sdw: rename be_index/link_id to link_index
  ASoC: intel: sof_sdw: Use a fixed DAI link id for AMP
  ASoC: intel: sof_sdw: move DMIC link id overwrite to
    create_sdw_dailink
  ASoC: intel: sof_sdw: remove SOF_RT715_DAI_ID_FIX quirk
  ASoC: intel: sof_sdw: remove sof_sdw_mic_codec_mockup_init
  ASoC: intel: sof_sdw: remove get_next_be_id
  ASoC: intel: sof_sdw: add link adr order check

Pierre-Louis Bossart (2):
  ASoC: Intel: sof_sdw: fix jack detection on HP Spectre x360
    convertible
  ASoC: Intel: sof_sdw: add SKU for Dell Latitude 9520

 sound/soc/intel/boards/sof_sdw.c            | 152 ++++++++++----------
 sound/soc/intel/boards/sof_sdw_common.h     |   7 +-
 sound/soc/intel/boards/sof_sdw_rt715.c      |   7 -
 sound/soc/intel/boards/sof_sdw_rt715_sdca.c |   7 -
 4 files changed, 85 insertions(+), 88 deletions(-)

--
2.17.1
2021-11-15 19:23:56 +00:00
Mark Brown
a4832f8027
Merge series "Add tfa9897 rcv-gpios support" from Vincent Knecht <vincent.knecht@mailoo.org>:
This is the continuation of a previous series [1] where
- patch 1/4 is removed in favor of using pin switch
  This will be posted independently of tfa989x support,
  since it mainly require changes to sound/soc/qcom/common.c
  and device DTS.
- patch 2/4 is already merged
so here are reworked patch 3/4 (bindings fixed and example added)
and patch 4/4 unchanged.

[1] https://patchwork.kernel.org/project/alsa-devel/cover/20211024085840.1536438-1-vincent.knecht@mailoo.org/

Vincent Knecht (2):
  ASoC: dt-bindings: nxp, tfa989x: Add rcv-gpios property for tfa9897
  ASoC: codecs: tfa989x: Add support for tfa9897 optional rcv-gpios

 .../bindings/sound/nxp,tfa989x.yaml           | 41 +++++++++++++++++++
 sound/soc/codecs/tfa989x.c                    | 20 ++++++++-
 2 files changed, 60 insertions(+), 1 deletion(-)

--
2.31.1
2021-11-15 19:23:54 +00:00
Mark Brown
7e5dfedb53
ASoC: Merge rt9120 series from ChiYuan Huang:
Changes from ChiYuan Huang <cy_huang@richtek.com> to fix a couple of
bugs and add a new device ID/quirk for the rt9120s to the driver.
2021-11-15 18:56:28 +00:00
Bard Liao
296c789ce1
ASoC: intel: sof_sdw: add link adr order check
We assume the adr order described in a snd_soc_acpi_link_adr array is
jack -> amp -> mic. We follow the same order to implement the topology.
We will need a special topology if we configure a snd_soc_acpi_link_adr
array with different order. Adding a check and a warning message can
remind people to keep the order when adding a new snd_soc_acpi_link_adr
array.

Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Link: https://lore.kernel.org/r/20211027021824.24776-11-yung-chuan.liao@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-11-15 13:26:59 +00:00
Bard Liao
4ed65d6ead
ASoC: intel: sof_sdw: remove get_next_be_id
DAI link id will not be set from sdw codec init feedback function,
and be_id is changed by create_sdw_dailink() now. So we don't need
get_next_be_id() anymore.

Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Link: https://lore.kernel.org/r/20211027021824.24776-10-yung-chuan.liao@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-11-15 13:26:58 +00:00
Bard Liao
bd98394a81
ASoC: intel: sof_sdw: remove sof_sdw_mic_codec_mockup_init
Now, we set DAI link id as SDW_DMIC_DAI_ID for all DMICs.
No need to set it in sof_sdw_mic_codec_mockup_init.

Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Link: https://lore.kernel.org/r/20211027021824.24776-9-yung-chuan.liao@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-11-15 13:26:57 +00:00
Bard Liao
f8f8312263
ASoC: intel: sof_sdw: remove SOF_RT715_DAI_ID_FIX quirk
SOF_RT715_DAI_ID_FIX is not used anywhere. Remove it.

Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Link: https://lore.kernel.org/r/20211027021824.24776-8-yung-chuan.liao@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-11-15 13:26:56 +00:00
Bard Liao
bf605cb042
ASoC: intel: sof_sdw: move DMIC link id overwrite to create_sdw_dailink
We can apply the fixed dai link id for DMICs in create_sdw_dailink().
No need to set it in each DMIC's callback.
The fixed dai link id is not only for rt715 and rt715-sdca, but for all
DMICs, therefore we remove the SOF_RT715_DAI_ID_FIX check as well.

Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Link: https://lore.kernel.org/r/20211027021824.24776-7-yung-chuan.liao@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-11-15 13:26:55 +00:00
Bard Liao
d471c034f8
ASoC: intel: sof_sdw: Use a fixed DAI link id for AMP
Currently, we assign SoundWire DAI link id according to the order in
the link address table, with the assumption that the headset codec is
listed first, then amplifiers and last capture devices. If the headset
codec is not present in a platform, the dai link for amplifiers will be
shifted, which can be handled in two ways
a) modify the topology to renumber the dailink changes
b) keep the dailink numbers constant in topology but also avoid the
   variations in the machine driver.

This patch adds support for option b), the dailink index for amplifiers
and capture devices becomes fixed.

Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Link: https://lore.kernel.org/r/20211027021824.24776-6-yung-chuan.liao@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-11-15 13:26:54 +00:00
Bard Liao
b63137cf51
ASoC: intel: sof_sdw: rename be_index/link_id to link_index
The link_id variable in sof_card_dai_links_create() and be_index argument
in create_sdw_dailink() is actually links' index. Rename them to link_index
to be consistent.

Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Link: https://lore.kernel.org/r/20211027021824.24776-5-yung-chuan.liao@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-11-15 13:26:53 +00:00
Pierre-Louis Bossart
1071f2415b
ASoC: Intel: sof_sdw: add SKU for Dell Latitude 9520
Different SKUs seem to be used for the same design.

BugLink: https://github.com/thesofproject/linux/issues/3206
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Kai Vehmanen <kai.vehmanen@intel.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Link: https://lore.kernel.org/r/20211027021824.24776-4-yung-chuan.liao@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-11-15 13:26:52 +00:00
Pierre-Louis Bossart
0527b19fa4
ASoC: Intel: sof_sdw: fix jack detection on HP Spectre x360 convertible
Tests on device show the JD2 mode does not work at all, the 'Headphone
Jack' and 'Headset Mic Jack' are shown as 'on' always.

JD1 seems to be the better option, with at least a change between the
two cases.

Jack not plugged-in:
[root@fedora ~]# amixer -Dhw:0 cget numid=12
numid=12,iface=CARD,name='Headphone Jack'
  ; type=BOOLEAN,access=r-------,values=1
  : values=off
[root@fedora ~]# amixer -Dhw:0 cget numid=13
numid=13,iface=CARD,name='Headset Mic Jack'
  ; type=BOOLEAN,access=r-------,values=1
  : values=off

Jack plugged-in:
[root@fedora ~]# amixer -Dhw:0 cget numid=13
numid=13,iface=CARD,name='Headset Mic Jack'
  ; type=BOOLEAN,access=r-------,values=1
  : values=on
[root@fedora ~]# amixer -Dhw:0 cget numid=13
numid=13,iface=CARD,name='Headset Mic Jack'
  ; type=BOOLEAN,access=r-------,values=1
  : values=on

The 'Headset Mic Jack' is updated with a delay which seems normal with
additional calibration needed.

Fixes: d92e279dee ('ASoC: Intel: sof_sdw: add quirk for HP Spectre x360 convertible')
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Link: https://lore.kernel.org/r/20211027021824.24776-3-yung-chuan.liao@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-11-15 13:26:51 +00:00
Bard Liao
dd31ddd819
ASoC: intel: sof_sdw: return the original error number
We don't want to convert create_sdw_dailink()'s return value to -ENOMEM.

Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: Rander Wang <rander.wang@intel.com>
Link: https://lore.kernel.org/r/20211027021824.24776-2-yung-chuan.liao@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-11-15 13:26:50 +00:00
Ranjani Sridharan
48b5b6a560
ASoC: SOF: trace: send DMA_TRACE_FREE IPC during release
Send the DMA_TRACE_FREE IPC during release to stop and free the trace
DMA in the DSP.

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
Link: https://lore.kernel.org/r/20211102101019.14037-4-peter.ujfalusi@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-11-15 13:26:48 +00:00
Ranjani Sridharan
b4e2d7ce13
ASoC: SOF: IPC: update ipc_log_header()
Parse all the trace DMA IPC commands in ipc_log_header().

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
Link: https://lore.kernel.org/r/20211102101019.14037-3-peter.ujfalusi@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-11-15 13:26:47 +00:00
Vincent Knecht
9da52c39b3
ASoC: codecs: tfa989x: Add support for tfa9897 optional rcv-gpios
Some OEM use a GPIO in addition to the tfa9897 RCV bit to
switch between loudspeaker and earpiece/receiver mode.

Add support for the GPIO switching by specifying rcv-gpios in DT.

Signed-off-by: Vincent Knecht <vincent.knecht@mailoo.org>
Link: https://lore.kernel.org/r/20211031210956.812101-3-vincent.knecht@mailoo.org
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-11-15 13:26:44 +00:00
Mark Brown
79a7a5ac3e
Merge existing fixes from asoc/for-5.16 into new branch 2021-11-15 13:25:03 +00:00
Mark Brown
58da0d84fd
Merge series "" from :
Changes from ChiYuan Huang <cy_huang@richtek.com> to fix a couple of
bugs and add a new device ID/quirk for the rt9120s to the driver.
2021-11-12 21:25:21 +00:00
Kuninori Morimoto
2ce1b21cb3
ASoC: rsnd: fixup DMAEngine API
commit d5bb69dc54 ("ASoC: sh: rcar: dma: : use proper DMAENGINE
API for termination") updated DMAEngine API _all() to _sync(),
but it should be _async().
_all() and _async() are almost same, the difference is only return
error code. _sync() will call dmaengine_synchronize() and will be
kernel panic.
This patch is needed for v5.15 or later.

[   27.293264] BUG: scheduling while atomic: irq/130-ec70000/131/0x00000003
[   27.300084] 2 locks held by irq/130-ec70000/131:
[   27.304743]  #0: ffff0004c274d908 (&group->lock){....}-{2:2}, at: _snd_pcm_stream_lock_irqsave+0x48/0x54
[   27.314344]  #1: ffff0004c1788c60 (&priv->lock#2){....}-{2:2}, at: rsnd_soc_dai_trigger+0x70/0x7bc
[   27.323409] irq event stamp: 206
[   27.326664] hardirqs last  enabled at (205): [<ffff80001082de50>] _raw_spin_unlock_irq+0x50/0xa0
[   27.335529] hardirqs last disabled at (206): [<ffff80001082d9e4>] _raw_spin_lock_irqsave+0xc4/0xd0
[   27.344564] softirqs last  enabled at (0): [<ffff800010037324>] copy_process+0x644/0x1b10
[   27.352819] softirqs last disabled at (0): [<0000000000000000>] 0x0
[   27.359142] CPU: 0 PID: 131 Comm: irq/130-ec70000 Not tainted 5.14.0-rc1+ #918
[   27.366429] Hardware name: Renesas H3ULCB Kingfisher board based on r8a77950 (DT)
[   27.373975] Call trace:
[   27.376442]  dump_backtrace+0x0/0x1b4
[   27.380141]  show_stack+0x24/0x30
[   27.383488]  dump_stack_lvl+0x8c/0xb8
[   27.387184]  dump_stack+0x18/0x34
[   27.390528]  __schedule_bug+0x8c/0x9c
[   27.394224]  __schedule+0x790/0x8dc
[   27.397746]  schedule+0x7c/0x110
[   27.401003]  synchronize_irq+0x94/0xd0
[   27.404786]  rcar_dmac_device_synchronize+0x20/0x2c
[   27.409710]  rsnd_dmaen_stop+0x50/0x64
[   27.413495]  rsnd_soc_dai_trigger+0x554/0x7bc
[   27.417890]  snd_soc_pcm_dai_trigger+0xe8/0x264

Cc: <stable@kernel.org>
Fixes: commit d5bb69dc54 ("ASoC: sh: rcar: dma: : use proper DMAENGINE API for termination")
Link: https://lore.kernel.org/r/TY2PR01MB3692889E1A7476C4322CC296D8AE9@TY2PR01MB3692.jpnprd01.prod.outlook.com
Reported-by: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
Acked-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/87mtmfz36o.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-11-12 21:25:19 +00:00
Arnd Bergmann
1218f06cb3
ASoC: SOF: build compression interface into snd_sof.ko
With CONFIG_SND_SOC_SOF_COMPRESS=m, the compression code is
not built into a the main SOF driver when that is built-in:

x86_64-linux-ld: sound/soc/sof/ipc.o: in function `ipc_stream_message':
ipc.c:(.text+0x5a2): undefined reference to `snd_sof_compr_fragment_elapsed'
x86_64-linux-ld: sound/soc/sof/topology.o: in function `sof_dai_load':
topology.c:(.text+0x32d1): undefined reference to `snd_sof_compr_init_elapsed_work'
x86_64-linux-ld: topology.c:(.text+0x32e1): undefined reference to `snd_sof_compr_init_elapsed_work'

Make this a 'bool' symbol so it just decides whether the
code gets built at all.

Fixes: 858f7a5c45 ("ASoC: SOF: Introduce fragment elapsed notification API")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Tested-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20211108111132.3800548-1-arnd@kernel.org
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-11-12 21:25:18 +00:00
AngeloGioacchino Del Regno
8c32984bc7
ASoC: mediatek: mt8173: Fix debugfs registration for components
When registering the mt8173-afe-pcm driver, we are also adding two
components: one is for the PCM DAIs and one is for the HDMI DAIs, but
when debugfs is enabled, we're getting the following issue:

[   17.279176] debugfs: Directory '11220000.audio-controller' with parent 'mtk-rt5650' already present!
[   17.288345] debugfs: Directory '11220000.audio-controller' with parent 'mtk-rt5650' already present!

To overcome to that without any potentially big rewrite of this driver,
similarly to what was done in mt8195-afe-pcm, add a debugfs_prefix to
the components before actually adding them.

Signed-off-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
Link: https://lore.kernel.org/r/20211111161108.502344-1-angelogioacchino.delregno@collabora.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-11-12 18:16:44 +00:00
Derek Fang
2cd9b0ef82
ASoC: rt5682: Re-detect the combo jack after resuming
Sometimes, end-users change the jack type under suspending,
so it needs to re-detect the combo jack type after resuming to
avoid any unexpected behaviors.

Signed-off-by: Derek Fang <derek.fang@realtek.com>
Link: https://lore.kernel.org/r/20211109095450.12950-2-derek.fang@realtek.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-11-12 18:16:43 +00:00
Derek Fang
a3774a2a65
ASoC: rt5682: Avoid the unexpected IRQ event during going to suspend
When the system suspends, the codec driver will set SAR to
power saving mode if a headset is plugged in.
There is a chance to generate an unexpected IRQ, and leads to
issues after resuming such as noise from OMTP type headsets.

Signed-off-by: Derek Fang <derek.fang@realtek.com>
Link: https://lore.kernel.org/r/20211109095450.12950-1-derek.fang@realtek.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-11-12 18:16:42 +00:00
Jack Yu
a382285b6f
ASoC: rt1011: revert 'I2S Reference' to SOC_ENUM_EXT
Revert 'I2S Reference' to SOC_ENUM_EXT because the settings are specific
for some platforms, the default setting for 'I2S Reference' does nothing,
only some SoC platform need to configure it.
Previous 'I2S Reference' in SOC_ENUM format only toggles one bit of
RT1011_TDM1_SET_1 register, which isn't enough for specific platform.

Signed-off-by: Jack Yu <jack.yu@realtek.com>
Link: https://lore.kernel.org/r/20211111091705.20879-1-jack.yu@realtek.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-11-12 18:16:41 +00:00
ChiYuan Huang
dbe638f71e
ASoC: rt9120: Add the compatibility with rt9120s
Use device id reg to be compatible with rt9120 and rt9120s.

Signed-off-by: ChiYuan Huang <cy_huang@richtek.com>
Link: https://lore.kernel.org/r/1636515921-31694-4-git-send-email-u0084500@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-11-12 18:16:39 +00:00
ChiYuan Huang
8f1f1846d7
ASoC: rt9120: Fix clock auto sync issue when fs is the multiple of 48
If fs is divided by 48, to make audio clock sync rate correct, internal
sync function have be disabled.

Signed-off-by: ChiYuan Huang <cy_huang@richtek.com>
Link: https://lore.kernel.org/r/1636515921-31694-3-git-send-email-u0084500@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-11-12 18:16:37 +00:00
ChiYuan Huang
9bb4e4bae5
ASoC: rt9120: Update internal ocp level to the correct value
Update internal ocp level to correct value.

Even the wrong ocp setting can also make the sound output, but the power
cannot match the IC capability.

Signed-off-by: ChiYuan Huang <cy_huang@richtek.com>
Link: https://lore.kernel.org/r/1636515921-31694-2-git-send-email-u0084500@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-11-12 18:16:35 +00:00
Gongjun Song
f55af7055c
ASoC: Intel: sof_sdw: Add support for SKU 0B12 product
This product supports a SoundWire headset codec, SoundWire
capture from local microphones and two SoundWire amplifiers.

Signed-off-by: Libin Yang <libin.yang@intel.com>
Signed-off-by: Gongjun Song <gongjun.song@intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Rander Wang <rander.wang@intel.com>
Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Link: https://lore.kernel.org/r/20211105022646.26305-10-yung-chuan.liao@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-11-05 17:04:21 +00:00
Gongjun Song
359ace2b9a
ASoC: Intel: soc-acpi: add SKU 0B29 SoundWire configuration
Product audio hardware configuration is rt711 on link2,
two rt1316s on link0 and link1, rt714 on link 3.

Signed-off-by: Gongjun Song <gongjun.song@intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Rander Wang <rander.wang@intel.com>
Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Link: https://lore.kernel.org/r/20211105022646.26305-9-yung-chuan.liao@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-11-05 17:04:20 +00:00
Gongjun Song
0c2ed4f03f
ASoC: Intel: sof_sdw: Add support for SKU 0B29 product
This product supports a SoundWire headset codec, SoundWire
capture from local microphones and two SoundWire amplifiers.

Signed-off-by: Gongjun Song <gongjun.song@intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Rander Wang <rander.wang@intel.com>
Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Link: https://lore.kernel.org/r/20211105022646.26305-8-yung-chuan.liao@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-11-05 17:04:18 +00:00
Gongjun Song
11e18f582c
ASoC: Intel: soc-acpi: add SKU 0B13 SoundWire configuration
Product audio hardware configuration is rt1316 on link2,
rt714 on link 3.

Signed-off-by: Gongjun Song <gongjun.song@intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Rander Wang <rander.wang@intel.com>
Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Link: https://lore.kernel.org/r/20211105022646.26305-7-yung-chuan.liao@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-11-05 17:04:17 +00:00
Gongjun Song
6448d0596e
ASoC: Intel: sof_sdw: Add support for SKU 0B13 product
This product supports SoundWire capture from local microphones
and one SoundWire amplifier(no headset codec).

Signed-off-by: Gongjun Song <gongjun.song@intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Rander Wang <rander.wang@intel.com>
Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Link: https://lore.kernel.org/r/20211105022646.26305-6-yung-chuan.liao@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-11-05 17:04:16 +00:00
Gongjun Song
6fef4c2f45
ASoC: Intel: sof_sdw: Add support for SKU 0B11 product
This product supports a SoundWire headset codec, SoundWire
capture from local microphones and two SoundWire amplifiers.

Signed-off-by: Gongjun Song <gongjun.song@intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Rander Wang <rander.wang@intel.com>
Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Link: https://lore.kernel.org/r/20211105022646.26305-5-yung-chuan.liao@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-11-05 17:04:15 +00:00
Gongjun Song
cf304329e4
ASoC: Intel: sof_sdw: Add support for SKU 0B00 and 0B01 products
Both products support a SoundWire headset codec, SoundWire
capture from local microphones and two SoundWire amplifiers.

Signed-off-by: Gongjun Song <gongjun.song@intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Rander Wang <rander.wang@intel.com>
Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Link: https://lore.kernel.org/r/20211105022646.26305-4-yung-chuan.liao@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-11-05 17:04:14 +00:00
Gongjun Song
a1797d61cb
ASoC: Intel: soc-acpi: add SKU 0AF3 SoundWire configuration
New product audio hardware configuration is rt714 on link0,
two rt1316s on link1 and link2

Signed-off-by: Gongjun Song <gongjun.song@intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Rander Wang <rander.wang@intel.com>
Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Link: https://lore.kernel.org/r/20211105022646.26305-3-yung-chuan.liao@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-11-05 17:04:14 +00:00
Gongjun Song
8f4fa45982
ASoC: Intel: sof_sdw: Add support for SKU 0AF3 product
This product supports SoundWire capture from local microphones
and two SoundWire amplifiers(no headset codec).

Signed-off-by: Gongjun Song <gongjun.song@intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Rander Wang <rander.wang@intel.com>
Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Link: https://lore.kernel.org/r/20211105022646.26305-2-yung-chuan.liao@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-11-05 17:04:13 +00:00
AngeloGioacchino Del Regno
0a8facac0d
ASoC: mediatek: mt8173-rt5650: Rename Speaker control to Ext Spk
Some RT5645 and RT5650 powered platforms are using "Ext Spk"
instead of "Speaker", and this is also reflected in alsa-lib
configurations for the generic RT5645 usecase manager configs.

Rename the "Speaker" control to "Ext Spk" in order to be able
to make the userspace reuse/inherit the same configurations also
for this machine, along with the others.

Signed-off-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
Link: https://lore.kernel.org/r/20211105152013.75252-1-angelogioacchino.delregno@collabora.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-11-05 15:26:39 +00:00
Takashi Iwai
827b0913a9
ASoC: DAPM: Cover regression by kctl change notification fix
The recent fix for DAPM to correct the kctl change notification by the
commit 5af82c81b2 ("ASoC: DAPM: Fix missing kctl change
notifications") caused other regressions since it changed the behavior
of snd_soc_dapm_set_pin() that is called from several API functions.
Formerly it returned always 0 for success, but now it returns 0 or 1.

This patch addresses it, restoring the old behavior of
snd_soc_dapm_set_pin() while keeping the fix in
snd_soc_dapm_put_pin_switch().

Fixes: 5af82c81b2 ("ASoC: DAPM: Fix missing kctl change notifications")
Reported-by: Yu-Hsuan Hsu <yuhsuan@chromium.org>
Cc: <stable@vger.kernel.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Link: https://lore.kernel.org/r/20211105090925.20575-1-tiwai@suse.de
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-11-05 12:58:12 +00:00
Kai Vehmanen
fd572393ba
ASoC: SOF: Intel: hda: fix hotplug when only codec is suspended
If codec is in runtime suspend, but controller is not, hotplug events
are missed as the codec has no way to alert the controller. Problem does
not occur if both controller and codec are active, or when both are
suspended.

An easy way to reproduce is to play an audio stream on one codec (e.g.
to HDMI/DP display codec), wait for other HDA codec to go to runtime
suspend, and then plug in a headset to the suspended codec. The jack
event is not reported correctly in this case. Another way to reproduce
is to force controller to stay active with
"snd_sof_pci.sof_pci_debug=0x1"

Fix the issue by reconfiguring the WAKEEN register when powering up/down
individual links, and handling control events in the interrupt handler.

Fixes: 87fc20e4a0 ("ASoC: SOF: Intel: hda: use hdac_ext fine-grained link management")
Reported-by: Hui Wang <hui.wang@canonical.com>
Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: Péter Ujfalusi <peter.ujfalusi@linux.intel.com>
Link: https://lore.kernel.org/r/20211105111655.668777-1-kai.vehmanen@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-11-05 12:58:11 +00:00
Linus Torvalds
abfecb3909 TTY / Serial driver update for 5.16-rc1
Here is the big set of tty and serial driver updates for 5.16-rc1.
 
 Nothing major in here at all, just lots of tiny serial and tty driver
 updates for various reported things, and some good cleanups.  These
 include:
 	- more good tty api cleanups from Jiri
 	- stm32 serial driver updates
 	- softlockup fix for non-preempt systems under high serial load
 	- rpmsg serial driver update
 	- 8250 drivers updates and fixes
 	- n_gsm line discipline fixes and updates as people are finally
 	  starting to use it.
 
 All of these have been in linux-next for a while now with no reported
 issues.
 
 Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
 -----BEGIN PGP SIGNATURE-----
 
 iG0EABECAC0WIQT0tgzFv3jCIUoxPcsxR9QN2y37KQUCYYPczQ8cZ3JlZ0Brcm9h
 aC5jb20ACgkQMUfUDdst+ykWbwCfaIScbUoCUx+h/uP93nKKD8B3KgYAoMvFuhhD
 D/fTLggs12x5NsvLBgtZ
 =rq0R
 -----END PGP SIGNATURE-----

Merge tag 'tty-5.16-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty

Pull tty / serial driver updates from Greg KH:
 "Here is the big set of tty and serial driver updates for 5.16-rc1.

  Nothing major in here at all, just lots of tiny serial and tty driver
  updates for various reported things, and some good cleanups. These
  include:

   - more good tty api cleanups from Jiri

   - stm32 serial driver updates

   - softlockup fix for non-preempt systems under high serial load

   - rpmsg serial driver update

   - 8250 drivers updates and fixes

   - n_gsm line discipline fixes and updates as people are finally
     starting to use it.

  All of these have been in linux-next for a while now with no reported
  issues"

* tag 'tty-5.16-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty: (86 commits)
  tty: Fix extra "not" in TTY_DRIVER_REAL_RAW description
  serial: cpm_uart: Protect udbg definitions by CONFIG_SERIAL_CPM_CONSOLE
  tty: rpmsg: Define tty name via constant string literal
  tty: rpmsg: Add pr_fmt() to prefix messages
  tty: rpmsg: Use dev_err_probe() in ->probe()
  tty: rpmsg: Unify variable used to keep an error code
  tty: rpmsg: Assign returned id to a local variable
  serial: stm32: push DMA RX data before suspending
  serial: stm32: terminate / restart DMA transfer at suspend / resume
  serial: stm32: rework RX dma initialization and release
  serial: 8250_pci: Remove empty stub pci_quatech_exit()
  serial: 8250_pci: Replace custom pci_match_id() implementation
  serial: xilinx_uartps: Fix race condition causing stuck TX
  serial: sunzilog: Mark sunzilog_putchar() __maybe_unused
  Revert "tty: hvc: pass DMA capable memory to put_chars()"
  Revert "virtio-console: remove unnecessary kmemdup()"
  serial: 8250_pci: Replace dev_*() by pci_*() macros
  serial: 8250_pci: Get rid of redundant 'else' keyword
  serial: 8250_pci: Refactor the loop in pci_ite887x_init()
  tty: add rpmsg driver
  ...
2021-11-04 09:09:37 -07:00
Peter Ujfalusi
d9835eaa3e
ASoC: SOF:control: Fix variable type in snd_sof_refresh_control()
The second parameter for snd_sof_ipc_set_get_comp_data() is ipc_cmd, not
ipc_ctrl_type and the type is u32.

Fixes: 756bbe4205 ("ASoC: SOF: Handle control change notification from firmware")
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@gmail.com>
Acked-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Link: https://lore.kernel.org/r/20211103082710.17165-1-peter.ujfalusi@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-11-04 13:33:22 +00:00
Linus Torvalds
d461e96cd2 ARM: SoC drivers for 5.16
These are all the driver updates for SoC specific drivers. There
 are a couple of subsystems with individual maintainers picking up
 their patches here:
 
  - The reset controller subsystem add support for a few new SoC
    variants to existing drivers, along with other minor improvements
 
  - The OP-TEE subsystem gets a driver for the ARM FF-A transport
 
  - The memory controller subsystem has improvements for Tegra,
    Mediatek, Renesas, Freescale and Broadcom specific drivers.
 
  - The tegra cpuidle driver changes get merged through this
    tree this time. There are only minor changes, but they depend
    on other tegra driver updates here.
 
  - The ep93xx platform finally moves to using the drivers/clk/
    subsystem, moving the code out of arch/arm in the process.
    This depends on a small sound driver change that is included
    here as well.
 
  - There are some minor updates for Qualcomm and Tegra specific
    firmware drivers.
 
 The other driver updates are mainly for drivers/soc, which contains
 a mixture of vendor specific drivers that don't really fit elsewhere:
 
  - Mediatek drivers gain more support for MT8192, with new support for
    hw-mutex and mmsys routing, plus support for reset lines in the
    mmsys driver.
 
  - Qualcomm gains a new "sleep stats" driver, and support for
    the "Generic Packet Router" in the APR driver.
 
  - There is a new user interface for routing the UARTS on ASpeed
    BMCs, something that apparently nobody else has needed so far.
 
  - More drivers can now be built as loadable modules, in particular
    for Broadcom and Samsung platforms.
 
  - Lots of improvements to the TI sysc driver for better suspend/resume
    support
 
 Finally, there are lots of minor cleanups and new device IDs for
 amlogic, renesas, tegra, qualcomm, mediateka, samsung, imx, layerscape,
 allwinner, broadcom, and omap.
 -----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCgAdFiEEo6/YBQwIrVS28WGKmmx57+YAGNkFAmGCvKgACgkQmmx57+YA
 GNnNfw/8DDTfMUycVvtaNslYlWri0/2O0nSqhNIIbTAcVuD/x5qo/McDhKuv+ldM
 BoTDMjRYZfQkrNXSEj3MaxB9E0o6Srva5SM8y4+Koe0VVtvEVovjYkXOhXqSEWWl
 aqVIe0S6Y1rF/KxJlvAfGxYHb5d+6aYqzdmhjURpXNGxqpSHb9/hqisY97Q9TpnD
 6lQZOz9d1JNDq0eOh1qjcfuMjg1EHZHDZJyioCvyX38KIl2q7p3ll2z/eqrrDhQZ
 TrvL/YVosTXqBcAfi47Oz+n/CX2i0MrjVO8nfPSGOq5UL4Al3SZD4XYY96IOIQrH
 +XGFigGGAkV2LfKSEPNJWaq7g+SiQUr2jc3p8b4Zxde8/+5M127/gotiPddyG2LX
 1OnFRnPskgRApGqHjGEcEzzJUTag7Hc+YVH82TMEHZhSDMq6i30k9UnyfXsziZDV
 8CrkOpjuSg+YxFv/83bfa1pIoYtFfjGr16mq4muajodnX7+b7My9iv+2Oo2iQM9y
 DwRUKj7+eap23SEUpi4et6HlNpoF6yJMbt5Ae1k+gTK2DvQ4Cx6n4QJz/I7WC1Wp
 BdVhvSH8XVppVLtQqODud+VWvLgLerRxUpGRdbS8r5VsnNUJTvaS4YGMpm9616G7
 TrgUSSvsyu1lLqbWMh+pOCk4l3r64vSUn581hrIw6jtioNGvMdE=
 =tUuj
 -----END PGP SIGNATURE-----

Merge tag 'drivers-5.16' of git://git.kernel.org/pub/scm/linux/kernel/git/soc/soc

Pull ARM SoC driver updates from Arnd Bergmann:
 "These are all the driver updates for SoC specific drivers. There are a
  couple of subsystems with individual maintainers picking up their
  patches here:

   - The reset controller subsystem add support for a few new SoC
     variants to existing drivers, along with other minor improvements

   - The OP-TEE subsystem gets a driver for the ARM FF-A transport

   - The memory controller subsystem has improvements for Tegra,
     Mediatek, Renesas, Freescale and Broadcom specific drivers.

   - The tegra cpuidle driver changes get merged through this tree this
     time. There are only minor changes, but they depend on other tegra
     driver updates here.

   - The ep93xx platform finally moves to using the drivers/clk/
     subsystem, moving the code out of arch/arm in the process. This
     depends on a small sound driver change that is included here as
     well.

   - There are some minor updates for Qualcomm and Tegra specific
     firmware drivers.

  The other driver updates are mainly for drivers/soc, which contains a
  mixture of vendor specific drivers that don't really fit elsewhere:

   - Mediatek drivers gain more support for MT8192, with new support for
     hw-mutex and mmsys routing, plus support for reset lines in the
     mmsys driver.

   - Qualcomm gains a new "sleep stats" driver, and support for the
     "Generic Packet Router" in the APR driver.

   - There is a new user interface for routing the UARTS on ASpeed BMCs,
     something that apparently nobody else has needed so far.

   - More drivers can now be built as loadable modules, in particular
     for Broadcom and Samsung platforms.

   - Lots of improvements to the TI sysc driver for better
     suspend/resume support"

  Finally, there are lots of minor cleanups and new device IDs for
  amlogic, renesas, tegra, qualcomm, mediateka, samsung, imx,
  layerscape, allwinner, broadcom, and omap"

* tag 'drivers-5.16' of git://git.kernel.org/pub/scm/linux/kernel/git/soc/soc: (179 commits)
  optee: Fix spelling mistake "reclain" -> "reclaim"
  Revert "firmware: qcom: scm: Add support for MC boot address API"
  qcom: spm: allow compile-testing
  firmware: arm_ffa: Remove unused 'compat_version' variable
  soc: samsung: exynos-chipid: add exynosautov9 SoC support
  firmware: qcom: scm: Don't break compile test on non-ARM platforms
  soc: qcom: smp2p: Add of_node_put() before goto
  soc: qcom: apr: Add of_node_put() before return
  soc: qcom: qcom_stats: Fix client votes offset
  soc: qcom: rpmhpd: fix sm8350_mxc's peer domain
  dt-bindings: arm: cpus: Document qcom,msm8916-smp enable-method
  ARM: qcom: Add qcom,msm8916-smp enable-method identical to MSM8226
  firmware: qcom: scm: Add support for MC boot address API
  soc: qcom: spm: Add 8916 SPM register data
  dt-bindings: soc: qcom: spm: Document qcom,msm8916-saw2-v3.0-cpu
  soc: qcom: socinfo: Add PM8150C and SMB2351 models
  firmware: qcom_scm: Fix error retval in __qcom_scm_is_call_available()
  soc: aspeed: Add UART routing support
  soc: fsl: dpio: rename the enqueue descriptor variable
  soc: fsl: dpio: use an explicit NULL instead of 0
  ...
2021-11-03 17:00:52 -07:00
Linus Torvalds
ff0700f036 sound updates for 5.16-rc1
Lots of code development have been see in ASoC side as usual, while
 the continued development on memalloc helper and USB-audio low-
 latency support are found in the rest.  Note that a few changes in the
 unusual places like arch/sh are included, which are a part of ASoC DAI
 format cleanups.
 
 ALSA core:
 - Continued memallloc helper updates and cleanups, now supporting
   non-coherent and non-contiguous pages
 - Fixes for races in mixer OSS layer
 
 ASoC:
 - A new version of the audio graph card which supports a wider range
   of systems
 - Several conversions to YAML DT bindings
 - Continuing cleanups to the SOF and Intel code
 - Move of the Cirrus DSP framework into drivers/firmware to allow for
   future use by non-audio DSPs
 - An overhaul of the cs42l42 driver, correcting many problems
 - DAI format terminology conversions over many drivers for cleanups
 - Support for AMD Vangogh and Yelow Cap, Cirrus CS35L41, Maxim
   MAX98520 and MAX98360A, Mediatek MT8195, Nuvoton NAU8821, nVidia
   Tegra210, NXP i.MX8ULP, Qualcomm AudioReach, Realtek ALC5682I-VS,
   RT5682S, and RT9120 and Rockchip RV1126 and RK3568
 
 USB-audio:
 - Continued improvements on low-latency playback
 - Quirks for Pioneer devices, Line6 HX-Stomp XL, Audient iD14
 
 HD-audio:
 - Reduce excessive udelay() calls on Intel platforms; this should
   reduce the CPU load with PulseAudio
 - Quirks for HP and Clevo laptops
 
 FireWire:
 - Support for meter information on MOTU
 -----BEGIN PGP SIGNATURE-----
 
 iQJCBAABCAAsFiEEIXTw5fNLNI7mMiVaLtJE4w1nLE8FAmGCYqkOHHRpd2FpQHN1
 c2UuZGUACgkQLtJE4w1nLE9JDQ//bjjRIVH+JmvhNgLJgJdtdpidaplKUtimEsWk
 8/bFJT0lqPjGMz43bALaj4UTvO2N39ZIW8FVmHDVGh54Xuw8Qu+M/NKiD3J2p4xO
 Pc2rljsiJr7G2VfcBEyDb74wF4fdiFqe6N8PsIT2EG7GxhZiZ6i4+7sdpKoXqmgv
 9ltUzPrtIQQva8c0ER+xHNG1sYVX0bh9vzRIA1aEosYmCPqMIatFBocqwT6fM4Ls
 Ko3GK3GBOnlfVoN+O/ZOsR6Lv6XYApUyp2HqCSrnZK1KvVY4ptYP8XLVwPdEi3OX
 5l0oilOvAch2KIj++K2yzk+xpoEQZ/MIO/1eehLN2ioWyayUNNbeHM0fl3dmdLUQ
 Gow8DbA9o63auERTt6qJs6ed7KOmXewKT9IKiSK6f991JaD0n7nCbcw6yRx1OqWA
 CafXVIVW1CsqTGJuMZzdzBvBZ2ex9OpdhpUw2v12vf2OXKQax9WsfJjVL+qmA0PC
 zbb6viwRKLhAYzoPh/pdHOLm2cvRvdJZstnW8w5+52g96LEF9v4bale7aPi4bqdi
 0o5l/0VGjiXjicT2tf/x8WhuExqPSA64L21adshZ0vmSrPmaGJb6IX4j4zd9TW5L
 v3xUUyKRmq3j7fYN2fN2hGh2qGq+EcdcfNyWOj2XrJm+JFB50/Ac1hcYd5WIZKrh
 xn1luaw=
 =UBNY
 -----END PGP SIGNATURE-----

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

Pull sound updates from Takashi Iwai:
 "Lots of code development have been see in ASoC side as usual, while
  the continued development on memalloc helper and USB-audio low-
  latency support are found in the rest.

  Note that a few changes in the unusual places like arch/sh are
  included, which are a part of ASoC DAI format cleanups.

  ALSA core:

   - Continued memalloc helper updates and cleanups, now supporting
     non-coherent and non-contiguous pages

   - Fixes for races in mixer OSS layer

  ASoC:

   - A new version of the audio graph card which supports a wider range
     of systems

   - Several conversions to YAML DT bindings

   - Continuing cleanups to the SOF and Intel code

   - Move of the Cirrus DSP framework into drivers/firmware to allow for
     future use by non-audio DSPs

   - An overhaul of the cs42l42 driver, correcting many problems

   - DAI format terminology conversions over many drivers for cleanups

   - Support for AMD Vangogh and Yelow Cap, Cirrus CS35L41, Maxim
     MAX98520 and MAX98360A, Mediatek MT8195, Nuvoton NAU8821, nVidia
     Tegra210, NXP i.MX8ULP, Qualcomm AudioReach, Realtek ALC5682I-VS,
     RT5682S, and RT9120 and Rockchip RV1126 and RK3568

  USB-audio:

   - Continued improvements on low-latency playback

   - Quirks for Pioneer devices, Line6 HX-Stomp XL, Audient iD14

  HD-audio:

   - Reduce excessive udelay() calls on Intel platforms; this should
     reduce the CPU load with PulseAudio

   - Quirks for HP and Clevo laptops

  FireWire:

   - Support for meter information on MOTU"

* tag 'sound-5.16-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound: (513 commits)
  ALSA: usb-audio: Add quirk for Audient iD14
  ALSA: hda/realtek: Add quirk for Clevo PC70HS
  ALSA: usb-audio: Line6 HX-Stomp XL USB_ID for 48k-fixed quirk
  ALSA: usb-audio: Add registration quirk for JBL Quantum 400
  ASoC: rsnd: Fix an error handling path in 'rsnd_node_count()'
  ASoC: tlv320aic3x: Make aic3x_remove() return void
  ASoC: Intel: soc-acpi: use const for all uses of snd_soc_acpi_codecs
  ASoC: Intel: soc-acpi-cht: shrink tables using compatible IDs
  ASoC: Intel: soc-acpi-byt: shrink tables using compatible IDs
  ASoC: Intel: sof_rt5682: use comp_ids to enumerate rt5682s
  ASoC: Intel: sof_rt5682: detect codec variant in probe function
  ASoC: soc-acpi: add comp_ids field for machine driver matching
  ASoC: mediatek: mt8195: add mt8195-mt6359-rt1011-rt5682 bindings document
  ASoC: mediatek: mt8195: add machine driver with mt6359, rt1011 and rt5682
  ASoC: Stop dummy from overriding hwparams
  ASoC: topology: Change topology device to card device
  ASoC: topology: Use correct device for prints
  ASoC: topology: Check for dapm widget completeness
  ASoC: topology: Add header payload_size verification
  ASoC: core: Remove invalid snd_soc_component_set_jack call
  ...
2021-11-03 07:49:25 -07:00
Linus Torvalds
6ab1d4839a platform-drivers-x86 for v5.16-1
Highlights:
  - AMD-PMC S0ix support fixes and improvements
  - HP-WMI support for Omen laptops
  - New nvidia-wmi-ec-backlight driver
  - New Intel ISH ECLITE driver
  - WMI core cleanups
  - Support for various new Melanox platforms
  - System76 Laptop support improvements
  - Surface Laptop Studio support and initial Surface Pro 8 support
  - Various other small fixes and hardware-id additions
 
 The following is an automated git shortlog grouped by driver:
 
 ABI:
  -  sysfs-platform-intel-pmc: add blank lines to make it valid for ReST
  -  sysfs-platform-dell-privacy-wmi: correct ABI entries
 
 ASoC:
  -  Intel: Move soc_intel_is_foo() helpers to a generic header
 
 Add Intel ishtp eclite driver:
  - Add Intel ishtp eclite driver
 
 Add driver for ACPI WMAA EC-based backlight control:
  - Add driver for ACPI WMAA EC-based backlight control
 
 Documentation/ABI:
  -  Add new line card attributes for mlxreg-io sysfs interfaces
  -  Add new attributes for mlxreg-io sysfs interfaces
 
 HID:
  -  surface-hid: Allow driver matching for target ID 1 devices
  -  surface-hid: Use correct event registry for managing HID events
 
 Input:
  -  axp20x-pek - Use new soc_intel_is_cht() helper
 
 Remove "WMAA" from identifier names in wmaa-backlight-wmi.c:
  - Remove "WMAA" from identifier names in wmaa-backlight-wmi.c
 
 Rename wmaa-backlight-wmi to nvidia-wmi-ec-backlight:
  - Rename wmaa-backlight-wmi to nvidia-wmi-ec-backlight
 
 Support for EC-connected GPIOs for identify LED/button on Barco P50 board:
  - Support for EC-connected GPIOs for identify LED/button on Barco P50 board
 
 acer-wmi:
  -  use __packed instead of __attribute__((packed))
 
 amd-pmc:
  -  Drop check for valid alarm time
  -  Downgrade dev_info message to dev_dbg
  -  fix compilation without CONFIG_RTC_SYSTOHC_DEVICE
  -  Add special handling for timer based S0i3 wakeup
  -  adjust arguments for `amd_pmc_send_cmd`
  -  Add alternative acpi id for PMC controller
  -  Add a message to print resume time info
  -  Send command to dump data after clearing OS_HINT
  -  Fix compilation when CONFIG_DEBUGFS is disabled
  -  Export Idlemask values based on the APU
  -  Check s0i3 cycle status
  -  Increase the response register timeout
 
 asus-wmi:
  -  rename platform_profile_* function symbols
 
 barco-p50-gpio:
  -  use KEY_VENDOR for button instead of KEY_RESTART
 
 dell:
  -  Make DELL_WMI_PRIVACY depend on DELL_WMI
  -  fix DELL_WMI_PRIVACY dependencies & build error
 
 dell-wmi:
  -  Recognise or support new switches
 
 docs:
  -  ABI: fix documentation warning in sysfs-driver-mlxreg-io
 
 gigabyte-wmi:
  -  add support for B550 AORUS ELITE AX V2
  -  add support for B550I Aorus Pro AX
 
 hp-wmi:
  -  rename platform_profile_* function symbols
  -  add support for omen laptops
 
 ideapad-laptop:
  -  Add platform support for Ideapad 5 Pro 16ACH6-82L5
 
 int1092:
  -  Fix non sequential device mode handling
 
 intel_int0002_vgpio:
  -  Use the new soc_intel_is_byt()/_cht() helpers
 
 intel_scu_ipc:
  -  Update timeout value in comment
  -  Increase virtual timeout to 10s
  -  Fix busy loop expiry time
 
 intel_skl_int3472:
  -  Correct null check
 
 lg-laptop:
  -  replace snprintf in show functions with sysfs_emit
  -  Correctly handle dmi_get_system_info() returning NULL
 
 mlx-platform:
  -  Add support for new system SGN2410
  -  Add BIOS attributes for CoffeeLake COMEx based systems
  -  Extend FAN and LED configuration to support new MQM97xx systems
  -  Add support for multiply cooling devices
  -  Configure notifier callbacks for modular system
  -  Add initial support for new modular system
 
 panasonic-laptop:
  -  Replace snprintf in show functions with sysfs_emit
 
 platform:
  -  x86: ideapad-laptop: Use ACPI_COMPANION() directly
  -  lg-laptop: drop unneeded MODULE_ALIAS
 
 platform/mellanox:
  -  mlxreg-lc: Add initial support for Nvidia line card devices
  -  mlxreg-io: Extend number of hwmon attributes
  -  mlxreg-hotplug: Extend logic for hotplug devices operations
  -  mlxreg-io: Fix read access of n-bytes size attributes
  -  mlxreg-io: Fix argument base in kstrtou32() call
 
 platform/surface:
  -  aggregator_registry: Add initial support for Surface Pro 8
  -  aggregator_registry: Add support for Surface Laptop Studio
  -  gpe: Add support for Surface Laptop Studio
 
 platform/x86/intel:
  -  hid: Add DMI switches allow list
  -  punit_ipc: Drop wrong use of ACPI_PTR()
 
 platform_data/mlxreg:
  -  Add new field for secured access
  -  Add new type to support modular systems
 
 sony-laptop:
  -  replace snprintf in show functions with sysfs_emit
 
 surface:
  -  surface3_power: Drop redundant acpi_bus_get_device() call
  -  surface3-wmi: Use ACPI_COMPANION() directly
 
 system76_acpi:
  -  Fix input device error handling
  -  fix Kconfig dependencies
  -  Add attribute group for kb_led_color
  -  Add battery charging thresholds
  -  Replace Fn+F2 function for OLED models
  -  Report temperature and fan speed
 
 thinkpad_acpi:
  -  Fix bitwise vs. logical warning
  -  Fix coccinelle warnings
  -  Switch to common use of attributes
 
 touchscreen_dmi:
  -  Add info for the Viglen Connect 10 tablet
  -  Update info for the Chuwi Hi10 Plus (CWI527) tablet
  -  Add info for the Chuwi HiBook (CWI514) tablet
 
 update email addresses. Change all email addresses for Mark Gross to use markgross@kernel.org.:
  - update email addresses. Change all email addresses for Mark Gross to use markgross@kernel.org.
 
 wmi:
  -  change notification handler type
  -  more detailed error reporting in find_guid()
  -  introduce helper to retrieve event data
  -  introduce helper to determine type
  -  introduce helper to generate method names
  -  introduce helper to convert driver to WMI driver
  -  simplify error handling logic
  -  do not fail if disabling fails
  -  improve debug messages
  -  align arguments of functions
  -  move variables
  -  remove variable
  -  use sizeof(*p) in allocation
  -  use !p to check for NULL
  -  use sysfs_emit()
  -  make GUID block packed
  -  use guid_t and guid_equal()
  -  use bool instead of int
  -  use BIT() macro
  -  remove unnecessary checks
  -  remove stray empty line
  -  remove unnecessary casts
  -  remove unnecessary argument
  -  remove unnecessary variable
  -  remove unnecessary initializations
  -  remove unnecessary initialization
  -  remove commas
  -  fix checkpatch warnings
  -  fix kernel doc
 -----BEGIN PGP SIGNATURE-----
 
 iQFIBAABCAAyFiEEuvA7XScYQRpenhd+kuxHeUQDJ9wFAmGBVW0UHGhkZWdvZWRl
 QHJlZGhhdC5jb20ACgkQkuxHeUQDJ9xufQgAnheynzaOChdXasbvR//mv+lyGE49
 76uRA9HF9SeP430B+MTkZuYhEIiiY7lKjHi7ZY15HPY0r6wrrbJn+zDBpXFo3Scy
 6CC/KUNNkwZgy1KoDC0v1SynlkHZgS4F98S1/IKkcBDQH91N0VltLFKuYYiPw2Hp
 APMmQUxGGxdmBlxyKOZnFK5BicNCzGL9klkU2evQmywICx3ZT3Q9jQ1YIoiw85O+
 sH7Owt3jIpWVbhb6TcPupuKw4LP6hqa8z9yYLchGaJQFyr1RXTznmLAB7foKRCJ/
 48jGgjlHF2OkrLiOvT8hFMqpU52VjVUr0fBGyRjWb7dIpt5Fp1M2HLlRXA==
 =cpVa
 -----END PGP SIGNATURE-----

Merge tag 'platform-drivers-x86-v5.16-1' of git://git.kernel.org/pub/scm/linux/kernel/git/pdx86/platform-drivers-x86

Pull x86 platform driver updates from Hans de Goede:
 "Highlights:

   - AMD-PMC S0ix support fixes and improvements

   - HP-WMI support for Omen laptops

   - New nvidia-wmi-ec-backlight driver

   - New Intel ISH ECLITE driver

   - WMI core cleanups

   - Support for various new Melanox platforms

   - System76 Laptop support improvements

   - Surface Laptop Studio support and initial Surface Pro 8 support

   - Various other small fixes and hardware-id additions"

* tag 'platform-drivers-x86-v5.16-1' of git://git.kernel.org/pub/scm/linux/kernel/git/pdx86/platform-drivers-x86: (106 commits)
  platform/x86: system76_acpi: Fix input device error handling
  platform/x86: touchscreen_dmi: Add info for the Viglen Connect 10 tablet
  platform/surface: aggregator_registry: Add initial support for Surface Pro 8
  platform/x86: mlx-platform: Add support for new system SGN2410
  platform/x86: mlx-platform: Add BIOS attributes for CoffeeLake COMEx based systems
  platform/x86: mlx-platform: Extend FAN and LED configuration to support new MQM97xx systems
  platform/x86: asus-wmi: rename platform_profile_* function symbols
  platform/x86: hp-wmi: rename platform_profile_* function symbols
  platform/x86: amd-pmc: Drop check for valid alarm time
  platform/x86: amd-pmc: Downgrade dev_info message to dev_dbg
  platform/x86: amd-pmc: fix compilation without CONFIG_RTC_SYSTOHC_DEVICE
  platform/x86: system76_acpi: fix Kconfig dependencies
  platform/x86: barco-p50-gpio: use KEY_VENDOR for button instead of KEY_RESTART
  platform/x86: sony-laptop: replace snprintf in show functions with sysfs_emit
  platform/x86: lg-laptop: replace snprintf in show functions with sysfs_emit
  docs: ABI: fix documentation warning in sysfs-driver-mlxreg-io
  platform/x86: wmi: change notification handler type
  HID: surface-hid: Allow driver matching for target ID 1 devices
  HID: surface-hid: Use correct event registry for managing HID events
  platform/surface: aggregator_registry: Add support for Surface Laptop Studio
  ...
2021-11-02 21:54:26 -07:00
Charles Keepax
a2697972b9
ASoC: cs35l41: Change monitor widgets to siggens
Currently the internal monitor sources are input widgets, which means
if the card is set to fully routed these will not enable unless connected
to something in the machine driver. However, all these are internal
monitor signals so it makes no sense to connect them to something in the
machine driver. As such switch them to siggen widgets which will have
the same behaviour except not require external linkage on a fully routed
card.

Signed-off-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Signed-off-by: David Rhodes <drhodes@opensource.cirrus.com>
Link: https://lore.kernel.org/r/20211029214028.401284-1-drhodes@opensource.cirrus.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-11-02 13:39:58 +00:00
Takashi Iwai
a0292f3ebe ASoC: Updates for v5.16
This is an unusually large set of updates, mostly a large crop of
 unusually big drivers coupled with extensive overhauls of existing code.
 There's a SH change here for the DAI format terminology, the change is
 straightforward and the SH maintainers don't seem very active.
 
  - A new version of the audio graph card which supports a wider range of
    systems.
  - Move of the Cirrus DSP framework into drivers/firmware to allow for
    future use by non-audio DSPs.
  - Several conversions to YAML DT bindings.
  - Continuing cleanups to the SOF and Intel code.
  - A very big overhaul of the cs42l42 driver, correcting many problems.
  - Support for AMD Vangogh and Yelow Cap, Cirrus CS35L41, Maxim
    MAX98520 and MAX98360A, Mediatek MT8195, Nuvoton NAU8821, nVidia
    Tegra210, NXP i.MX8ULP, Qualcomm AudioReach, Realtek ALC5682I-VS,
    RT5682S, and RT9120 and Rockchip RV1126 and RK3568
 -----BEGIN PGP SIGNATURE-----
 
 iQEzBAABCgAdFiEEreZoqmdXGLWf4p/qJNaLcl1Uh9AFAmF/+i8ACgkQJNaLcl1U
 h9AWiAf+OoukOIBspXW3hoa7gfAhiP1bEpaforZaz0grYDT8IGBwO01JTe3qlHM2
 KLSi1k97Y33aVPjIox6ynJ9EJ+OwGfHujqFCeI1jm+QRnOCAqQx8oHaKCMzbvUpk
 rFhok4xR5XMR6NZUGQVtp5cv903r32mb0Prxvp6CXeGc6HZxcjAMYsGRBPcQoprN
 FCkiTf1qxrNQl2UmRsf8rDQmHiHpnGjiUpIUrtY9wvZGE3EQzfhQ3r1TAw7AVMmC
 YDQxjU/KftW2zTgXx+mGtu1iX0OMUBo/W8oR9RjIUUIkyA6CllScBOvQIgp9EU18
 PZPIEsyuC9zwcxHb7bPXx5E9vRsY7A==
 =/NwC
 -----END PGP SIGNATURE-----

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

ASoC: Updates for v5.16

This is an unusually large set of updates, mostly a large crop of
unusually big drivers coupled with extensive overhauls of existing code.
There's a SH change here for the DAI format terminology, the change is
straightforward and the SH maintainers don't seem very active.

 - A new version of the audio graph card which supports a wider range of
   systems.
 - Move of the Cirrus DSP framework into drivers/firmware to allow for
   future use by non-audio DSPs.
 - Several conversions to YAML DT bindings.
 - Continuing cleanups to the SOF and Intel code.
 - A very big overhaul of the cs42l42 driver, correcting many problems.
 - Support for AMD Vangogh and Yelow Cap, Cirrus CS35L41, Maxim
   MAX98520 and MAX98360A, Mediatek MT8195, Nuvoton NAU8821, nVidia
   Tegra210, NXP i.MX8ULP, Qualcomm AudioReach, Realtek ALC5682I-VS,
   RT5682S, and RT9120 and Rockchip RV1126 and RK3568
2021-11-01 16:58:27 +01:00
Takashi Iwai
8beea31350 Merge branch 'for-next' into for-linus
Merge 5.16-devel branch for upstreaming

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2021-11-01 07:34:19 +01:00
Mark Brown
6195eb15f6
Merge series "Multiple headphone codec driver support" from Brent Lu <brent.lu@intel.com>:
Support multiple headphone drivers in same machine driver. In this
case, both rt5682 and rt5682s are supported and enumerated by different
ACPI HID "10EC5682" and "RTL5682".

V2 Changes:
- remove useless 'NULL', 'false' in if-condition
- can use 'comp_ids' field alone to enumerate driver
- add comma to the end of entry in structure initialization
- keep the table of byt/cht/cml/icl untouched

V3 Changes:
- upstreamd from SOF github, PR#3200
- use new compatiable IDs to shrink the enumerate table of BYT and CHT
- add 'const' to snd_soc_acpi_codecs structures

V4 Changes:
- add signoff to patch 4~6

V5 Changes:
- none, just rebase for patch 3 conflict

Brent Lu (3):
  ASoC: soc-acpi: add comp_ids field for machine driver matching
  ASoC: Intel: sof_rt5682: detect codec variant in probe function
  ASoC: Intel: sof_rt5682: use comp_ids to enumerate rt5682s

Pierre-Louis Bossart (3):
  ASoC: Intel: soc-acpi-byt: shrink tables using compatible IDs
  ASoC: Intel: soc-acpi-cht: shrink tables using compatible IDs
  ASoC: Intel: soc-acpi: use const for all uses of snd_soc_acpi_codecs

 include/sound/soc-acpi.h                      |  3 +
 sound/soc/intel/boards/sof_rt5682.c           | 34 ++-------
 .../intel/common/soc-acpi-intel-adl-match.c   | 11 ++-
 .../intel/common/soc-acpi-intel-bxt-match.c   |  2 +-
 .../intel/common/soc-acpi-intel-byt-match.c   | 68 +++++++-----------
 .../intel/common/soc-acpi-intel-cht-match.c   | 69 +++++++------------
 .../intel/common/soc-acpi-intel-cml-match.c   |  8 +--
 .../intel/common/soc-acpi-intel-glk-match.c   |  2 +-
 .../intel/common/soc-acpi-intel-jsl-match.c   | 43 ++++--------
 .../intel/common/soc-acpi-intel-kbl-match.c   | 12 ++--
 .../intel/common/soc-acpi-intel-skl-match.c   |  2 +-
 .../intel/common/soc-acpi-intel-tgl-match.c   | 11 ++-
 sound/soc/soc-acpi.c                          | 24 ++++++-
 13 files changed, 119 insertions(+), 170 deletions(-)

--
2.25.1
2021-10-29 21:53:41 +01:00
Mark Brown
956ac4f1f5
Merge series "ASoC: Sanity checks and soc-topology updates" from Cezary Rojewski <cezary.rojewski@intel.com>:
Couple of soc-topology related changes and a use-after-free fix. Said fix
and two sanity checks for soc-topology lead the way. While the
use-after-free is quite obvious, the sanity checks are here to cover for
cases where user malformed the topology file -or- access to filesystem
somehow got interrupted during copy operation. We shouldn't be reading
outside the file boundary.

Afterward a change to soc_tplg_add_kcontrol(): device being passed to
soc_tplg_add_dcontrol() from comp->dev to tplg->dev which corrects
dev_xxx() invoked later on.
Also, device used for topology memory allocations from component->dev to
component->card->dev so memory gets freed each time card device (usually
platform device) is removed rather than the component device what may
happen less frequently.

Dummy component gets smarter and no longer overrides hw_params if
there are other components accociated with related struct
snd_soc_pcm_runtime instance.

Amadeusz Sławiński (5):
  ASoC: core: Remove invalid snd_soc_component_set_jack call
  ASoC: topology: Check for dapm widget completeness
  ASoC: topology: Use correct device for prints
  ASoC: topology: Change topology device to card device
  ASoC: Stop dummy from overriding hwparams

Cezary Rojewski (1):
  ASoC: topology: Add header payload_size verification

 sound/soc/soc-core.c     |  3 ---
 sound/soc/soc-topology.c | 34 ++++++++++++++++++++++++++++++----
 sound/soc/soc-utils.c    | 13 +++++++++++++
 3 files changed, 43 insertions(+), 7 deletions(-)

--
2.25.1
2021-10-29 21:53:39 +01:00
Christophe JAILLET
173632358f
ASoC: rsnd: Fix an error handling path in 'rsnd_node_count()'
If we return before the end of the 'for_each_child_of_node()' iterator, the
reference taken on 'np' must be released.

Add the missing 'of_node_put()' call.

Fixes: c413983eb6 ("ASoC: rsnd: adjust disabled module")
Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Reviewed-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/4c0e893cbfa21dc76c1ede0b6f4f8cff42209299.1634586167.git.christophe.jaillet@wanadoo.fr
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-10-29 18:55:25 +01:00
Uwe Kleine-König
2a7985136c
ASoC: tlv320aic3x: Make aic3x_remove() return void
Up to now aic3x_remove() returns zero unconditionally. Make it return
void instead which makes it easier to see in the callers that there is
no error to handle.

Also the return value of i2c and spi remove callbacks is ignored anyway.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Link: https://lore.kernel.org/r/20211019074125.3812513-1-u.kleine-koenig@pengutronix.de
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-10-29 18:55:24 +01:00
Pierre-Louis Bossart
9a5d96add5
ASoC: Intel: soc-acpi: use const for all uses of snd_soc_acpi_codecs
'const' qualifiers are missing on some platforms, add as needed.

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Brent Lu <brent.lu@intel.com>
Link: https://lore.kernel.org/r/20211029171409.611600-7-brent.lu@intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-10-29 18:55:22 +01:00
Pierre-Louis Bossart
959ae8215a
ASoC: Intel: soc-acpi-cht: shrink tables using compatible IDs
We have multiple entries for the same codecs, use the new compatible
IDs to have a single entry.

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Brent Lu <brent.lu@intel.com>
Link: https://lore.kernel.org/r/20211029171409.611600-6-brent.lu@intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-10-29 18:55:21 +01:00
Pierre-Louis Bossart
dac7cbd55d
ASoC: Intel: soc-acpi-byt: shrink tables using compatible IDs
We have multiple entries for the same codecs, use the new compatible
IDs to have a single entry.

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Brent Lu <brent.lu@intel.com>
Link: https://lore.kernel.org/r/20211029171409.611600-5-brent.lu@intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-10-29 18:55:20 +01:00
Brent Lu
d4f3fdc2b7
ASoC: Intel: sof_rt5682: use comp_ids to enumerate rt5682s
Use comp_ids field to enumerate rt5682/rt5682s headphone codec for
JSL/TGL/ADL devices and remove redundant entries in tables.

Signed-off-by: Brent Lu <brent.lu@intel.com>
Link: https://lore.kernel.org/r/20211029171409.611600-4-brent.lu@intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-10-29 18:55:19 +01:00
Brent Lu
8fe6ec0318
ASoC: Intel: sof_rt5682: detect codec variant in probe function
Detect whether the headphone codec is ALC5682I-VS or not in probe
function so we don't need to duplicate all board configs for this new
variant.

Signed-off-by: Brent Lu <brent.lu@intel.com>
Link: https://lore.kernel.org/r/20211029171409.611600-3-brent.lu@intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-10-29 18:55:18 +01:00
Brent Lu
cafa39b650
ASoC: soc-acpi: add comp_ids field for machine driver matching
A machine driver needs to be enumerated by more than one ACPI HID if
it supports second headphone driver (i.e. rt5682 and rt5682s).
However, the id field in snd_soc_acpi_mach structure could contain
only one HID. By adding a 'comp_ids' field which can contain several
HIDs, we can enumerate a machine driver by multiple ACPI HIDs.

Signed-off-by: Brent Lu <brent.lu@intel.com>
Link: https://lore.kernel.org/r/20211029171409.611600-2-brent.lu@intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-10-29 18:55:16 +01:00
Trevor Wu
0261e36477
ASoC: mediatek: mt8195: add machine driver with mt6359, rt1011 and rt5682
This patch adds support for mt8195 board with mt6359, rt1011 and rt5682.

Signed-off-by: Trevor Wu <trevor.wu@mediatek.com>
Link: https://lore.kernel.org/r/20211020071428.14297-2-trevor.wu@mediatek.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-10-29 16:49:47 +01:00
Amadeusz Sławiński
6c504663ba
ASoC: Stop dummy from overriding hwparams
In case that there are other components assigned to runtime device,
depending on order dummy component can override their params with its
own, which shouldn't happen. Check if there are any other components
assigned to rtd and if so, skip setting hwparams.

Occurs when using topology where 'snd-soc-dummy' gets assigned by
default as codec and platform component.

Alternative approach would be to copy whole dummy handling and rename it
to "snd-soc-null" or something similar. And remove hwparams assignment
to make it really do nothing.

Signed-off-by: Amadeusz Sławiński <amadeuszx.slawinski@linux.intel.com>
Signed-off-by: Cezary Rojewski <cezary.rojewski@intel.com>
Link: https://lore.kernel.org/r/20211015161257.27052-7-cezary.rojewski@intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-10-29 16:49:45 +01:00
Amadeusz Sławiński
f714fbc1e8
ASoC: topology: Change topology device to card device
Topology needs device for prints and resource allocation. So far,
component->dev is used. However, this may lead to high memory use in
model where card is an independent driver which can be reloaded and
topology is loaded from component's probe() method. Every time machine
driver is reloaded topology is being loaded anew, each time allocating
new memory. Said memory will only be freed when component itself is
being freed.

Address the problem by tying topology to component->card->dev instead,
so memory occupied by the topology is freed whenever related machine
device gets removed.

Signed-off-by: Amadeusz Sławiński <amadeuszx.slawinski@linux.intel.com>
Signed-off-by: Cezary Rojewski <cezary.rojewski@intel.com>
Link: https://lore.kernel.org/r/20211015161257.27052-6-cezary.rojewski@intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-10-29 16:49:44 +01:00
Amadeusz Sławiński
2a710bb35a
ASoC: topology: Use correct device for prints
soc_tplg_add_dcontrol() passes device as argument which is later used to
print messages. Align it with all other prints in file to use tplg->dev.

Signed-off-by: Amadeusz Sławiński <amadeuszx.slawinski@linux.intel.com>
Signed-off-by: Cezary Rojewski <cezary.rojewski@intel.com>
Link: https://lore.kernel.org/r/20211015161257.27052-5-cezary.rojewski@intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-10-29 16:49:43 +01:00
Amadeusz Sławiński
2e288333e9
ASoC: topology: Check for dapm widget completeness
Add sanity checks to make sure the data is read within file boundary.
Helps in situations where file is only partially copied or malformed.

Signed-off-by: Amadeusz Sławiński <amadeuszx.slawinski@linux.intel.com>
Signed-off-by: Cezary Rojewski <cezary.rojewski@intel.com>
Link: https://lore.kernel.org/r/20211015161257.27052-4-cezary.rojewski@intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-10-29 16:49:42 +01:00
Cezary Rojewski
86e2d14b6d
ASoC: topology: Add header payload_size verification
Add sanity check to make sure the data is read within file boundary.
Helps in situations where file is only partially copied or malformed.

Signed-off-by: Cezary Rojewski <cezary.rojewski@intel.com>
Link: https://lore.kernel.org/r/20211015161257.27052-3-cezary.rojewski@intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-10-29 16:49:41 +01:00
Amadeusz Sławiński
7db53c21b1
ASoC: core: Remove invalid snd_soc_component_set_jack call
If snd_soc_component_set_jack() is called after
snd_soc_component_remove() it may operate on memory which is freed in
->remove handler.

Signed-off-by: Amadeusz Sławiński <amadeuszx.slawinski@linux.intel.com>
Signed-off-by: Cezary Rojewski <cezary.rojewski@intel.com>
Link: https://lore.kernel.org/r/20211015161257.27052-2-cezary.rojewski@intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-10-29 16:49:40 +01:00
Vincent Knecht
b6a4e209fb
ASoC: codecs: tfa989x: Add support for tfa9897 RCV bit
TFA9897 has an internal 'rcv' switch so that it can manage both
loudspeaker and earpiece modes with the same physical speaker.

Signed-off-by: Vincent Knecht <vincent.knecht@mailoo.org>
Link: https://lore.kernel.org/r/20211024085840.1536438-3-vincent.knecht@mailoo.org
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-10-29 15:59:36 +01:00
Arnd Bergmann
62a3032260
ASoC: amd: acp: select CONFIG_SND_SOC_ACPI
The acp-platform driver now needs the ACPI helpers:

ld.lld: error: undefined symbol: snd_soc_acpi_find_machine
>>> referenced by acp-platform.c
>>>               soc/amd/acp/acp-platform.o:(acp_machine_select) in archive sound/built-in.a

ld.lld: error: undefined symbol: snd_soc_acpi_codec_list
>>> referenced by acp-renoir.c
>>>               soc/amd/acp/acp-renoir.o:(snd_soc_acpi_amd_acp_machines) in archive sound/built-in.a

Other drivers using this interface, select SND_SOC_ACPI, so do the
same thing here.

Fixes: e646b51f5d ("ASoC: amd: acp: Add callback for machine driver on ACP")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Link: https://lore.kernel.org/r/20211029113714.966823-1-arnd@kernel.org
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-10-29 14:57:16 +01:00
Mark Brown
1560081f4c
Merge series "ASoC: cs42l42: Fix definition and handling of jack switch invert" from Richard Fitzgerald <rf@opensource.cirrus.com>:
Summary: The driver applied the opposite of the DT setting to the
wrong register bit.

The jack plug detect hardware in cs42l42 is somewhat confusing,
compounded by an unclear description in the datasheet. This is most
likely the reason that the driver implemented a DT property for the
wrong register bit, that had the opposite effect of what was
described in the binding.

Changing the meaning of the property values isn't feasible; the
driver dates from 2016 and the risk of breaking out-of-tree configs
is too high (the property is also available to ACPI systems).

So the fix is to make the binding doc match the actual behaviour and
then fix the driver to apply it to the correct register bit.

As a bonus, patch #3 converts the binding to yaml.

Richard Fitzgerald (3):
  ASoC: dt-bindings: cs42l42: Correct description of ts-inv
  ASoC: cs42l42: Correct configuring of switch inversion from ts-inv
  ASoC: dt-bindings: cs42l42: Convert binding to yaml

 .../devicetree/bindings/sound/cirrus,cs42l42.yaml  | 225 +++++++++++++++++++++
 .../devicetree/bindings/sound/cs42l42.txt          | 114 -----------
 MAINTAINERS                                        |   1 +
 sound/soc/codecs/cs42l42.c                         |   9 +-
 4 files changed, 230 insertions(+), 119 deletions(-)
 create mode 100644 Documentation/devicetree/bindings/sound/cirrus,cs42l42.yaml
 delete mode 100644 Documentation/devicetree/bindings/sound/cs42l42.txt

--
2.11.0
2021-10-29 14:51:28 +01:00
Brent Lu
88b4d77d60
ASoC: Intel: glk_rt5682_max98357a: support ALC5682I-VS codec
Detect the codec variant in probe function and update DAI link
accordingly. Also add an new entry in enumeration table for machine
driver enumeration.

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/20211028140909.496022-1-brent.lu@intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-10-29 12:36:11 +01:00
Julian Braha
2554877e4b
ASoC: fix unmet dependencies on GPIOLIB for SND_SOC_RT1015P
When SND_SOC_MT8192_MT6359_RT1015_RT5682,
SND_SOC_MT8192_MT6359_RT1015_RT5682,
SND_SOC_MT8183_DA7219_MAX98357A, or
SND_SOC_MT8183_MT6358_TS3A227E_MAX98357A is selected,
and GPIOLIB is not selected, Kbuild gives the following
warnings, respectively:

WARNING: unmet direct dependencies detected for SND_SOC_DMIC
  Depends on [n]: SOUND [=y] && !UML && SND [=y] && SND_SOC [=y] && GPIOLIB [=n]
  Selected by [y]:
  - SND_SOC_MT8192_MT6359_RT1015_RT5682 [=y] && SOUND [=y] && !UML && SND [=y] && SND_SOC [=y] && I2C [=y] && SND_SOC_MT8192 [=y] && MTK_PMIC_WRAP [=y]

WARNING: unmet direct dependencies detected for SND_SOC_RT1015P
  Depends on [n]: SOUND [=y] && !UML && SND [=y] && SND_SOC [=y] && GPIOLIB [=n]
  Selected by [y]:
  - SND_SOC_MT8192_MT6359_RT1015_RT5682 [=y] && SOUND [=y] && !UML && SND [=y] && SND_SOC [=y] && I2C [=y] && SND_SOC_MT8192 [=y] && MTK_PMIC_WRAP [=y]

WARNING: unmet direct dependencies detected for SND_SOC_RT1015P
  Depends on [n]: SOUND [=y] && !UML && SND [=y] && SND_SOC [=y] && GPIOLIB [=n]
  Selected by [y]:
  - SND_SOC_MT8183_DA7219_MAX98357A [=y] && SOUND [=y] && !UML && SND [=y] && SND_SOC [=y] && SND_SOC_MT8183 [=y] && I2C [=y]

WARNING: unmet direct dependencies detected for SND_SOC_RT1015P
  Depends on [n]: SOUND [=y] && !UML && SND [=y] && SND_SOC [=y] && GPIOLIB [=n]
  Selected by [y]:
  - SND_SOC_MT8183_MT6358_TS3A227E_MAX98357A [=y] && SOUND [=y] && !UML && SND [=y] && SND_SOC [=y] && I2C [=y] && SND_SOC_MT8183 [=y]

This is because these config options select SND_SOC_RT1015P
without selecting or depending on GPIOLIB, despite
SND_SOC_RT1015P depending on GPIOLIB.

These unmet dependency bugs were detected by Kismet,
a static analysis tool for Kconfig. Please advise if this
is not the appropriate solution.

Signed-off-by: Julian Braha <julianbraha@gmail.com>
Acked-by: Tzung-Bi Shih <tzungbi@google.com>
Link: https://lore.kernel.org/r/20211029001225.27218-1-julianbraha@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-10-29 12:36:05 +01:00
Pierre-Louis Bossart
986c5b0a1d
ASoC: es8316: add support for ESSX8336 ACPI _HID
The same codec seems to have different personalities. ESSX8316 was
used for Baytrail/CherryTrail, ESSX8336 seems to be used for AppoloLake,
GeminiLake, JasperLake and TigerLake devices.

BugLink: https://github.com/thesofproject/linux/issues/2955
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>-e
Reviewed-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Link: https://lore.kernel.org/r/20211029011109.23633-1-yung-chuan.liao@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-10-29 12:36:04 +01:00
Richard Fitzgerald
778a0cbef5
ASoC: cs42l42: Correct configuring of switch inversion from ts-inv
The setting from the cirrus,ts-inv property should be applied to the
TIP_SENSE_INV bit, as this is the one that actually affects the jack
detect block. The TS_INV bit only swaps the meaning of the PLUG and
UNPLUG interrupts and should always be 1 for the interrupts to have
the normal meaning.

Due to some misunderstanding the driver had been implemented to
configure the TS_INV bit based on the jack switch polarity. This made
the interrupts behave the correct way around, but left the jack detect
block, button detect and analogue circuits always interpreting an open
switch as unplugged.

The signal chain inside the codec is:

SENSE pin -> TIP_SENSE_INV -> TS_INV -> (invert) -> interrupts
                  |
                  v
             Jack detect,
          button detect and
            analog control

As the TIP_SENSE_INV already performs the necessary inversion the
TS_INV bit never needs to change. It must always be 1 to yield the
expected interrupt behaviour.

Some extra confusion has arisen because of the additional invert in the
interrupt path, meaning that a value applied to the TS_INV bit produces
the opposite effect of applying it to the TIP_SENSE_INV bit. The ts-inv
property has therefore always had the opposite effect to what might be
expected (0 = inverted, 1 = not inverted). To maintain the meaning of
the ts-inv property it must be inverted when applied to TIP_SENSE_INV.

Signed-off-by: Richard Fitzgerald <rf@opensource.cirrus.com>
Fixes: 2c394ca796 ("ASoC: Add support for CS42L42 codec")
Link: https://lore.kernel.org/r/20211028140902.11786-3-rf@opensource.cirrus.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-10-29 12:28:47 +01:00