Commit graph

46414 commits

Author SHA1 Message Date
Dan Carpenter
469e2f28c2
ASoC: SOF: ipc3-dtrace: uninitialized data in dfsentry_trace_filter_write()
This doesn't check how many bytes the simple_write_to_buffer() writes to
the buffer.  The only thing that we know is that the first byte is
initialized and the last byte of the buffer is set to NUL.  However
the middle bytes could be uninitialized.

There is no need to use simple_write_to_buffer().  This code does not
support partial writes but instead passes "pos = 0" as the starting
offset regardless of what the user passed as "*ppos".  Just use the
copy_from_user() function and initialize the whole buffer.

Fixes: 671e0b9005 ("ASoC: SOF: Clone the trace code to ipc3-dtrace as fw_tracing implementation")
Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>
Link: https://lore.kernel.org/r/74148292-ce4d-4e01-a1a7-921e6767da14@moroto.mountain
Signed-off-by: Mark Brown <broonie@kernel.org>
2023-07-17 06:15:10 +01:00
Thomas Petazzoni
e51df4f81b
ASoC: cs42l51: fix driver to properly autoload with automatic module loading
In commit 2cb1e0259f ("ASoC: cs42l51: re-hook of_match_table
pointer"), 9 years ago, some random guy fixed the cs42l51 after it was
split into a core part and an I2C part to properly match based on a
Device Tree compatible string.

However, the fix in this commit is wrong: the MODULE_DEVICE_TABLE(of,
....) is in the core part of the driver, not the I2C part. Therefore,
automatic module loading based on module.alias, based on matching with
the DT compatible string, loads the core part of the driver, but not
the I2C part. And threfore, the i2c_driver is not registered, and the
codec is not known to the system, nor matched with a DT node with the
corresponding compatible string.

In order to fix that, we move the MODULE_DEVICE_TABLE(of, ...) into
the I2C part of the driver. The cs42l51_of_match[] array is also moved
as well, as it is not possible to have this definition in one file,
and the MODULE_DEVICE_TABLE(of, ...) invocation in another file, due
to how MODULE_DEVICE_TABLE works.

Thanks to this commit, the I2C part of the driver now properly
autoloads, and thanks to its dependency on the core part, the core
part gets autoloaded as well, resulting in a functional sound card
without having to manually load kernel modules.

Fixes: 2cb1e0259f ("ASoC: cs42l51: re-hook of_match_table pointer")
Cc: stable@vger.kernel.org
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
Link: https://lore.kernel.org/r/20230713112112.778576-1-thomas.petazzoni@bootlin.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2023-07-17 06:15:09 +01:00
Mark Brown
0791faebfe Linux 6.5-rc2
-----BEGIN PGP SIGNATURE-----
 
 iQFSBAABCAA8FiEEq68RxlopcLEwq+PEeb4+QwBBGIYFAmS0at0eHHRvcnZhbGRz
 QGxpbnV4LWZvdW5kYXRpb24ub3JnAAoJEHm+PkMAQRiG6m8H/RZCd2DWeM94CgK5
 DIxNLxu90PrEcrOnqeHFJtQoSiUQTHeseh9E4BH0JdPDxtlU89VwYRAevseWiVkp
 JyyJPB40UR4i2DO0P1+oWBBsGEG+bo8lZ1M+uxU5k6lgC0fAi96/O48mwwmI0Mtm
 P6BkWd3IkSXc7l4AGIrKa5P+pYEnm0Z6YAZILfdMVBcLXZWv1OAwEEkZNdUuhE3d
 5DxlQ8MLzlQIbe+LasiwdL9r606acFaJG9Hewl9x5DBlsObZ3d2rX4vEt1NEVh89
 shV29xm2AjCpLh4kstJFdTDCkDw/4H7TcFB/NMxXyzEXp3Bx8YXq+mjVd2mpq1FI
 hHtCsOA=
 =KiaU
 -----END PGP SIGNATURE-----
gpgsig -----BEGIN PGP SIGNATURE-----
 
 iQEzBAABCgAdFiEEreZoqmdXGLWf4p/qJNaLcl1Uh9AFAmS0zgsACgkQJNaLcl1U
 h9C8Zwf9HZwtLMlojz17PYAkErGIwAGzwH8jsBmWnOwMuifQi8ofpFLv0gFz17k0
 P3bIyXBc4JV3I0+A+b5+sv+BOtaUk9pWSoLIn5SAEK0ydfqpWhkKou2eoMmGt/UW
 Zv6WSCfgN7K2XiXIuvUBjyr4F57m+GMb5/UIPDv01TPrOb+Usz6kmZwgtRqpOTE4
 ozDNUwNtx074h7ZHNx/taP7i2bt9pD+KnY6KgJ/6S9QtCE7+SCuDGIV35YFJx/8R
 b+hrmm40ES7GP/qYXZ+OF+iBAm7svs6nSKbkSmKxZZDHc9i4GkOOt8yI3TvF2GPf
 uTFjjLNuZEHat5ksZfFCbdEAlYR0sQ==
 =x+J9
 -----END PGP SIGNATURE-----

ASoC: Merge v6.5-rc2

Get a similar baseline to my other branches, and fixes for people using
the branch.
2023-07-17 06:12:31 +01:00
Derek Fang
cc8ff2dfcb
ASoC: rt5640: Fix the issue of speaker noise
Remove the class-D internal register setting during initialization
to be compatible with most speaker designs to avoid noise.

Signed-off-by: Derek Fang <derek.fang@realtek.com>
Link: https://lore.kernel.org/r/20230712062553.31066-1-derek.fang@realtek.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2023-07-14 14:44:21 +01:00
Kailang Yang
69ea4c9d02 ALSA: hda/realtek - remove 3k pull low procedure
This was the ALC283 depop procedure.
Maybe this procedure wasn't suitable with new codec.
So, let us remove it. But HP 15z-fc000 must do 3k pull low. If it
reboot with plugged headset,
it will have errors show don't find codec error messages. Run 3k pull
low will solve issues.
So, let AMD chipset will run this for workarround.

Fixes: 5aec989130 ("ALSA: hda/realtek - ALC236 headset MIC recording issue")
Signed-off-by: Kailang Yang <kailang@realtek.com>
Cc: <stable@vger.kernel.org>
Reported-by: Joseph C. Sible <josephcsible@gmail.com>
Closes: https://lore.kernel.org/r/CABpewhE4REgn9RJZduuEU6Z_ijXNeQWnrxO1tg70Gkw=F8qNYg@mail.gmail.com/
Link: https://lore.kernel.org/r/4678992299664babac4403d9978e7ba7@realtek.com
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2023-07-14 07:59:21 +02:00
Uwe Kleine-König
35bc3efb31 ALSA: pcmtest: Don't use static storage to track per device data
While there is probably only ever a single instance of such a pcmtst
device, it's still bad style to use a static variable to store per
device data. Make use of platform_get_drvdata() and
platform_set_drvdata() which fixes a data corruption if there should be
two or more such devices (or this driver is used as a template for
another driver).

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Acked-by: Ivan Orlov <ivan.orlov0322@gmail.com>
Link: https://lore.kernel.org/r/20230707075058.3402832-2-u.kleine-koenig@pengutronix.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2023-07-10 08:52:37 +02:00
Uwe Kleine-König
cb2bffdea2 ALSA: pcmtest: Convert to platform remove callback returning void
The .remove() callback for a platform driver returns an int which makes
many driver authors wrongly assume it's possible to do error handling by
returning an error code. However the value returned is ignored (apart
from emitting a warning) and this typically results in resource leaks.
To improve here there is a quest to make the remove callback return
void. In the first step of this quest all drivers are converted to
.remove_new() which already returns void. Eventually after all drivers
are converted, .remove_new() is renamed to .remove().

Trivially convert this driver from always returning zero in the remove
callback to the void returning variant.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Acked-by: Ivan Orlov <ivan.orlov0322@gmail.com>
Link: https://lore.kernel.org/r/20230707075058.3402832-1-u.kleine-koenig@pengutronix.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2023-07-10 08:52:15 +02:00
Mario Limonciello
cd710900ed
ASoC: amd: ps: Fix extraneous error messages
On Pink Sardine machines that don't have SdW controllers in use, the property
`mipi-sdw-manager-list` won't exist.  There is no point in showing an error
to a user when this situation is encountered.

Furthermore if the machine doesn't have a DMIC connected to the ACP, there
may be no platform devices created either.

Downgrade the associated message to debug.

Fixes: d1351c30ac ("ASoC: amd: ps: create platform devices based on acp config")
Signed-off-by: Mario Limonciello <mario.limonciello@amd.com>
Link: https://lore.kernel.org/r/20230708025208.54272-1-mario.limonciello@amd.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2023-07-09 22:42:57 +01:00
Fabio Estevam
86867aca73
ASoC: fsl_sai: Revert "ASoC: fsl_sai: Enable MCTL_MCLK_EN bit for master mode"
This reverts commit ff87d619ac.

Andreas reports that on an i.MX8MP-based system where MCLK needs to be
used as an input, the MCLK pin is actually an output, despite not having
the 'fsl,sai-mclk-direction-output' property present in the devicetree.

This is caused by commit ff87d619ac ("ASoC: fsl_sai: Enable
MCTL_MCLK_EN bit for master mode") that sets FSL_SAI_MCTL_MCLK_EN
unconditionally for imx8mm/8mn/8mp/93, causing the MCLK to always
be configured as output.

FSL_SAI_MCTL_MCLK_EN corresponds to the MOE (MCLK Output Enable) bit
of register MCR and the drivers sets it when the
'fsl,sai-mclk-direction-output' devicetree property is present.

Revert the commit to allow SAI to use MCLK as input as well.

Cc: stable@vger.kernel.org
Fixes: ff87d619ac ("ASoC: fsl_sai: Enable MCTL_MCLK_EN bit for master mode")
Reported-by: Andreas Henriksson <andreas@fatal.se>
Signed-off-by: Fabio Estevam <festevam@denx.de>
Acked-by: Shengjiu Wang <shengjiu.wang@gmail.com>
Link: https://lore.kernel.org/r/20230706221827.1938990-1-festevam@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2023-07-09 22:42:56 +01:00
Linus Torvalds
4c8ab068be sound fixes for 6.5-rc1
A collection of small fixes that have been gathered recently:
 
 - Two code-typo fixes in the new UMP core
 - A fix in jack reporting to avoid the usage of mutex
 - A potential data race fix in HD-audio core regmap code
 - A potential data race fix in PCM allocation helper code
 - HD-audio quirks for ASUS, Clevo and Unis machines
 - Constifications in FireWire drivers
 -----BEGIN PGP SIGNATURE-----
 
 iQJCBAABCAAsFiEEIXTw5fNLNI7mMiVaLtJE4w1nLE8FAmSnwToOHHRpd2FpQHN1
 c2UuZGUACgkQLtJE4w1nLE9b2hAAyJ0mHV74OWq1Dlt9qBODaCO85OuLAzBfkABy
 /EvpZXgZlrcptfaOm0q/ASWj7U7cYzqgj7svqR7Ju5oY781tUHkTJAMdK43NJdF+
 dXnpPi1aXsvv+v7dodqoPVFMX3Bt8ku03AIgNhi//AaIa8MmNu89A8jR3Iy8iva3
 Qv6UoxAYuAIXhD3ZL0snXAxSZqo/JLdScFgiy7RTbqj0CcdlPTZr+6NY0fcceyb5
 EaG+YccxLV/SRkVXlriOf+qZvSWbl+ZT2wWnnjjKUcYiA/riMfvZCWcoKiZCKnDM
 MEdI8OHCi16+rrTAUvx2YCm3WVFf3CVC5Ia6rU0ieaR9i2+ER3pvok2ozvFpw8ES
 DKVdltU2Z36ARolN388Hmyi8k7RW7aomy55V/ZlF2HVWsOwGPOJwGrUbCqFN7rtt
 DprmBcnwXJBlVxSgJMAHXuiqnyVtbzIXXDUFI8ESslmoByc3ImLPo4hGSytfY4Bc
 MAq0sZchwOcx5ylOzRpfFgWbg0X8r8FS0lhw1xLvxaxcwnblOiQLe61oL628Zhpt
 Y79AdZCyn/EhnYB3yRdLQ3TDryaNaH3l3fJxYhWJdQ86fGCGK9xKQh09ibJz96R5
 CiggFvSQyokfIUj7PvYY7RqS7BXcJS3Vd2lQKgQN4tviPpo0Y93LPeDflBvFqxkm
 tJyr48Y=
 =8Fqj
 -----END PGP SIGNATURE-----

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

Pull sound fixes from Takashi Iwai:
 "A collection of small fixes that have been gathered recently:

   - Two code-typo fixes in the new UMP core

   - A fix in jack reporting to avoid the usage of mutex

   - A potential data race fix in HD-audio core regmap code

   - A potential data race fix in PCM allocation helper code

   - HD-audio quirks for ASUS, Clevo and Unis machines

   - Constifications in FireWire drivers"

* tag 'sound-fix-6.5-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound:
  ALSA: hda/realtek: Add quirk for ASUS ROG GZ301V
  ALSA: jack: Fix mutex call in snd_jack_report()
  ALSA: seq: ump: fix typo in system_2p_ev_to_ump_midi1()
  ALSA: hda/realtek: Whitespace fix
  ALSA: hda/realtek: Add quirk for ASUS ROG G614Jx
  ALSA: hda/realtek: Amend G634 quirk to enable rear speakers
  ALSA: hda/realtek: Add quirk for ASUS ROG GA402X
  ALSA: hda/realtek: Add quirk for ASUS ROG GX650P
  ALSA: pcm: Fix potential data race at PCM memory allocation helpers
  ALSA: hda: fix a possible null-pointer dereference due to data race in snd_hdac_regmap_sync()
  ALSA: hda/realtek: Add quirks for Unis H3C Desktop B760 & Q760
  ALSA: hda/realtek: Add quirk for Clevo NPx0SNx
  ALSA: ump: Correct wrong byte size at converting a UMP System message
  ALSA: fireface: make read-only const array for model names static
  ALSA: oxfw: make read-only const array models static
2023-07-07 15:40:17 -07:00
Luke D. Jones
5251605f4d ALSA: hda/realtek: Add quirk for ASUS ROG GZ301V
Adds the required quirk to enable the Cirrus amp and correct pins
on the ASUS ROG GZ301V series which uses an SPI connected Cirrus amp.

While this works if the related _DSD properties are made available, these
aren't included in the ACPI of these laptops (yet).

Signed-off-by: Luke D. Jones <luke@ljones.dev>
Link: https://lore.kernel.org/r/20230706223323.30871-2-luke@ljones.dev
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2023-07-07 08:07:49 +02:00
Takashi Iwai
89dbb335cb ALSA: jack: Fix mutex call in snd_jack_report()
snd_jack_report() is supposed to be callable from an IRQ context, too,
and it's indeed used in that way from virtsnd driver.  The fix for
input_dev race in commit 1b6a6fc528 ("ALSA: jack: Access input_dev
under mutex"), however, introduced a mutex lock in snd_jack_report(),
and this resulted in a potential sleep-in-atomic.

For addressing that problem, this patch changes the relevant code to
use the object get/put and removes the mutex usage.  That is,
snd_jack_report(), it takes input_get_device() and leaves with
input_put_device() for assuring the input_dev being assigned.

Although the whole mutex could be reduced, we keep it because it can
be still a protection for potential races between creation and
deletion.

Fixes: 1b6a6fc528 ("ALSA: jack: Access input_dev under mutex")
Reported-by: Dan Carpenter <dan.carpenter@linaro.org>
Closes: https://lore.kernel.org/r/cf95f7fe-a748-4990-8378-000491b40329@moroto.mountain
Tested-by: Amadeusz Sławiński <amadeuszx.slawinski@linux.intel.com>
Cc: <stable@vger.kernel.org>
Link: https://lore.kernel.org/r/20230706155357.3470-1-tiwai@suse.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2023-07-06 18:01:59 +02:00
Mark Brown
980d97efdb
ASoC/soundwire/qdsp6/wcd: fix leaks and probe deferral
Merge series from Johan Hovold <johan+linaro@kernel.org>:

I've been hitting a race during boot which breaks probe of the sound
card on the Lenovo ThinkPad X13s as I've previously reported here:

	https://lore.kernel.org/all/ZIHMMFtuDtvdpFAZ@hovoldconsulting.com/

The immediate issue appeared to be a probe deferral that was turned into
a hard failure, but addressing that in itself only made things worse as
it exposed further bugs.

I was hoping someone more familiar with the code in question would look
into this, but as this affects users of the X13s and breaks audio on my
machine every fifth boot or so, I decided to investigate it myself.

As expected, the Qualcomm codec drivers are broken and specifically leak
resources on component remove, which in turn breaks sound card probe
deferrals.

The source of the deferral itself appears to be legitimate and was
simply due to some audio component not yet having been registered due to
random changes in timing during boot.

These issues can most easily be reproduced by simply blacklisting the
q6apm_dai module and loading it manually after boot.

Included are also two patches that suppresses error messages on
component probe deferral to avoid spamming the logs during boot.
2023-07-06 16:03:07 +01:00
Geert Uytterhoeven
e231cd833f
ASoC: codecs: SND_SOC_WCD934X should select REGMAP_IRQ
If CONFIG_SND_SOC_WCD934X=y, CONFIG_COMPILE_TEST=y,
CONFIG_MFD_WCD934X=n, CONFIG_REGMAP_IRQ=n:

    aarch64-linux-gnu-ld: sound/soc/codecs/wcd934x.o: in function `wcd934x_codec_probe':
    wcd934x.c:(.text+0x33cc): undefined reference to `regmap_irq_get_virq'
    aarch64-linux-gnu-ld: sound/soc/codecs/wcd934x.o: in function `wcd934x_comp_probe':
    wcd934x.c:(.text+0x4cb0): undefined reference to `regmap_irq_get_virq'
    aarch64-linux-gnu-ld: wcd934x.c:(.text+0x4cc0): undefined reference to `regmap_irq_get_virq'
    aarch64-linux-gnu-ld: wcd934x.c:(.text+0x4cd0): undefined reference to `regmap_irq_get_virq'
    aarch64-linux-gnu-ld: wcd934x.c:(.text+0x4ce0): undefined reference to `regmap_irq_get_virq'
    aarch64-linux-gnu-ld: sound/soc/codecs/wcd934x.o:wcd934x.c:(.text+0x4cf0): more undefined references to `regmap_irq_get_virq' follow

Fix this by making SND_SOC_WCD934X select REGMAP_IRQ.

Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
Link: https://lore.kernel.org/r/cafd878747e7951914a7d9fea33788a4a230d1f0.1688643442.git.geert@linux-m68k.org
Signed-off-by: Mark Brown <broonie@kernel.org>
2023-07-06 13:46:39 +01:00
Srinivas Kandagatla
c1be62923d
ASoC: qcom: q6apm: do not close GPR port before closing graph
Closing GPR port before graph close can result in un handled notifications
from DSP, this results in spam of errors from GPR driver as there is no
one to handle these notification at that point in time.

Fix this by closing GPR port after graph close is finished.

Fixes: 5477518b8a ("ASoC: qdsp6: audioreach: add q6apm support")
Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Link: https://lore.kernel.org/r/20230705131842.41584-1-srinivas.kandagatla@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>
2023-07-06 13:46:38 +01:00
Johan Hovold
f09b6e9679
ASoC: core: suppress probe deferral errors
Suppress probe deferral error messages when probing link components to
avoid spamming the logs, for example, if a required component has not
yet been registered:

	snd-sc8280xp sound: ASoC: failed to instantiate card -517

Note that dev_err_probe() is not used as the card can be unbound and
rebound while the underlying platform device remains bound to its
driver.

Signed-off-by: Johan Hovold <johan+linaro@kernel.org>
Link: https://lore.kernel.org/r/20230705123018.30903-9-johan+linaro@kernel.org
Signed-off-by: Mark Brown <broonie@kernel.org>
2023-07-06 13:46:32 +01:00
Johan Hovold
b6c3bdda3a
ASoC: topology: suppress probe deferral errors
Suppress probe deferral error messages when loading topologies and
creating frontend links to avoid spamming the logs when a component has
not yet been registered:

    snd-sc8280xp sound: ASoC: adding FE link failed
    snd-sc8280xp sound: ASoC: topology: could not load header: -517

Note that dev_err_probe() is not used as the topology component can be
probed and removed while the underlying platform device remains bound to
its driver.

Signed-off-by: Johan Hovold <johan+linaro@kernel.org>
Link: https://lore.kernel.org/r/20230705123018.30903-8-johan+linaro@kernel.org
Signed-off-by: Mark Brown <broonie@kernel.org>
2023-07-06 13:46:31 +01:00
Johan Hovold
a5475829ad
ASoC: codecs: wcd-mbhc-v2: fix resource leaks on component remove
The MBHC resources must be released on component probe failure and
removal so can not be tied to the lifetime of the component device.

This is specifically needed to allow probe deferrals of the sound card
which otherwise fails when reprobing the codec component:

    snd-sc8280xp sound: ASoC: failed to instantiate card -517
    genirq: Flags mismatch irq 299. 00002001 (mbhc sw intr) vs. 00002001 (mbhc sw intr)
    wcd938x_codec audio-codec: Failed to request mbhc interrupts -16
    wcd938x_codec audio-codec: mbhc initialization failed
    wcd938x_codec audio-codec: ASoC: error at snd_soc_component_probe on audio-codec: -16
    snd-sc8280xp sound: ASoC: failed to instantiate card -16

Fixes: 0e5c9e7ff8 ("ASoC: codecs: wcd: add multi button Headset detection support")
Cc: stable@vger.kernel.org      # 5.14
Cc: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Signed-off-by: Johan Hovold <johan+linaro@kernel.org>
Reviewed-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Link: https://lore.kernel.org/r/20230705123018.30903-7-johan+linaro@kernel.org
Signed-off-by: Mark Brown <broonie@kernel.org>
2023-07-06 13:46:30 +01:00
Johan Hovold
798590cc7d
ASoC: codecs: wcd934x: fix resource leaks on component remove
Make sure to release allocated MBHC resources also on component remove.

This is specifically needed to allow probe deferrals of the sound card
which otherwise fails when reprobing the codec component.

Fixes: 9fb9b1690f ("ASoC: codecs: wcd934x: add mbhc support")
Cc: stable@vger.kernel.org      # 5.14
Cc: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Signed-off-by: Johan Hovold <johan+linaro@kernel.org>
Reviewed-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Link: https://lore.kernel.org/r/20230705123018.30903-6-johan+linaro@kernel.org
Signed-off-by: Mark Brown <broonie@kernel.org>
2023-07-06 13:46:29 +01:00
Johan Hovold
a3406f8777
ASoC: codecs: wcd938x: fix resource leaks on component remove
Make sure to release allocated resources on component probe failure and
on remove.

This is specifically needed to allow probe deferrals of the sound card
which otherwise fails when reprobing the codec component:

    snd-sc8280xp sound: ASoC: failed to instantiate card -517
    genirq: Flags mismatch irq 289. 00002001 (HPHR PDM WD INT) vs. 00002001 (HPHR PDM WD INT)
    wcd938x_codec audio-codec: Failed to request HPHR WD interrupt (-16)
    genirq: Flags mismatch irq 290. 00002001 (HPHL PDM WD INT) vs. 00002001 (HPHL PDM WD INT)
    wcd938x_codec audio-codec: Failed to request HPHL WD interrupt (-16)
    genirq: Flags mismatch irq 291. 00002001 (AUX PDM WD INT) vs. 00002001 (AUX PDM WD INT)
    wcd938x_codec audio-codec: Failed to request Aux WD interrupt (-16)
    genirq: Flags mismatch irq 292. 00002001 (mbhc sw intr) vs. 00002001 (mbhc sw intr)
    wcd938x_codec audio-codec: Failed to request mbhc interrupts -16

Fixes: 8d78602aa8 ("ASoC: codecs: wcd938x: add basic driver")
Cc: stable@vger.kernel.org	# 5.14
Cc: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Signed-off-by: Johan Hovold <johan+linaro@kernel.org>
Reviewed-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Link: https://lore.kernel.org/r/20230705123018.30903-5-johan+linaro@kernel.org
Signed-off-by: Mark Brown <broonie@kernel.org>
2023-07-06 13:46:28 +01:00
Johan Hovold
ed0dd9205b
ASoC: codecs: wcd938x: fix missing clsh ctrl error handling
Allocation of the clash control structure may fail so add the missing
error handling to avoid dereferencing an error pointer.

Fixes: 8d78602aa8 ("ASoC: codecs: wcd938x: add basic driver")
Cc: stable@vger.kernel.org	# 5.14
Cc: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Signed-off-by: Johan Hovold <johan+linaro@kernel.org>
Reviewed-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Link: https://lore.kernel.org/r/20230705123018.30903-4-johan+linaro@kernel.org
Signed-off-by: Mark Brown <broonie@kernel.org>
2023-07-06 13:46:25 +01:00
Johan Hovold
46ec420573
ASoC: qdsp6: audioreach: fix topology probe deferral
Propagate errors when failing to load the topology component so that
probe deferrals can be handled.

Fixes: 36ad9bf1d9 ("ASoC: qdsp6: audioreach: add topology support")
Cc: stable@vger.kernel.org      # 5.17
Cc: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Signed-off-by: Johan Hovold <johan+linaro@kernel.org>
Reviewed-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Link: https://lore.kernel.org/r/20230705123018.30903-3-johan+linaro@kernel.org
Signed-off-by: Mark Brown <broonie@kernel.org>
2023-07-06 13:46:24 +01:00
Linus Torvalds
fe1de55167 soundwire updates for 6.5
- Stream handling and slave alert handling
  - Qualcomm Soundwire v2.0.0 controller support
  - Intel ACE2.x initial support and code reorganization
 -----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCAAdFiEE+vs47OPLdNbVcHzyfBQHDyUjg0cFAmSlHY4ACgkQfBQHDyUj
 g0fHJw//XRkP6BDfB3D/dnfJTPtWpcIBChdrImhNlL52czqUiyZXfBtkQkaGcDdy
 AFFcsvqYZkgQTXcyAoT/g5E/4M92RnrXHdxcQREsziBU1xnGNAtUDfK8EyPE+0I5
 xBVUmtPGC9NS24UVDXKlOnq/6hPw0Ab4JVzFRMziqC8iIXTA4vj9xenjI2XX4K8d
 J5ajVBA7bGDeAN/mPJsCdCnT4i1si23/vUgk93pC/onCO3phZqh4TK4pY/qbwXzx
 tFwCh6qam0iY70Ga1T0HVc5wCMxXcmZFJuM8HnpTOYArubGpW7bOamxlItZtv4vL
 CEEqWgMWBE5r50fgaxe3zJ278nQSBQ8Gx5IP+OCPdt9FdqfEFFzVv+LWb+BVaKdJ
 N2IRT97t89PrMqU8zcm05HnR7lkgLvwle7eFcNLZaG3FleGp+P5nixCa4+tyvq+b
 a7/YtQIbkkXUFxKNMY8fVquk+to9H6xxeLrPmuufwwnO2DiYMuIPina0zU5/gEor
 qhzg5zTDK5lyO7P4AC/HWt50jl0IYDLIqBfdEVQ94G+QopPRVOGXQWfqipWC9f//
 WxDTi5IKCtL7QXJTbpUKBqu5N84LFqJpPNFA0GG9Wy9+hsUOwI+kFQpB5TQfCETD
 7rwncBhrzJNhtZmLv54EMs5hISWl/CDEiyvItdho2r904/AcIWM=
 =gjRz
 -----END PGP SIGNATURE-----

Merge tag 'soundwire-6.5-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/vkoul/soundwire

Pull soundwire updates from Vinod Koul:

 - Stream handling and slave alert handling

 - Qualcomm Soundwire v2.0.0 controller support

 - Intel ACE2.x initial support and code reorganization

* tag 'soundwire-6.5-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/vkoul/soundwire: (55 commits)
  soundwire: stream: Make master_list ordered to prevent deadlocks
  soundwire: bus: Prevent lockdep asserts when stream has multiple buses
  soundwire: qcom: fix storing port config out-of-bounds
  soundwire: intel_ace2x: fix SND_SOC_SOF_HDA_MLINK dependency
  soundwire: debugfs: Add missing SCP registers
  soundwire: stream: Remove unnecessary gotos
  soundwire: stream: Invert logic on runtime alloc flags
  soundwire: stream: Remove unneeded checks for NULL bus
  soundwire: bandwidth allocation: Remove pointless variable
  soundwire: cadence: revisit parity injection
  soundwire: intel/cadence: update hardware reset sequence
  soundwire: intel_bus_common: enable interrupts last
  soundwire: intel_bus_common: update error log
  soundwire: amd: Improve error message in remove callback
  soundwire: debugfs: fix unbalanced pm_runtime_put()
  soundwire: qcom: fix unbalanced pm_runtime_put()
  soundwire: qcom: set clk stop need reset flag at runtime
  soundwire: qcom: add software workaround for bus clash interrupt assertion
  soundwire: qcom: wait for fifo to be empty before suspend
  soundwire: qcom: drop unused struct qcom_swrm_ctrl members
  ...
2023-07-05 10:54:43 -07:00
Srinivas Kandagatla
c03226ba15
ASoC: codecs: wcd938x: fix dB range for HPHL and HPHR
dB range for HPHL and HPHR gains are from +6dB to -30dB in steps of
1.5dB with register values range from 0 to 24.

Current code maps these dB ranges incorrectly, fix them to allow proper
volume setting.

Fixes: e8ba1e05bd ("ASoC: codecs: wcd938x: add basic controls")
Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Link: https://lore.kernel.org/r/20230705125723.40464-1-srinivas.kandagatla@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>
2023-07-05 14:53:47 +01:00
Srinivas Kandagatla
4f3fcf5f6d
ASoC: qcom: q6afe-dai: fix Display Port Playback stream name
With recent changes to add more display ports did not change the Stream
name in q6afe-dai. This results in below error
"ASoC: Failed to add route DISPLAY_PORT_RX -> Display Port Playback(*)"
and sound card fails to probe.

Fix this by adding correct stream name.

Fixes: 90848a2557 ("ASoC: qcom: q6dsp: add support to more display ports")
Reported-by: Amit Pundir <amit.pundir@linaro.org>
Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Link: https://lore.kernel.org/r/20230705124850.40069-1-srinivas.kandagatla@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>
2023-07-05 14:53:46 +01:00
Shuming Fan
bf62eec5cd
ASoC: rt5645: check return value after reading device id
If the I2C controller encounters some problems like timed-out, the codec
driver will report the error code for the first read.

Signed-off-by: Shuming Fan <shumingf@realtek.com>
Link: https://lore.kernel.org/r/20230705042915.24932-1-shumingf@realtek.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2023-07-05 13:00:54 +01:00
Nathan Chancellor
d9ba2975e9
ASoC: cs35l45: Select REGMAP_IRQ
After commit 6085f9e6dc ("ASoC: cs35l45: IRQ support"), without any
other configuration that selects CONFIG_REGMAP_IRQ, modpost errors out
with:

  ERROR: modpost: "regmap_irq_get_virq" [sound/soc/codecs/snd-soc-cs35l45.ko] undefined!
  ERROR: modpost: "devm_regmap_add_irq_chip" [sound/soc/codecs/snd-soc-cs35l45.ko] undefined!

Add the Kconfig selection to ensure these functions get built and
included, which resolves the build failure.

Cc: stable@vger.kernel.org
Fixes: 6085f9e6dc ("ASoC: cs35l45: IRQ support")
Reported-by: Marcus Seyfarth <m.seyfarth@gmail.com>
Closes: https://github.com/ClangBuiltLinux/linux/issues/1882
Signed-off-by: Nathan Chancellor <nathan@kernel.org>
Link: https://lore.kernel.org/r/20230703-cs35l45-select-regmap_irq-v1-1-37d7e838b614@kernel.org
Signed-off-by: Mark Brown <broonie@kernel.org>
2023-07-05 13:00:53 +01:00
Takashi Iwai
5284876d82 Merge branch 'topic/midi20' into for-linus
Pull yet more a typo fix in the converter code.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2023-07-05 11:50:56 +02:00
Minjie Du
983b9180db ALSA: seq: ump: fix typo in system_2p_ev_to_ump_midi1()
Fix data->system.parm2 typo.

Fixes: e9e02819a9 ("ALSA: seq: Automatic conversion of UMP events")
Signed-off-by: Minjie Du <duminjie@vivo.com>
Link: https://lore.kernel.org/r/20230705093545.14695-1-duminjie@vivo.com
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2023-07-05 11:50:29 +02:00
Johan Hovold
7dfae2631b
ASoC: codecs: wcd938x: fix missing mbhc init error handling
MBHC initialisation can fail so add the missing error handling to avoid
dereferencing an error pointer when later configuring the jack:

    Unable to handle kernel paging request at virtual address fffffffffffffff8

    pc : wcd_mbhc_start+0x28/0x380 [snd_soc_wcd_mbhc]
    lr : wcd938x_codec_set_jack+0x28/0x48 [snd_soc_wcd938x]

    Call trace:
     wcd_mbhc_start+0x28/0x380 [snd_soc_wcd_mbhc]
     wcd938x_codec_set_jack+0x28/0x48 [snd_soc_wcd938x]
     snd_soc_component_set_jack+0x28/0x8c [snd_soc_core]
     qcom_snd_wcd_jack_setup+0x7c/0x19c [snd_soc_qcom_common]
     sc8280xp_snd_init+0x20/0x2c [snd_soc_sc8280xp]
     snd_soc_link_init+0x28/0x90 [snd_soc_core]
     snd_soc_bind_card+0x628/0xbfc [snd_soc_core]
     snd_soc_register_card+0xec/0x104 [snd_soc_core]
     devm_snd_soc_register_card+0x4c/0xa4 [snd_soc_core]
     sc8280xp_platform_probe+0xf0/0x108 [snd_soc_sc8280xp]

Fixes: bcee7ed09b ("ASoC: codecs: wcd938x: add Multi Button Headset Control support")
Cc: stable@vger.kernel.org      # 5.15
Cc: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Signed-off-by: Johan Hovold <johan+linaro@kernel.org>
Link: https://lore.kernel.org/r/20230703124701.11734-1-johan+linaro@kernel.org
Signed-off-by: Mark Brown <broonie@kernel.org>
2023-07-04 13:54:16 +01:00
Luke D. Jones
72cea3a317 ALSA: hda/realtek: Whitespace fix
Remove an erroneous whitespace.

Fixes: 31278997ad ("ALSA: hda/realtek - Add headset quirk for Dell DT")
Signed-off-by: Luke D. Jones <luke@ljones.dev>
Link: https://lore.kernel.org/r/20230704044619.19343-6-luke@ljones.dev
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2023-07-04 08:41:40 +02:00
Luke D. Jones
33d7c9c3bf ALSA: hda/realtek: Add quirk for ASUS ROG G614Jx
Adds the required quirk to enable the Cirrus amp and correct pins
on the ASUS ROG G614J series which uses an SPI connected Cirrus amp.

While this works if the related _DSD properties are made available, these
aren't included in the ACPI of these laptops (yet).

Signed-off-by: Luke D. Jones <luke@ljones.dev>
Link: https://lore.kernel.org/r/20230704044619.19343-5-luke@ljones.dev
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2023-07-04 08:40:02 +02:00
Luke D. Jones
b759a5f097 ALSA: hda/realtek: Amend G634 quirk to enable rear speakers
Amends the last quirk for the G634 with 0x1caf subsys to enable the rear
speakers via pincfg.

Signed-off-by: Luke D. Jones <luke@ljones.dev>
Link: https://lore.kernel.org/r/20230704044619.19343-4-luke@ljones.dev
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2023-07-04 08:39:47 +02:00
Luke D. Jones
9abc77fb14 ALSA: hda/realtek: Add quirk for ASUS ROG GA402X
Adds the required quirk to enable the Cirrus amp and correct pins
on the ASUS ROG GA402X series which uses an I2C connected Cirrus amp.

While this works if the related _DSD properties are made available, these
aren't included in the ACPI of these laptops (yet).

Signed-off-by: Luke D. Jones <luke@ljones.dev>
Link: https://lore.kernel.org/r/20230704044619.19343-3-luke@ljones.dev
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2023-07-04 08:39:34 +02:00
Luke D. Jones
8cc87c055d ALSA: hda/realtek: Add quirk for ASUS ROG GX650P
Adds the required quirk to enable the Cirrus amp and correct pins
on the ASUS ROG GV601V series which uses an I2C connected Cirrus amp.

While this works if the related _DSD properties are made available, these
aren't included in the ACPI of these laptops (yet).

Signed-off-by: Luke D. Jones <luke@ljones.dev>
Link: https://lore.kernel.org/r/20230704044619.19343-2-luke@ljones.dev
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2023-07-04 08:39:23 +02:00
Takashi Iwai
bd55842ed9 ALSA: pcm: Fix potential data race at PCM memory allocation helpers
The PCM memory allocation helpers have a sanity check against too many
buffer allocations.  However, the check is performed without a proper
lock and the allocation isn't serialized; this allows user to allocate
more memories than predefined max size.

Practically seen, this isn't really a big problem, as it's more or
less some "soft limit" as a sanity check, and it's not possible to
allocate unlimitedly.  But it's still better to address this for more
consistent behavior.

The patch covers the size check in do_alloc_pages() with the
card->memory_mutex, and increases the allocated size there for
preventing the further overflow.  When the actual allocation fails,
the size is decreased accordingly.

Reported-by: BassCheck <bass@buaa.edu.cn>
Reported-by: Tuo Li <islituo@gmail.com>
Link: https://lore.kernel.org/r/CADm8Tek6t0WedK+3Y6rbE5YEt19tML8BUL45N2ji4ZAz1KcN_A@mail.gmail.com
Reviewed-by: Jaroslav Kysela <perex@perex.cz>
Cc: <stable@vger.kernel.org>
Link: https://lore.kernel.org/r/20230703112430.30634-1-tiwai@suse.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2023-07-03 14:52:27 +02:00
Johan Hovold
6f49256897
ASoC: codecs: wcd938x: fix soundwire initialisation race
Make sure that the soundwire device used for register accesses has been
enumerated and initialised before trying to read the codec variant
during component probe.

This specifically avoids interpreting (a masked and shifted) -EBUSY
errno as the variant:

	wcd938x_codec audio-codec: ASoC: error at soc_component_read_no_lock on audio-codec for register: [0x000034b0] -16

in case the soundwire device has not yet been initialised, which in turn
prevents some headphone controls from being registered.

Fixes: 8d78602aa8 ("ASoC: codecs: wcd938x: add basic driver")
Cc: stable@vger.kernel.org	# 5.14
Cc: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Reported-by: Steev Klimaszewski <steev@kali.org>
Signed-off-by: Johan Hovold <johan+linaro@kernel.org>
Tested-by: Steev Klimaszewski <steev@kali.org>
Link: https://lore.kernel.org/r/20230701094723.29379-1-johan+linaro@kernel.org
Signed-off-by: Mark Brown <broonie@kernel.org>
2023-07-03 13:04:50 +01:00
Tuo Li
1f4a08fed4 ALSA: hda: fix a possible null-pointer dereference due to data race in snd_hdac_regmap_sync()
The variable codec->regmap is often protected by the lock
codec->regmap_lock when is accessed. However, it is accessed without
holding the lock when is accessed in snd_hdac_regmap_sync():

  if (codec->regmap)

In my opinion, this may be a harmful race, because if codec->regmap is
set to NULL right after the condition is checked, a null-pointer
dereference can occur in the called function regcache_sync():

  map->lock(map->lock_arg); --> Line 360 in drivers/base/regmap/regcache.c

To fix this possible null-pointer dereference caused by data race, the
mutex_lock coverage is extended to protect the if statement as well as the
function call to regcache_sync().

[ Note: the lack of the regmap_lock itself is harmless for the current
  codec driver implementations, as snd_hdac_regmap_sync() is only for
  PM runtime resume that is prohibited during the codec probe.
  But the change makes the whole code more consistent, so it's merged
  as is -- tiwai ]

Reported-by: BassCheck <bass@buaa.edu.cn>
Signed-off-by: Tuo Li <islituo@gmail.com>
Link: https://lore.kernel.org/r/20230703031016.1184711-1-islituo@gmail.com
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2023-07-03 10:08:12 +02:00
dengxiang
73f1c75d5e ALSA: hda/realtek: Add quirks for Unis H3C Desktop B760 & Q760
These models use NSIWAY amplifiers for internal speaker, but cannot put
sound outside from these amplifiers. So eapd verbs are needed to initialize
the amplifiers. They can be added during boot to get working sound out
of internal speaker.

Signed-off-by: dengxiang <dengxiang@nfschina.com>
Link: https://lore.kernel.org/r/20230703021751.2945750-1-dengxiang@nfschina.com
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2023-07-03 09:58:15 +02:00
Mark Brown
055509cdfd
ASoC: codecs: wcd938x/wcd934x: loglevel fix and
Merge series from Johan Hovold <johan+linaro@kernel.org>:

When investigating a race in the wcd938x driver I noticed that the MBHC
impedance measurements where printed at error loglevel which is clearly
wrong.

Fix that, and clean up the logging somewhat by using dev_printk() and
addressing some style issues.

Included are also two patches that drop the bogus inline keywords from
the functions involved.
2023-06-30 19:18:53 +01:00
Johan Hovold
c93723ada3
ASoC: codecs: wcd934x: drop inline keywords
The compiler is generally better at deciding what functions should be
inlined than driver authors are.

Drop the bogus inline keyword from two functions that were neither very
small or used in a single place.

Signed-off-by: Johan Hovold <johan+linaro@kernel.org>
Reviewed-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Link: https://lore.kernel.org/r/20230630142717.5314-6-johan+linaro@kernel.org
Signed-off-by: Mark Brown <broonie@kernel.org>
2023-06-30 16:55:29 +01:00
Johan Hovold
cb7d60ab98
ASoC: codecs: wcd934x: demote impedance printk
Demote the MBHC impedance measurement printk, which is only needed
for development and debugging, to debug level.

While at it, fix the capitalisation of "ohm" and add the missing space
before the opening parenthesis.

Signed-off-by: Johan Hovold <johan+linaro@kernel.org>
Reviewed-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Link: https://lore.kernel.org/r/20230630142717.5314-5-johan+linaro@kernel.org
Signed-off-by: Mark Brown <broonie@kernel.org>
2023-06-30 16:55:28 +01:00
Johan Hovold
17d59d9ed8
ASoC: codecs: wcd938x: use dev_printk() for impedance logging
Pass the component structure also to the
wcd938x_mbhc_get_result_params() helper so that the component device can
be used for logging consistently.

Signed-off-by: Johan Hovold <johan+linaro@kernel.org>
Reviewed-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Link: https://lore.kernel.org/r/20230630142717.5314-4-johan+linaro@kernel.org
Signed-off-by: Mark Brown <broonie@kernel.org>
2023-06-30 16:55:27 +01:00
Johan Hovold
5db9fe9562
ASoC: codecs: wcd938x: drop inline keywords
The compiler is generally better at deciding what functions should be
inlined than driver authors are.

Drop the bogus inline keyword from two functions that were neither very
small or used in a single place.

Signed-off-by: Johan Hovold <johan+linaro@kernel.org>
Reviewed-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Link: https://lore.kernel.org/r/20230630142717.5314-3-johan+linaro@kernel.org
Signed-off-by: Mark Brown <broonie@kernel.org>
2023-06-30 16:55:26 +01:00
Johan Hovold
e5ce198bd5
ASoC: codecs: wcd938x: fix mbhc impedance loglevel
Demote the MBHC impedance measurement printk, which is not an error
message, from error to debug level.

While at it, fix the capitalisation of "ohm" and add the missing space
before the opening parenthesis.

Fixes: bcee7ed09b ("ASoC: codecs: wcd938x: add Multi Button Headset Control support")
Signed-off-by: Johan Hovold <johan+linaro@kernel.org>
Reviewed-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Link: https://lore.kernel.org/r/20230630142717.5314-2-johan+linaro@kernel.org
Signed-off-by: Mark Brown <broonie@kernel.org>
2023-06-30 16:55:25 +01:00
Srinivas Kandagatla
ac192c1a54
ASoC: qdsp6: q6apm: use dai link pcm id as pcm device number
For some reason we ended up with a setup without this flag.
This resulted in inconsistent sound card devices numbers which
 are also not starting as expected at dai_link->id.
 (Ex: MultiMedia1 pcm ended up with device number 4 instead of 0)

With this patch patch now the MultiMedia1 PCM ends up with device number 0
as expected.

[This is causing unstable numbering in userspace as other changes go in,
which in turn gets noticed by some userspace.  There's been multiple
values so we can't simply pick one and revert to it.  Do not backport
since it will introduce a change. -- broonie]

Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Link: https://lore.kernel.org/r/20230628092404.13927-1-srinivas.kandagatla@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>
2023-06-30 14:53:48 +01:00
Johan Hovold
85a61b1ce4
ASoC: codecs: wcd938x: fix codec initialisation race
Make sure to resume the codec and soundwire device before trying to read
the codec variant and configure the device during component probe.

This specifically avoids interpreting (a masked and shifted) -EBUSY
errno as the variant:

	wcd938x_codec audio-codec: ASoC: error at soc_component_read_no_lock on audio-codec for register: [0x000034b0] -16

when the soundwire device happens to be suspended, which in turn
prevents some headphone controls from being registered.

Fixes: 8d78602aa8 ("ASoC: codecs: wcd938x: add basic driver")
Cc: stable@vger.kernel.org      # 5.14
Cc: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Reported-by: Steev Klimaszewski <steev@kali.org>
Signed-off-by: Johan Hovold <johan+linaro@kernel.org>
Link: https://lore.kernel.org/r/20230630120318.6571-1-johan+linaro@kernel.org
Signed-off-by: Mark Brown <broonie@kernel.org>
2023-06-30 14:53:47 +01:00
Mastan Katragadda
b1db244c71
ASoC: SOF: amd: add revision check for sending sha dma completion command
ACP driver should send SHA DMA completion command to PSP module for RN
platform only.
Add a revision check for RN platform.

Signed-off-by: Mastan Katragadda <Mastan.Katragadda@amd.com>
Link: https://lore.kernel.org/r/20230630070544.2167421-1-Mastan.Katragadda@amd.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2023-06-30 14:53:46 +01:00
Linus Torvalds
bf1fa6f155 ARM: SoC changes for 6.5
These are mostly minor cleanups and bugfixes that address harmless
 problems.
 
 The largest branch is a conversion of the omap platform
 to use GPIO descriptors throughout the tree, for any devices that
 are not fully converted to devicetree.
 
 The Samsung Exynos platform gains back support for the Exynos4212
 chip that was previously unused and removed but is now used for
 the Samsung Galaxy Tab3.
 -----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCgAdFiEEiK/NIGsWEZVxh/FrYKtH/8kJUicFAmScsH8ACgkQYKtH/8kJ
 UicTOhAAxQB1zySNJ4vOwTnV9Mrey+b/1RvjKDwZAa3uuP6vgpPjAjqVxlRxl+TM
 SWal+0zzj+vrFTkTl0niT+DzMFOEnLqhBd7smN8YKmC+hD3t9g5Dos7Q/IsUVlrT
 SnXDmit+eSI2QXFeO1OM0LdmniLDcKydsQ8o4beKF6YaJRGYACNSmtIjB3KvWccv
 3cQXoaqN5rFoQxbLiGVINVyDU3Qpie2m8RqUcVWSmva46UM2yDAUWXwFNxcP8jXp
 WjL+NaiH7Ea/pzPcn3895u5ybIOZSylxLGRzL1ktewJqczUKf701qVZbf6enZp99
 SbEQQh4DKm4DkpQ/JdPoO9x3InORAGUQ1p0Ssa92rKuiEVSXsQUeO3BNAYGfvpy3
 o3QElSp6hlDWOHk9KawHzY3lfMsvKnTckFQDZxMbvC0+tQj6cDIM/qWo74CdZ07S
 UxVa1C9L2Lerv6IAG3v2meI9HjBn7DInWjfOAOxj2gX/ryIrdX9lO0692n6nVYca
 szH3CANjwPCPrtjAE2RXPjLTK+6nmQDavcEVEiG1SoGTplLh7RZgeQXV+5iIaOLp
 Nc8MDddR656kPBEprgoEugGZuLjsY2IGaLj+FNGriOEBKo5jpfEFeRQ2GPKxoyWR
 OHeWtxcFtBc2SnfVOtdMQ/X3UZTd4vlJYbNffiL+2NSM0iMBbHs=
 =z6FU
 -----END PGP SIGNATURE-----

Merge tag 'soc-arm-6.5' of git://git.kernel.org/pub/scm/linux/kernel/git/soc/soc

Pull ARM SoC updates from Arnd Bergmann:
 "These are mostly minor cleanups and bugfixes that address harmless
  problems.

  The largest branch is a conversion of the omap platform to use GPIO
  descriptors throughout the tree, for any devices that are not fully
  converted to devicetree.

  The Samsung Exynos platform gains back support for the Exynos4212 chip
  that was previously unused and removed but is now used for the Samsung
  Galaxy Tab3"

* tag 'soc-arm-6.5' of git://git.kernel.org/pub/scm/linux/kernel/git/soc/soc: (24 commits)
  ARM: omap2: Fix copy/paste bug
  MAINTAINERS: Replace my email address
  Input: ads7846 - fix pointer cast warning
  Input: ads7846 - Fix usage of match data
  ARM: omap2: Fix checkpatch issues
  arm: omap1: replace printk() with pr_err macro
  ARM: omap: Fix checkpatch issues
  ARM: s3c: Switch i2c drivers back to use .probe()
  ARM: versatile: mark mmc_status() static
  ARM: spear: include "pl080.h" for pl080_get_signal() prototype
  ARM: sa1100: address missing prototype warnings
  ARM: pxa: fix missing-prototypes warnings
  ARM: orion5x: fix d2net gpio initialization
  ARM: omap2: fix missing tick_broadcast() prototype
  ARM: omap1: add missing include
  ARM: lpc32xx: add missing include
  ARM: imx: add missing include
  ARM: highbank: add missing include
  ARM: ep93xx: fix missing-prototype warnings
  ARM: davinci: fix davinci_cpufreq_init() declaration
  ...
2023-06-29 15:28:33 -07:00
Linus Torvalds
f8824e151f sound updates for 6.5-rc1
Lots of changes as usual, but the only significant stuff in ALSA core
 part is the MIDI 2.0 support, while ASoC core kept receiving the code
 refactoring.  The majority of changes are seen rather in device
 drivers, and quite a few new drivers can be found there.
 
 Here we go, some highlights:
 
 ALSA and ASoC Core:
 - Support of MIDI 2.0 devices: rawmidi and sequencer API have been
   extended for the support of the new UMP (Universal MIDI Packet)
   protocol, USB audio driver got the USB MIDI 2.0 interface support
 - Continued refactoring around ASoC DAI links and the ordering of
   trigger callbacks
 - PCM ABI extension for better drain support
 
 ASoC Drivers:
 - Conversions of many drivers to use maple tree based caches
 - Everlasting improvement works on ASoC Intel drivers
 - Compressed audio support for Qualcomm
 - Support for AMD SoundWire, Analog Devices SSM3515, Google Chameleon,
   Ingenic X1000, Intel systems with various CODECs, Loongson
   platforms, Maxim MAX98388, Mediatek MT8188, Nuvoton NAU8825C, NXP
   platforms with NAU8822, Qualcomm WSA884x, StarFive JH7110, Texas
   Instruments TAS2781
 
 HD-audio:
 - Quirks for HP and ASUS machines
 - CS35L41 HD-audio codec fixes
 - Loongson HD-audio support
 
 Misc:
 - A new virtual PCM test driver for kselftests
 - Continued refactoring and improvements on the legacy emu10k1 driver
 -----BEGIN PGP SIGNATURE-----
 
 iQJCBAABCAAsFiEEIXTw5fNLNI7mMiVaLtJE4w1nLE8FAmScAA8OHHRpd2FpQHN1
 c2UuZGUACgkQLtJE4w1nLE8rGg/+MZtQVa/uPAS914pTaBbwr0JTmaZwnroCYAGZ
 VF708hXDoqdJMXkVyBxogpBGdydwCCEIPZ6TKslslIjxz1eojATN1BiAlYDSrTOL
 TYORARXJ+HLHK8/okCucIAl7A1CNxRHBUfSqgN7N6OWfYY/Rd8JL6mIuL8M0rPkT
 dAN219q/+GVMckiUVVSo78SRZL93S6TiQkcomeA3SoB3ycGCkaDD9Leb4vwr6iPa
 Yytcf/DWWD5plEEZFVzuyT1KTyi3HhcVZYF29QaoZaSkNIBwUJV7IObz+zJTs5BC
 /CgudWbQ/uhgiOucKNId+7sG04ehTJgKDRVZ6ArQt2p0aLC8KZKB+ytt9QHdCPlZ
 czQX86PjQ4DeivvTaoFvqjDfDFosSWkHWYxqA0fEEVd7p+6ZrhmZdmtidFxF5/Oq
 Dk0AFRwc71w4/OZU83lYv2BLXaqGVZ8ptmeEILaAJoxkpWwomHYW5nYFZ2Pnb8h3
 Yl9Q0f82uFNqfPcGJLSpqJ/Or9BVI2qQU75gHHXIe1GXUAaHkLLRPfpzQtGjkPap
 KC0+VMGEWy0y0mdytt0ecIkz2Dv/RvlahTr5jHEXSb3r93H6nRTTjxzyLvXHoPy0
 4iVf1g7VPL69V3vZ6AlkPdMo/yV7q/72bP0ZJ6CgVtdOZO4Q1N8ItwFt8FN0nAcu
 FeYq8pg=
 =GuXv
 -----END PGP SIGNATURE-----

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

Pull sound updates from Takashi Iwai:
 "Lots of changes as usual, but the only significant stuff in ALSA core
  part is the MIDI 2.0 support, while ASoC core kept receiving the code
  refactoring. The majority of changes are seen rather in device
  drivers, and quite a few new drivers can be found there.

  Here we go, some highlights:

  ALSA and ASoC Core:
   - Support of MIDI 2.0 devices: rawmidi and sequencer API have been
     extended for the support of the new UMP (Universal MIDI Packet)
     protocol, USB audio driver got the USB MIDI 2.0 interface support
   - Continued refactoring around ASoC DAI links and the ordering of
     trigger callbacks
   - PCM ABI extension for better drain support

  ASoC Drivers:
   - Conversions of many drivers to use maple tree based caches
   - Everlasting improvement works on ASoC Intel drivers
   - Compressed audio support for Qualcomm
   - Support for AMD SoundWire, Analog Devices SSM3515, Google
     Chameleon, Ingenic X1000, Intel systems with various CODECs,
     Loongson platforms, Maxim MAX98388, Mediatek MT8188, Nuvoton
     NAU8825C, NXP platforms with NAU8822, Qualcomm WSA884x, StarFive
     JH7110, Texas Instruments TAS2781

  HD-audio:
   - Quirks for HP and ASUS machines
   - CS35L41 HD-audio codec fixes
   - Loongson HD-audio support

  Misc:
   - A new virtual PCM test driver for kselftests
   - Continued refactoring and improvements on the legacy emu10k1
     driver"

* tag 'sound-6.5-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound: (556 commits)
  ALSA: hda/realtek: Enable mute/micmute LEDs and limit mic boost on EliteBook
  ASoC: hdmi-codec: fix channel info for compressed formats
  ALSA: pcm: fix ELD constraints for (E)AC3, DTS(-HD) and MLP formats
  ASoC: core: Always store of_node when getting DAI link component
  ASoC: tas2781: Fix error code in tas2781_load_calibration()
  ASoC: amd: update pm_runtime enable sequence
  ALSA: ump: Export MIDI1 / UMP conversion helpers
  ASoC: tas2781: fix Kconfig dependencies
  ASoC: amd: acp: remove acp poweroff function
  ASoC: amd: acp: clear pdm dma interrupt mask
  ASoC: codecs: max98090: Allow dsp_a mode
  ASoC: qcom: common: add default jack dapm pins
  ASoC: loongson: fix address space confusion
  ASoC: dt-bindings: microchip,sama7g5-pdmc: Simplify "microchip,mic-pos" constraints
  ASoC: tegra: Remove stale comments in AHUB
  ASoC: tegra: Use normal system sleep for ASRC
  ALSA: hda/realtek: Add quirks for ROG ALLY CS35l41 audio
  ASoC: fsl-asoc-card: Allow passing the number of slots in use
  ASoC: codecs: wsa884x: Add WSA884x family of speakers
  ASoC: dt-bindings: qcom,wsa8840: Add WSA884x family of speakers
  ...
2023-06-29 10:46:47 -07:00
Linus Torvalds
ff7ddcf0db This batch of clk driver updates for the merge window contains almost no new
SoC support. Instead there's a treewide patch series from Maxime that makes
 clk_ops::determine_rate mandatory for muxes. Beyond that core framework change
 we have the usual pile of clk driver updates such as migrating i2c drivers to
 use .probe() again or YAMLfication of clk DT bindings so we can validate DTBs.
 Overall the SoCs that got the most updates this time around in terms of
 diffstat are the Amlogic and Mediatek drivers because they added new SoC
 support or fixed up various drivers to have proper data.
 
 In general things look kinda quiet. I suspect the core framework change may
 still shake out some problems after the merge window, mostly because not
 everyone tests linux-next where that series has been for some number of weeks.
 I saw that there's at least one pending fix for Tegra that needs to be wrapped
 up into a proper patch. I'll try to catch those bits before the window closes
 so that -rc1 is bootable. More details below.
 
 Core:
  - Make clk_ops::determine_rate mandatory for muxes
 
 New Drivers:
  - Add amlogic a1 SoC family PLL and peripheral clock controller support
 
 Updates:
  - Handle allocation failures from kasprintf() and friends
  - Migrate platform clk drivers to .remove_new()
  - Migrate i2c clk drivers to .probe() instead of .probe_new()
  - Remove CLK_SET_PARENT from all Mediatek MSDC core clocks
  - Add infra_ao reset support for Mediatek MT8188 SoCs
  - Align driver_data to i2c_device_id tables in some i2c clk drivers
  - Use device_get_match_data() in vc5 clk driver
  - New Kconfig symbol name (SOC_MICROCHIP_POLARFIRE) for Microchip FPGA clock
    drivers
  - Use of_property_read_bool() to read "microchip,pic32mzda-sosc" boolean DT
    property in clk-pic32mzda
  - Convert AT91 clock dt-bindings to YAML
  - Remove CLK_SET_RATE_PARENT flag from LDB clocks on i.MX6SX
  - Keep i.MX UART clocks enabled during kernel boot if earlycon is set
  - Drop imx_unregister_clocks() as there are no users anymore
  - Switch to _safe iterator on imx_clk_scu_unregister() to avoid use after free
  - Add determine_rate op to the imx8m composite clock
  - Use device managed API for iomap and kzalloc for i.MXRT1050, i.MX8MN,
    i.MX8MP and i.MX93 clock controller drivers
  - Add missing interrupt DT property for the i.MX8M clock controller
  - Re-add support for Exynos4212 clock controller because we are
    re-introducing the SoC in the mainline
  - Add CONFIG_OF dependency to Samsung clk Kconfig symbols to solve some
    objtool warnings
  - Preselect PLL MIPI as TCON0 parent for Allwinner A64 SoC
  - Convert the Renesas clock drivers to readl_poll_timeout_atomic()
  - Add PWM clock on Renesas R-Car V3U
  - Fix PLL5 on Renesas RZ/G2L and RZ/V2L
 -----BEGIN PGP SIGNATURE-----
 
 iQJFBAABCAAvFiEE9L57QeeUxqYDyoaDrQKIl8bklSUFAmSaakgRHHNib3lkQGtl
 cm5lbC5vcmcACgkQrQKIl8bklSV1ShAAvvDE7CbcWQqIQvweGL/WjFEp+05OBQHs
 eqHVEZshdw2Bk7eVyaU86Yjasq317yd0PUo/Mnme7tr4Od5WauegXhM5mR85crfQ
 qdA3/A/3ZyvlSxWCefsoXEee62D/2fLGro73NFWlYWf3U7j4saAxw/Fto9AAyZQd
 kX0kAmrKzjRJPyh2xTJlz5b5os3D1SOstmPXjUGuv+2gaC5cBt/pEd+vPX+OW5mD
 IFy+N1CVx2UHJrvK5qCzuP8Aun3usFM2fvMEjfThuR0h7gaTU67sdqydl7a30PzU
 fM+vsQVnU8VxCqquZ4lGWa+pvFSID3tuBdy+B7d2EQnID0558Qom8+syKC2nN0/m
 kN/W4fgWCkoMSHj50VYpbRMUHn8N96t/61uoxAF+byGGZ4h8xxgGylSZVip7awbh
 yUJWvPmDq2UKJzjr3jILEjvigUun3PjezT2D9me64z+TUKAFMtomAt75U1pAShtO
 tWsvC2u2GLns9PS3EC3ov9zhiyVN9MjzlqYEjgGbM2C3swJgY8nnnO2izMpuaC9L
 fB8HtzMNwu+Ct6MKISabHex2Oeh3yhEtfZaldx2DdV05ejxndDzNz4sfh7XAkrFr
 G3x+yn94geaYL0/OMhDw/MqdVWIiTf4q8FYK6yv7XicIQGtLs2GHXxHJf1ltCxHb
 nCnNBgJmYXo=
 =6M8D
 -----END PGP SIGNATURE-----

Merge tag 'clk-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/clk/linux

Pull clk updates from Stephen Boyd:
 "This batch of clk driver updates contains almost no new SoC support.
  Instead there's a treewide patch series from Maxime that makes
  clk_ops::determine_rate mandatory for muxes.

  Beyond that core framework change we have the usual pile of clk driver
  updates such as migrating i2c drivers to use .probe() again or
  YAMLfication of clk DT bindings so we can validate DTBs.

  Overall the SoCs that got the most updates this time around in terms
  of diffstat are the Amlogic and Mediatek drivers because they added
  new SoC support or fixed up various drivers to have proper data.

  In general things look kinda quiet. I suspect the core framework
  change may still shake out some problems after the merge window,
  mostly because not everyone tests linux-next where that series has
  been for some number of weeks. I saw that there's at least one pending
  fix for Tegra that needs to be wrapped up into a proper patch. I'll
  try to catch those bits before the window closes so that -rc1 is
  bootable. More details below.

  Core:
   - Make clk_ops::determine_rate mandatory for muxes

  New Drivers:
   - Add amlogic a1 SoC family PLL and peripheral clock controller support

  Updates:
   - Handle allocation failures from kasprintf() and friends
   - Migrate platform clk drivers to .remove_new()
   - Migrate i2c clk drivers to .probe() instead of .probe_new()
   - Remove CLK_SET_PARENT from all Mediatek MSDC core clocks
   - Add infra_ao reset support for Mediatek MT8188 SoCs
   - Align driver_data to i2c_device_id tables in some i2c clk drivers
   - Use device_get_match_data() in vc5 clk driver
   - New Kconfig symbol name (SOC_MICROCHIP_POLARFIRE) for Microchip
     FPGA clock drivers
   - Use of_property_read_bool() to read "microchip,pic32mzda-sosc"
     boolean DT property in clk-pic32mzda
   - Convert AT91 clock dt-bindings to YAML
   - Remove CLK_SET_RATE_PARENT flag from LDB clocks on i.MX6SX
   - Keep i.MX UART clocks enabled during kernel boot if earlycon is set
   - Drop imx_unregister_clocks() as there are no users anymore
   - Switch to _safe iterator on imx_clk_scu_unregister() to avoid use
     after free
   - Add determine_rate op to the imx8m composite clock
   - Use device managed API for iomap and kzalloc for i.MXRT1050,
     i.MX8MN, i.MX8MP and i.MX93 clock controller drivers
   - Add missing interrupt DT property for the i.MX8M clock controller
   - Re-add support for Exynos4212 clock controller because we are
     re-introducing the SoC in the mainline
   - Add CONFIG_OF dependency to Samsung clk Kconfig symbols to solve
     some objtool warnings
   - Preselect PLL MIPI as TCON0 parent for Allwinner A64 SoC
   - Convert the Renesas clock drivers to readl_poll_timeout_atomic()
   - Add PWM clock on Renesas R-Car V3U
   - Fix PLL5 on Renesas RZ/G2L and RZ/V2L"

* tag 'clk-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/clk/linux: (149 commits)
  clk: fix typo in clk_hw_register_fixed_rate_parent_data() macro
  clk: Fix memory leak in devm_clk_notifier_register()
  clk: mvebu: Iterate over possible CPUs instead of DT CPU nodes
  clk: mvebu: Use of_get_cpu_hwid() to read CPU ID
  MAINTAINERS: Add Marvell mvebu clock drivers
  clk: clocking-wizard: check return value of devm_kasprintf()
  clk: ti: clkctrl: check return value of kasprintf()
  clk: keystone: sci-clk: check return value of kasprintf()
  clk: si5341: free unused memory on probe failure
  clk: si5341: check return value of {devm_}kasprintf()
  clk: si5341: return error if one synth clock registration fails
  clk: cdce925: check return value of kasprintf()
  clk: vc5: check memory returned by kasprintf()
  clk: mediatek: clk-mt8173-apmixedsys: Fix iomap not released issue
  clk: mediatek: clk-mt8173-apmixedsys: Fix return value for of_iomap() error
  clk: mediatek: clk-mtk: Grab iomem pointer for divider clocks
  clk: keystone: syscon-clk: Add support for audio refclk
  dt-bindings: clock: Add binding documentation for TI Audio REFCLK
  dt-bindings: clock: ehrpwm: Remove unneeded syscon compatible
  clk: keystone: syscon-clk: Allow the clock node to not be of type syscon
  ...
2023-06-29 10:05:47 -07:00
Sameer Pujar
70a6404ff6
ASoC: rt5640: Fix sleep in atomic context
Following prints are observed while testing audio on Jetson AGX Orin which
has onboard RT5640 audio codec:

  BUG: sleeping function called from invalid context at kernel/workqueue.c:3027
  in_atomic(): 1, irqs_disabled(): 128, non_block: 0, pid: 0, name: swapper/0
  preempt_count: 10001, expected: 0
  RCU nest depth: 0, expected: 0
  ------------[ cut here ]------------
  WARNING: CPU: 0 PID: 0 at kernel/irq/handle.c:159 __handle_irq_event_percpu+0x1e0/0x270
  ---[ end trace ad1c64905aac14a6 ]-

The IRQ handler rt5640_irq() runs in interrupt context and can sleep
during cancel_delayed_work_sync().

Fix this by running IRQ handler, rt5640_irq(), in thread context.
Hence replace request_irq() calls with devm_request_threaded_irq().

Fixes: 051dade346 ("ASoC: rt5640: Fix the wrong state of JD1 and JD2")
Cc: stable@vger.kernel.org
Cc: Oder Chiou <oder_chiou@realtek.com>
Signed-off-by: Sameer Pujar <spujar@nvidia.com>
Link: https://lore.kernel.org/r/1688015537-31682-4-git-send-email-spujar@nvidia.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2023-06-29 11:40:28 +01:00
Sheetal
6dfe70be0b
ASoC: tegra: Fix ADX byte map
Byte mask for channel-1 of stream-1 is not getting enabled and this
causes failures during ADX use cases. This happens because the byte
map value 0 matches the byte map array and put() callback returns
without enabling the corresponding bits in the byte mask.

ADX supports 4 output streams and each stream can have a maximum of
16 channels. Each byte in the input frame is uniquely mapped to a
byte in one of these 4 outputs. This mapping is done with the help of
byte map array via user space control setting. The byte map array
size in the driver is 16 and each array element is of size 4 bytes.
This corresponds to 64 byte map values.

Each byte in the byte map array can have any value between 0 to 255
to enable the corresponding bits in the byte mask. The value 256 is
used as a way to disable the byte map. However the byte map array
element cannot store this value. The put() callback disables the byte
mask for 256 value and byte map value is reset to 0 for this case.
This causes problems during subsequent runs since put() callback,
for value of 0, just returns without enabling the byte mask. In short,
the problem is coming because 0 and 256 control values are stored as
0 in the byte map array.

Right now fix the put() callback by actually looking at the byte mask
array state to identify if any change is needed and update the fields
accordingly. The get() callback needs an update as well to return the
correct control value that user has set before. Note that when user
set 256, the value is stored as 0 and byte mask is disabled. So byte
mask state is used to either return 256 or the value from byte map
array.

Given above, this looks bit complicated and all this happens because
the byte map array is tightly packed and cannot actually store the 256
value. Right now the priority is to fix the existing failure and a TODO
item is put to improve this logic.

Fixes: 3c97881b8c ("ASoC: tegra: Fix kcontrol put callback in ADX")
Cc: stable@vger.kernel.org
Signed-off-by: Sheetal <sheetal@nvidia.com>
Reviewed-by: Mohan Kumar D <mkumard@nvidia.com>
Reviewed-by: Sameer Pujar <spujar@nvidia.com>
Link: https://lore.kernel.org/r/1688015537-31682-3-git-send-email-spujar@nvidia.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2023-06-29 11:40:27 +01:00
Sheetal
49bd7b0814
ASoC: tegra: Fix AMX byte map
Byte mask for channel-1 of stream-1 is not getting enabled and this
causes failures during AMX use cases. This happens because the byte
map value 0 matches the byte map array and put() callback returns
without enabling the corresponding bits in the byte mask.

AMX supports 4 input streams and each stream can take a maximum of
16 channels. Each byte in the output frame is uniquely mapped to a
byte in one of these 4 inputs. This mapping is done with the help of
byte map array via user space control setting. The byte map array
size in the driver is 16 and each array element is of size 4 bytes.
This corresponds to 64 byte map values.

Each byte in the byte map array can have any value between 0 to 255
to enable the corresponding bits in the byte mask. The value 256 is
used as a way to disable the byte map. However the byte map array
element cannot store this value. The put() callback disables the byte
mask for 256 value and byte map value is reset to 0 for this case.
This causes problems during subsequent runs since put() callback,
for value of 0, just returns without enabling the byte mask. In short,
the problem is coming because 0 and 256 control values are stored as
0 in the byte map array.

Right now fix the put() callback by actually looking at the byte mask
array state to identify if any change is needed and update the fields
accordingly. The get() callback needs an update as well to return the
correct control value that user has set before. Note that when user
sets 256, the value is stored as 0 and byte mask is disabled. So byte
mask state is used to either return 256 or the value from byte map
array.

Given above, this looks bit complicated and all this happens because
the byte map array is tightly packed and cannot actually store the 256
value. Right now the priority is to fix the existing failure and a TODO
item is put to improve this logic.

Fixes: 8db78ace1b ("ASoC: tegra: Fix kcontrol put callback in AMX")
Cc: stable@vger.kernel.org
Signed-off-by: Sheetal <sheetal@nvidia.com>
Reviewed-by: Mohan Kumar D <mkumard@nvidia.com>
Reviewed-by: Sameer Pujar <spujar@nvidia.com>
Link: https://lore.kernel.org/r/1688015537-31682-2-git-send-email-spujar@nvidia.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2023-06-29 11:40:26 +01:00
Werner Sembach
22065e4214 ALSA: hda/realtek: Add quirk for Clevo NPx0SNx
This applies a SND_PCI_QUIRK(...) to the Clevo NPx0SNx barebones fixing the
microphone not being detected on the headset combo port.

Signed-off-by: Werner Sembach <wse@tuxedocomputers.com>
Cc: <stable@vger.kernel.org>
Link: https://lore.kernel.org/r/20230628155434.584159-1-wse@tuxedocomputers.com
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2023-06-29 08:42:57 +02:00
Linus Torvalds
362067b6d5 regulator: Updates for v6.5
This release is almost all drivers, there's some small improvements in
 the core but otherwise everything is updates to drivers, mostly the
 addition of new ones.
 
 There's also a bunch of changes pulled in from the MFD subsystem as
 dependencies, Rockchip and TI core MFD code that the regulator drivers
 depend on.
 
 I've also yet again managed to put a SPI commit in the regulator tree, I
 don't know what it is about those two trees (this for spi-geni-qcom).
 
  - Support for Renesas RAA215300, Rockchip RK808, Texas Instruments
    TPS6594 and TPS6287x, and X-Powers AXP15060 and AXP313a
 -----BEGIN PGP SIGNATURE-----
 
 iQEzBAABCgAdFiEEreZoqmdXGLWf4p/qJNaLcl1Uh9AFAmSZkRUACgkQJNaLcl1U
 h9A0bAf+IM6F/vTF7R/2NTlR3M/Z7HGinxK1oit6LuZfKnveaRRCEWvBVoZzZpjs
 CzdWTPBWA2jyETzEqmX7gxYnxf2aaLieLEpKRZSh3uQd5OKmrizQDs5/OdaVUViK
 /ytmqd/IFgFfwaI+az38CQlTf+dDyuJDB0OwlkEkoaxWjeiAh6INBh6xO9aKczoW
 lFd0tOVQt1EcBKdB4tBJLTFIWWsG66xy9NZ018FrcA+bCmQVBvkbqcahayI5Q6Kw
 m5H7cZuFbKV51AlyYMF/C4Lwhy1mOT166eRmSrgxBXCsqhpFeHYkJQkmumNd3gkQ
 oSQPTZHqSblJA7Utw09mlT6r/xqL0Q==
 =/f85
 -----END PGP SIGNATURE-----

Merge tag 'regulator-v6.5' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/regulator

Pull regulator updates from Mark Brown:
 "This release is almost all drivers, there's some small improvements in
  the core but otherwise everything is updates to drivers, mostly the
  addition of new ones.

  There's also a bunch of changes pulled in from the MFD subsystem as
  dependencies, Rockchip and TI core MFD code that the regulator drivers
  depend on.

  I've also yet again managed to put a SPI commit in the regulator tree,
  I don't know what it is about those two trees (this for
  spi-geni-qcom).

  Summary:

   - Support for Renesas RAA215300, Rockchip RK808, Texas Instruments
     TPS6594 and TPS6287x, and X-Powers AXP15060 and AXP313a"

* tag 'regulator-v6.5' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/regulator: (43 commits)
  regulator: Add Renesas PMIC RAA215300 driver
  regulator: dt-bindings: Add Renesas RAA215300 PMIC bindings
  regulator: ltc3676: Use maple tree register cache
  regulator: ltc3589: Use maple tree register cache
  regulator: helper: Document ramp_delay parameter of regulator_set_ramp_delay_regmap()
  regulator: mt6358: Use linear voltage helpers for single range regulators
  regulator: mt6358: Const-ify mt6358_regulator_info data structures
  regulator: mt6358: Drop *_SSHUB regulators
  regulator: mt6358: Merge VCN33_* regulators
  regulator: dt-bindings: mt6358: Drop *_sshub regulators
  regulator: dt-bindings: mt6358: Merge ldo_vcn33_* regulators
  regulator: dt-bindings: pwm-regulator: Add missing type for "pwm-dutycycle-unit"
  regulator: Switch two more i2c drivers back to use .probe()
  spi: spi-geni-qcom: Do not do DMA map/unmap inside driver, use framework instead
  soc: qcom: geni-se: Add interfaces geni_se_tx_init_dma() and geni_se_rx_init_dma()
  regulator: tps6594-regulator: Add driver for TI TPS6594 regulators
  regulator: axp20x: Add AXP15060 support
  regulator: axp20x: Add support for AXP313a variant
  dt-bindings: pfuze100.yaml: Add an entry for interrupts
  regulator: stm32-pwr: Fix regulator disabling
  ...
2023-06-28 13:32:47 -07:00
Takashi Iwai
4926a34b1b Merge branch 'topic/midi20' into for-linus
Pull a typo fix in MIDI 2.0 helper code.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2023-06-28 11:44:45 +02:00
Takashi Iwai
4eecae44a5 ALSA: ump: Correct wrong byte size at converting a UMP System message
A wrong size for UMP_SYSTEM_STATUS_MIDI_TIME_CODE and case
UMP_SYSTEM_STATUS_SONG_SELECT was reported at converting to the legacy
MIDI 1.0 stream.  This patch corrects the value.

Fixes: 0b5288f5fe ("ALSA: ump: Add legacy raw MIDI support")
Link: https://lore.kernel.org/r/20230628094352.15754-1-tiwai@suse.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2023-06-28 11:44:30 +02:00
Takashi Sakamoto
a64db0b9df ALSA: fireface: make read-only const array for model names static
It is preferable not to populate the constant array for constant strings
on the stack.

Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Link: https://lore.kernel.org/r/20230627235406.289970-1-o-takashi@sakamocchi.jp
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2023-06-28 11:42:55 +02:00
Colin Ian King
d17f0ce9a9 ALSA: oxfw: make read-only const array models static
Don't populate the const array on the stack, instead make it static.

Signed-off-by: Colin Ian King <colin.i.king@gmail.com>
Reviewed-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Link: https://lore.kernel.org/r/20230627113253.700065-1-colin.i.king@gmail.com
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2023-06-28 11:42:29 +02:00
Takashi Iwai
d6048fdc87 ASoC: Updates for v6.5
A fairly quiet release from a core and framework point of view, but a
 very big one from the point of view of new drivers:
 
  - More refectoring from Morimoto-san, this time mainly around DAI
    links and how we control the ordering of trigger() callbacks.
  - Convert a lot of drivers to use maple tree based caches.
  - Lots of work on the x86 driver stack.
  - Compressed audio support for Qualcomm.
  - Support for AMD SoundWire, Analog Devices SSM3515, Google Chameleon,
    Ingenic X1000, Intel systems with various CODECs, Longsoon platforms,
    Maxim MAX98388, Mediatek MT8188, Nuvoton NAU8825C, NXP platforms with
    NAU8822, Qualcomm WSA884x, StarFive JH7110, Texas Instruments TAS2781.
 -----BEGIN PGP SIGNATURE-----
 
 iQEzBAABCgAdFiEEreZoqmdXGLWf4p/qJNaLcl1Uh9AFAmSZjIQACgkQJNaLcl1U
 h9Dm0wf/X1q4n6KSXLvSyoSUxS/RWzWgyDDX7a4iLcFiov3ehHpVwzhwI/+1xSzs
 SGhg6q2rud05SejFBh+2L7HMZfdXWSfW9ukaGz3UsCdqw3/7zAUFgY1RGtjZO4lA
 eH50vEME9RbkIDgyxzYe9eViaKGh2fNxIbQ2d9hx6+nIVNfuuSikvGz4K/9PD0DN
 2tBgzuIWwrPIbvMV2zHDCycmVG0lqScMWjIrdpDFxa63aPTr920YqYWSoQfOUR1s
 j9zlZWnclTjrqRl1GZHxnM8N70vmutZWXAB1WFjal6mmMd6lUG71CyYHvA5h5D0V
 ygNpn9B5REYlHBVzI43uT3nog+iS4Q==
 =dbjW
 -----END PGP SIGNATURE-----

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

ASoC: Updates for v6.5

A fairly quiet release from a core and framework point of view, but a
very big one from the point of view of new drivers:

 - More refectoring from Morimoto-san, this time mainly around DAI
   links and how we control the ordering of trigger() callbacks.
 - Convert a lot of drivers to use maple tree based caches.
 - Lots of work on the x86 driver stack.
 - Compressed audio support for Qualcomm.
 - Support for AMD SoundWire, Analog Devices SSM3515, Google Chameleon,
   Ingenic X1000, Intel systems with various CODECs, Longsoon platforms,
   Maxim MAX98388, Mediatek MT8188, Nuvoton NAU8825C, NXP platforms with
   NAU8822, Qualcomm WSA884x, StarFive JH7110, Texas Instruments TAS2781.
2023-06-26 15:38:02 +02:00
Takashi Iwai
a15b513756 Merge branch 'for-next' into for-linus
Pull the 6.5-devel branch for upstreaming.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2023-06-26 15:23:23 +02:00
Andy Chi
e94f1f96f1 ALSA: hda/realtek: Enable mute/micmute LEDs and limit mic boost on EliteBook
On HP EliteBook 835/845/845W G10, the audio LEDs can be enabled by
ALC285_FIXUP_HP_MUTE_LED. So use it accordingly.

Signed-off-by: Andy Chi <andy.chi@canonical.com>
Cc: <stable@vger.kernel.org>
Fixes: 3e10f6ca76 ("ALSA: hda/realtek: Add quirk for HP EliteBook G10 laptops")
Link: https://lore.kernel.org/r/20230626130301.301712-1-andy.chi@canonical.com
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2023-06-26 15:22:47 +02:00
Vijendar Mukunda
85aeab3622
ASoC: amd: acp: fix for invalid dai id handling in acp_get_byte_count()
For invalid dai id, instead of returning -EINVAL
return bytes count as zero in acp_get_byte_count() function.

Fixes: 623621a9f9 ("ASoC: amd: Add common framework to support I2S on ACP SOC")

Signed-off-by: Vijendar Mukunda <Vijendar.Mukunda@amd.com>
Link: https://lore.kernel.org/r/20230626105356.2580125-6-Vijendar.Mukunda@amd.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2023-06-26 13:29:01 +01:00
Vijendar Mukunda
68a653ab86
ASoC: amd: ps: fix byte count return value for invalid SoundWire manager instance
acp_get_byte_count() function should return zero bytes instead of
-EINVAL for invalid SoundWire manager instance.

Fixes: f722917350 ("ASoC: amd: ps: add SoundWire dma driver dma ops")
Signed-off-by: Vijendar Mukunda <Vijendar.Mukunda@amd.com>
Link: https://lore.kernel.org/r/20230626105356.2580125-5-Vijendar.Mukunda@amd.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2023-06-26 13:29:00 +01:00
Vijendar Mukunda
46b50e514b
ASoC: amd: ps: add comments for DMA register mapping
Add comments for DMA register mapping for both the SoundWire manager
instances.

Signed-off-by: Vijendar Mukunda <Vijendar.Mukunda@amd.com>
Link: https://lore.kernel.org/r/20230626105356.2580125-4-Vijendar.Mukunda@amd.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2023-06-26 13:28:59 +01:00
Vijendar Mukunda
f15f6b294d
ASoC: amd: ps: fix for position register set for AUDIO0 RX stream
For AUDIO0 RX stream, AUDIO0_RX position registers should be used.
DMA error is reported due to referring wrong position register set for
AUDIO0 RX stream.
Correct the position register set for AUDIO0 RX stream.

Fixes: f722917350 ("ASoC: amd: ps: add SoundWire dma driver dma ops")

Signed-off-by: Vijendar Mukunda <Vijendar.Mukunda@amd.com>
Link: https://lore.kernel.org/r/20230626105356.2580125-3-Vijendar.Mukunda@amd.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2023-06-26 13:28:58 +01:00
Vijendar Mukunda
322a163ea6
ASoC: amd: ps: add fix for dma irq mask for rx streams for SDW0 instance
Correct the DMA irq mask macro to program DMA irq bits correctly for
SDW0 instance rx streams.

Fixes: 298d4f7b17 ("ASoC: amd: ps: add support for SoundWire DMA interrupts")

Signed-off-by: Vijendar Mukunda <Vijendar.Mukunda@amd.com>
Link: https://lore.kernel.org/r/20230626105356.2580125-2-Vijendar.Mukunda@amd.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2023-06-26 13:28:57 +01:00
Vijendar Mukunda
7beda6a256
ASoC: amd: ps: add comments for DMA irq bits mapping
Add comments for DMA stream id and IRQ bit mapping in
ACP_EXTERNAL_CNTL & ACP_EXTERNAL_CNTL1 registers for
SDW0 and SDW1 manager instances.

Signed-off-by: Vijendar Mukunda <Vijendar.Mukunda@amd.com>
Link: https://lore.kernel.org/r/20230626105356.2580125-1-Vijendar.Mukunda@amd.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2023-06-26 13:28:56 +01:00
Matthias Reichl
7b51620801
ASoC: hdmi-codec: fix channel info for compressed formats
According to CTA 861 the channel/speaker allocation info in the
audio infoframe only applies to uncompressed (PCM) audio streams.

The channel count info should indicate the number of channels
in the transmitted audio, which usually won't match the number of
channels used to transmit the compressed bitstream.

Some devices (eg some Sony TVs) will refuse to decode compressed
audio if these values are not set correctly.

To fix this we can simply set the channel count to 0 (which means
"refer to stream header") and set the channel/speaker allocation to 0
as well (which would mean stereo FL/FR for PCM, a safe value all sinks
will support) when transmitting compressed audio.

Signed-off-by: Matthias Reichl <hias@horus.com>
Link: https://lore.kernel.org/r/20230624165232.5751-1-hias@horus.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2023-06-26 13:28:55 +01:00
Matthias Reichl
4e08713336 ASoC: hdmi-codec: fix channel info for compressed formats
According to CTA 861 the channel/speaker allocation info in the
audio infoframe only applies to uncompressed (PCM) audio streams.

The channel count info should indicate the number of channels
in the transmitted audio, which usually won't match the number of
channels used to transmit the compressed bitstream.

Some devices (eg some Sony TVs) will refuse to decode compressed
audio if these values are not set correctly.

To fix this we can simply set the channel count to 0 (which means
"refer to stream header") and set the channel/speaker allocation to 0
as well (which would mean stereo FL/FR for PCM, a safe value all sinks
will support) when transmitting compressed audio.

Signed-off-by: Matthias Reichl <hias@horus.com>
Link: https://lore.kernel.org/r/20230624165232.5751-1-hias@horus.com
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2023-06-25 08:42:57 +02:00
Matthias Reichl
04b49b90ca ALSA: pcm: fix ELD constraints for (E)AC3, DTS(-HD) and MLP formats
The SADs of compressed formats contain the channel and sample rate
info of the audio data inside the compressed stream, but when
building constraints we must use the rates and channels used to
transport the compressed streams.

eg 48kHz 6ch EAC3 needs to be transmitted as a 2ch 192kHz stream.

This patch fixes the constraints for the common AC3 and DTS formats,
the constraints for the less common MPEG, DSD etc formats are copied
directly from the info in the SADs as before as I don't have the specs
and equipment to test those.

Signed-off-by: Matthias Reichl <hias@horus.com>
Link: https://lore.kernel.org/r/20230624165216.5719-1-hias@horus.com
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2023-06-25 08:42:53 +02:00
Mark Brown
54e47eade7
Add Renesas PMIC RAA215300 and built-in RTC
Merge series from Biju Das <biju.das.jz@bp.renesas.com>:

This patch series aims to add support for Renesas PMIC RAA215300 and
built-in RTC found on this PMIC device.

The details of PMIC can be found here[1].

Renesas PMIC RAA215300 exposes two separate i2c devices, one for the main
device and another for rtc device.
2023-06-24 01:57:59 +01:00
Mark Brown
2d0cad0473
ASoC: core: Always store of_node when getting DAI link component
The generic snd_soc_dai_get_dlc() contains a default translation function
for DAI names which has factored out common code in a number of card
drivers, resolving the dai_name and of_node either using a driver provided
translation function or with a generic implementation. Unfortunately the
of_node can't be set by the translation function since it currently doesn't
have an interface to do that but snd_soc_dai_get_dlc() only initialises the
of_node in the case where there is no translation function.

This breaks the Meson support after conversion to use the generic helpers
since the DPCM cards for it check which component of the SoC is connected
to each link by checking the compatible for the component and the Meson
components provide a custom operation so don't use the generic code.

Fix this and potentially other cards by unconditionally storing the node in
the dai_link_component, there shouldn't be a binding specific of_node
selected since that's how we determine the translation function.

Fixes: 2e1dbea1f8 ("ASoC: meson: use snd_soc_{of_}get_dlc()")
Fixes: 3c8b586185 ("ASoC: soc-core.c: add index on snd_soc_of_get_dai_name()")
Link: https://lore.kernel.org/r/Message-Id: <20230623-asoc-fix-meson-probe-v1-1-82b2c2ec5ca4@kernel.org>
Signed-off-by: Mark Brown <broonie@kernel.org>
2023-06-23 22:09:00 +01:00
Dan Carpenter
ed959833db
ASoC: tas2781: Fix error code in tas2781_load_calibration()
Return -EINVAL instead of success on this error path.

Fixes: 915f5eadeb ("ASoC: tas2781: firmware lib")
Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>
Link: https://lore.kernel.org/r/Message-Id: <729bb6b3-bc1d-4b3d-8b65-077a492c753c@moroto.mountain>
Signed-off-by: Mark Brown <broonie@kernel.org>
2023-06-23 16:28:58 +01:00
Arun Gopal Kondaveeti
154756319c
ASoC: amd: update pm_runtime enable sequence
pm_runtime_allow() is not needed for ACP child platform devices.
Replace pm_runtime_allow() with pm_runtime_mark_last_busy()
& pm_runtime_set_active() in pm_runtime enable sequence for
ACP child platform drivers.

Signed-off-by: Arun Gopal <arungopal.kondaveeti@amd.com>
Link: https://lore.kernel.org/r/Message-Id: <20230623214150.4058721-1-arungopal.kondaveeti@amd.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2023-06-23 11:07:39 +01:00
Takashi Iwai
4a1b5ba16e Merge branch 'topic/midi20' into for-next
Pull one more API update for UMP core.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2023-06-23 09:56:24 +02:00
Takashi Iwai
33cd763078 ALSA: ump: Export MIDI1 / UMP conversion helpers
Yet more preliminary work for the upcoming USB gadget support.

Now export the helpers to convert between legacy MIDI1 and UMP data
for handling the MIDI 1.0 USB interface.  The header file is moved to
include/sound.

The API functions are slightly changed, so that they can be used
without the direct access to snd_ump object.  The allocation is done
in ump.c itself as it's a simple kcalloc().

Link: https://lore.kernel.org/r/20230623075530.10976-1-tiwai@suse.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2023-06-23 09:56:11 +02:00
Arnd Bergmann
fcb66ee8d1
ASoC: tas2781: fix Kconfig dependencies
The new driver has two modules that both get enabled for build testing
when all codecs are selected. The comlib part has an i2c dependency,
so this remains disabled on builds without i2c, but then the other
one fails to link:

ERROR: modpost: "tasdevice_dev_bulk_write" [sound/soc/codecs/snd-soc-tas2781-fmwlib.ko] undefined!
ERROR: modpost: "tasdevice_dev_update_bits" [sound/soc/codecs/snd-soc-tas2781-fmwlib.ko] undefined!
ERROR: modpost: "tasdevice_dev_bulk_read" [sound/soc/codecs/snd-soc-tas2781-fmwlib.ko] undefined!
ERROR: modpost: "tasdevice_dev_read" [sound/soc/codecs/snd-soc-tas2781-fmwlib.ko] undefined!
ERROR: modpost: "tasdevice_dev_write" [sound/soc/codecs/snd-soc-tas2781-fmwlib.ko] undefined!

There are many ways to address this, adding an explicit dependency seems
to be the clearest method that keeps the structure of the driver otherwise
unchanged.

Fixes: ef3bcde75d ("ASoC: tas2781: Add tas2781 driver")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Link: https://lore.kernel.org/r/Message-Id: <20230622101205.3180938-1-arnd@kernel.org>
Signed-off-by: Mark Brown <broonie@kernel.org>
2023-06-22 23:31:28 +01:00
Syed Saba Kareem
3eb96217c1
ASoC: amd: acp: remove acp poweroff function
BIOS invokes ACP Power off sequence based on ACP device state.
Remove redundant code from ACP PCI driver for ACP Power off sequence.

Signed-off-by: Syed Saba Kareem <Syed.SabaKareem@amd.com>
Link: https://lore.kernel.org/r/Message-Id: <20230622152406.3709231-4-Syed.SabaKareem@amd.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2023-06-22 23:31:27 +01:00
Syed Saba Kareem
ad60672394
ASoC: amd: acp: clear pdm dma interrupt mask
Clear pdm dma interrupt mask in acp_dmic_shutdown().

'Fixes: c32bd332ce ("ASoC: amd: acp: Add generic support for
PDM controller on ACP")'

Signed-off-by: Syed Saba Kareem <Syed.SabaKareem@amd.com>
Link: https://lore.kernel.org/r/Message-Id: <20230622152406.3709231-1-Syed.SabaKareem@amd.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2023-06-22 23:31:26 +01:00
Maxim Kochetkov
fb180283c0
ASoC: codecs: max98090: Allow dsp_a mode
TDM mode for max98090 is dsp_a compatible with such limitations:
1) Up to four timeslots supported.
2) Only 16 bits timeslots supported.
3) Only 2 active timeslots (L/R) supported.

We want to setup TDM mode only when dsp_a mode is selected. So move
M98090_REG_TDM_FORMAT/M98090_REG_TDM_CONTROL registers setup from
max98090_set_tdm_slot() to the max98090_dai_set_fmt(). Also extend
max98090_set_tdm_slot() with all TDM limitations check.

Signed-off-by: Maxim Kochetkov <fido_max@inbox.ru>
Link: https://lore.kernel.org/r/Message-Id: <20230622142038.63388-1-fido_max@inbox.ru>
Signed-off-by: Mark Brown <broonie@kernel.org>
2023-06-22 23:31:25 +01:00
Srinivas Kandagatla
82f76ac26c
ASoC: qcom: common: add default jack dapm pins
If the soundcard does not specify the dapm pins, let the common
code add these pins for jack.

Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Tested-by: Johan Hovold <johan+linaro@kernel.org>
Link: https://lore.kernel.org/r/Message-Id: <20230302120327.10823-1-srinivas.kandagatla@linaro.org>
Signed-off-by: Mark Brown <broonie@kernel.org>
2023-06-22 18:02:07 +01:00
Arnd Bergmann
012fa2622e
ASoC: loongson: fix address space confusion
The i2s driver uses the mapped __iomem address of the FIFO as the DMA
address for the device. This apparently works on loongarch because of
the way it handles __iomem pointers as aliases of physical addresses,
but this is not portable to other architectures and causes a compiler
warning when dma addresses are not the same size as pointers:

sound/soc/loongson/loongson_i2s_pci.c: In function 'loongson_i2s_pci_probe':
sound/soc/loongson/loongson_i2s_pci.c:110:29: error: cast from pointer to integer of different size [-Werror=pointer-to-int-cast]
  110 |         tx_data->dev_addr = (dma_addr_t)i2s->reg_base + LS_I2S_TX_DATA;
      |                             ^
sound/soc/loongson/loongson_i2s_pci.c:113:29: error: cast from pointer to integer of different size [-Werror=pointer-to-int-cast]
  113 |         rx_data->dev_addr = (dma_addr_t)i2s->reg_base + LS_I2S_RX_DATA;
      |                             ^

Change the driver to instead use the physical address as stored in the
PCI BAR resource directly. Since 'dev_addr' is a 32-bit address, I think
this results in the same truncated address on loongarch but is otherwise
closer to portable code and avoids the warning.

Fixes: d84881e068 ("ASoC: Add support for Loongson I2S controller")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Link: https://lore.kernel.org/r/Message-Id: <20230622101235.3230941-1-arnd@kernel.org>
Signed-off-by: Mark Brown <broonie@kernel.org>
2023-06-22 18:02:06 +01:00
Sameer Pujar
f47d43283a
ASoC: tegra: Remove stale comments in AHUB
Remove stale comments in AHUB driver which is related to DAPM
widgets and routes. This is misleading otherwise.

Signed-off-by: Sameer Pujar <spujar@nvidia.com>
Link: https://lore.kernel.org/r/Message-Id: <1687433656-7892-7-git-send-email-spujar@nvidia.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2023-06-22 18:02:05 +01:00
Sameer Pujar
2cc41db71a
ASoC: tegra: Use normal system sleep for ASRC
Align with other AHUB module drivers and use normal system
sleep for ASRC as well.

Signed-off-by: Sameer Pujar <spujar@nvidia.com>
Link: https://lore.kernel.org/r/Message-Id: <1687433656-7892-6-git-send-email-spujar@nvidia.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2023-06-22 18:02:04 +01:00
Matthew Anderson
724418b84e ALSA: hda/realtek: Add quirks for ROG ALLY CS35l41 audio
This requires a patched ACPI table or a firmware from ASUS to work because
the system does not come with the _DSD field for the CSC3551.

Link: https://bugzilla.kernel.org/show_bug.cgi?id=217550
Signed-off-by: Matthew Anderson <ruinairas1992@gmail.com>
Tested-by: Philip Mueller <philm@manjaro.org>
Link: https://lore.kernel.org/r/20230621161714.9442-1-ruinairas1992@gmail.com
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2023-06-21 18:22:40 +02:00
Takashi Iwai
6f9441f4e3 ASoC: Fix for v6.4
A fix for a typoed iterator in the Intel Soundwire driver, fairly simple
 on inspection though not reviewed by Intel.
 -----BEGIN PGP SIGNATURE-----
 
 iQEzBAABCgAdFiEEreZoqmdXGLWf4p/qJNaLcl1Uh9AFAmSS9eUACgkQJNaLcl1U
 h9AUrgf8DzxOtaTaxzWGlVhoky6KxmYXXLANFOM1iDvGghoxEiYRCjn79El5+MuL
 YfmgOzUX1ls1T9eZFzUqhAmavjfYbQw7bK90nuK2iNklxswhFbvwJdb0X854eFza
 wLZEXhDnw9uyuCeenhC/JICxz5JvRnscmQ+rMy0SZQhKWeQ5QUdy2oa1o6dEpLd7
 uaqZirgaaa2jWikj/6KwO7/sEaE7UznZfwdMbijwwwURXMty1+9Zo5V8+sctYbjI
 oMHhiTbgAPbgfKN6k7MntGwWXBM7CXpAuzz6SOwdrOQmKaE5ODAAG1PnAWMkR2DQ
 T0rlCos56Xrom2lseAQoX/97OKCJWA==
 =dj3R
 -----END PGP SIGNATURE-----

Merge tag 'asoc-fix-v6.4-rc7' of https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound into for-linus

ASoC: Fix for v6.4

A fix for a typoed iterator in the Intel Soundwire driver, fairly simple
on inspection though not reviewed by Intel.
2023-06-21 15:23:23 +02:00
Fabio Estevam
6ab11462c6
ASoC: fsl-asoc-card: Allow passing the number of slots in use
Currently, fsl-asoc-card supports passing the width of the TDM slot, but
not the number of slots in use, as it harcodes it as two slots.

Add support for passing the number of slots in use.

Signed-off-by: Fabio Estevam <festevam@denx.de>
Link: https://lore.kernel.org/r/20230616203913.551183-1-festevam@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2023-06-21 13:42:51 +01:00
Krzysztof Kozlowski
aa21a7d4f6
ASoC: codecs: wsa884x: Add WSA884x family of speakers
Add drivers for Qualcomm WSA8840/WSA8845/WSA8845H smart speaker
amplifiers.

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Link: https://lore.kernel.org/r/20230616115751.392886-2-krzysztof.kozlowski@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>
2023-06-21 13:42:50 +01:00
Mac Chiang
b20c81371a
ASoC: Intel: sof_rt5682: Add mtl support RT1019P speaker
This patch support below hardware configuration:

SSP2: 10EC5682/RTL5682 codec
SSP0: RTL1019 amplifier

Signed-off-by: Mac Chiang <mac.chiang@intel.com>
Signed-off-by: Rui Zhou <zhourui@huaqin.corp-partner.google.com>
Link: https://lore.kernel.org/r/20230616063617.25900-2-mac.chiang@intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2023-06-21 13:42:48 +01:00
Terry Cheong
1f583cbdc3
ASoC: Intel: sof_rt5682: reorder quirk table
Reorder the entries in quirk table to group entries with same platform.

Signed-off-by: Terry Cheong <htcheong@chromium.org>
Signed-off-by: Mac Chiang <mac.chiang@intel.com>
Link: https://lore.kernel.org/r/20230616063617.25900-1-mac.chiang@intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2023-06-21 13:42:47 +01:00
Luke D. Jones
82edd1bd7f ALSA: hda/realtek: Add quirk for ASUS ROG GV601V
Adds the required quirk to enable the Cirrus amp and correct pins
on the ASUS ROG GV601V series.

While this works if the related _DSD properties are made available, these
aren't included in the ACPI of these laptops (yet).

Signed-off-by: Luke D. Jones <luke@ljones.dev>
Link: https://lore.kernel.org/r/20230621085715.5382-1-luke@ljones.dev
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2023-06-21 13:33:01 +02:00
Takashi Iwai
6b164eaecd Merge branch 'topic/midi20' into for-next
This is a small patch set to change the UMP core for the upcoming
gadget driver support.  Basically exporting a couple of helper
functions and adding a flag to suppress the internal UMP handling.
No functional changes by those alone.

Link: https://lore.kernel.org/r/20230621110241.4751-1-tiwai@suse.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2023-06-21 13:06:43 +02:00
Takashi Iwai
4dce2f076b ALSA: ump: Export snd_ump_receive_ump_val()
This is another preliminary patch for USB MIDI 2.0 gadget driver.
Export the currently local snd_ump_receive_ump_val().  It can be used
by the gadget driver for processing the UMP data.

Link: https://lore.kernel.org/r/20230621110241.4751-4-tiwai@suse.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2023-06-21 13:06:19 +02:00
Takashi Iwai
eacd9c7f1d ALSA: ump: Add no_process_stream flag
This is another preliminary patch for USB MIDI 2.0 gadget driver.
Add a new flag, no_process_stream, to snd_ump for suppressing the UMP
Stream message handling in UMP core.

Link: https://lore.kernel.org/r/20230621110241.4751-3-tiwai@suse.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2023-06-21 13:06:18 +02:00
Takashi Iwai
a798076837 ALSA: ump: Add helper to change MIDI protocol
This is a preliminary patch for MIDI 2.0 USB gadget driver.
Export a new helper to allow changing the current MIDI protocol from
the outside.

Link: https://lore.kernel.org/r/20230621110241.4751-2-tiwai@suse.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2023-06-21 13:06:18 +02:00
Ivan Orlov
8d0cf150d2 sound: make all 'class' structures const
Now that the driver core allows for struct class to be in read-only
memory, making all 'class' structures to be declared at build time
placing them into read-only memory, instead of having to be dynamically
allocated at load time.

Cc: Jaroslav Kysela <perex@perex.cz>
Cc: Takashi Iwai <tiwai@suse.com>
Cc: Ivan Orlov <ivan.orlov0322@gmail.com>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: Geoff Levand <geoff@infradead.org>
Cc: Thierry Reding <treding@nvidia.com>
Cc: "Uwe Kleine-König" <u.kleine-koenig@pengutronix.de>
Cc: alsa-devel@alsa-project.org
Suggested-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Ivan Orlov <ivan.orlov0322@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Link: https://lore.kernel.org/r/20230620175633.641141-2-gregkh@linuxfoundation.org
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2023-06-21 07:29:10 +02:00
Srinivas Kandagatla
7ea9ee0064 ALSA: compress: allow setting codec params after next track
For gapless playback it is possible that each track can have different
codec profile with same decoder, for example we have WMA album,
we may have different tracks as WMA v9, WMA v10 and so on

Or if DSP's like QDSP have abililty to switch decoders on single stream
for each track, then this call could be used to set new codec parameters.

Existing code does not allow to change this profile while doing gapless
playback.

Reuse existing SNDRV_COMPRESS_SET_PARAMS to set this new track params along
some additional checks to enforce proper state machine.

With this new changes now the user can call SNDRV_COMPRESS_SET_PARAMS
anytime after setting next track and additional check in write should
also ensure that params are set before writing new data.

Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Acked-by: Vinod Koul <vkoul@kernel.org>
Link: https://lore.kernel.org/r/20230619092805.21649-1-srinivas.kandagatla@linaro.org
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2023-06-21 07:28:31 +02:00
Mark Brown
1afc383a17
ASoC: Merge up fixes for CI
Some of the fixes merged should be relevant for my CI stability.
2023-06-21 01:32:48 +01:00