ASoC: Intel: use software node API in SoundWire machines
The function device_add_properties() is going to be removed.
Replacing it with software node API equivalents.
Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Reviewed-by: Hans de Goede <hdegoede@redhat.com> Co-developed-by: Heikki Krogerus <heikki.krogerus@linux.intel.com> Signed-off-by: Heikki Krogerus <heikki.krogerus@linux.intel.com> Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Link: https://lore.kernel.org/r/20210813151116.23931-7-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown <broonie@kernel.org>
ASoC: Intel: sof_sdw_rt711*: keep codec device reference until remove
Follow the example of Intel Atom drivers and keep a reference to the
headset codec until the properties are removed.
There is no guarantee that the module for the codec driver is loaded
before the machine driver probe, the use of the deferred probe
mechanism is required.
ASoC: Intel: sof_sdw: pass card information to init/exit functions
If we want to handle a context in init/exit function, we have to pass
the card information. This will be necessary to better deal with
device properties in the follow-up commits.
ASoC: Intel: boards: get codec device with ACPI instead of bus search
We have an existing 'adev' handle from which we can find the codec
device, no need for an I2C bus search.
Suggested-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Reviewed-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Link: https://lore.kernel.org/r/20210813151116.23931-4-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown <broonie@kernel.org>
ASoC: Intel: boards: handle errors with acpi_dev_get_first_match_dev()
acpi_dev_get_first_match_dev() searches for an acpi_handle
instantiated by the ACPI table scanning done early during boot.
Two of three machine drivers using this search don't deal with errors
and the one which does (bytcr_rt5651) returns -ENODEV, which doesn't
make sense here: an alternate driver will not be probed.
Add consistent error handling and report -ENXIO.
Suggested-by: Hans de Goede <hdegoede@redhat.com> Reviewed-by: Hans de Goede <hdegoede@redhat.com> Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Link: https://lore.kernel.org/r/20210813151116.23931-3-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown <broonie@kernel.org>
In current ACPI-based devices, the DSDT does not include any of the
properties required by the codec driver. This is not an ACPI
limitation proper since the _DSD method could be used, as done for
Camera and SoundWire in newer platforms. For legacy devices, there is
unfortunately no other option than using a work-around: we add
properties to the codec device from the machine driver.
To avoid any issues with the codec driver being unbound, we need to
keep a reference to the codec device until the card is removed.
Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Co-developed-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Link: https://lore.kernel.org/r/20210813151116.23931-2-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown <broonie@kernel.org>
ASoC: cs42l42: Assume 24-bit samples are in 32-bit slots
If the machine driver doesn't call snd_soc_dai_set_sysclk() the
SCLK is assumed to be sample_rate * sample_bits * 2 (that is, the
rate necessary for a standard I2S frame).
But 24-bit samples can be sent in either a 24-bit slot or a 32-bit
slot. If the PLL is configured for a 24-bit slot, but a 32-bit slot is
used, cs42l42 will be overclocked.
Ultimately it is the machine driver's responsibilty to call
snd_soc_dai_set_sysclk() if SLK will be different from the standard
I2S rate. However, it is convenient to assume 32-bit slots to allow
this common case without needing special machine driver support. The
machine driver then only has to set SCLK if the slots are 24-bit, but
if it fails to do this cs42l42 won't be overclocked.
Dmitry Osipenko [Mon, 2 Aug 2021 18:52:58 +0000 (21:52 +0300)]
ASoC: rt5640: Silence warning message about missing interrupt
Interrupt is optional for the RT5640 codec. Nexus 7 doesn't use interrupt,
this results in a noisy warning message that looks like a error condition.
Make interrupt explicitly optional to silence the message, use modern
IRQF_NO_AUTOEN flag and correct the reg[q]uest typo in the message.
ASoC: codecs: wcd938x: add Multi Button Headset Control support
WCD938x has Multi Button Headset Control hardware to support Headset
insertion, type detection, 8 headset buttons detection, Over Current
detection and Impedence measurements.
This patch adds support for this using wcd-mbhc apis.
I2S always has two LRCLK phases and both CH1 and CH2 of the RX
must be enabled (corresponding to the low and high phases of LRCLK.)
The selection of the valid data channels is done by setting the DAC
CHA_SEL and CHB_SEL. CHA_SEL is always the first (left) channel,
CHB_SEL depends on the number of active channels.
Previously for mono ASP CH2 was not enabled, the result was playing
mono data would not produce any audio output.
ASoC: cs42l42: Constrain sample rate to prevent illegal SCLK
The lowest valid SCLK corresponds to 44.1 kHz at 16-bit. Sample
rates less than this would produce SCLK below the minimum when using
a normal I2S frame. A constraint must be applied to prevent this.
The constraint is not applied if the machine driver sets SCLK, to
allow setups where the host generates additional bits per LRCLK
phase to increase the SCLK frequency. In these cases the machine
driver would always have to inform this driver of the actual SCLK,
and it must select a legal SCLK.
An I2S frame starts on the falling edge of LRCLK so ASP_STP must
be 0.
At the same time, move other format settings in the same register
from cs42l42_pll_config() to cs42l42_set_dai_fmt() where you'd
expect to find them, and merge into a single write.
ASoC: cs42l42: PLL must be running when changing MCLK_SRC_SEL
Both SCLK and PLL clocks must be running to drive the glitch-free mux
behind MCLK_SRC_SEL and complete the switchover.
This patch moves the writing of MCLK_SRC_SEL to when the PLL is started
and stopped, so that it only transitions while the PLL is running.
The unconditional write MCLK_SRC_SEL=0 in cs42l42_mute_stream() is safe
because if the PLL is not running MCLK_SRC_SEL is already 0.
Mark Brown [Thu, 5 Aug 2021 19:15:52 +0000 (20:15 +0100)]
Merge series "ASoC: soc-dapm: cleanup cppcheck warning" from Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>:
Hi Mark
Now I'm posting audio-graph-card2 patch-set, but it seems it needs longer
discussion. Thus I want to post more easy patch first, and reduce my
local patches.
These are cppcheck warning cleanup patches for soc-dapm.
Kuninori Morimoto (12):
ASoC: soc-dapm: cleanup cppcheck warning at dapm_wcache_lookup()
ASoC: soc-dapm: cleanup cppcheck warning at dapm_connect_mux()
ASoC: soc-dapm: cleanup cppcheck warning at dapm_set_mixer_path_status()
ASoC: soc-dapm: cleanup cppcheck warning at dapm_new_pga()
ASoC: soc-dapm: cleanup cppcheck warning at dapm_new_dai_link()
ASoC: soc-dapm: cleanup cppcheck warning at dapm_seq_check_event()
ASoC: soc-dapm: cleanup cppcheck warning at dapm_seq_run()
ASoC: soc-dapm: cleanup cppcheck warning at snd_soc_dapm_del_route()
ASoC: soc-dapm: cleanup cppcheck warning at snd_soc_dapm_add_routes()
ASoC: soc-dapm: cleanup cppcheck warning at snd_soc_dapm_weak_routes()
ASoC: soc-dapm: cleanup cppcheck warning at snd_soc_dapm_new_controls()
ASoC: soc-dapm: cleanup cppcheck warning at soc_dapm_dai_stream_event()
The allocation of the DAI link components (DLCs) passed the wrong
pointer to sizeof. Since simple_dai_props is much larger than
snd_soc_dai_link_component, there was no out of bounds access, only
wasted memory.
Fixes: f2138aed231c8 ("ASoC: simple-card-utils: enable flexible CPU/Codec/Platform") Fixes: 050c7950fd706 ("ASoC: simple-card-utils: alloc dai_link information for CPU/Codec/Platform") Reviewed-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Signed-off-by: Samuel Holland <samuel@sholland.org> Link: https://lore.kernel.org/r/20210805050706.46833-1-samuel@sholland.org Signed-off-by: Mark Brown <broonie@kernel.org>
sound/soc/codecs/wcd938x.c:3701:9: warning: Identical condition and
return expression 'ret', return value is always 0
[identicalConditionAfterEarlyExit]
return ret;
^
sound/soc/codecs/wcd938x.c:3691:6: note: If condition 'ret' is true,
the function will return/exit
if (ret)
^
sound/soc/codecs/wcd938x.c:3701:9: note: Returning identical expression 'ret'
return ret;
^
ASoC: max98090: remove duplicate status reads and useless assignmment
The logic for the jack detection has not changed since the first
commit for this driver. Remove a duplicate read and remove useless
assignment
sound/soc/codecs/max98090.c:2170:6: style: Variable 'reg' is
reassigned a value before the old one has been
used. [redundantAssignment]
reg = snd_soc_component_read(component, M98090_REG_JACK_STATUS);
^
sound/soc/codecs/max98090.c:2161:7: note: reg is assigned
reg = snd_soc_component_read(component, M98090_REG_JACK_STATUS);
^
sound/soc/codecs/max98090.c:2170:6: note: reg is overwritten
reg = snd_soc_component_read(component, M98090_REG_JACK_STATUS);
^
sound/soc/codecs/max98090.c:2170:6: style: Variable 'reg' is
reassigned a value before the old one has been
used. [redundantAssignment]
reg = snd_soc_component_read(component, M98090_REG_JACK_STATUS);
^
sound/soc/codecs/max98090.c:2167:7: note: reg is assigned
reg = snd_soc_component_read(component, M98090_REG_JACK_STATUS);
^
sound/soc/codecs/max98090.c:2170:6: note: reg is overwritten
reg = snd_soc_component_read(component, M98090_REG_JACK_STATUS);
^
ASoC: soc-dapm: cleanup cppcheck warning at snd_soc_dapm_del_route()
This patch cleanups below cppcheck warning.
sound/soc/soc-dapm.c:3007:30: style: The scope of the variable 'wsource' can be reduced. [variableScope]
struct snd_soc_dapm_widget *wsource, *wsink;
^
sound/soc/soc-dapm.c:3007:40: style: The scope of the variable 'wsink' can be reduced. [variableScope]
struct snd_soc_dapm_widget *wsource, *wsink;
^
ASoC: soc-dapm: cleanup cppcheck warning at dapm_set_mixer_path_status()
This patch cleanups below cppcheck warning, and its related code.
unsigned int val;
^
sound/soc/soc-dapm.c:789:15: style: The scope of the variable 'val' can be reduced. [variableScope] Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Link: https://lore.kernel.org/r/87v94ku252.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Mark Brown <broonie@kernel.org>
ASoC: soc-dapm: cleanup cppcheck warning at dapm_wcache_lookup()
This patch cleanups below cppcheck warning.
sound/soc/soc-dapm.c:653:20: style: The scope of the variable 'wlist' can be reduced. [variableScope]
struct list_head *wlist;
^
sound/soc/soc-dapm.c:655:6: style: The scope of the variable 'i' can be reduced. [variableScope]
int i = 0;
^
Takashi Iwai [Wed, 4 Aug 2021 07:52:23 +0000 (09:52 +0200)]
ASoC: amd: vangogh: Drop superfluous mmap callback
The mmap callback of vangogh driver just calls the default mmap
handler, and it's superfluous, as the PCM core would call it if not
set. Let's drop the superfluous mmap callback.
Mark Brown [Tue, 3 Aug 2021 22:27:25 +0000 (23:27 +0100)]
Merge series "ASoC: soc-ops: cleanup cppcheck warning" from Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>:
Hi Mark
Now I'm posting audio-graph-card2 patch-set, but it seems it needs longer
discussion. Thus I want to post more easy patch first, and reduce my
local patches.
These are cppcheck warning cleanup patches for soc-ops.
Kuninori Morimoto (4):
ASoC: soc-ops: cleanup cppcheck warning at snd_soc_put_volsw_sx()
ASoC: soc-ops: cleanup cppcheck warning at snd_soc_limit_volume()
ASoC: soc-ops: cleanup cppcheck warning at snd_soc_get_xr_sx()
ASoC: soc-ops: cleanup cppcheck warning at snd_soc_put_xr_sx()
ASoC: soc-ops: cleanup cppcheck warning at snd_soc_put_xr_sx()
This patch cleanups below cppcheck warning.
sound/soc/soc-ops.c:859:18: style: The scope of the variable 'regval' can be reduced. [variableScope]
unsigned int i, regval, regmask;
^
sound/soc/soc-ops.c:859:26: style: The scope of the variable 'regmask' can be reduced. [variableScope]
unsigned int i, regval, regmask;
^
sound/soc/soc-ops.c:860:6: style: The scope of the variable 'err' can be reduced. [variableScope]
int err;
^
The default SOF topology enables SSP capture and DMICs, even though
both of these hardware capabilities are not always available in
hardware (specific versions of HiFiberry and DMIC kit needed).
For the SSP capture, this leads to annoying "SP5-Codec: ASoC: no
backend capture" and "streamSSP5-Codec: ASoC: no users capture at
close - state 0" errors.
Update the quirks to match what the topology needs, which also allows
for the ability to remove SSP capture and DMIC support.
jairaj arava [Mon, 2 Aug 2021 15:21:49 +0000 (10:21 -0500)]
ASoC: SOF: Intel: Use DMI string to search for adl_mx98373_rt5682 variant
DMI product name is used to support system variants based on
adl_mx98373_rt5682 in current implementation. Replace this DMI search with
DMI_OEM_STRING and coreboot(BIOS used in these systems) is
setting the needed DMI_OEM_STRING field to uniquely identify these
systems.
ASoC: cs42l42: Remove duplicate control for WNF filter frequency
The driver was defining two ALSA controls that both change the same
register field for the wind noise filter corner frequency. The filter
response has two corners, at different frequencies, and the duplicate
controls most likely were an attempt to be able to set the value using
either of the frequencies.
However, having two controls changing the same field can be problematic
and it is unnecessary. Both frequencies are related to each other so
setting one implies exactly what the other would be.
Removing a control affects user-side code, but there is currently no
known use of the removed control so it would be best to remove it now
before it becomes a problem.
The previous Kconfig cleanup added simplifications but also introduced
a new one by moving a boolean to a tristate. This leads to randconfig
problems.
This patch moves the select operations in the SOUNDWIRE_LINK_BASELINE
option. The INTEL_SOUNDWIRE config remains a tristate for backwards
compatibility with older configurations but is essentially an on/off
switch.
Mark Brown [Mon, 2 Aug 2021 20:27:55 +0000 (21:27 +0100)]
Merge series "soundwire/ASoC: abstract platform-dependent bases" from Bard Liao <yung-chuan.liao@linux.intel.com>:
shim base and alh base are platform-dependent. This series suggests
to use variables for those bases. It allows us to use different bases
for new platforms.
v2:
- Update the commit message of "soundwire: move intel sdw register
definitions to sdw_intel.h"
Mark Brown [Mon, 2 Aug 2021 20:27:54 +0000 (21:27 +0100)]
Merge series "ASoC: Intel: bytcr_rt5640: Fix HP ElitePad 1000 G2 audio routing" from Hans de Goede <hdegoede@redhat.com>:
Changes in v2:
- Only set lineout_string if BYT_RT5640_LINEOUT is set, since
BYT_RT5640_LINEOUT_AS_HP2 only works if the lineout is enabled in
the first place
Original cover-letter:
The HP Elitepad 1000 G2 has 2 headset jacks:
1. on the dock which uses the output of the codecs built-in HP-amp +
the standard IN2 input which is always used with the headset-jack.
2. on the tablet itself, this uses the line-out of the codec, combined
with an external HP-amp + IN1 for the headset-mic.
This series adds support for this, resolving:
https://bugzilla.kernel.org/show_bug.cgi?id=213415
Note this series does not add jack-detect support. I plan to add that
with a follow-up series when I can make some time to implement that.
Regards,
Hans
Hans de Goede (6):
ASoC: Intel: bytcr_rt5640: Move "Platform Clock" routes to the maps
for the matching in-/output
ASoC: Intel: bytcr_rt5640: Add line-out support
ASoC: Intel: bytcr_rt5640: Add a byt_rt5640_get_codec_dai() helper
ASoC: Intel: bytcr_rt5640: Add support for a second headphones output
ASoC: Intel: bytcr_rt5640: Add support for a second headset mic input
ASoC: Intel: bytcr_rt5640: Fix HP ElitePad 1000 G2 quirk
Hans de Goede [Mon, 2 Aug 2021 14:25:01 +0000 (16:25 +0200)]
ASoC: Intel: bytcr_rt5640: Fix HP ElitePad 1000 G2 quirk
The HP Elitepad 1000 G2 has 2 headset jacks:
1. on the dock which uses the output of the codecs built-in HP-amp +
the standard IN2 input which is always used with the headset-jack.
2. on the tablet itself, this uses the line-out of the codec, combined
with an external HP-amp + IN1 for the headset-mic.
Fix the HP ElitePad 1000 G2 to properly reflect this now that the
machine-driver supports this setup.
Note this also changes the mapping for the internal mic. from
IN1 (which was pointing to the 2nd headset-jack mic) to DMIC2
which is the actual input for the internal mics.
Hans de Goede [Mon, 2 Aug 2021 14:25:00 +0000 (16:25 +0200)]
ASoC: Intel: bytcr_rt5640: Add support for a second headset mic input
Some devices (HP Elitepad 1000 G2) have 2 headset jacks (1 on the dock,
2nd on the tablet itself). The 2nd headset mic input on these is
connected to in1 (the internal mics on the HP Elitepad 1000 G2 use DMIC2).
Add support for this through a new BYT_RT5640_HSMIC2_ON_IN1 quirk.
Hans de Goede [Mon, 2 Aug 2021 14:24:59 +0000 (16:24 +0200)]
ASoC: Intel: bytcr_rt5640: Add support for a second headphones output
Some devices (HP Elitepad 1000 G2) have a second headphones output
(1 on the dock, 2nd on the tablet itself) which is implemented through
the line-out output of the codec combined with an external hp-amp
which gets enabled through the codec's GPIO1 pin.
Add support for this through a new BYT_RT5640_LINEOUT_AS_HP2 quirk,
note users are expected to use this combined with the
BYT_RT5640_LINEOUT quirk. If that quirk is not set the new quirk is
ignored.
HDA_DSP_REG_SNDW_WAKE_STS is actually (SDW_SHIM_BASE + SDW_SHIM_WAKESTS)
and SDW_SHIM_BASE is platform-dependent. Removing HDA_DSP_REG_SNDW_WAKE_STS
and use (hdev->desc->sdw_shim_base + SDW_SHIM_WAKESTS) instead.
Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com> Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com> Link: https://lore.kernel.org/r/20210723115451.7245-4-yung-chuan.liao@linux.intel.com Signed-off-by: Mark Brown <broonie@kernel.org>
soundwire: move intel sdw register definitions to sdw_intel.h
Those Intel sdw registers will be used by ASoC SOF drivers in the
following commits. So move those definitions to sdw_intel.h and it can
be visible to SOF drivers.
Mark Brown [Mon, 2 Aug 2021 14:42:31 +0000 (15:42 +0100)]
Merge series "ASoC: soc-topology: cleanup cppcheck warning" from Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>:
Hi Mark
Now I'm posting audio-graph-card2 patch-set, but it seems it needs longer
discussion. Thus I want to post more easy patch first, and reduce my
local patches.
These are cppcheck warning cleanup patches for soc-topology.
Kuninori Morimoto (5):
ASoC: soc-topology: cleanup cppcheck warning at soc_tplg_process_headers()
ASoC: soc-topology: cleanup cppcheck warning at soc_tplg_dai_elems_load()
ASoC: soc-topology: cleanup cppcheck warning at soc_tplg_dapm_widget_elems_load()
ASoC: soc-topology: cleanup cppcheck warning at soc_tplg_kcontrol_elems_load()
ASoC: soc-topology: cleanup cppcheck warning at snd_soc_find_dai_link()
ASoC: soc-topology: cleanup cppcheck warning at soc_tplg_kcontrol_elems_load()
This patch cleanups below cppcheck warning.
sound/soc/soc-topology.c:1038:31: style: The scope of the variable 'control_hdr' can be reduced. [variableScope]
struct snd_soc_tplg_ctl_hdr *control_hdr;
^
ASoC: soc-topology: cleanup cppcheck warning at soc_tplg_dapm_widget_elems_load()
This patch cleanups below cppcheck warning.
sound/soc/soc-topology.c:1599:35: style: The scope of the variable 'widget' can be reduced. [variableScope]
struct snd_soc_tplg_dapm_widget *widget;
^
sound/soc/soc-topology.c:1600:6: style: The scope of the variable 'ret' can be reduced. [variableScope]
int ret, count, i;
^
ASoC: soc-topology: cleanup cppcheck warning at soc_tplg_dai_elems_load()
This patch cleanups below cppcheck warning.
sound/soc/soc-topology.c:2350:27: style: The scope of the variable 'dai' can be reduced. [variableScope]
struct snd_soc_tplg_dai *dai;
^
sound/soc/soc-topology.c:2352:9: style: The scope of the variable 'ret' can be reduced. [variableScope]
int i, ret;
^
PCM buffers might be allocated dynamically when the buffer
preallocation failed or a larger buffer is requested, and it's not
guaranteed that substream->dma_buffer points to the actually used
buffer. The driver needs to refer to substream->runtime->dma_addr
instead for the buffer address.
Mark Brown [Wed, 28 Jul 2021 23:47:29 +0000 (00:47 +0100)]
ASoC: nau8824: Fix open coded prefix handling
As with the component layer code the nau8824 driver had been doing some
open coded pin manipulation which will have been broken now the core is
fixed to handle this properly, remove the open coding to avoid the issue.
ASoC: kirkwood: Fix reference to PCM buffer address
The transition to the managed PCM buffers allowed the dynamically
buffer allocation, while the driver code still assumes the fixed
preallocation buffer and sets up the DMA stuff at the open call.
This needs to be moved to hw_params after the buffer allocation and
setup. Also, the reference to the buffer address has to be corrected
to runtime->dma_addr.
Fixes: b3c0ae75f5d3 ("ASoC: kirkwood: Use managed DMA buffer allocation") Cc: Lars-Peter Clausen <lars@metafoo.de> Cc: <stable@vger.kernel.org> Signed-off-by: Takashi Iwai <tiwai@suse.de> Link: https://lore.kernel.org/r/20210728112353.6675-6-tiwai@suse.de Signed-off-by: Mark Brown <broonie@kernel.org>
ASoC: uniphier: Fix reference to PCM buffer address
Along with the transition to the managed PCM buffers, the driver now
accepts the dynamically allocated buffer, while it still kept the
reference to the old preallocated buffer address. This patch corrects
to the right reference via runtime->dma_addr.
(Although this might have been already buggy before the cleanup with
the managed buffer, let's put Fixes tag to point that; it's a corner
case, after all.)
Fixes: d55894bc2763 ("ASoC: uniphier: Use managed buffer allocation") Cc: <stable@vger.kernel.org> Signed-off-by: Takashi Iwai <tiwai@suse.de> Link: https://lore.kernel.org/r/20210728112353.6675-5-tiwai@suse.de Signed-off-by: Mark Brown <broonie@kernel.org>
PCM buffers might be allocated dynamically when the buffer
preallocation failed or a larger buffer is requested, and it's not
guaranteed that substream->dma_buffer points to the actually used
buffer. The driver needs to refer to substream->runtime->dma_addr
instead for the buffer address.
ASoC: intel: atom: Fix reference to PCM buffer address
PCM buffers might be allocated dynamically when the buffer
preallocation failed or a larger buffer is requested, and it's not
guaranteed that substream->dma_buffer points to the actually used
buffer. The address should be retrieved from runtime->dma_addr,
instead of substream->dma_buffer (and shouldn't use virt_to_phys).
Also, remove the line overriding runtime->dma_area superfluously,
which was already set up at the PCM buffer allocation.
Cc: Cezary Rojewski <cezary.rojewski@intel.com> Cc: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Cc: <stable@vger.kernel.org> Signed-off-by: Takashi Iwai <tiwai@suse.de> Link: https://lore.kernel.org/r/20210728112353.6675-3-tiwai@suse.de Signed-off-by: Mark Brown <broonie@kernel.org>
An I2S frame always has a left and right channel slot even if mono
data is being sent. So if channels==1 the actual bitclock frequency
is 2 * snd_soc_params_to_bclk(params).
ASoC: cs42l42: Correct definition of ADC Volume control
The ADC volume is a signed 8-bit number with range -97 to +12,
with -97 being mute. Use a SOC_SINGLE_S8_TLV() to define this
and fix the DECLARE_TLV_DB_SCALE() to have the correct start and
mute flag.
Mark Brown [Thu, 29 Jul 2021 16:24:46 +0000 (17:24 +0100)]
Merge series "ASoC: soc-core: cleanup cppcheck warning" from Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>:
Hi Mark
Now I'm posting audio-graph-card2 patch-set, but it seems it needs longer
discussion. Thus I want to post more easy patch first, and reduce my
local patches.
These are cppcheck warning cleanup patches for soc-core.
Kuninori Morimoto (7):
ASoC: soc-core: cleanup cppcheck warning at snd_soc_set_dmi_name()
ASoC: soc-core: cleanup cppcheck warning at snd_soc_get_dai_name()
ASoC: soc-core: cleanup cppcheck warning at snd_soc_daifmt_parse_format()
ASoC: soc-core: cleanup cppcheck warning at snd_soc_unregister_component()
ASoC: soc-core: cleanup cppcheck warning at snd_soc_add_controls()
ASoC: soc-core: cleanup cppcheck warning at snd_soc_of_parse_audio_simple_widgets()
ASoC: soc-core: cleanup cppcheck warning at snd_soc_of_parse_audio_routing()