Mark Brown [Tue, 1 Jun 2021 17:10:41 +0000 (18:10 +0100)]
Merge series "ASoC: Constify snd_compress_ops" from Rikard Falkeborn <rikard.falkeborn@gmail.com>:
The only use of the static and global snd_compress_ops structs is to
assign their address to the compress_ops field in the
snd_soc_component_driver struct which is a pointer to const. Make them
const to allow the compiler to put them in read-only memory.
ASoC: SOF: Intel: hda: don't print ROM status if cl_dsp_init() fails
cl_dsp_init() dumps the ROM status if it fails after max
attempts before powering off the DSP. Remove the duplicate
log to print the ROM status and error in
hda_dsp_cl_boot_firmware(). These values are invalid anyway
as the DSP is already powered off.
Co-developed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com> Reviewed-by: Bard Liao <bard.liao@intel.com> Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com> Link: https://lore.kernel.org/r/20210528160551.10145-2-kai.vehmanen@linux.intel.com Signed-off-by: Mark Brown <broonie@kernel.org>
The only usage of sof_probe_compressed_ops is to assign its address to
the compress_ops field in the snd_soc_component_driver struct, which is
a pointer to const. The assignment is done in sound/soc/sof/pcm.c. Make
it const to allow the compiler to put it in read-only memory.
The snd_compress_ops structs are only stored in the compress_ops field
of a snd_soc_component_driver struct, so make it const to allow the
compiler to put it in read-only memory.
The snd_compress_ops structs are only stored in the compress_ops field
of a snd_soc_component_driver struct, so make it const to allow the
compiler to put it in read-only memory.
The snd_compress_ops structs are only stored in the compress_ops field
of a snd_soc_component_driver struct, so make it const to allow the
compiler to put it in read-only memory.
The snd_compress_ops structs are only stored in the compress_ops field
of a snd_soc_component_driver struct, so make it const to allow the
compiler to put it in read-only memory.
In general Renesas SoC's SSI/SRC are all enabled, but some SoC is not.
H2 E2
SRC0 <=
SRC1 SRC1
SRC2 SRC2
... ...
Renesas Sound driver is assuming that *all* modules are
enabled, and thus it is using *data array* to access each modules.
Because of it, we have been using "status = disabled" at DT,
and using *full size* array but avoiding disabled module.
This patch adds "char *name" to rsnd_dma_request_channel().
It is not yet used so far, but is preparation for
next "ASoC: rsnd: adjust disabled module" patch
This patch adds "char *name" to rsnd_parse_connect_common().
It is not yet used so far, but is preparation for
next "ASoC: rsnd: adjust disabled module" patch
Reported-by: Hulk Robot <hulkci@huawei.com> Signed-off-by: Zou Wei <zou_wei@huawei.com>
Message-Id: <1622113652-56646-1-git-send-email-zou_wei@huawei.com> Signed-off-by: Mark Brown <broonie@kernel.org>
rsnd_ssiu_busif_err_irq_ctrl() has very similar duplicated code.
This patch merge and tidyup the code.
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Message-Id: <87sg28lwxw.wl-kuninori.morimoto.gx@renesas.com> Signed-off-by: Mark Brown <broonie@kernel.org>
rsnd_ssiu_busif_err_status_clear() has very similar duplicated code.
This patch merge and tidyup the code.
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Message-Id: <87tumolwy3.wl-kuninori.morimoto.gx@renesas.com> Signed-off-by: Mark Brown <broonie@kernel.org>
ASoC: rsnd: implement BUSIF related code in ssiu.c
BUSIF is SSIU feature, but its related code is
implemented at ssi.c today.
This patch moves it to ssiu.c
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Message-Id: <87v974lwy9.wl-kuninori.morimoto.gx@renesas.com> Signed-off-by: Mark Brown <broonie@kernel.org>
Renesas Sound uses many modules (SSI/SSIU/SRC/CTU/MIX/DVC/DMA),
and supports complex connections/path.
Thus each modules needs to save its status to correctly control it.
This status is updated when by .trigger, and .hw_params/.hw_free.
Renesas Sound is protecting modules by using lock when .trigger,
but it was not enough to protecting each modules "status" if it was
used from many paths.
1) .hw_params/.hw_free update status
2) another doesn't update status, but overwrites by same value
This patch do
1) protects .hw_params/.hw_free by lock
2) do nothing if no status update
Without this patch, protected mod->status (= .trigger) might be
overwrote by non protected mod->status (= .hw_params / .hw_free),
and in such case, CTU/MIX/DVC/SSIU/SSI which are used from
many paths might get damage.
If above issue happens, Renesas Sound will be hung (= silence)
and never be recoverd.
I could reproduce this issue by continue playing very short sound
with loop very long term (3-4 hours) through 2 inputs (= MIXer).
For updating rsnd_status_update(), this patch removes rsnd_dai_call()
debug message. Because we already have debugfs support, and is not
good match to new code.
Reported-by: Linh Phung T. Y <linh.phung.jy@renesas.com> Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Message-Id: <87wnrklwyh.wl-kuninori.morimoto.gx@renesas.com> Signed-off-by: Mark Brown <broonie@kernel.org>
Current rsnd supports #define DEBUG, but it is not helpful
if issue happen after 4-5 hours.
This patch adds debugfs support for it.
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Message-Id: <87y2c0lwyn.wl-kuninori.morimoto.gx@renesas.com> Signed-off-by: Mark Brown <broonie@kernel.org>
Current rsnd is using dev_dbg() if irq error happen,
but it makes debug very difficult if some strange things happen.
This patch uses dev_info() for it, and rename the macro name.
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Message-Id: <87zgwglwyv.wl-kuninori.morimoto.gx@renesas.com> Signed-off-by: Mark Brown <broonie@kernel.org>
ASoC: rsnd: indicate unknown error at rsnd_dai_call()
Current rsnd_dai_call() doesn't indicate error message,
thus it is very difficult to know the issue
when strange things happen.
This patch indicates error for it.
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Message-Id: <871r9snbji.wl-kuninori.morimoto.gx@renesas.com> Signed-off-by: Mark Brown <broonie@kernel.org>
Current ssi.c checks BUSIF when TDM mode, but it should be checked
everytime.
This patch do it.
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Message-Id: <8735u8nbjr.wl-kuninori.morimoto.gx@renesas.com> Signed-off-by: Mark Brown <broonie@kernel.org>
SSIU is not needed if SSI was PIO mode.
This patch ignores such case.
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Message-Id: <874keonbkg.wl-kuninori.morimoto.gx@renesas.com> Signed-off-by: Mark Brown <broonie@kernel.org>
ASoC: rsnd: ignore runtime NULL case at rsnd_runtime_channel_original_with_params()
runtime might be NULL. Let's ignore such case.
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Message-Id: <875yz4nbkt.wl-kuninori.morimoto.gx@renesas.com> Signed-off-by: Mark Brown <broonie@kernel.org>
ASoC: rsnd: call unregister for null_hw when removed
commit d6956a7dde6fb ("ASoC: rsnd: add null CLOCKIN support")
added null_clk, but it is using local static valuable.
It will be leaked if rsnd driver was removed.
This patch moves it to priv, and call unregister when removing.
YueHaibing [Mon, 24 May 2021 11:42:39 +0000 (19:42 +0800)]
ASoC: cs42l52: use DEVICE_ATTR_WO macro
Use DEVICE_ATTR_WO() helper instead of plain DEVICE_ATTR(),
which makes the code a bit shorter and easier to read.
Signed-off-by: YueHaibing <yuehaibing@huawei.com> Reviewed-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Message-Id: <20210524114239.7960-1-yuehaibing@huawei.com> Signed-off-by: Mark Brown <broonie@kernel.org>
David Rhodes [Tue, 25 May 2021 19:44:39 +0000 (14:44 -0500)]
ASoC: cs35l3x: Use neutral language in amp drivers
Revise variable names and comments in
cs35l35 and cs35l36 amp drivers.
Signed-off-by: David Rhodes <drhodes@opensource.cirrus.com> Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Message-Id: <20210525194439.2232908-1-drhodes@opensource.cirrus.com> Signed-off-by: Mark Brown <broonie@kernel.org>
YueHaibing [Mon, 24 May 2021 11:40:17 +0000 (19:40 +0800)]
ASoC: cs43130: Use DEVICE_ATTR_RO macro
Use DEVICE_ATTR_RO() helper instead of plain DEVICE_ATTR(),
which makes the code a bit shorter and easier to read.
Signed-off-by: YueHaibing <yuehaibing@huawei.com> Reviewed-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Message-Id: <20210524114017.18672-1-yuehaibing@huawei.com> Signed-off-by: Mark Brown <broonie@kernel.org>
YueHaibing [Mon, 24 May 2021 11:47:53 +0000 (19:47 +0800)]
ASoC: wm8962: Use DEVICE_ATTR_WO macro
Use DEVICE_ATTR_WO() helper instead of plain DEVICE_ATTR(),
which makes the code a bit shorter and easier to read.
Signed-off-by: YueHaibing <yuehaibing@huawei.com> Acked-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Message-Id: <20210524114753.39544-1-yuehaibing@huawei.com> Signed-off-by: Mark Brown <broonie@kernel.org>
YueHaibing [Mon, 24 May 2021 11:45:03 +0000 (19:45 +0800)]
ASoC: cs42l56: use DEVICE_ATTR_WO macro
Use DEVICE_ATTR_WO() helper instead of plain DEVICE_ATTR(),
which makes the code a bit shorter and easier to read.
Signed-off-by: YueHaibing <yuehaibing@huawei.com> Reviewed-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Message-Id: <20210524114503.26460-1-yuehaibing@huawei.com> Signed-off-by: Mark Brown <broonie@kernel.org>
Wei Yongjun [Mon, 24 May 2021 13:35:53 +0000 (13:35 +0000)]
ASoC: imx-card: Make some symbols static
The sparse tool complains as follows:
sound/soc/fsl/imx-card.c:121:27: warning:
symbol 'ak4458_fs_mul' was not declared. Should it be static?
sound/soc/fsl/imx-card.c:138:31: warning:
symbol 'ak4458_tdm_fs_mul' was not declared. Should it be static?
sound/soc/fsl/imx-card.c:149:27: warning:
symbol 'ak4497_fs_mul' was not declared. Should it be static?
sound/soc/fsl/imx-card.c:166:27: warning:
symbol 'ak5558_fs_mul' was not declared. Should it be static?
sound/soc/fsl/imx-card.c:180:31: warning:
symbol 'ak5558_tdm_fs_mul' was not declared. Should it be static?
Those symbols are not used outside of imx-card.c, so marks
them static.
Fixes: aa736700f42f ("ASoC: imx-card: Add imx-card machine driver") Reported-by: Hulk Robot <hulkci@huawei.com> Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
Message-Id: <20210524133553.2366502-1-weiyongjun1@huawei.com> Signed-off-by: Mark Brown <broonie@sirena.org.uk>
YueHaibing [Mon, 24 May 2021 11:51:31 +0000 (19:51 +0800)]
ASoC: tlv320aic26: use DEVICE_ATTR_RW macro
Use DEVICE_ATTR_RW() helper instead of plain DEVICE_ATTR(),
which makes the code a bit shorter and easier to read.
Signed-off-by: YueHaibing <yuehaibing@huawei.com>
Message-Id: <20210524115131.46288-1-yuehaibing@huawei.com> Signed-off-by: Mark Brown <broonie@sirena.org.uk>
Lucas Tanure [Tue, 25 May 2021 09:08:22 +0000 (10:08 +0100)]
ASoC: cs42l42: Check jack status before reporting button events
Jack must be connected before reporting button events and
if the jack is disconnected button release must be reported
Signed-off-by: Lucas Tanure <tanureal@opensource.cirrus.com> Reviewed-by: Richard Fitzgerald <rf@opensource.cirrus.com>
Message-Id: <20210525090822.64577-4-tanureal@opensource.cirrus.com> Signed-off-by: Mark Brown <broonie@sirena.org.uk>
Signed-off-by: Lucas Tanure <tanureal@opensource.cirrus.com> Reviewed-by: Richard Fitzgerald <rf@opensource.cirrus.com>
Message-Id: <20210525090822.64577-3-tanureal@opensource.cirrus.com> Signed-off-by: Mark Brown <broonie@sirena.org.uk>
Add support for 24bits, 2 channels, 48k Sample rate bit clock
Signed-off-by: Lucas Tanure <tanureal@opensource.cirrus.com> Reviewed-by: Richard Fitzgerald <rf@opensource.cirrus.com>
Message-Id: <20210525090822.64577-2-tanureal@opensource.cirrus.com> Signed-off-by: Mark Brown <broonie@sirena.org.uk>
The 16 Bits, 2 channels, 48K sample rate use case needs
to configure a safer pll_divout during the start of PLL
After 800us from the start of PLL the correct pll_divout
can be set
Signed-off-by: Lucas Tanure <tanureal@opensource.cirrus.com> Reviewed-by: Richard Fitzgerald <rf@opensource.cirrus.com>
Message-Id: <20210525090822.64577-1-tanureal@opensource.cirrus.com> Signed-off-by: Mark Brown <broonie@sirena.org.uk>
Stephan Gerhold [Thu, 13 May 2021 10:41:29 +0000 (12:41 +0200)]
ASoC: codecs: Add driver for NXP/Goodix TFA989x (TFA1) amplifiers
NXP's TFA98xx (now part of Goodix) are fairly popular speaker amplifiers
used in many smartphones and tablets. Most of them are sold as "smart
amplifiers" with built-in "CoolFlux DSP" that is used for volume control,
plus a "sophisticated speaker-boost and protection algorithm".
Unfortunately, they are also almost entirely undocumented. The short
datasheets (e.g. [1] for TFA9897) describe the available features,
but do not provide any information about the registers or how to use
the "CoolFlux DSP".
The amplifiers are most often configured through proprietary userspace
libraries. There are also some (rather complex) kernel drivers (e.g. [2])
but even those rely on obscure firmware blobs for configuration (so-called
"containers"). They seem to contain different "profiles" with tuned speaker
settings, sample rates and volume steps (which would be better exposed
as separate ALSA mixers).
The format of the firmware files seems to have changed a lot over the time,
so it's not even possible to simply re-use the firmware originally provided
by the vendor.
Overall, it seems close to impossible to develop a proper mainline driver
for these amplifiers that could make proper use of the built-in DSP.
This commit implements a compromise: At least the TFA1 family of the
TFA98xx amplifiers (usually called TFA989x) provide a way to *bypass*
the DSP using a special register sequence. The register sequence can be
found in similar variations in the kernel drivers from lots of vendors
e.g. in [3] and was probably mainly used for factory testing.
With the DSP bypassed, the amplifier acts mostly like a dumb standard
speaker amplifier, without (hardware) volume control. However, the setup
is much simpler and it works without any obscure firmware.
This driver implements the DSP bypass combined with chip-specific
initialization sequences adapted from [2]. Only TFA9895 is supported in
this initial commit. Except for the lack of volume control I can not hear
any difference with or without the DSP, it works just fine.
This driver allows the speaker to work on mainline Linux running on the
Samsung Galaxy A3/A5 (2015) [TFA9895] and Alcatel Idol 3 [TFA9897].
TFA9897 support will be added in separate patch set later.
Stephan Gerhold [Thu, 13 May 2021 10:41:28 +0000 (12:41 +0200)]
ASoC: dt-bindings: codecs: Add bindings for nxp, tfa989x
NXP/Goodix TFA989X (TFA1) amplifiers are controlled via an I2C bus.
Add simple device tree bindings that describe how to set them up
in the device tree.
Right now only nxp,tfa9895 is supported but this will be extended
to at least nxp,tfa9897 in the near future.
commit 06e8f5c842f2d ("ASoC: rsnd: don't call clk_get_rate() under
atomic context") used saved clk_rate, thus for_each_rsnd_clk()
is no longer needed. This patch fixes it.
Kefeng Wang [Mon, 24 May 2021 02:49:41 +0000 (10:49 +0800)]
ASoC: core: Fix Null-point-dereference in fmt_single_name()
Check the return value of devm_kstrdup() in case of
Null-point-dereference.
Fixes: 45dd9943fce0 ("ASoC: core: remove artificial component and DAI name constraint") Cc: Dmitry Baryshkov <dmitry.baryshkov@linaro.org> Reported-by: Hulk Robot <hulkci@huawei.com> Signed-off-by: Kefeng Wang <wangkefeng.wang@huawei.com> Link: https://lore.kernel.org/r/20210524024941.159952-1-wangkefeng.wang@huawei.com Signed-off-by: Mark Brown <broonie@kernel.org>
Peter Ujfalusi [Fri, 21 May 2021 09:27:59 +0000 (12:27 +0300)]
ASoC: SOF: pci: No need to cast second time to save the desc
At the start of the function we already have the desc, no need to cast it
again from pci_id->driver_data to save it to sof_pdata.
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com> Reviewed-by: Rander Wang <rander.wang@intel.com> Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com> Link: https://lore.kernel.org/r/20210521092804.3721324-3-kai.vehmanen@linux.intel.com Signed-off-by: Mark Brown <broonie@kernel.org>
Peter Ujfalusi [Fri, 21 May 2021 09:27:58 +0000 (12:27 +0300)]
ASoC: SOF: Check desc->ops directly in acpi/pci/of probe functions
We can check for the desc->ops directly in the probe functions, the ops
is not used directly in the functions.
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com> Reviewed-by: Rander Wang <rander.wang@intel.com> Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com> Link: https://lore.kernel.org/r/20210521092804.3721324-2-kai.vehmanen@linux.intel.com Signed-off-by: Mark Brown <broonie@kernel.org>
Shengjiu Wang [Mon, 17 May 2021 10:31:28 +0000 (18:31 +0800)]
ASoC: imx-card: Add imx-card machine driver
Add machine driver for i.MX boards, which supports
AK4458/AK5558/AK4497/AK5552 DAC/ADC attached to
SAI interface currently, but these DAC/ADCs are not
only supported codecs. This machine driver is designed
to be a more common machine driver for i.MX platform,
it can support widely cpu dai interface and codec
dai interface.
Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com> Signed-off-by: Mihai Serban <mihai.serban@nxp.com> Signed-off-by: Cosmin-Gabriel Samoila <cosmin.samoila@nxp.com> Signed-off-by: Viorel Suman <viorel.suman@nxp.com> Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com> Signed-off-by: Adrian Alonso <adrian.alonso@nxp.com> Link: https://lore.kernel.org/r/1621247488-21412-2-git-send-email-shengjiu.wang@nxp.com Signed-off-by: Mark Brown <broonie@kernel.org>
Shengjiu Wang [Mon, 17 May 2021 10:31:27 +0000 (18:31 +0800)]
ASoC: dt-bindings: imx-card: Add binding doc for imx sound card
Imx-card is a new added machine driver for supporting
ak4458/ak5558/ak5552/ak4497 codec on i.MX platforms. But these
DAC/ADCs are not only supported codecs. This machine driver is
designed to be a more common machine driver for i.MX platform,
it can support widely cpu dai interface and codec dai interface.
Jaska Uimonen [Wed, 19 May 2021 10:07:13 +0000 (13:07 +0300)]
ASoC: topology: Fix using uninitialized pointer
The original patch changed kcontrol_type to a pointer. In some goto
cases the pointer is assigned into a struct member as uninitialized and
this will cause a runtime error with UBSan even if it isn't a real bug.
So initialize the pointer to NULL.
Reported-by: Dan Carpenter <dan.carpenter@oracle.com> Fixes: d29d41e28eea ("ASoC: topology: Add support for multiple kcontrol types to a widget") Signed-off-by: Jaska Uimonen <jaska.uimonen@linux.intel.com> Reviewed-by: Kai Vehmanen <kai.vehmanen@linux.intel.com> Link: https://lore.kernel.org/r/20210519100713.879958-1-jaska.uimonen@linux.intel.com Signed-off-by: Mark Brown <broonie@kernel.org>
Dan Carpenter [Thu, 20 May 2021 05:08:24 +0000 (08:08 +0300)]
ASoC: cs35l33: fix an error code in probe()
This error path returns zero (success) but it should return -EINVAL.
Fixes: 3333cb7187b9 ("ASoC: cs35l33: Initial commit of the cs35l33 CODEC driver.") Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Reviewed-by: Charles Keepax <ckeepax@opensource.cirrus.com> Link: https://lore.kernel.org/r/YKXuyGEzhPT35R3G@mwanda Signed-off-by: Mark Brown <broonie@kernel.org>
Mark Brown [Wed, 19 May 2021 16:00:39 +0000 (17:00 +0100)]
Merge series "ASoC: meson: g12a-toacodec: add support for SM1" from Neil Armstrong <narmstrong@baylibre.com>:
This patchset adds Amlogic SM1 support on the TOACODEC driver, first by switching
to regmap fields for some bit fields to avoid code duplication, and then by adding
the corresponding bits & struct for the SM1 changed bits.
Changes since v2 at [2]:
- use raw values instead of defines in REG_FIELD() for g12a_toacodec_match_data
Neil Armstrong [Tue, 11 May 2021 07:48:28 +0000 (09:48 +0200)]
ASoC: meson: g12a-toacodec: use regmap fields to prepare SM1 support
Switch usage to regmap field for bits handled by the g12a_toacodec_mux_put_enum()
function to avoid uselesss code duplication when adding SM1 variant support.
BE hw_params op was recently added for SSP type DAIs.
But sending the DAI_CONFIG IPC during hw_params
is not supported with older firmware. So add an ABI check
to avoid sending the IPC if the firmware ABI is older than
3.18.
Fixes: e12be9fbfb91 ('ASoC: SOF: Intel: HDA: add hw params callback for SSP DAIs') Tested-by: Yong Zhi <yong.zhi@intel.com> Reviewed-by: Kai Vehmanen <kai.vehmanen@linux.intel.com> Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com> Link: https://lore.kernel.org/r/20210518174121.151601-1-ranjani.sridharan@linux.intel.com Signed-off-by: Mark Brown <broonie@kernel.org>
Jaska Uimonen [Fri, 7 May 2021 07:02:46 +0000 (10:02 +0300)]
ASoC: topology: Add support for multiple kcontrol types to a widget
Current dapm widget has a single variable to describe its kcontrol's
type. As there can be many kcontrols in one widget it is inherently
presumed that the types are the same.
Lately there has been use cases where different types of kcontrols would
be needed for a single widget. Thus add pointer to dapm widget to hold
an array for different kcontrol types and modify the kcontrol creation
to operate in a loop based on individual kcontrol type.
Change control creation and deletion to use individual kcontrol types in
SOF driver. This is done in the same patch for not breaking bisect. SOF
driver is also currently the only one using the dapm widget
kcontrol_type.
Signed-off-by: Jaska Uimonen <jaska.uimonen@linux.intel.com> Reviewed-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com> Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com> Link: https://lore.kernel.org/r/20210507070246.404446-1-jaska.uimonen@linux.intel.com Signed-off-by: Mark Brown <broonie@kernel.org>
This patch adds missing MODULE_DEVICE_TABLE definition which generates
correct modalias for automatic loading of this driver when it is built
as an external module.
Mark Brown [Wed, 12 May 2021 15:22:59 +0000 (16:22 +0100)]
Merge series "ASoC: SOF/Intel: fix and remove Sparse warnings" from Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>:
We updated our SOF CI settings last week (see below) to use more options
for Sparse, and sure enough it detected one nasty single-character bug
in one of my previous patches, along with more trivial issues with
string/integer sizes and signed/unsigned confusions.
export ARCH=x86_64
export CF="-Wsparse-error -Wsparse-all -Wno-bitwise-pointer -Wno-pointer-arith -Wno-typesign -Wnoshadow"
make -k sound/soc/sof/ C=2
make -k sound/soc/intel/common/ C=2
make -k sound/soc/intel/boards/ C=2
make -k drivers/soundwire/ C=2
Vitaly Rodionov [Tue, 11 May 2021 14:52:20 +0000 (15:52 +0100)]
ASoC: cs42l42: make HSBIAS_SENSE_EN optional
HSBIAS_SENSE_EN configures HSBIAS output current sense through
the external 2.21-k resistor. HSBIAS_SENSE is hardware feature to reduce
the potential pop noise during the headset plug out slowly. But on some
platforms ESD voltage will affect it causing test to fail, especially
with CTIA headset type. For different hardware setups, a designer might
want to tweak default behavior.
The warnings that commit 5f1b95d08de7 ("ASoC: q6dsp: q6afe: remove
unneeded dead-store initialization") was trying to fix were already
fixed in commit 12900bacb4f3 ("ASoC: qcom: q6afe: remove useless
assignments"). With both commits in the tree, port_id is uninitialized,
as pointed out by clang:
sound/soc/qcom/qdsp6/q6afe.c:1213:18: warning: variable 'port_id' is
uninitialized when used here [-Wuninitialized]
stop->port_id = port_id;
^~~~~~~
sound/soc/qcom/qdsp6/q6afe.c:1186:13: note: initialize the variable
'port_id' to silence this warning
int port_id;
^
= 0
1 warning generated.
Bring back the initialization so that everything works as intended.
Fixes: 5f1b95d08de7 ("ASoC: q6dsp: q6afe: remove unneeded dead-store initialization") Reported-by: kernel test robot <lkp@intel.com> Signed-off-by: Nathan Chancellor <nathan@kernel.org> Link: https://lore.kernel.org/r/20210511190306.2418917-1-nathan@kernel.org Signed-off-by: Mark Brown <broonie@kernel.org>
ASoC: SOF: Intel: hda: fix index used in inner loop
With more warnings than the default, Sparse throws the following
warning:
sound/soc/sof/intel/hda.c:1127:49: error: self-comparison always
evaluates to true
sound/soc/sof/intel/hda.c:1128:49: error: self-comparison always
evaluates to true
sound/soc/sof/intel/hda.c:1129:48: error: self-comparison always
evaluates to true
This looks like an obvious error, with a likely copy-pasted line
leading to the use of the wrong index in an inner loop. One of the
worst single-character bugs in a long time.
This problem was not detected in our tests since in practice SoundWire
platforms only have identical devices per link and the index mistake
did not change the results.
Fixes: 6f5d506d7ff1dq ('ASoC: SOF: Intel: SoundWire: refine ACPI match') Reviewed-by: Paul Olaru <paul.olaru@oss.nxp.com> Reviewed-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com> Reviewed-by: Rander Wang <rander.wang@intel.com> Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Link: https://lore.kernel.org/r/20210511213707.32958-2-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown <broonie@kernel.org>
This device requires single register transactions, this will
definely cause problems with the new device ID parsing which uses
regmap_bulk_read but might also show up in the cache sync sometimes.
Add the missing flags to the regmap_config.
This device requires single register transactions, this will
definely cause problems with the new device ID parsing which uses
regmap_bulk_read but might also show up in the cache sync sometimes.
Add the missing flags to the regmap_config.
This device requires single register transactions, this will
definely cause problems with the new device ID parsing which uses
regmap_bulk_read but might also show up in the cache sync sometimes.
Add the missing flags to the regmap_config.
This device requires single register transactions, this will
definely cause problems with the new device ID parsing which
uses regmap_bulk_read but might also show up in the cache sync
sometimes. Add the missing flags to the regmap_config.
Zou Wei [Wed, 12 May 2021 03:12:25 +0000 (11:12 +0800)]
ASoC: sti-sas: add missing MODULE_DEVICE_TABLE
This patch adds missing MODULE_DEVICE_TABLE definition which generates
correct modalias for automatic loading of this driver when it is built
as an external module.
Main issue I'm understanding is name create timing.
We want to create dailink->name via dlc->dai_name.
But in CPU case, this dai_name might be removed by asoc_simple_canonicalize_cpu()
if it CPU was single DAI.
Thus, we need to
A) get dlc->dai_name
B) create dailink->name via dlc->dai_name
C) call asoc_simple_canonicalize_cpu()
Above reverted patch did A->C->B.
My previous v1 patch did B->A->C.
I'm so sorry that I didn't deep test on v1.
I hope v2 patches has no issues on kontron-sl28-var3-ads2.
cs42l42 does not support standard burst transfers so the use_single_read
and use_single_write flags must be set in the regmap config.
Because of this bug, the patch:
commit 0a0eb567e1d4 ("ASoC: cs42l42: Minor error paths fixups")
broke cs42l42 probe() because without the use_single_* flags it causes
regmap to issue a burst read.
However, the missing use_single_* could cause problems anyway because the
regmap cache can attempt burst transfers if these flags are not set.
Fixes: 2c394ca79604 ("ASoC: Add support for CS42L42 codec") Signed-off-by: Richard Fitzgerald <rf@opensource.cirrus.com> Acked-by: Charles Keepax <ckeepax@opensource.cirrus.com> Link: https://lore.kernel.org/r/20210511132855.27159-1-rf@opensource.cirrus.com Signed-off-by: Mark Brown <broonie@kernel.org>
audio-graph is using cpus->dai_name / codecs->dai_name for
dailink->name.
In graph_parse_node(), xxx->dai_name is got by
snd_soc_get_dai_name(), but it might be removed soon by
asoc_simple_canonicalize_cpu().
The order should be
*1) call snd_soc_get_dai_name()
2) create dailink name
*3) call asoc_simple_canonicalize_cpu()
* are implemented in graph_parse_node().
This patch remove 3) from graph_parse_node()
Reported-by: "kernelci.org bot" <bot@kernelci.org> Fixes: 8859f809c7d5813 ("ASoC: audio-graph: add graph_parse_node()") Fixes: e51237b8d305225 ("ASoC: audio-graph: add graph_link_init()") Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Tested-by: Michael Walle <michael@walle.cc> Link: https://lore.kernel.org/r/87cztyawzr.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Mark Brown <broonie@kernel.org>
Hans de Goede [Sat, 8 May 2021 15:01:46 +0000 (17:01 +0200)]
ASoC: Intel: bytcr_rt5640: Add quirk for the Lenovo Miix 3-830 tablet
The Lenovo Miix 3-830 tablet has only 1 speaker, has an internal analog
mic on IN1 and uses JD2 for jack-detect, add a quirk to automatically
apply these settings on Lenovo Miix 3-830 tablets.
Hans de Goede [Sat, 8 May 2021 15:01:45 +0000 (17:01 +0200)]
ASoC: Intel: bytcr_rt5640: Add quirk for the Glavey TM800A550L tablet
Add a quirk for the Glavey TM800A550L tablet, this BYTCR tablet has no CHAN
package in its ACPI tables and uses SSP0-AIF1 rather then SSP0-AIF2 which
is the default for BYTCR devices.
Mark Brown [Tue, 11 May 2021 08:06:03 +0000 (09:06 +0100)]
Merge series "PinePhone BT audio bringup" from Samuel Holland <samuel@sholland.org>:
This series uses the additional DAIs added to the sun8i-codec driver to
add hardware routing for BT SCO (headset) audio on the PinePhone.
The BT audio connection is represented by the "dummy" bt-sco codec. The
connection to the Quectel EG-25G modem via AIF2 works as well, but I do
not include it here because there is no appropriate codec driver in
tree. We have been using an out-of-tree "dummy" codec driver for the
modem similar to bt-sco, and I'm not sure if such a driver would be
desired upstream.
Changes from v2:
- Also accept #sound-dai-cells in the binding. Since dt-core.yaml
already sets the type of this property, it is not possible to use
oneOf, nor make a specific value deprecated.
Changes from v1:
- Fixed DT binding example to follow new binding
Arnaud Ferraris (1):
arm64: dts: allwinner: pinephone: Set audio card name
Samuel Holland (6):
ASoC: dt-bindings: sun8i-codec: Increase #sound-dai-cells
ARM: dts: sun8i-a33: Allow using multiple codec DAIs
arm64: dts: allwinner: a64: Allow using multiple codec DAIs
arm64: dts: allwinner: a64: Add pinmux nodes for AIF2/AIF3
arm64: dts: allwinner: a64: Allow multiple DAI links
arm64: dts: allwinner: pinephone: Add support for Bluetooth audio
Mark Brown [Tue, 11 May 2021 08:06:01 +0000 (09:06 +0100)]
Merge series "Tidy up device ID reading on legacy Cirrus parts" from Charles Keepax <ckeepax@opensource.cirrus.com>:
Pierre requested I have a look at some cppcheck warnings in the cs42l42
driver, since it is reassigning the ret variable without ever checking
the result. Looking a bit more broadly this happens in quite a few
legacy Cirrus parts, as they all use the same process to read the ID,
factor out a small helper so they can all share the same code. Whilst
in there fix up a couple of other trivial error path issues as well.
Thanks,
Charles
Charles Keepax (10):
ASoC: cirrus: Add helper function for reading the device ID
ASoC: cs35l32: Minor error paths fixups
ASoC: cs35l33: Minor error paths fixups
ASoC: cs35l34: Minor error paths fixups
ASoC: cs35l35: Minor error paths fixups
ASoC: cs35l35: Correct errata handling
ASoC: cs42l42: Minor error paths fixups
ASoC: cs42l73: Minor error paths fixups
ASoC: cs43130: Minor error paths fixups
ASoC: cs53l30: Minor error paths fixups