Mario Limonciello [Tue, 31 Jan 2023 18:46:47 +0000 (12:46 -0600)]
ASoC: amd: yc: Adjust the gain for PDM DMIC
A number of users for Lenovo Rembrandt based laptops are
reporting that the microphone is too quiet relative to
Windows with a dual boot.
Increase the PDM gain to overcome this problem.
Signed-off-by: Mario Limonciello <mario.limonciello@amd.com>
Reviewed-by: Jaroslav Kysela <perex@perex.cz>
Link: https://lore.kernel.org/r/20230131184653.10216-2-mario.limonciello@amd.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Christophe Branchereau [Sun, 22 Jan 2023 21:07:03 +0000 (22:07 +0100)]
ASoC: codecs/jz4760: add digital gain controls
Both the DAC and ADC have digital gain controls available
for their mixers, which go from -31 to 0db by step of 1db.
Signed-off-by: Christophe Branchereau <cbranchereau@gmail.com>
Link: https://lore.kernel.org/r/20230122210703.2552384-1-cbranchereau@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Kuninori Morimoto [Wed, 1 Feb 2023 02:02:22 +0000 (02:02 +0000)]
ASoC: rsnd: add R-Car Gen4 Sound support
This patch is tested on V4H White Hawk + ARD-AUDIO-DA7212
Signed-off-by: Linh Phung <linh.phung.jy@renesas.com>
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/87o7qe5ej5.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Kuninori Morimoto [Wed, 1 Feb 2023 02:02:07 +0000 (02:02 +0000)]
ASoC: dt-bindings: renesas: add R8A779G0 V4H
Document R-Car V4H (R8A779G0), and R-Car Gen4 SoC bindings.
Link: https://lore.kernel.org/r/87zga6t5r4.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/87pmau5ejk.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Kuninori Morimoto [Wed, 1 Feb 2023 02:00:49 +0000 (02:00 +0000)]
ASoC: rsnd: dma.c: tidyup rsnd_dma_probe()
This patch tidyups rsnd_dma_probe(), but there is no effect.
This is prepare for Gen4 support.
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/87r0va5elq.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Kuninori Morimoto [Wed, 1 Feb 2023 02:00:42 +0000 (02:00 +0000)]
ASoC: rsnd: tidyup rsnd_dma_addr()
This patch tidyups rsnd_dma_addr(), but there is no effect.
This is prepare for Gen4 support.
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/87sffq5elx.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Kuninori Morimoto [Wed, 1 Feb 2023 02:00:36 +0000 (02:00 +0000)]
ASoC: rsnd: use array for 44.1kHz/48kHz rate handling
ADG need to know output rate of 44.1kHz/48kHz.
It is using single variable for each, but this patch changes
it to array. Nothing is changed by this patch.
This is prepare for R-Car Gen4 support.
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/87tu065em3.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Kuninori Morimoto [Wed, 1 Feb 2023 02:00:32 +0000 (02:00 +0000)]
ASoC: rsnd: use clkin/out_size
Current adg.c is assuming number of clkin/clkout are fixed, but it is
not correct on Gen4. This patch uses clkin/out_size to handling it.
This is prepare for R-Car Gen4 support.
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/87v8km5em7.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Kuninori Morimoto [Wed, 1 Feb 2023 02:00:27 +0000 (02:00 +0000)]
ASoC: rsnd: moves clkout_name to top of the file
This patch moves clkout_name to top of the file to handling both
clkin/clkout in the same place.
This is prepare for R-Car Gen4 support.
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/87wn525emc.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Kuninori Morimoto [Wed, 1 Feb 2023 02:00:22 +0000 (02:00 +0000)]
ASoC: rsnd: rename clk to clkin
Current adg.c is usig "clk" as clock IN, but is using "clkout" for
clock OUT. This patch arranges "clk" to "clkin".
This is prepare for R-Car Gen4 support.
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/87y1pi5emh.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Kuninori Morimoto [Wed, 1 Feb 2023 02:00:18 +0000 (02:00 +0000)]
ASoC: rsnd: remove unnecessary ADG flags
The flag LRCLK_ASYNC / AUDIO_OUT_48 had been added to handling
special case of Salvator-X board, but it is not used on upstream.
It makes code complex today, let's remove these.
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/87zg9y5emm.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Kuninori Morimoto [Wed, 1 Feb 2023 02:00:13 +0000 (02:00 +0000)]
ASoC: rsnd: use same debug message format on clkout
This patch follows clkin debug message style on clkout.
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/871qna6t77.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Kuninori Morimoto [Wed, 1 Feb 2023 02:00:08 +0000 (02:00 +0000)]
ASoC: rsnd: indicate warning once if it can't handle requested rule
Some SoC can't handle all requested hw rule. In such case, it will indicate
like below, but it is unclear why it didn't work to user.
This patch indicates warning in such case once, because player will try to
similar rule many times.
# aplay sound.wav
Playing WAVE 'sound.wav' : Signed 16 bit Little Endian, Rate 48000 Hz, Stereo
aplay: aplay.c: 1359: set_params: Assertion `err >= 0' failed.
Aborted by signal Aborted...
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/87357q6t7b.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Kuninori Morimoto [Wed, 1 Feb 2023 02:00:03 +0000 (02:00 +0000)]
ASoC: rsnd: indicate necessary error when clock start failed
rsnd_ssi_master_clk_start() indicates error message if it couldn't
handle requested clock/rate, but it is not caring all cases.
This patch cares it.
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/874js66t7g.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Kuninori Morimoto [Wed, 1 Feb 2023 01:59:58 +0000 (01:59 +0000)]
ASoC: rsnd: Remove unnecessary rsnd_dbg_dai_call()
commit
b43b8ae87c8e0a8 ("ASoC: rsnd: protect mod->status") removed
RSND_DEBUG_NO_DAI_CALL and rsnd_dbg_dai_call(), but these are still
exist on rsnd.h. This patch removes it.
Fixes:
b43b8ae87c8e ("ASoC: rsnd: protect mod->status")
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/875ycm6t7l.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Kuninori Morimoto [Wed, 1 Feb 2023 01:59:52 +0000 (01:59 +0000)]
ASoC: rsnd: fixup #endif position
commit
1f9c82b5ab83ff2 ("ASoC: rsnd: add debugfs support") added
CONFIG_DEBUG_FS related definitions on rsnd.h, but it should be
added inside of RSND_H. This patch fixup it.
Fixes:
1f9c82b5ab83 ("ASoC: rsnd: add debugfs support")
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/877cx26t7r.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Kuninori Morimoto [Wed, 1 Feb 2023 01:59:46 +0000 (01:59 +0000)]
ASoC: rsnd: check whether playback/capture property exists
Current rsnd sets "channels_min" which is used from
snd_soc_dai_stream_valid() without checking DT playback/capture property.
Thus, "aplay -l" or "arecord -l" will indicate un-exising device.
This patch checks DT proerty and do nothing playback/capture settings if
not exist.
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/878rhi6t7x.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Yassine Oudjana [Wed, 22 Jun 2022 06:11:06 +0000 (10:11 +0400)]
ASoC: qcom: apq8096: set driver name correctly
Set driver name to allow matching different UCM2 configurations
for the multiple devices sharing the same APQ8096 ASoC.
Signed-off-by: Yassine Oudjana <y.oudjana@protonmail.com>
Link: https://lore.kernel.org/r/20220622061106.35071-1-y.oudjana@protonmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Kuninori Morimoto [Wed, 1 Feb 2023 01:06:15 +0000 (01:06 +0000)]
ASoC: cs42l42: use helper function
Current ASoC has many helper function.
Link: https://lore.kernel.org/r/20230201111415.67bd4b7e@canb.auug.org.au
Reported-by: Stephen Rothwell <sfr@canb.auug.org.au>
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/87bkme6vp5.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Mark Brown [Tue, 31 Jan 2023 17:07:56 +0000 (17:07 +0000)]
ASoC: cs42l42: Add SoundWire support
Merge series from Stefan Binding <sbinding@opensource.cirrus.com>:
The CS42L42 has a SoundWire interface for control and audio. This
chain of patches adds support for this.
Patches #1 .. #5 split out various changes to the existing code that
are needed for adding Soundwire. These are mostly around clocking and
supporting the separate probe and enumeration stages in SoundWire.
Patches #6 .. #8 actually adds the SoundWire handling.
Mark Brown [Tue, 31 Jan 2023 17:07:49 +0000 (17:07 +0000)]
ASoC: use helper function and cleanup
Merge series from Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>:
struct snd_soc_dai need to have info for playback/capture,
but it is using "playback/capture_xxx" or "tx/tx_xxx" or array.
This kind of random definition is very difficult to read.
This patch-set add helper functions and each driver use it.
And cleanup the definition.
Mark Brown [Tue, 31 Jan 2023 14:12:09 +0000 (14:12 +0000)]
ASoC: mchp-spdifrx: add runtime PM support and fixes
Merge series from Claudiu Beznea <claudiu.beznea@microchip.com>:
This series adds runtime PM support for Microchip SPDIFRX driver.
Along with it I added few fixes identified while going though the code
and playing with Microchip SPDIFRX controller.
Mark Brown [Tue, 31 Jan 2023 14:12:02 +0000 (14:12 +0000)]
ASoC: codecs: Add Awinic AW88395 audio amplifier
Merge series from wangweidong.a@awinic.com:
The Awinic AW88395 is an I2S/TDM input, high efficiency
digital Smart K audio amplifier with an integrated 10.25V
smart boost converter.
Add a DT schema for describing Awinic AW88395 audio amplifiers. They are
controlled using I2C
Mark Brown [Tue, 31 Jan 2023 14:11:55 +0000 (14:11 +0000)]
Add the Renesas IDT821034 codec support
Merge series from Herve Codina <herve.codina@bootlin.com>:
The Renesas IDT821034 codec is four channel PCM codec with on-chip
filters and programmable gain setting. It also provides SLIC
(Subscriber Line Interface Circuit) signals as GPIOs.
Stefan Binding [Fri, 27 Jan 2023 16:51:11 +0000 (16:51 +0000)]
ASoC: cs42l42: Wait for debounce interval after resume
Since clock stop causes bus reset on Intel controllers, we need
to wait for the debounce interval on resume, to ensure all the
interrupt status registers are set correctly.
Signed-off-by: Stefan Binding <sbinding@opensource.cirrus.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20230127165111.3010960-9-sbinding@opensource.cirrus.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Richard Fitzgerald [Fri, 27 Jan 2023 16:51:10 +0000 (16:51 +0000)]
ASoC: cs42l42: Don't set idle_bias_on
idle_bias_on was set because cs42l42 has a "VMID" type pseudo-midrail
supply (named FILT+), and these typically take a long time to charge.
But the driver never enabled pm_runtime so it would never have powered-
down the cs42l42 anyway.
In fact, FILT+ can charge to operating voltage within 12.5 milliseconds
of enabling HP or ADC. This time is already covered by the startup
delay of the HP/ADC.
The datasheet warning about FILT+ taking up to 1 second to charge only
applies in the special cases that either the PLL is started or
DETECT_MODE set to non-zero while both HP and ADC are off. The driver
never does either of these.
Removing idle_bias_on allows the Soundwire host controller to suspend
if there isn't a snd_soc_jack handler registered.
Signed-off-by: Richard Fitzgerald <rf@opensource.cirrus.com>
Signed-off-by: Stefan Binding <sbinding@opensource.cirrus.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20230127165111.3010960-8-sbinding@opensource.cirrus.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Richard Fitzgerald [Fri, 27 Jan 2023 16:51:09 +0000 (16:51 +0000)]
ASoC: cs42l42: Add SoundWire support
This adds support for using CS42L42 as a SoundWire device.
SoundWire-specifics are kept separate from the I2S implementation as
much as possible, aiming to limit the risk of breaking the I2C+I2S
support.
There are some important differences in the silicon behaviour between
I2S and SoundWire mode that are reflected in the implementation:
- ASP (I2S) most not be used in SoundWire mode because the two interfaces
share pins.
- The SoundWire capture (record) port only supports 1 channel. It does
not have left-to-right duplication like the ASP.
- DP2 can only be prepared if the HP has powered-up. DP1 can only be
prepared if the ADC has powered-up. (This ordering restriction does
not exist for ASPs.) The SoundWire core port-prepare step is
triggered by the DAI-link prepare(). This happens before the
codec DAI prepare() or the DAPM sequence so these cannot be used
to enable HP/ADC. Instead the HP/ADC enable/disable are done during
the port_prep callback.
- The SRCs are an integral part of the audio chain but in silicon their
power control is linked to the ASP. There is no equivalent power link
to SoundWire DPs so the driver must take "manual" control of SRC power.
- The SoundWire control registers occupy the lower part of the SoundWire
address space so cs42l42 registers are offset by 0x8000 (non-paged) in
SoundWire mode.
- Register addresses are 8-bit paged in I2C mode but 16-bit unpaged in
SoundWire.
- Special procedures are needed on register read/writes to (a) ensure
that the previous internal bus transaction has completed, and
(b) handle delayed read results, when the read value could not be
returned within the SoundWire read command.
There are also some differences in driver implementation between I2S
and SoundWire operation:
- CS42L42 I2S does not runtime_suspend, but runtime_suspend/resume support
has been added into the driver in SoundWire mode as the most convenient
way to power-up the bus manager and to handle the unattach_request
condition, though the CS42L42 chip does not itself suspend or resume.
- Intel SoundWire host controllers have a low-power clock-stop mode that
requires resetting all peripherals when resuming. This means that the
interrupt registers will be reset in between the interrupt being
generated and the interrupt being handled, and since the interrupt
status is debounced, these values may not be accurate immediately,
and may cause spurious unplug events before settling.
- As in I2S mode, the PLL is only used while audio is active because
of clocking quirks in the silicon. For SoundWire the cs42l42_pll_config()
is deferred until the DAI prepare(), to allow the cs42l42_bus_config()
callback to set the SCLK.
Signed-off-by: Richard Fitzgerald <rf@opensource.cirrus.com>
Signed-off-by: Stefan Binding <sbinding@opensource.cirrus.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20230127165111.3010960-7-sbinding@opensource.cirrus.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Richard Fitzgerald [Fri, 27 Jan 2023 16:51:08 +0000 (16:51 +0000)]
ASoC: cs42l42: Export some functions for SoundWire
Export functions that will be needed by a SoundWire module.
Signed-off-by: Richard Fitzgerald <rf@opensource.cirrus.com>
Signed-off-by: Stefan Binding <sbinding@opensource.cirrus.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20230127165111.3010960-6-sbinding@opensource.cirrus.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Richard Fitzgerald [Fri, 27 Jan 2023 16:51:07 +0000 (16:51 +0000)]
ASoC: cs42l42: Separate ASP config from PLL config
Setup of the ASP (audio serial port) was being done as a side-effect of
cs42l42_pll_config() and forces a restriction on the ratio of sample_rate
to bit_clock that is invalid for Soundwire.
Move the ASP setup into a dedicated function.
Signed-off-by: Richard Fitzgerald <rf@opensource.cirrus.com>
Signed-off-by: Stefan Binding <sbinding@opensource.cirrus.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20230127165111.3010960-5-sbinding@opensource.cirrus.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Richard Fitzgerald [Fri, 27 Jan 2023 16:51:06 +0000 (16:51 +0000)]
ASoC: cs42l42: Ensure MCLKint is a multiple of the sample rate
The chosen clocking configuration must give an internal MCLK (MCLKint)
that is an integer multiple of the sample rate.
On I2S each of the supported bit clock frequencies can only be generated
from one sample rate group (either the 44100 or the 48000) so the code
could use only the bitclock to look up a PLL config.
The relationship between sample rate and bitclock frequency is more
complex on Soundwire and so it is possible to set a frame shape to
generate a bitclock from the "wrong" group. For example 2*147 with a
48000 sample rate would give a bitclock of
14112000 which on I2S
could only be derived from a 44100 sample rate.
Signed-off-by: Richard Fitzgerald <rf@opensource.cirrus.com>
Signed-off-by: Stefan Binding <sbinding@opensource.cirrus.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20230127165111.3010960-4-sbinding@opensource.cirrus.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Richard Fitzgerald [Fri, 27 Jan 2023 16:51:05 +0000 (16:51 +0000)]
ASoC: cs42l42: Add SOFT_RESET_REBOOT register
The SOFT_RESET_REBOOT register is needed to recover CS42L42 state after
a Soundwire bus reset.
This is required to be set whenever there is severe/hard bus reset.
Signed-off-by: Richard Fitzgerald <rf@opensource.cirrus.com>
Signed-off-by: Stefan Binding <sbinding@opensource.cirrus.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20230127165111.3010960-3-sbinding@opensource.cirrus.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Stefan Binding [Fri, 27 Jan 2023 16:51:04 +0000 (16:51 +0000)]
soundwire: stream: Add specific prep/deprep commands to port_prep callback
Currently, port_prep callback only has commands for PRE_PREP, PREP,
and POST_PREP, which doesn't directly say whether this is for a
prepare or deprepare call. Extend the command list enum to say
whether the call is for prepare or deprepare aswell.
Also remove SDW_OPS_PORT_PREP from sdw_port_prep_ops as this is unused,
and update this enum to be simpler and more consistent with enum
sdw_clk_stop_type.
Note: Currently, the only users of SDW_OPS_PORT_POST_PREP are codec
drivers sound/soc/codecs/wsa881x.c and sound/soc/codecs/wsa883x.c, both
of which seem to assume that POST_PREP only occurs after a prepare,
even though it would also have occurred after a deprepare. Since it
doesn't make sense to mark the port prepared after a deprepare, changing
the enum to separate PORT_DEPREP from PORT_PREP should make the check
for PORT_PREP in those drivers be more logical.
Signed-off-by: Stefan Binding <sbinding@opensource.cirrus.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Acked-By: Vinod Koul <vkoul@kernel.org>
Link: https://lore.kernel.org/r/20230127165111.3010960-2-sbinding@opensource.cirrus.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Kiseok Jo [Tue, 31 Jan 2023 05:09:47 +0000 (05:09 +0000)]
ASoC: dt-bindings: irondevice,sma1303.yaml: Fix about breaking the checks
Fix the bindings checks like syntax error.
Signed-off-by: Kiseok Jo <kiseok.jo@irondevice.com>
Reported-by: Rob Herring <robh@kernel.org>
Link: https://lore.kernel.org/r/20230131050946.14385-1-kiseok.jo@irondevice.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Uwe Kleine-König [Tue, 31 Jan 2023 08:21:07 +0000 (09:21 +0100)]
ASoC: sma1303: Convert to i2c's .probe_new()
The probe function doesn't make use of the i2c_device_id * parameter so it
can be trivially converted.
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Link: https://lore.kernel.org/r/20230131082107.174739-1-u.kleine-koenig@pengutronix.de
Signed-off-by: Mark Brown <broonie@kernel.org>
Kiseok Jo [Tue, 31 Jan 2023 05:45:27 +0000 (05:45 +0000)]
MAINTAINERS: add IRON DEVICE AUDIO CODEC DRIVERS
Add Kiseok Jo as maintainer for Iron Device audio codec drivers.
Signed-off-by: Kiseok Jo <kiseok.jo@irondevice.com>
Link: https://lore.kernel.org/r/20230131054526.14653-1-kiseok.jo@irondevice.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Kuninori Morimoto [Tue, 31 Jan 2023 02:02:04 +0000 (02:02 +0000)]
ASoC: soc-dai.h: cleanup Playback/Capture data for snd_soc_dai
Current snd_soc_dai has data for Playback/Capture, but it is very
random. Someone is array (A), someone is playback/capture (B),
and someone is tx/rx (C);
struct snd_soc_dai {
...
(A) unsigned int stream_active[SNDRV_PCM_STREAM_LAST + 1];
(B) struct snd_soc_dapm_widget *playback_widget;
(B) struct snd_soc_dapm_widget *capture_widget;
(B) void *playback_dma_data;
(B) void *capture_dma_data;
...
(C) unsigned int tx_mask;
(C) unsigned int rx_mask;
};
Because of it, the code was very complicated.
This patch creates new data structure to merge these into one,
and tidyup the code.
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Reviewed-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Link: https://lore.kernel.org/r/87cz6vea1v.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Kuninori Morimoto [Tue, 31 Jan 2023 02:01:59 +0000 (02:01 +0000)]
ASoC: soc-topology.c: use helper function
Current ASoC has many helper function.
This patch use it.
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/87edrbea20.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Kuninori Morimoto [Tue, 31 Jan 2023 02:01:54 +0000 (02:01 +0000)]
ASoC: soc-pcm.c: use helper function
Current ASoC has many helper function.
This patch use it.
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Reviewed-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Link: https://lore.kernel.org/r/87fsbrea25.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Kuninori Morimoto [Tue, 31 Jan 2023 02:01:49 +0000 (02:01 +0000)]
ASoC: soc-dai.c: use helper function
Current ASoC has many helper function.
This patch use it.
Link: https://lore.kernel.org/all/6f047ec5-4055-761d-c1ea-c2d0b606e53a@linux.intel.com/
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/87h6w7ea2a.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Kuninori Morimoto [Tue, 31 Jan 2023 02:01:34 +0000 (02:01 +0000)]
ASoC: soc-dapm.c: use helper function
Current ASoC has many helper function.
This patch use it.
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Reviewed-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Link: https://lore.kernel.org/r/87ilgnea2p.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Kuninori Morimoto [Tue, 31 Jan 2023 02:01:29 +0000 (02:01 +0000)]
ASoC: soc-core.c: use helper function
Current ASoC has many helper function.
This patch use it.
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Reviewed-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Link: https://lore.kernel.org/r/87k013ea2u.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Kuninori Morimoto [Tue, 31 Jan 2023 02:01:18 +0000 (02:01 +0000)]
ASoC: ti: use helper function
Current ASoC has many helper function.
This patch use it.
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/87leljea35.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Kuninori Morimoto [Tue, 31 Jan 2023 02:01:13 +0000 (02:01 +0000)]
ASoC: tegra: use helper function
Current ASoC has many helper function.
This patch use it.
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/87mt5zea3a.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Kuninori Morimoto [Tue, 31 Jan 2023 02:01:08 +0000 (02:01 +0000)]
ASoC: sof: use helper function
Current ASoC has many helper function.
This patch use it.
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/87o7qfea3f.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Kuninori Morimoto [Tue, 31 Jan 2023 02:01:02 +0000 (02:01 +0000)]
ASoC: rockchip: use helper function
Current ASoC has many helper function.
This patch use it.
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/87pmavea3l.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Kuninori Morimoto [Tue, 31 Jan 2023 02:00:57 +0000 (02:00 +0000)]
ASoC: meson: use helper function
Current ASoC has many helper function.
This patch use it.
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Reviewed-by: Jerome Brunet <jbrunet@baylibre.com>
Link: https://lore.kernel.org/r/87r0vbea3r.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Kuninori Morimoto [Tue, 31 Jan 2023 02:00:49 +0000 (02:00 +0000)]
ASoC: mediatek: use helper function
Current ASoC has many helper function.
This patch use it.
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
Link: https://lore.kernel.org/r/87sffrea3z.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Kuninori Morimoto [Tue, 31 Jan 2023 02:00:42 +0000 (02:00 +0000)]
ASoC: intel: use helper function
Current ASoC has many helper function.
This patch use it.
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/87tu07ea45.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Kuninori Morimoto [Tue, 31 Jan 2023 02:00:37 +0000 (02:00 +0000)]
ASoC: sdw-mockup: use helper function
Current ASoC has many helper function.
This patch use it.
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/87v8knea4b.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Kuninori Morimoto [Tue, 31 Jan 2023 02:00:29 +0000 (02:00 +0000)]
ASoC: spear: use helper function
Current ASoC has many helper function.
This patch use it.
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/87wn53ea4i.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Kuninori Morimoto [Tue, 31 Jan 2023 02:00:24 +0000 (02:00 +0000)]
ASoC: cirrus: use helper function
Current ASoC has many helper function.
This patch use it.
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/87y1pjea4n.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Kuninori Morimoto [Tue, 31 Jan 2023 02:00:16 +0000 (02:00 +0000)]
ASoC: rt: use helper function
Current ASoC has many helper function.
This patch use it.
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/87zg9zea4w.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Kuninori Morimoto [Tue, 31 Jan 2023 01:59:58 +0000 (01:59 +0000)]
ASoC: max: use helper function
Current ASoC has many helper function.
This patch use it.
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/871qnbfopt.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Kuninori Morimoto [Tue, 31 Jan 2023 01:59:50 +0000 (01:59 +0000)]
ASoC: hda: use helper function
Current ASoC has many helper function.
This patch use it.
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/87357rfoq1.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Kuninori Morimoto [Tue, 31 Jan 2023 01:59:40 +0000 (01:59 +0000)]
ASoC: hdmi-codec: use helper function
Current ASoC has many helper function.
This patch use it.
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/874js7foqb.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Kuninori Morimoto [Tue, 31 Jan 2023 01:59:27 +0000 (01:59 +0000)]
ASoC: soc.h: add snd_soc_card_is_instantiated() helper
ASoC framework/driver checks whether card was instantiated every
where. Then, it should check card pointer too in such case.
This patch adds snd_soc_card_is_instantiated() for it.
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Reviewed-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Link: https://lore.kernel.org/r/875ycnfoqp.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Kuninori Morimoto [Tue, 31 Jan 2023 01:59:17 +0000 (01:59 +0000)]
ASoC: soc-dai.h: add snd_soc_dai_get/set_widget_playback/capture() helper
snd_soc_dai_get_widget() requests SNDRV_PCM_STREAM_PLAYBACK/CAPTURE.
This patch adds helper for it.
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Reviewed-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Link: https://lore.kernel.org/r/877cx3foqz.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Kuninori Morimoto [Tue, 31 Jan 2023 01:59:07 +0000 (01:59 +0000)]
ASoC: soc-dai.h: add snd_soc_dai_tdm_mask_set/get() helper
Current ASoC has tx/rx_mask, and is directly accessing to them,
but accessing to it via function is nice idea.
This patch adds snd_soc_dai_tdm_mask_set/get() for it.
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Reviewed-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Link: https://lore.kernel.org/r/878rhjfor8.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Kuninori Morimoto [Tue, 31 Jan 2023 01:58:58 +0000 (01:58 +0000)]
ASoC: soc-dai.h: add snd_soc_dai_dma_data_set/get() for low level
Current ASoC has snd_soc_dai_set/get_dma_data() which is assuming
struct snd_pcm_substream to get Playback/Capture direction.
But, many drivers want to use it not through snd_pcm_substream.
This patch adds more low level snd_soc_dai_dma_data_set/get() for it,
and previous functions will be macro for it.
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Reviewed-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Link: https://lore.kernel.org/r/87a61zfori.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Kuninori Morimoto [Tue, 31 Jan 2023 01:58:50 +0000 (01:58 +0000)]
ASoC: soc-dai.h: add missing snd_soc_dai_set_widget()
Current ASoC has snd_soc_dai_get_widget() (= _get_) but doesn't
have _set_ function. This patch adds it.
This patch also cleanup unnecessary line break for _get_ function.
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Reviewed-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Link: https://lore.kernel.org/r/87bkmfforp.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Mark Brown [Mon, 30 Jan 2023 20:59:22 +0000 (20:59 +0000)]
ASoC: topology: Fixes and cleanups
Merge series from Amadeusz Sławiński <amadeuszx.slawinski@linux.intel.com>:
Following is series of fixes and cleanups for core topology code. Few
patches fixing various problems all around and few fixing function
names.
Mark Brown [Mon, 30 Jan 2023 20:46:25 +0000 (20:46 +0000)]
ASoC: dt-bindings: audio-graph-port related update
Merge series from Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>:
Audio-Graph-Card and Simple-Audio-Card are similar Card
and are sharing same utils. Thus we can also sharing same schema.
This patch-set fixup some Renesas's "make dtbs_check".
Weidong Wang [Fri, 13 Jan 2023 05:53:01 +0000 (13:53 +0800)]
ASoC: dt-bindings: Add schema for "awinic,aw88395"
Add a DT schema for describing Awinic AW88395 audio amplifiers. They are
controlled using I2C.
Signed-off-by: Weidong Wang <wangweidong.a@awinic.com>
Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Link: https://lore.kernel.org/r/20230113055301.189541-6-wangweidong.a@awinic.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Weidong Wang [Fri, 13 Jan 2023 05:53:00 +0000 (13:53 +0800)]
ASoC: codecs: Aw88395 chip register file, data type file and Kconfig Makefile
The Awinic AW88395 is an I2S/TDM input, high efficiency
digital Smart K audio amplifier with an integrated 10.25V
smart boost convert
Signed-off-by: Nick Li <liweilei@awinic.com>
Signed-off-by: Bruce zhao <zhaolei@awinic.com>
Signed-off-by: Weidong Wang <wangweidong.a@awinic.com>
Link: https://lore.kernel.org/r/20230113055301.189541-5-wangweidong.a@awinic.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Weidong Wang [Fri, 13 Jan 2023 05:52:59 +0000 (13:52 +0800)]
ASoC: codecs: Aw88395 function for ALSA Audio Driver
The Awinic AW88395 is an I2S/TDM input, high efficiency
digital Smart K audio amplifier with an integrated 10.25V
smart boost convert
Signed-off-by: Nick Li <liweilei@awinic.com>
Signed-off-by: Bruce zhao <zhaolei@awinic.com>
Signed-off-by: Ben Yi <yijiangtao@awinic.com>
Signed-off-by: Weidong Wang <wangweidong.a@awinic.com>
Link: https://lore.kernel.org/r/20230113055301.189541-4-wangweidong.a@awinic.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Weidong Wang [Fri, 13 Jan 2023 05:52:58 +0000 (13:52 +0800)]
ASoC: codecs: ACF bin parsing and check library file for aw88395
The Awinic AW88395 is an I2S/TDM input, high efficiency
digital Smart K audio amplifier with an integrated 10.25V
smart boost convert
Signed-off-by: Nick Li <liweilei@awinic.com>
Signed-off-by: Bruce zhao <zhaolei@awinic.com>
Signed-off-by: Weidong Wang <wangweidong.a@awinic.com>
Link: https://lore.kernel.org/r/20230113055301.189541-3-wangweidong.a@awinic.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Weidong Wang [Fri, 13 Jan 2023 05:52:57 +0000 (13:52 +0800)]
ASoC: codecs: Add i2c and codec registration for aw88395 and their associated operation functions
The Awinic AW88395 is an I2S/TDM input, high efficiency
digital Smart K audio amplifier with an integrated 10.25V
smart boost convert
Signed-off-by: Nick Li <liweilei@awinic.com>
Signed-off-by: Bruce zhao <zhaolei@awinic.com>
Signed-off-by: Weidong Wang <wangweidong.a@awinic.com>
Link: https://lore.kernel.org/r/20230113055301.189541-2-wangweidong.a@awinic.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Herve Codina [Thu, 26 Jan 2023 08:51:37 +0000 (09:51 +0100)]
MAINTAINERS: add the Renesas IDT821034 codec entry
After contributing the driver, add myself as the maintainer for the
Renesas IDT821034 codec.
Signed-off-by: Herve Codina <herve.codina@bootlin.com>
Link: https://lore.kernel.org/r/20230126085137.375814-4-herve.codina@bootlin.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Herve Codina [Thu, 26 Jan 2023 08:51:36 +0000 (09:51 +0100)]
ASoC: codecs: Add support for the Renesas IDT821034 codec
The Renesas IDT821034 codec is four channel PCM codec with on-chip
filters and programmable gain setting.
It also provides SLIC (Subscriber Line Interface Circuit) signals as
GPIOs.
Signed-off-by: Herve Codina <herve.codina@bootlin.com>
Link: https://lore.kernel.org/r/20230126085137.375814-3-herve.codina@bootlin.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Herve Codina [Thu, 26 Jan 2023 08:51:35 +0000 (09:51 +0100)]
ASoC: Add Renesas IDT821034 codec bindings
The Renesas IDT821034 codec is a quad PCM codec with programmable
gain.
Signed-off-by: Herve Codina <herve.codina@bootlin.com>
Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Link: https://lore.kernel.org/r/20230126085137.375814-2-herve.codina@bootlin.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Claudiu Beznea [Mon, 30 Jan 2023 12:06:47 +0000 (14:06 +0200)]
ASoC: mchp-spdifrx: document data structures
Document data structures used by mchp-spdifrx driver.
Signed-off-by: Claudiu Beznea <claudiu.beznea@microchip.com>
Link: https://lore.kernel.org/r/20230130120647.638049-9-claudiu.beznea@microchip.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Claudiu Beznea [Mon, 30 Jan 2023 12:06:46 +0000 (14:06 +0200)]
ASoC: mchp-spdifrx: add runtime pm support
Add runtime PM support for Microchip SPDIFRX driver. On runtime suspend
the clocks are disabled and regmap is set in caching mode. On runtime
resume the clocks are enabled and regmap is synced with the device.
Signed-off-by: Claudiu Beznea <claudiu.beznea@microchip.com>
Link: https://lore.kernel.org/r/20230130120647.638049-8-claudiu.beznea@microchip.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Claudiu Beznea [Mon, 30 Jan 2023 12:06:45 +0000 (14:06 +0200)]
ASoC: mchp-spdifrx: remove struct mchp_spdifrx_dev::fmt member
Remove member fmt of struct mchp_spdifrx_dev as it is not used anywhere.
Signed-off-by: Claudiu Beznea <claudiu.beznea@microchip.com>
Link: https://lore.kernel.org/r/20230130120647.638049-7-claudiu.beznea@microchip.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Claudiu Beznea [Mon, 30 Jan 2023 12:06:44 +0000 (14:06 +0200)]
ASoC: mchp-spdifrx: use unsigned long to store clk_get_rate() value
clk_get_rate() returns an unsigned long. Use a variable of type
unsigned long to store it.
Signed-off-by: Claudiu Beznea <claudiu.beznea@microchip.com>
Link: https://lore.kernel.org/r/20230130120647.638049-6-claudiu.beznea@microchip.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Claudiu Beznea [Mon, 30 Jan 2023 12:06:43 +0000 (14:06 +0200)]
ASoC: mchp-spdifrx: disable all interrupts in mchp_spdifrx_dai_remove()
CSC interrupts which might be used in controls are on bits 8 and 9 of
SPDIFRX_IDR register. Thus disable all the interrupts that are exported
by driver.
Fixes:
ef265c55c1ac ("ASoC: mchp-spdifrx: add driver for SPDIF RX")
Signed-off-by: Claudiu Beznea <claudiu.beznea@microchip.com>
Link: https://lore.kernel.org/r/20230130120647.638049-5-claudiu.beznea@microchip.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Claudiu Beznea [Mon, 30 Jan 2023 12:06:42 +0000 (14:06 +0200)]
ASoC: mchp-spdifrx: fix controls that works with completion mechanism
Channel status get and channel subcode get controls relies on data
returned by controls when certain IRQs are raised. To achieve that
completions are used b/w controls and interrupt service routine. The
concurrent accesses to these controls are protected by
struct snd_card::controls_rwsem.
Issues identified:
- reinit_completion() may be called while waiting for completion
which should be avoided
- in case of multiple threads waiting, the complete() call in interrupt
will signal only one waiting thread per interrupt which may lead to
timeout for the others
- in case of channel status get as the CSC interrupt is not refcounted
ISR may disable interrupt for threads that were just enabled it.
To solve these the access to controls were protected by a mutex. Along
with this there is no need for spinlock to protect the software cache
reads/updates b/w controls and ISR as the update is happening only when
requested from control, and only one reader can reach the control.
Fixes:
ef265c55c1ac ("ASoC: mchp-spdifrx: add driver for SPDIF RX")
Signed-off-by: Claudiu Beznea <claudiu.beznea@microchip.com>
Link: https://lore.kernel.org/r/20230130120647.638049-4-claudiu.beznea@microchip.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Claudiu Beznea [Mon, 30 Jan 2023 12:06:41 +0000 (14:06 +0200)]
ASoC: mchp-spdifrx: fix return value in case completion times out
wait_for_completion_interruptible_timeout() returns 0 in case of
timeout. Check this into account when returning from function.
Fixes:
ef265c55c1ac ("ASoC: mchp-spdifrx: add driver for SPDIF RX")
Signed-off-by: Claudiu Beznea <claudiu.beznea@microchip.com>
Link: https://lore.kernel.org/r/20230130120647.638049-3-claudiu.beznea@microchip.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Claudiu Beznea [Mon, 30 Jan 2023 12:06:40 +0000 (14:06 +0200)]
ASoC: mchp-spdifrx: fix controls which rely on rsr register
The SPDIFRX block is clocked by 2 clocks: peripheral and generic clocks.
Peripheral clock feeds user interface (registers) and generic clock feeds
the receiver.
To enable the receiver the generic clock needs to be enabled and also the
ENABLE bit of MCHP_SPDIFRX_MR register need to be set.
The signal control exported by mchp-spdifrx driver reports wrong status
when the receiver is disabled. This can happen when requesting the signal
and the capture was not previously started. To solve this the receiver
needs to be enabled (by enabling generic clock and setting ENABLE bit of
MR register) before reading the signal status.
As with this fix there are 2 paths now that need to control the generic
clock and ENABLE bit of SPDIFRX_MR register (one path though controls, one
path though configuration) a mutex has been introduced. We can't rely on
subsystem locking as the controls are protected by
struct snd_card::controls_rwsem semaphore and configuration is protected
by a different lock (embedded in snd_pcm_stream_lock_irq()).
The introduction of mutex is also extended to other controls which rely on
SPDIFRX_RSR.ULOCK bit as it has been discovered experimentally that having
both clocks enabled but not the receiver (through ENABLE bit of SPDIFRX.MR)
leads to inconsistent values of SPDIFRX_RSR.ULOCK. Thus on some controls we
rely on software state (dev->trigger_enabled protected by mutex) to
retrieve proper values.
Fixes:
ef265c55c1ac ("ASoC: mchp-spdifrx: add driver for SPDIF RX")
Signed-off-by: Claudiu Beznea <claudiu.beznea@microchip.com>
Link: https://lore.kernel.org/r/20230130120647.638049-2-claudiu.beznea@microchip.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Amadeusz Sławiński [Fri, 27 Jan 2023 23:11:11 +0000 (00:11 +0100)]
ASoC: topology: Use unload() op directly
struct snd_soc_dobj only needs pointer to the unload function, instead
however, there is pointer to all topology operations. Change code to use
the function pointer instead of pointer to structure containing all
operations.
Reviewed-by: Cezary Rojewski <cezary.rojewski@intel.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Signed-off-by: Amadeusz Sławiński <amadeuszx.slawinski@linux.intel.com>
Link: https://lore.kernel.org/r/20230127231111.937721-12-amadeuszx.slawinski@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Amadeusz Sławiński [Fri, 27 Jan 2023 23:11:10 +0000 (00:11 +0100)]
ASoC: topology: Unify kcontrol removal code
Functions removing bytes, enum and mixer kcontrols are identical. Unify
them under one function and use it to free associated kcontrols.
Reviewed-by: Cezary Rojewski <cezary.rojewski@intel.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Signed-off-by: Amadeusz Sławiński <amadeuszx.slawinski@linux.intel.com>
Link: https://lore.kernel.org/r/20230127231111.937721-11-amadeuszx.slawinski@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Amadeusz Sławiński [Fri, 27 Jan 2023 23:11:09 +0000 (00:11 +0100)]
ASoC: topology: Remove unnecessary check for EOF
Caller already checks if hdr_pos is behind EOF, before calling
soc_tplg_valid_header(), so there is no need to recheck it again. This
also allows to remove behaviour of return 0 - forcing the caller to
break out of while loop.
Reviewed-by: Cezary Rojewski <cezary.rojewski@intel.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Signed-off-by: Amadeusz Sławiński <amadeuszx.slawinski@linux.intel.com>
Link: https://lore.kernel.org/r/20230127231111.937721-10-amadeuszx.slawinski@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Amadeusz Sławiński [Fri, 27 Jan 2023 23:11:08 +0000 (00:11 +0100)]
ASoC: topology: Return an error on complete() failure
Function soc_tplg_dapm_complete() detects an error and logs it, but
doesn't return failure to the caller, fix it by returning the error.
Reviewed-by: Cezary Rojewski <cezary.rojewski@intel.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Signed-off-by: Amadeusz Sławiński <amadeuszx.slawinski@linux.intel.com>
Link: https://lore.kernel.org/r/20230127231111.937721-9-amadeuszx.slawinski@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Amadeusz Sławiński [Fri, 27 Jan 2023 23:11:07 +0000 (00:11 +0100)]
ASoC: topology: Pass correct pointer instead of casting
Instead of passing address of structure, the containing structure is
cast to target structure. While it works - the expected structure is the
first field of containing one - it is bad practice, fix this by passing
pointer to structure field.
Reviewed-by: Cezary Rojewski <cezary.rojewski@intel.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Signed-off-by: Amadeusz Sławiński <amadeuszx.slawinski@linux.intel.com>
Link: https://lore.kernel.org/r/20230127231111.937721-8-amadeuszx.slawinski@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Amadeusz Sławiński [Fri, 27 Jan 2023 23:11:06 +0000 (00:11 +0100)]
ASoC: topology: Remove unnecessary forward declarations
There is no need to forward declare functions if their use is after
their definition.
Reviewed-by: Cezary Rojewski <cezary.rojewski@intel.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Signed-off-by: Amadeusz Sławiński <amadeuszx.slawinski@linux.intel.com>
Link: https://lore.kernel.org/r/20230127231111.937721-7-amadeuszx.slawinski@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Amadeusz Sławiński [Fri, 27 Jan 2023 23:11:05 +0000 (00:11 +0100)]
ASoC: topology: Rename remove_ handlers
Those are the only functions missing soc_tplg_ prefix, add it for
consistency.
Reviewed-by: Cezary Rojewski <cezary.rojewski@intel.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Signed-off-by: Amadeusz Sławiński <amadeuszx.slawinski@linux.intel.com>
Link: https://lore.kernel.org/r/20230127231111.937721-6-amadeuszx.slawinski@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Amadeusz Sławiński [Fri, 27 Jan 2023 23:11:04 +0000 (00:11 +0100)]
ASoC: topology: Fix function name
Functions other than soc_valid_header have soc_tplg_ prefix. Rename
function to follow convention in file.
Reviewed-by: Cezary Rojewski <cezary.rojewski@intel.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Signed-off-by: Amadeusz Sławiński <amadeuszx.slawinski@linux.intel.com>
Link: https://lore.kernel.org/r/20230127231111.937721-5-amadeuszx.slawinski@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Amadeusz Sławiński [Fri, 27 Jan 2023 23:11:03 +0000 (00:11 +0100)]
ASoC: topology: Fix typo in functions name
Topology is being abbreviated to "tplg", not "tplc", however, few
functions have typo in name, fix it.
Reviewed-by: Cezary Rojewski <cezary.rojewski@intel.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Signed-off-by: Amadeusz Sławiński <amadeuszx.slawinski@linux.intel.com>
Link: https://lore.kernel.org/r/20230127231111.937721-4-amadeuszx.slawinski@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Amadeusz Sławiński [Fri, 27 Jan 2023 23:11:02 +0000 (00:11 +0100)]
ASoC: topology: Remove unused SOC_TPLG_PASS_PINS constant
The constant is unused, so it can be safely removed.
Reviewed-by: Cezary Rojewski <cezary.rojewski@intel.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Signed-off-by: Amadeusz Sławiński <amadeuszx.slawinski@linux.intel.com>
Link: https://lore.kernel.org/r/20230127231111.937721-3-amadeuszx.slawinski@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Amadeusz Sławiński [Fri, 27 Jan 2023 23:11:01 +0000 (00:11 +0100)]
ASoC: topology: Properly access value coming from topology file
When accessing values coming from topology, le32_to_cpu should be used.
One of recent commits missed that.
Fixes:
86e2d14b6d1a ("ASoC: topology: Add header payload_size verification")
Reviewed-by: Cezary Rojewski <cezary.rojewski@intel.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Signed-off-by: Amadeusz Sławiński <amadeuszx.slawinski@linux.intel.com>
Link: https://lore.kernel.org/r/20230127231111.937721-2-amadeuszx.slawinski@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Steffen Aschbacher [Sat, 28 Jan 2023 08:27:44 +0000 (10:27 +0200)]
ASoC: dt-bindings: add entry for TAS5720A-Q1 driver
Add entry for the TAS5720A-Q1 driver in the dt-bindings doc.
Acked-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Signed-off-by: Steffen Aschbacher <steffen.aschbacher@stihl.de>
Signed-off-by: Alexandru Ardelean <alex@shruggie.ro>
Link: https://lore.kernel.org/r/20230128082744.41849-4-alex@shruggie.ro
Signed-off-by: Mark Brown <broonie@kernel.org>
Steffen Aschbacher [Sat, 28 Jan 2023 08:27:43 +0000 (10:27 +0200)]
ASoC: tas5720: set bit 7 in ANALOG_CTRL_REG for TAS5720A-Q1 during probe
Set the reserved bit 7 in the ANALOG_CTRL_REG for the TAS5720A-Q1 device,
when probing.
The datasheet mentions that the bit should be 1 during reset/powerup.
The device did not initialize before setting this value to 1. So, this
could be a quirk of this device. Or it could be a quirk with the board on
which it was tested.
That is why this patch is separate from the patch that adds support for the
TAS5720A-Q1 device.
Signed-off-by: Steffen Aschbacher <steffen.aschbacher@stihl.de>
Signed-off-by: Alexandru Ardelean <alex@shruggie.ro>
Link: https://lore.kernel.org/r/20230128082744.41849-3-alex@shruggie.ro
Signed-off-by: Mark Brown <broonie@kernel.org>
Steffen Aschbacher [Sat, 28 Jan 2023 08:27:42 +0000 (10:27 +0200)]
ASoC: codecs: tas5720: add support for TAS5720A-Q1 (automotive) variant
This change adds support the TAS5720A-Q1 audio codec, in the same driver as
tas5720.
Functionally, this driver is pretty similar to it's TAS5720x variant.
The first 3 registers are the same, so the main control and device
identification can happen with these registers.
The next registers differ.
This variant offers control (in the registers) for 2 speakers, which is
implemented here (in a basic manner).
Signed-off-by: Steffen Aschbacher <steffen.aschbacher@stihl.de>
Signed-off-by: Alexandru Ardelean <alex@shruggie.ro>
Link: https://lore.kernel.org/r/20230128082744.41849-2-alex@shruggie.ro
Signed-off-by: Mark Brown <broonie@kernel.org>
Alexandru Ardelean [Sat, 28 Jan 2023 08:27:41 +0000 (10:27 +0200)]
ASoC: codecs: tas5720: split a tas5720_mute_soc_component() function
This is to be re-used in tas5720_mute() (which is part of the dai_ops) and
also in the tas5720_fault_check_work() hook.
The benefit here isn't too great (now).
It's only when we add support for a new device with a slightly different
regmap that this becomes more useful.
Signed-off-by: Alexandru Ardelean <alex@shruggie.ro>
Link: https://lore.kernel.org/r/20230128082744.41849-1-alex@shruggie.ro
Signed-off-by: Mark Brown <broonie@kernel.org>
Marek Vasut [Thu, 5 Jan 2023 14:41:44 +0000 (15:41 +0100)]
ASoC: dt-bindings: fsl-sai: Simplify the VFxxx dmas binding
Get rid of the vf610 sai special case, instead update the vfxxx.dtsi
DT to use the same DMA channel ordering as all the other devices. The
sai DMA channel ordering has not been aligned with other IP DMA channel
ordering in the vfxxx.dtsi anyway.
Signed-off-by: Marek Vasut <marex@denx.de>
Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Link: https://lore.kernel.org/r/20230105144145.165010-1-marex@denx.de
Signed-off-by: Mark Brown <broonie@kernel.org>
Colin Ian King [Mon, 30 Jan 2023 09:21:57 +0000 (09:21 +0000)]
ASoC: SMA1303: Fix spelling mistake "Invald" -> "Invalid"
There are spelling mistakes in dev_err messages. Fix them.
Signed-off-by: Colin Ian King <colin.i.king@gmail.com>
Link: https://lore.kernel.org/r/20230130092157.36446-1-colin.i.king@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Venkata Prasad Potturu [Mon, 30 Jan 2023 10:01:00 +0000 (15:31 +0530)]
ASoC: amd: acp: Refactor bit width calculation
Refactor bit width calculation using params_physical_width()
instead hard-code values.
Signed-off-by: Venkata Prasad Potturu <venkataprasad.potturu@amd.com>
Link: https://lore.kernel.org/r/20230130100104.4076640-1-venkataprasad.potturu@amd.com
Reviewed-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
Kuninori Morimoto [Mon, 23 Jan 2023 05:27:06 +0000 (05:27 +0000)]
ASoC: dt-bindings: simple-card: add missing #address-cells/#size-cells
In case of using MIXer with Simple Audio Card, it needs below DT.
simple-audio-card,dai-link@1 {
cpu@0 {
...
};
cpu@1 {
...
};
...
};
This case, it requires "reg = <xxx>" which needs #address-cells/#size-cells,
but simple-audio-card.yaml is missing these. This patch adds it.
Without this patch, we will get below warning.
${LINUX}/arch/arm64/boot/dts/renesas/r8a77950-ulcb.dtb: sound: simple-audio-card,dai-link@0: '#address-cells', '#size-cells' do not match any of the regexes: '^codec(@[0-9a-f]+)?', '^cpu(@[0-9a-f]+)?', 'pinctrl-[0-9]+'
From schema: ${LINUX}/Documentation/devicetree/bindings/sound/simple-card.yaml
Link: https://lore.kernel.org/r/167344317928.394453.14105689826645262807.robh@kernel.org
Reported-by: Rob Herring <robh@kernel.org>
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/87cz757rdi.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Kuninori Morimoto [Mon, 23 Jan 2023 05:26:07 +0000 (05:26 +0000)]
ASoC: dt-bindings: renesas,rsnd: #sound-dai-cells is not mandatory
Current renesas,rsnd is requesting #sound-dai-cells, but it is
needed in case of it is using "simple-card", but not needed in case of
"audio-graph". We will get below warning without this patch.
This patch fiup it.
${LINUX}/arch/arm64/boot/dts/renesas/r8a77950-salvator-x.dtb: sound@
ec500000: '#sound-dai-cells' is a required property
From schema: ${LINUX}/Documentation/devicetree/bindings/sound/renesas,rsnd.yaml
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/87edrl7rf4.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Kuninori Morimoto [Mon, 23 Jan 2023 05:26:01 +0000 (05:26 +0000)]
ASoC: dt-bindings: renesas,rsnd: tidyup rcar_sound,src
Some SRC is not implemented on some SoC, thus
interrupts/dmas/dma-names are not mandatory.
This patch solve it. Without this patch we will get below error
when 'make DT_CHECKER_FLAGS=-m dt_binding_check'.
dtschema/dtc warnings/errors:
${LINUX}/Documentation/devicetree/bindings/sound/renesas,rsnd.example.dtb: \
sound@
ec500000: Unevaluated properties are not allowed ('rcar_sound,src' was unexpected)
From schema: /builds/robherring/dt-review-ci/linux/Documentation/devicetree/bindings/sound/renesas,rsnd.yaml
Link: https://lore.kernel.org/r/167344317928.394453.14105689826645262807.robh@kernel.org
Reported-by: Rob Herring <robh@kernel.org>
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/87fsc17rfa.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Kuninori Morimoto [Mon, 23 Jan 2023 05:25:52 +0000 (05:25 +0000)]
ASoC: dt-bindings: renesas,rsnd: add missing playback/capture
renesas,rsnd.yaml is possible to use ports/port/endpoint if it is using
Audio Graph Card/Card2 for sound. The schema is defined under
audio-graph-port.yaml.
rsnd driver needs "playback/capture" property under endpoint, but it is not
defined in audio-graph-port.yaml. This patch adds missing "playback/capture"
properties under endpoint.
Without this patch, we will get below warning
${LINUX}/arch/arm64/boot/dts/renesas/r8a77950-salvator-x.dtb: sound@
ec500000: ports:port@0:endpoint: Unevaluated properties are not allowed ('playback', 'capture' were unexpected)
From schema: ${LINUX}/Documentation/devicetree/bindings/sound/renesas,rsnd.yaml
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/87h6wh7rfj.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>