Commit graph

1215187 commits

Author SHA1 Message Date
Richard Fitzgerald
1a1c3d794e
ASoC: cs35l56: Use PCI SSID as the firmware UID
If the driver properties do not define a cirrus,firmware-uid try to get the
PCI SSID as the UID.

On PCI-based systems the PCI SSID is used to uniquely identify the specific
sound hardware. This is the standard mechanism for x86 systems and is the
way to get a unique system identifier for systems that use the CS35L56 on
SoundWire.

For non-SoundWire systems there is no Windows equivalent of the ASoC driver
in I2C/SPI mode. These would be:

1. HDA systems, which are handled by the HDA subsystem.
2. Linux-specific systems.
3. Composite devices where the cs35l56 is not present in ACPI and is
   configured using software nodes.

Case 2 can use the firmware-uid property, though the PCI SSID is supported
as an alternative, as it is the standard PCI mechanism.

Case 3 is a SoundWire system where some other codec is the SoundWire bridge
device and CS35L56 is not listed in ACPI. As these are SoundWire systems
they will normally use the PCI SSID.

Signed-off-by: Richard Fitzgerald <rf@opensource.cirrus.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20230912163207.3498161-5-rf@opensource.cirrus.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2023-09-12 18:53:50 +01:00
Richard Fitzgerald
d8b387544f
ASoC: Intel: sof_sdw: Copy PCI SSID to struct snd_soc_card
If the PCI SSID has been set in the struct snd_soc_acpi_mach_params,
copy this to struct snd_soc_card so that it can be used by other
ASoC components.

This is important for components that must apply system-specific
configuration.

Signed-off-by: Richard Fitzgerald <rf@opensource.cirrus.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20230912163207.3498161-4-rf@opensource.cirrus.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2023-09-12 18:53:49 +01:00
Richard Fitzgerald
ba2de401d3
ASoC: SOF: Pass PCI SSID to machine driver
Pass the PCI SSID of the audio interface through to the machine driver.
This allows the machine driver to use the SSID to uniquely identify the
specific hardware configuration and apply any platform-specific
configuration.

struct snd_sof_pdata is passed around inside the SOF code, but it then
passes configuration information to the machine driver through
struct snd_soc_acpi_mach and struct snd_soc_acpi_mach_params. So SSID
information has been added to both snd_sof_pdata and
snd_soc_acpi_mach_params.

PCI does not define 0x0000 as an invalid value so we can't use zero to
indicate that the struct member was not written. Instead a flag is
included to indicate that a value has been written to the
subsystem_vendor and subsystem_device members.

sof_pci_probe() creates the struct snd_sof_pdata. It is passed a struct
pci_dev so it can fill in the SSID value.

sof_machine_check() finds the appropriate struct snd_soc_acpi_mach. It
copies the SSID information across to the struct snd_soc_acpi_mach_params.
This done before calling any custom set_mach_params() so that it could be
used by the set_mach_params() callback to apply variant params.

The machine driver receives the struct snd_soc_acpi_mach as its
platform_data.

Signed-off-by: Richard Fitzgerald <rf@opensource.cirrus.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20230912163207.3498161-3-rf@opensource.cirrus.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2023-09-12 18:53:48 +01:00
Richard Fitzgerald
47f56e38a1
ASoC: soc-card: Add storage for PCI SSID
Add members to struct snd_soc_card to store the PCI subsystem ID (SSID)
of the soundcard.

The PCI specification provides two registers to store a vendor-specific
SSID that can be read by drivers to uniquely identify a particular
"soundcard". This is defined in the PCI specification to distinguish
products that use the same silicon (and therefore have the same silicon
ID) so that product-specific differences can be applied.

PCI only defines 0xFFFF as an invalid value. 0x0000 is not defined as
invalid. So the usual pattern of zero-filling the struct and then
assuming a zero value unset will not work. A flag is included to
indicate when the SSID information has been filled in.

Unlike DMI information, which has a free-format entirely up to the vendor,
the PCI SSID has a strictly defined format and a registry of vendor IDs.

It is usual in Windows drivers that the SSID is used as the sole identifier
of the specific end-product and the Windows driver contains tables mapping
that to information about the hardware setup, rather than using ACPI
properties.

This SSID is important information for ASoC components that need to apply
hardware-specific configuration on PCI-based systems.

As the SSID is a generic part of the PCI specification and is treated as
identifying the "soundcard", it is reasonable to include this information
in struct snd_soc_card, instead of components inventing their own custom
ways to pass this information around.

Signed-off-by: Richard Fitzgerald <rf@opensource.cirrus.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20230912163207.3498161-2-rf@opensource.cirrus.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2023-09-12 18:53:47 +01:00
Kuninori Morimoto
b399dc73f0
ASoC: rsnd: remove unneeded of_node_put()
The loop is not using "node", of_node_put(node) is not needed.

Cc: Julia Lawall <julia.lawall@inria.fr>
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/8734zlilmd.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2023-09-12 14:34:09 +01:00
Mark Brown
2b3357dc41
SM6115 TX Macro
Merge series from Konrad Dybcio <konrad.dybcio@linaro.org>:

Like most Qualcomm SoCs, SM6115 has a TX Macro.

Only some minor changes were required.
2023-09-12 14:29:55 +01:00
Mark Brown
0ed30d3fe2
ASoC: Update jh7110 PWM DAC for ops move
For some reason the JH7110 PWM DAC driver made it through build testing
in spite of not being updated for the move of probe() to the ops struct.
Make the required update.

Signed-off-by: Mark Brown <broonie@kernel.org>
2023-09-11 23:48:39 +01:00
Mark Brown
3597ea7476
Match data improvements for wm8580 driver
Merge series from Biju Das <biju.das.jz@bp.renesas.com>:

This patch series aims to add match data improvements for wm8580 driver.

This patch series is only compile tested.
2023-09-11 22:39:09 +01:00
Mark Brown
ecfca1fb9e
ASoC: Convert some Maxim codecs to use GPIO
Merge series from Linus Walleij <linus.walleij@linaro.org>:

The Maxim devices are pretty straight-forward to convert
over to use GPIO descriptors, so let's do it.
2023-09-11 22:39:00 +01:00
Mark Brown
0a69e8a697
Match data improvements for tlv320aic32x4 driver
Merge series from Biju Das <biju.das.jz@bp.renesas.com>:

This patch series aims to add match data improvements for tlv320aic32x4
driver.

This patch series is only compile tested.
2023-09-11 22:38:52 +01:00
Mark Brown
966277df0a
ASoC: Convert some Maxim codecs to use GPIO
Merge series from Linus Walleij <linus.walleij@linaro.org>:

The Maxim devices are pretty straight-forward to convert
over to use GPIO descriptors, so let's do it.
2023-09-11 22:38:44 +01:00
Mark Brown
f3dbb935d2
ASoC: mt8188-mt6359: add SOF support
Merge series from Trevor Wu <trevor.wu@mediatek.com>:

This series introduces dynamic pinctrl and adds support for the SOF on
the mt8188-mt6359 machine driver.
2023-09-11 22:38:36 +01:00
Mark Brown
6a3af823c1
Match data improvements for ak4642 driver
Merge series from Biju Das <biju.das.jz@bp.renesas.com>:

This patch series aims to add match data improvements for ak4642 driver.

This patch series is only compile tested.
2023-09-11 22:38:28 +01:00
Mark Brown
dbef51669b
ASoC: amd: acp: Add sound support for a line of
Merge series from Marian Postevca <posteuca@mutex.one>:

This series adds support for a line of HUAWEI laptops with
AMD CPUs that connect using the ACP3x module to a ES8336 CODEC.

The CODEC driver must be extended to support the S32 LE format
and the MCLK div by 2 option. MCLK div by 2 is needed for one specific
SKU, which uses a 48Mhz MCLK, which seems to be too high of a frequency
for the CODEC and must be divided by 2.

The acp legacy driver must also be extended by using callbacks so that
the more complicated handling of this specific CODEC can be moved
outside the more generic ACP code.
2023-09-11 22:38:20 +01:00
Mark Brown
09d86dbf16
Improve CS35l41-based audio codec drivers
Merge series from Cristian Ciocaltea <cristian.ciocaltea@collabora.com>:

This patch series contains several fixes and improvements to drivers
based on the CS35l41 audio codec.

It has been verified on Valve's Steam Deck, except the HDA related patches.
2023-09-11 22:38:11 +01:00
Mark Brown
5b772c61eb
Add PWM-DAC audio support for StarFive JH7110
Merge series from Hal Feng <hal.feng@starfivetech.com>:

This patchset adds PWM-DAC audio support for the StarFive JH7110 SoC.
The PWM-DAC module does not require a hardware codec, but a dummy codec is
needed for the driver. The dummy spdif codec driver, which is already
upstream, is compatible with the one which JH7110 PWM-DAC needed. So we
use it as the dummy codec driver for the JH7110 PWM-DAC module.
2023-09-11 22:37:52 +01:00
Cristian Ciocaltea
206b250c3e
ALSA: hda: cs35l41: Consistently use dev_err_probe()
Replace the remaining dev_err() calls in probe() with dev_err_probe(),
to improve consistency.

Signed-off-by: Cristian Ciocaltea <cristian.ciocaltea@collabora.com>
Reviewed-by: Takashi Iwai <tiwai@suse.de>
Link: https://lore.kernel.org/r/20230907171010.1447274-12-cristian.ciocaltea@collabora.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2023-09-11 13:34:42 +01:00
Cristian Ciocaltea
85a1bf86fa
ALSA: hda: cs35l41: Undo runtime PM changes at driver exit time
According to the documentation, drivers are responsible for undoing at
removal time all runtime PM changes done during probing.

Hence, add the missing calls to pm_runtime_dont_use_autosuspend(), which
are necessary for undoing pm_runtime_use_autosuspend().

Fixes: 1873ebd30c ("ALSA: hda: cs35l41: Support Hibernation during Suspend")
Signed-off-by: Cristian Ciocaltea <cristian.ciocaltea@collabora.com>
Reviewed-by: Takashi Iwai <tiwai@suse.de>
Link: https://lore.kernel.org/r/20230907171010.1447274-11-cristian.ciocaltea@collabora.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2023-09-11 13:34:41 +01:00
Cristian Ciocaltea
486465508f
ALSA: hda: cs35l41: Fix unbalanced pm_runtime_get()
If component_add() fails, probe() returns without calling
pm_runtime_put(), which leaves the runtime PM usage counter incremented.

Fix the issue by jumping to err_pm label and drop the now unnecessary
pm_runtime_disable() call.

Fixes: 7b2f3eb492 ("ALSA: hda: cs35l41: Add support for CS35L41 in HDA systems")
Signed-off-by: Cristian Ciocaltea <cristian.ciocaltea@collabora.com>
Reviewed-by: Takashi Iwai <tiwai@suse.de>
Link: https://lore.kernel.org/r/20230907171010.1447274-10-cristian.ciocaltea@collabora.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2023-09-11 13:34:40 +01:00
Cristian Ciocaltea
611b8813a2
ASoC: cs35l41: Use modern pm_ops
Make use of the recently introduced EXPORT_GPL_DEV_PM_OPS() macro, to
conditionally export the runtime/system PM functions.

Replace the old SET_{RUNTIME,SYSTEM_SLEEP,NOIRQ_SYSTEM_SLEEP}_PM_OPS()
helpers with their modern alternatives and get rid of the now
unnecessary '__maybe_unused' annotations on all PM functions.

Additionally, use the pm_ptr() macro to fix the following errors when
building with CONFIG_PM disabled:

ERROR: modpost: "cs35l41_pm_ops" [sound/soc/codecs/snd-soc-cs35l41-spi.ko] undefined!
ERROR: modpost: "cs35l41_pm_ops" [sound/soc/codecs/snd-soc-cs35l41-i2c.ko] undefined!

Signed-off-by: Cristian Ciocaltea <cristian.ciocaltea@collabora.com>
Acked-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Reviewed-by: Takashi Iwai <tiwai@suse.de>
Link: https://lore.kernel.org/r/20230907171010.1447274-9-cristian.ciocaltea@collabora.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2023-09-11 13:34:39 +01:00
Cristian Ciocaltea
3db52739ac
ASoC: cs35l41: Make use of dev_err_probe()
Use dev_err_probe() helper where possible, to simplify error handling
during probe.

Signed-off-by: Cristian Ciocaltea <cristian.ciocaltea@collabora.com>
Acked-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Reviewed-by: Takashi Iwai <tiwai@suse.de>
Link: https://lore.kernel.org/r/20230907171010.1447274-8-cristian.ciocaltea@collabora.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2023-09-11 13:34:39 +01:00
Cristian Ciocaltea
2d5661e600
ASoC: cs35l41: Undo runtime PM changes at driver exit time
According to the documentation, drivers are responsible for undoing at
removal time all runtime PM changes done during probing.

Hence, add the missing calls to pm_runtime_dont_use_autosuspend(), which
are necessary for undoing pm_runtime_use_autosuspend().

Note this would have been handled implicitly by
devm_pm_runtime_enable(), but there is a need to continue using
pm_runtime_enable()/pm_runtime_disable() in order to ensure the runtime
PM is disabled as soon as the remove() callback is entered.

Fixes: f517ba4924 ("ASoC: cs35l41: Add support for hibernate memory retention mode")
Signed-off-by: Cristian Ciocaltea <cristian.ciocaltea@collabora.com>
Reviewed-by: Takashi Iwai <tiwai@suse.de>
Link: https://lore.kernel.org/r/20230907171010.1447274-7-cristian.ciocaltea@collabora.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2023-09-11 13:34:38 +01:00
Cristian Ciocaltea
9f8948db98
ASoC: cs35l41: Verify PM runtime resume errors in IRQ handler
The interrupt handler invokes pm_runtime_get_sync() without checking the
returned error code.

Add a proper verification and switch to pm_runtime_resume_and_get(), to
avoid the need to call pm_runtime_put_noidle() for decrementing the PM
usage counter before returning from the error condition.

Fixes: f517ba4924 ("ASoC: cs35l41: Add support for hibernate memory retention mode")
Signed-off-by: Cristian Ciocaltea <cristian.ciocaltea@collabora.com>
Acked-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Reviewed-by: Takashi Iwai <tiwai@suse.de>
Link: https://lore.kernel.org/r/20230907171010.1447274-6-cristian.ciocaltea@collabora.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2023-09-11 13:34:37 +01:00
Cristian Ciocaltea
77bf613f0b
ASoC: cs35l41: Fix broken shared boost activation
Enabling the active/passive shared boosts requires setting SYNC_EN, but
*not* before receiving the PLL Lock signal.

Due to improper error handling, it was not obvious that waiting for the
completion operation times out and, consequently, the shared boost is
never activated.

Further investigations revealed the signal is triggered while
snd_pcm_start() is executed, right after receiving the
SNDRV_PCM_TRIGGER_START command, which happens long after the
SND_SOC_DAPM_PRE_PMU event handler is invoked as part of
snd_pcm_prepare().  That is where cs35l41_global_enable() is called
from.

Increasing the wait duration doesn't help, as it only causes an
unnecessary delay in the invocation of snd_pcm_start().  Moving the wait
and the subsequent regmap operations to the SNDRV_PCM_TRIGGER_START
callback is not a solution either, since they would be executed in an
IRQ-off atomic context.

Solve the issue by setting the SYNC_EN bit in PWR_CTRL3 register right
after receiving the PLL Lock interrupt.

Additionally, drop the unnecessary writes to PWR_CTRL1 register, part of
the original mdsync_up_seq, which would have toggled GLOBAL_EN with
unwanted consequences on PLL locking behavior.

Fixes: f503056493 ("ALSA: cs35l41: Add shared boost feature")
Signed-off-by: Cristian Ciocaltea <cristian.ciocaltea@collabora.com>
Reviewed-by: David Rhodes <david.rhodes@cirrus.com>
Reviewed-by: Takashi Iwai <tiwai@suse.de>
Link: https://lore.kernel.org/r/20230907171010.1447274-5-cristian.ciocaltea@collabora.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2023-09-11 13:34:36 +01:00
Cristian Ciocaltea
5ad668a9ce
ASoC: cs35l41: Initialize completion object before requesting IRQ
Technically, an interrupt handler can be called before probe() finishes
its execution, hence ensure the pll_lock completion object is always
initialized before being accessed in cs35l41_irq().

Fixes: f503056493 ("ALSA: cs35l41: Add shared boost feature")
Signed-off-by: Cristian Ciocaltea <cristian.ciocaltea@collabora.com>
Acked-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Reviewed-by: Takashi Iwai <tiwai@suse.de>
Link: https://lore.kernel.org/r/20230907171010.1447274-4-cristian.ciocaltea@collabora.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2023-09-11 13:34:35 +01:00
Cristian Ciocaltea
4bb5870ab6
ASoC: cs35l41: Handle mdsync_up reg write errors
The return code of regmap_multi_reg_write() call related to "MDSYNC up"
sequence is shadowed by the subsequent regmap_read_poll_timeout()
invocation, which will hit a timeout in case the write operation above
fails.

Make sure cs35l41_global_enable() returns the correct error code instead
of -ETIMEDOUT.

Additionally, to be able to distinguish between the timeouts of
wait_for_completion_timeout() and regmap_read_poll_timeout(), print an
error message for the former and return immediately.  This also avoids
having to wait unnecessarily for the second time.

Fixes: f8264c7592 ("ALSA: cs35l41: Poll for Power Up/Down rather than waiting a fixed delay")
Signed-off-by: Cristian Ciocaltea <cristian.ciocaltea@collabora.com>
Acked-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Reviewed-by: Takashi Iwai <tiwai@suse.de>
Link: https://lore.kernel.org/r/20230907171010.1447274-3-cristian.ciocaltea@collabora.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2023-09-11 13:34:34 +01:00
Cristian Ciocaltea
a9a3f54a23
ASoC: cs35l41: Handle mdsync_down reg write errors
The return code of regmap_multi_reg_write() call related to "MDSYNC
down" sequence is shadowed by the subsequent
wait_for_completion_timeout() invocation, which is expected to time
timeout in case the write operation failed.

Let cs35l41_global_enable() return the correct error code instead of
-ETIMEDOUT.

Fixes: f503056493 ("ALSA: cs35l41: Add shared boost feature")
Signed-off-by: Cristian Ciocaltea <cristian.ciocaltea@collabora.com>
Acked-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Reviewed-by: Takashi Iwai <tiwai@suse.de>
Link: https://lore.kernel.org/r/20230907171010.1447274-2-cristian.ciocaltea@collabora.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2023-09-11 13:34:34 +01:00
Linus Walleij
ce22caa4a1
ASoC: max98927: Drop pointless includes
This driver is already using solely GPIO descriptors and
do not need to include the legacy headers <linux/gpio.h>
or <linux/of_gpio.h>. Drop them.

Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Link: https://lore.kernel.org/r/20230911-descriptors-asoc-max-v2-7-b9d793fb768e@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>
2023-09-11 12:50:10 +01:00
Linus Walleij
0d22f950eb
ASoC: max98520: Drop pointless includes
This driver is already using solely GPIO descriptors and
do not need to include the legacy headers <linux/gpio.h>
or <linux/of_gpio.h>. Drop them.

Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Link: https://lore.kernel.org/r/20230911-descriptors-asoc-max-v2-6-b9d793fb768e@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>
2023-09-11 12:50:09 +01:00
Linus Walleij
0a5b7ee05f
ASoC: max98396: Drop pointless include
This driver is already using solely GPIO descriptors and
do not need to include the legacy header <linux/gpio.h>.
Drop it.

Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Link: https://lore.kernel.org/r/20230911-descriptors-asoc-max-v2-5-b9d793fb768e@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>
2023-09-11 12:50:08 +01:00
Linus Walleij
832beb640e
ASoC: max98388: Correct the includes
The MAX98388 driver is using the modern GPIO descriptor API
but uses legacy includes. Include the proper <linux/consumer.h>
header instead.

Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Link: https://lore.kernel.org/r/20230911-descriptors-asoc-max-v2-4-b9d793fb768e@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>
2023-09-11 12:50:08 +01:00
Linus Walleij
d3091d09de
ASoC: max98373: Convert to use GPIO descriptors
Instead of relying on legacy interfaces, convert the driver to
use GPIO descriptors. This is a straight-forward conversion,
we support also sdw devices providing GPIO descriptor tables
if they so desire.

Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Link: https://lore.kernel.org/r/20230911-descriptors-asoc-max-v2-3-b9d793fb768e@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>
2023-09-11 12:50:07 +01:00
Linus Walleij
02de898322
ASoC: max98357a: Drop pointless include
This driver is already using solely GPIO descriptors and
do not need to include the legacy header <linux/gpio.h>.
Drop it.

Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Link: https://lore.kernel.org/r/20230911-descriptors-asoc-max-v2-2-b9d793fb768e@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>
2023-09-11 12:50:06 +01:00
Linus Walleij
637a7969ef
ASoC: max9768: Convert to use GPIO descriptors
The MAX9768 is pretty straight forward to convert to GPIO
descriptors.

To name the GPIO properties, I looke at the bindings in
maxim,max9759.yaml which names these GPIO "mute" and
"shutdown" respectively.

No board files using platform data exist in the kernel, new
users can use GPIO descriptor tables if desired.

Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Link: https://lore.kernel.org/r/20230911-descriptors-asoc-max-v2-1-b9d793fb768e@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>
2023-09-11 12:50:05 +01:00
Hal Feng
d1802d59ab
ASoC: starfive: Add JH7110 PWM-DAC driver
Add PWM-DAC driver support for the StarFive JH7110 SoC.

Reviewed-by: Walker Chen <walker.chen@starfivetech.com>
Signed-off-by: Hal Feng <hal.feng@starfivetech.com>
Link: https://lore.kernel.org/r/20230814080618.10036-3-hal.feng@starfivetech.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2023-09-11 01:33:39 +01:00
Hal Feng
748c482d03
ASoC: dt-bindings: Add StarFive JH7110 PWM-DAC controller
Add bindings for the PWM-DAC controller on the JH7110
RISC-V SoC by StarFive Ltd.

Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Signed-off-by: Hal Feng <hal.feng@starfivetech.com>
Link: https://lore.kernel.org/r/20230814080618.10036-2-hal.feng@starfivetech.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2023-09-11 01:32:45 +01:00
Biju Das
e17e892dc8
ASoC: tas571x: Simplify probe()
Simplify probe() by replacing of_match_device->i2c_get_match_data().

Signed-off-by: Biju Das <biju.das.jz@bp.renesas.com>
Link: https://lore.kernel.org/r/20230827091525.39263-1-biju.das.jz@bp.renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2023-09-11 01:30:05 +01:00
Vlad Karpovich
c3c9b17d27
ASoC: cs35l45: Add AMP Enable Switch control
The "AMP Enable Switch" is useful in systems with multiple
amplifiers connected to the same audio bus
but not all of them are needed for all use cases.

Signed-off-by: Vlad Karpovich <vkarpovi@opensource.cirrus.com>
Acked-by: Ricardo Rivera-Matos <rriveram@opensource.cirrus.com>
Acked-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Link: https://lore.kernel.org/r/20230831162042.471801-4-vkarpovi@opensource.cirrus.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2023-09-11 01:30:05 +01:00
Vlad Karpovich
3fecf69aa7
ASoC: cs35l45: Connect DSP to the monitoring signals
Link VMON, IMON, TEMPMON, VDD_BSTMON and VDD_BATTMON
to DSP1. The CSPL firmware uses them for the speaker calibration
and monitoring.

Signed-off-by: Vlad Karpovich <vkarpovi@opensource.cirrus.com>
Acked-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Acked-by: Ricardo Rivera-Matos <rriveram@opensource.cirrus.com>
Link: https://lore.kernel.org/r/20230831162042.471801-3-vkarpovi@opensource.cirrus.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2023-09-11 01:30:04 +01:00
Vlad Karpovich
18050443b9
ASoC: cs35l45: Analog PCM Volume and Amplifier Mode controls
Adds "Analog PCM Volume" control with supported values
0 = 10dB,1 = 13dB,2 = 16dB and 3 = 19dB.
The amplifier can operate either in Speaker Mode or Receiver Mode
as configured by the user. Speaker Mode has four gain options
to support maximum amplifier output amplitude for loud
speaker application. Receiver Mode has further optimized
noise performance while maintaining sufficient output to support
phone receiver application. While configured in Receiver Mode,
the analog PCM Volume control is disabled and
the analog gain is fixed to 1dB.

Signed-off-by: Vlad Karpovich <vkarpovi@opensource.cirrus.com>
Acked-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Link: https://lore.kernel.org/r/20230831162042.471801-2-vkarpovi@opensource.cirrus.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2023-09-11 01:30:03 +01:00
Ricardo Rivera-Matos
44f37b6ce0
ASoC: cs35l45: Checks index of cs35l45_irqs[]
Checks the index computed by the virq offset before printing the
error condition in cs35l45_spk_safe_err() handler.

Signed-off-by: Ricardo Rivera-Matos <rriveram@opensource.cirrus.com>
Signed-off-by: Vlad Karpovich <vkarpovi@opensource.cirrus.com>
Acked-by: Ricardo Rivera-Matos <rriveram@opensource.cirrus.com>
Acked-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Link: https://lore.kernel.org/r/20230831162042.471801-1-vkarpovi@opensource.cirrus.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2023-09-11 01:30:02 +01:00
Biju Das
ad19199233
ASoC: cs42xx8-i2c: Simplify probe()
Simplify probe() by replacing of_match_device->i2c_get_match_data() and
extend matching support for ID table. Also replace
dev_err()->dev_err_probe() to simplify the code.

Signed-off-by: Biju Das <biju.das.jz@bp.renesas.com>
Acked-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Link: https://lore.kernel.org/r/20230828174856.122559-1-biju.das.jz@bp.renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2023-09-11 01:30:01 +01:00
Biju Das
26eacb98ca
ASoC: wm8580: Simplify probe()
Simplify probe() by replacing of_match_device->i2c_get_match_data() and
extend matching support for ID table.

While at it, remove comma in the terminator entry and simplify probe()
by replacing dev_err->dev_err_probe().

Signed-off-by: Biju Das <biju.das.jz@bp.renesas.com>
Acked-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Link: https://lore.kernel.org/r/20230828174019.119250-1-biju.das.jz@bp.renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2023-09-11 01:30:00 +01:00
Jerome Brunet
43f2d432e4
ASoC: meson: axg: extend TDM maximum sample rate to 384kHz
The TDM HW on the axg SoC families and derivatives actually supports
384kHz sampling rate.

Update the fifo and tdm interface constraints accordingly.

Signed-off-by: Jerome Brunet <jbrunet@baylibre.com>
Link: https://lore.kernel.org/r/20230907090910.13546-1-jbrunet@baylibre.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2023-09-11 01:30:00 +01:00
Andy Shevchenko
428cc4106a
ASoC: soc.h: replace custom COUNT_ARGS() & CONCATENATE() implementations
Replace custom implementation of the macros from args.h.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Reviewed-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/20230904111524.1740930-1-andriy.shevchenko@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2023-09-11 01:29:59 +01:00
Marian Postevca
54fcd9dd44
ASoC: amd: acp: Add machine driver that enables sound for systems with a ES8336 codec
This commit enables sound for a line of Huawei laptops that use
the ES8336 codec which is connected to the ACP3X module.

Signed-off-by: Marian Postevca <posteuca@mutex.one>
Link: https://lore.kernel.org/r/20230829220116.1159-6-posteuca@mutex.one
Signed-off-by: Mark Brown <broonie@kernel.org>
2023-09-11 01:24:11 +01:00
Marian Postevca
c680f57095
ASoC: amd: acp: Add support for splitting the codec specific code from the ACP driver
This commit adds support for splitting more complicated machine
drivers, that need special handling, from the generic ACP code.

By adding support for callbacks to configure and handle codec
specific implementation details, we can split them in separate
files that don't clutter the ACP code.

Signed-off-by: Marian Postevca <posteuca@mutex.one>
Link: https://lore.kernel.org/r/20230829220116.1159-5-posteuca@mutex.one
Signed-off-by: Mark Brown <broonie@kernel.org>
2023-09-11 01:24:10 +01:00
Marian Postevca
869f30782c
ASoC: es8316: Enable support for MCLK div by 2
To properly support a line of Huawei laptops with an AMD CPU
and an ES8336 codec connected to the ACP3X module, we need
to enable the codec option to divide the MCLK by 2.
This is needed because for at least one SKU that has a 48Mhz
MCLK the sound is distorted unless the MCLK div by 2 option
is enabled.

The option to divide the MCLK will first be tried. If no suitable
clocking can be generated from this frequency, then the normal
non-halved MCLK frequency will be tried.

Signed-off-by: Marian Postevca <posteuca@mutex.one>
Link: https://lore.kernel.org/r/20230829220116.1159-4-posteuca@mutex.one
Signed-off-by: Mark Brown <broonie@kernel.org>
2023-09-11 01:24:09 +01:00
Marian Postevca
a43c0dc100
ASoC: es8316: Replace NR_SUPPORTED_MCLK_LRCK_RATIOS with ARRAY_SIZE()
No need for a special define since we can use ARRAY_SIZE() directly,
and won't need to worry to keep it in sync.

Signed-off-by: Marian Postevca <posteuca@mutex.one>
Link: https://lore.kernel.org/r/20230829220116.1159-3-posteuca@mutex.one
Signed-off-by: Mark Brown <broonie@kernel.org>
2023-09-11 01:24:08 +01:00
Marian Postevca
2f06f231f0
ASoC: es8316: Enable support for S32 LE format
This CODEC does support the S32 LE format in es8316_pcm_hw_params(),
but doesn't have it enabled in ES8316_FORMATS. Enable it so that we
have more options to match with components.

Signed-off-by: Marian Postevca <posteuca@mutex.one>
Link: https://lore.kernel.org/r/20230829220116.1159-2-posteuca@mutex.one
Signed-off-by: Mark Brown <broonie@kernel.org>
2023-09-11 01:24:07 +01:00