snd_soc_set_runtime_hwparams() is called from each driver
to initialize hw parameters,
but coping each parameters one-by-one.
Current code is not copying all parameters, but no big effect
if we do it. This patch copies all parameters by simple code.
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/87h7lluoba.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
soc-pcm needs DAI name and it will be "multicpu/multicodec" if it has
many DAIs. But current code is using very verbose for it.
This patch uses macro and makes code simple.
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/87im61uobf.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
soc_pcm_apply_symmetry() is used like below in all cases.
if (snd_soc_dai_active(dai)) {
err = soc_pcm_apply_symmetry(fe_substream, dai);
...
}
Because of this style, the code is deep nested.
This patch checks it under soc_pcm_apply_symmetry(), and makes code simple.
static int soc_pcm_apply_symmetry(...)
{
...
=> if (!snd_soc_dai_active(...))
return 0;
...
}
=> ret = soc_pcm_apply_symmetry();
if (ret < 0)
...
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/87k0qhuobl.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
The series reuses mt8183-mt6358-ts3a227-max98357.c for supporting
machine driver with rt1015p speaker amplifier.
The 1st patch adds document for the new proposed compatible string.
The 2nd patch changes the machine driver to support "RT1015P" codec.
Tzung-Bi Shih (2):
ASoC: dt-bindings: mt8183: add compatible string for using rt1015p
ASoC: mediatek: mt8183: support machine driver with rt1015p
.../sound/mt8183-mt6358-ts3a227-max98357.txt | 1 +
sound/soc/mediatek/Kconfig | 1 +
.../mt8183/mt8183-mt6358-ts3a227-max98357.c | 29 +++++++++++++++++++
3 files changed, 31 insertions(+)
--
2.31.0.rc2.261.g7f71774620-goog
When DMI information is not present, trying to assign the card long
name results in the following warning.
WARNING KERN tegra-audio-graph-card sound: ASoC: no DMI vendor name!
The initial solution suggested was to test if the card device is an
ACPI one. This causes a regression visible to userspace on all Intel
platforms, with UCM unable to load card profiles based on DMI
information: the card devices are not necessarily ACPI ones, e.g. when
the parent creates platform devices on Intel devices.
To fix this problem, this patch exports the existing dmi_available
variable and tests it in the ASoC core.
Fixes: c014170408 ("ASoC: soc-core: Prevent warning if no DMI table is present")
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Takashi Iwai <tiwai@suse.de>
Acked-by: Jean Delvare <jdelvare@suse.de>
Link: https://lore.kernel.org/r/20210310193928.108850-1-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Supports machine driver with rt1015p ("mt8183_mt6358_ts3a227_rt1015p").
Embeds in the existing mt8183-mt6358-ts3a227-max98357.c because they
share most of the code.
Signed-off-by: Tzung-Bi Shih <tzungbi@google.com>
Link: https://lore.kernel.org/r/20210311033151.1818603-3-tzungbi@google.com
Signed-off-by: Mark Brown <broonie@kernel.org>
cppcheck warning:
sound/soc/codecs/wm_adsp.c:2092:9: warning: Identical condition and
return expression 'ret', return value is always 0
[identicalConditionAfterEarlyExit]
return ret;
^
sound/soc/codecs/wm_adsp.c:2070:6: note: If condition 'ret' is true,
the function will return/exit
if (ret)
^
sound/soc/codecs/wm_adsp.c:2092:9: note: Returning identical
expression 'ret'
return ret;
^
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Acked-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Link: https://lore.kernel.org/r/20210311004332.120901-10-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
cppcheck warnings:
sound/soc/codecs/wm8903.c:1552:11: style: Variable 'best_val' is
assigned a value that is never used. [unreadVariable]
best_val = ((clk_sys * 10) / bclk_divs[0].ratio) - bclk;
^
sound/soc/codecs/wm8903.c:1559:12: style: Variable 'best_val' is
assigned a value that is never used. [unreadVariable]
best_val = cur_val;
^
Indeed what matters in the code is the blck_div, the best_val is
assigned but never tested or used.
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Acked-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Link: https://lore.kernel.org/r/20210311004332.120901-5-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
cppcheck complains about some members not being used, but it's really
the entire structure that is never used anywhere.
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Acked-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Link: https://lore.kernel.org/r/20210311004332.120901-4-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Hi All,
Here is a patch series for reporting to user space jack and button events and
add the support for Capture. With some cleanups and fixes along the way.
Regards,
Lucas Tanure
Lucas Tanure (12):
ASoC: cs42l42: Fix Bitclock polarity inversion
ASoC: cs42l42: Fix channel width support
ASoC: cs42l42: Fix mixer volume control
ASoC: cs42l42: Don't enable/disable regulator at Bias Level
ASoC: cs42l42: Always wait at least 3ms after reset
ASoC: cs42l42: Remove power if the driver is being removed
ASoC: cs42l42: Disable regulators if probe fails
ASoC: cs42l42: Provide finer control on playback path
ASoC: cs42l42: Set clock source for both ways of stream
ASoC: cs42l42: Add Capture Support
ASoC: cs42l42: Report jack and button detection
ASoC: cs42l42: Use bclk from hw_params if set_sysclk was not called
Richard Fitzgerald (3):
ASoC: cs42l42: Wait at least 150us after writing SCLK_PRESENT
ASoC: cs42l42: Only start PLL if it is needed
ASoC: cs42l42: Wait for PLL to lock before switching to it
sound/soc/codecs/cs42l42.c | 435 +++++++++++++++++++++----------------
sound/soc/codecs/cs42l42.h | 41 +++-
2 files changed, 282 insertions(+), 194 deletions(-)
--
2.30.1
This patch keeps the delay time (50 ms) for jack detection and zero delay time for the button press.
This patch improves the reaction of the button press.
Signed-off-by: Shuming Fan <shumingf@realtek.com>
Link: https://lore.kernel.org/r/20210309085827.32032-1-shumingf@realtek.com
Tested-by Curtis Malainey <cujomalainey@chromium.org>
Signed-off-by: Mark Brown <broonie@kernel.org>
In case of error, the function devm_regmap_init_sdw_mbq() and
devm_regmap_init_sdw() returns ERR_PTR() not NULL. The NULL test
in the return value check should be replaced with IS_ERR().
Fixes: 393c52d2d109 ("ASoC: rt715-sdca: Add RT715 sdca vendor-specific driver")
Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
Link: https://lore.kernel.org/r/20210309131458.1884899-1-weiyongjun1@huawei.com
Signed-off-by: Mark Brown <broonie@kernel.org>
The PLL is only needed for sclk < 11289600 Hz and cs42l42_pll_config()
will not configure it for higher rates. So it must only be enabled
when it is needed.
Signed-off-by: Richard Fitzgerald <rf@opensource.cirrus.com>
Signed-off-by: Lucas Tanure <tanureal@opensource.cirrus.com>
Link: https://lore.kernel.org/r/20210306185553.62053-15-tanureal@opensource.cirrus.com
Signed-off-by: Mark Brown <broonie@kernel.org>
There must be a delay of at least 150us after writing SCLK_PRESENT
before issuing another I2C write.
This is done using struct reg_sequence because it can specify a delay
after the write and the whole sequence is written atomically.
Signed-off-by: Richard Fitzgerald <rf@opensource.cirrus.com>
Signed-off-by: Lucas Tanure <tanureal@opensource.cirrus.com>
Link: https://lore.kernel.org/r/20210306185553.62053-14-tanureal@opensource.cirrus.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Add support for reading the source clock from snd_soc_params_to_bclk
so the machine driver is not required to call cs42l42_set_sysclk
Signed-off-by: Lucas Tanure <tanureal@opensource.cirrus.com>
Link: https://lore.kernel.org/r/20210306185553.62053-13-tanureal@opensource.cirrus.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Report the Jack events to the user space through ALSA.
Also moves request_threaded_irq() to component_probe so it don't get
interrupts before the initialization the struct snd_soc_jack.
Signed-off-by: Lucas Tanure <tanureal@opensource.cirrus.com>
Link: https://lore.kernel.org/r/20210306185553.62053-12-tanureal@opensource.cirrus.com
Signed-off-by: Mark Brown <broonie@kernel.org>
The Asus T100HA and T101HA 2-in-1s use a rt5645 family codec and always
report that a headset (rather then headphones) are plugged in even when
regular headphones are plugged in.
And when a headset is used, then the headset-microphone does not work.
According to RealTek the ALC3270 variant used in these devices does not
support headsets only headphones.
Since the ALC3270 is a budget version of the regular ALC5645 codec,
I assume that it is using a package with less pins and the headset-mic
pin is simply not connected.
Detect if the codec is an ALC3270 based on the ACPI HID and if it is
an ALC3270 then always report SND_JACK_MICROPHONE as false, so that
userspace will not try to use the not-connected headset-mic.
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Link: https://lore.kernel.org/r/20210306230223.516566-2-hdegoede@redhat.com
Signed-off-by: Mark Brown <broonie@kernel.org>
sound/soc/codecs/rt5645.c is the only user of the rt5645_platform_data,
move its definition to sound/soc/codecs/rt5645.c and remove the now
empty include/sound/rt5645.h file.
Note since the DMI quirk mechanism uses pointers to the
rt5645_platform_data struct we can NOT simply add its members to
the rt5645_priv struct and completely remove the struct.
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Link: https://lore.kernel.org/r/20210306230223.516566-1-hdegoede@redhat.com
Signed-off-by: Mark Brown <broonie@kernel.org>
The function devm_platform_ioremap_resource has already contained
error message if failed, so remove superfluous dev_err here.
Signed-off-by: Zhang Shengju <zhangshengju@cmss.chinamobile.com>
Signed-off-by: Tang Bin <tangbin@cmss.chinamobile.com>
Acked-by: Paul Cercueil <paul@crapouillou.net>
Link: https://lore.kernel.org/r/20210307072133.10832-1-tangbin@cmss.chinamobile.com
Signed-off-by: Mark Brown <broonie@kernel.org>
With S20_3LE format case, the sysclk = rate * 384,
the bclk = rate * 20 * 2, there is no proper bclk divider
for 384 / 40, because current condition needs exact match.
So driver fails to configure the clocking:
wm8962 3-001a: Unsupported BCLK ratio 9
Fix this by relaxing bitclk divider searching, so that when
no exact value can be derived from sysclk pick the closest
value greater than expected bitclk.
Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com>
Reviewed-by: Daniel Baluta <daniel.baluta@nxp.com>
Acked-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Link: https://lore.kernel.org/r/1615170877-25918-1-git-send-email-shengjiu.wang@nxp.com
Signed-off-by: Mark Brown <broonie@kernel.org>
A previous cleanup commit removed the ininitialization of st2_mem_alloc.
Fix this by restoring the original behaviour by initializing it to zero.
Addresses-Coverity: ("Uninitialized scalar variable")
Fixes: e80382fe721f ("ASoC: fsl: fsl_easrc: remove useless assignments")
Signed-off-by: Colin Ian King <colin.king@canonical.com>
Link: https://lore.kernel.org/r/20210303091835.5024-1-colin.king@canonical.com
Signed-off-by: Mark Brown <broonie@kernel.org>
./sound/soc/codecs/lpass-rx-macro.c:3588:3-8: No need to set .owner here.
The core will do it.
Remove .owner field if calls are used which set it automatically
Reported-by: Abaci Robot <abaci@linux.alibaba.com>
Signed-off-by: Yang Li <yang.lee@linux.alibaba.com>
Link: https://lore.kernel.org/r/1614762481-102466-1-git-send-email-yang.lee@linux.alibaba.com
Signed-off-by: Mark Brown <broonie@kernel.org>
In case of error, the function devm_regmap_init_sdw() returns ERR_PTR()
and never returns NULL. The NULL test in the return value check should
be replaced with IS_ERR().
Fixes: a262057df513 ("ASoC: rt1316: Add RT1316 SDCA vendor-specific driver")
Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
Link: https://lore.kernel.org/r/20210303064041.898281-1-weiyongjun1@huawei.com
Signed-off-by: Mark Brown <broonie@kernel.org>
The function devm_platform_ioremap_resource has already contained
error message, so remove the redundant dev_err here.
Signed-off-by: Tang Bin <tangbin@cmss.chinamobile.com>
Acked-by: Paul Cercueil <paul@crapouillou.net>
Link: https://lore.kernel.org/r/20210302135630.11456-1-tangbin@cmss.chinamobile.com
Signed-off-by: Mark Brown <broonie@kernel.org>
make W=1 warning:
sound/soc/qcom/qdsp6/q6afe.c:1460: warning: expecting prototype for
q6afe_dam_port_prepare(). Prototype was for
q6afe_cdc_dma_port_prepare() instead
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20210302205926.49063-10-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
make W=1 warning:
sound/soc/intel/boards/bytcr_wm5102.c:216:40: error:
‘byt_wm5102_dai_params’ defined but not used
[-Werror=unused-const-variable=]
216 | static const struct snd_soc_pcm_stream byt_wm5102_dai_params = {
| ^~~~~~~~~~~~~~~~~~~~~
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20210302205926.49063-9-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
make W=1 warning:
sound/soc/fsl/fsl_ssi.c:371: warning: expecting prototype for
fsl_ssi_irq(). Prototype was for fsl_ssi_isr() instead
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20210302205926.49063-7-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
make W=1 warning:
sound/soc/amd/renoir/rn-pci-acp3x.c:24: warning: wrong kernel-doc
identifier on line:
* dmic_acpi_check = -1 - Use ACPI/DMI method to detect the DMIC
hardware presence at runtime
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20210302205926.49063-6-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>