Commit graph

1013588 commits

Author SHA1 Message Date
Kuninori Morimoto
ab62e8a8bc
ASoC: rsnd: attach SSIU when SSI was DMA mode
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>
2021-05-27 11:15:27 +01:00
Kuninori Morimoto
6da8f00e7a
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>
2021-05-27 11:15:26 +01:00
Kuninori Morimoto
965386c976
ASoC: rsnd: call unregister for null_hw when removed
commit d6956a7dde ("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.

Fixes: d6956a7dde ("ASoC: rsnd: add null CLOCKIN support")
Link: https://lore.kernel.org/r/87tumsoe2p.wl-kuninori.morimoto.gx@renesas.com
Reported-by: Geert Uytterhoeven <geert@linux-m68k.org>
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Message-Id: <877djknbl5.wl-kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-05-27 11:15:26 +01:00
YueHaibing
058efb4064
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>
2021-05-26 12:07:16 +01:00
David Rhodes
4e7f0ea0e2
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>
2021-05-26 12:07:16 +01:00
YueHaibing
6405941e68
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>
2021-05-26 12:07:15 +01:00
YueHaibing
d04260393e
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>
2021-05-26 12:07:14 +01:00
YueHaibing
3ef6253cd0
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>
2021-05-26 12:07:13 +01:00
Wei Yongjun
d5bd87e3a3
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: aa736700f4 ("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>
2021-05-25 16:45:07 +01:00
YueHaibing
2eadc04d83
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>
2021-05-25 16:45:06 +01:00
Lucas Tanure
0e91438ff7
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>
2021-05-25 16:45:05 +01:00
Lucas Tanure
4b38da6ffd
ASoC: cs42l42: Add support for 2400000 Bit clock
Add support for 2.4MHz clock source

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>
2021-05-25 16:45:05 +01:00
Lucas Tanure
f5b49d9851
ASoC: cs42l42: Add support for 2304000 Bit clock
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>
2021-05-25 16:45:04 +01:00
Lucas Tanure
1c52825c38
ASoC: cs42l42: Fix 1536000 Bit Clock instability
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>
2021-05-25 16:45:03 +01:00
Mark Brown
d4e9889b02
Merge branch 'for-5.13' of https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound into asoc-5.14 2021-05-25 16:44:26 +01:00
Mark Brown
eb37ca9c98
Merge series "ASoC: rsnd: add D3 support" from Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>:
Hi Mark, Rob

These adds R-Car D3 support for rsnd driver.
[1/3] is tidyup patch for dt-bindings (not only for D3).
[2/3], [3/3] are for R-Car D3.

Kuninori Morimoto (3):
  ASoC: dt-bindings: renesas: rsnd: tidyup properties
  ASoC: rsnd: tidyup loop on rsnd_adg_clk_query()
  ASoC: rsnd: add null CLOCKIN support

 .../bindings/sound/renesas,rsnd.yaml          | 10 ++++-
 sound/soc/sh/rcar/adg.c                       | 37 ++++++++++++++++---
 2 files changed, 41 insertions(+), 6 deletions(-)

--
2.25.1
2021-05-24 12:54:49 +01:00
Stephan Gerhold
af00978a0a
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.

[1]: https://product.goodix.com/en/docview/TFA9897%20SDS_Rev.3.1?objectId=47&objectType=document&version=78
[2]: https://source.codeaurora.org/external/mas/tfa98xx
[3]: 57b5050e34/sound/soc/codecs/tfa98xx.c (L1422-L1462)

Signed-off-by: Stephan Gerhold <stephan@gerhold.net>
Link: https://lore.kernel.org/r/20210513104129.36583-2-stephan@gerhold.net
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-05-24 09:51:32 +01:00
Stephan Gerhold
17ba36b704
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.

Signed-off-by: Stephan Gerhold <stephan@gerhold.net>
Reviewed-by: Rob Herring <robh@kernel.org>
Link: https://lore.kernel.org/r/20210513104129.36583-1-stephan@gerhold.net
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-05-24 09:51:31 +01:00
Kuninori Morimoto
d6956a7dde
ASoC: rsnd: add null CLOCKIN support
Some Renesas SoC doesn't have full CLOCKIN.
This patch add null_clk, and accepts it.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/87tumsoe2p.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-05-24 09:51:26 +01:00
Kuninori Morimoto
cf9d5c6619
ASoC: rsnd: tidyup loop on rsnd_adg_clk_query()
commit 06e8f5c842 ("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.

Fixes: 06e8f5c842 ("ASoC: rsnd: don't call clk_get_rate() under atomic context")
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/87v978oe2u.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-05-24 09:51:25 +01:00
Kuninori Morimoto
17c2d247dd
ASoC: dt-bindings: renesas: rsnd: tidyup properties
1) resets/reset-names needs minItems
2) It can use ports, not only port
3) It is not using audio-graph properties

Without this patch, we will get warnings

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/87wnrooe2z.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-05-24 09:51:25 +01:00
Kefeng Wang
41daf6ba59
ASoC: core: Fix Null-point-dereference in fmt_single_name()
Check the return value of devm_kstrdup() in case of
Null-point-dereference.

Fixes: 45dd9943fc ("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>
2021-05-24 09:49:28 +01:00
Vamshi Krishna Gopal
03effde3a2
ASoC: Intel: sof_sdw: add quirk support for Brya and BT-offload
Brya is another ADL-P product.

AlderLake has support for Bluetooth audio offload capability.
Enable the BT-offload quirk for ADL-P Brya and the Intel RVP.

Signed-off-by: Vamshi Krishna Gopal <vamshi.krishna.gopal@intel.com>
Signed-off-by: Yong Zhi <yong.zhi@intel.com>
Reviewed-by: Bard Liao <bard.liao@intel.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Link: https://lore.kernel.org/r/20210521155632.3736393-2-kai.vehmanen@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-05-21 18:40:45 +01:00
Vamshi Krishna Gopal
c0fbe9fd31
ASoC: Intel: common: Add entries for sdw codecs in ADL match table
RT5682 and Max98373 are added with SDW0,SDW2 links respectively.

Signed-off-by: Vamshi Krishna Gopal <vamshi.krishna.gopal@intel.com>
Reviewed-by: Bard Liao <bard.liao@intel.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Link: https://lore.kernel.org/r/20210521155632.3736393-1-kai.vehmanen@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-05-21 18:40:44 +01:00
Peter Ujfalusi
9d5536e0e1
ASoC: SOF: Intel: hda: Remove conditions against CONFIG_PCI
The HDA support can only be compiled when SND_SOC_SOF_PCI is enabled which
depends on CONFIG_PCI.

This makes the IS_ENABLED(CONFIG_PCI) checks redundant in the code, they
will resolve to true all the time.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.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-8-kai.vehmanen@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-05-21 13:13:41 +01:00
Pierre-Louis Bossart
4f50f16e94
ASoC: SOF: ops: don't return void value
Sparse throws the following warning:

sound/soc/sof/ops.h:247:17: error: returning void-valued expression

Remove the useless returns.

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
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: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Link: https://lore.kernel.org/r/20210521092804.3721324-7-kai.vehmanen@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-05-21 13:13:40 +01:00
Jaska Uimonen
ccaea61a8d
ASoC: SOF: topology: fix assignment to use le32_to_cpu
Fix sparse warning by using le32_to_cpu.

Signed-off-by: Jaska Uimonen <jaska.uimonen@linux.intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Link: https://lore.kernel.org/r/20210521092804.3721324-6-kai.vehmanen@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-05-21 13:13:39 +01:00
Peter Ujfalusi
c03459415c
ASoC: SOF: loader: Use snd_sof_dsp_block_read() instead sof_block_read()
SOF core should use the IO functions via callbacks and not directly to
ensure that it remains platform independent.

Fixes: 83ee7ab162 ("ASoC: SOF: Intel: byt: Refactor fw ready / mem windows creation")
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
Reviewed-by: Daniel Baluta <daniel.baluta@gmail.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.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-5-kai.vehmanen@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-05-21 13:13:38 +01:00
Keyon Jie
3b2e93ed12
ASoC: SOF: ops: print out the polling register
Print the register offset out to provide more useful information for the
register polling debugging.

Signed-off-by: Keyon Jie <yang.jie@linux.intel.com>
Reviewed-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.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-4-kai.vehmanen@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-05-21 13:13:37 +01:00
Peter Ujfalusi
e5eaa4e66f
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>
2021-05-21 13:13:36 +01:00
Peter Ujfalusi
fd979ec12e
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>
2021-05-21 13:13:35 +01:00
Stephen Boyd
af2702549d
ASoC: qcom: lpass-cpu: Use optional clk APIs
This driver spits out a warning for me at boot:

 sc7180-lpass-cpu 62f00000.lpass: asoc_qcom_lpass_cpu_platform_probe() error getting optional null: -2

but it looks like it is all an optional clk. Use the optional clk APIs
here so that we don't see this message and everything else is the same.

Cc: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Cc: Banajit Goswami <bgoswami@codeaurora.org>
Fixes: 3e53ac8230 ("ASoC: qcom: make osr clock optional")
Signed-off-by: Stephen Boyd <swboyd@chromium.org>
Reviewed-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Link: https://lore.kernel.org/r/20210520014807.3749797-1-swboyd@chromium.org
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-05-21 13:12:29 +01:00
Shengjiu Wang
aa736700f4
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>
2021-05-20 17:57:30 +01:00
Shengjiu Wang
623cd9cfca
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.

Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com>
Reviewed-by: Rob Herring <robh@kernel.org>
Link: https://lore.kernel.org/r/1621247488-21412-1-git-send-email-shengjiu.wang@nxp.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-05-20 17:57:29 +01:00
Jaska Uimonen
b9c035aa43
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: d29d41e28e ("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>
2021-05-20 17:57:28 +01:00
Dan Carpenter
833bc4cf97
ASoC: cs35l33: fix an error code in probe()
This error path returns zero (success) but it should return -EINVAL.

Fixes: 3333cb7187 ("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>
2021-05-20 17:57:21 +01:00
Mark Brown
60339074c4
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

Changes since v1 at [1]:
- switch to regmap field

[1] https://lore.kernel.org/r/20210429170147.3615883-1-narmstrong@baylibre.com
[2] https://lore.kernel.org/r/20210505072607.3815442-1-narmstrong@baylibre.com

Neil Armstrong (2):
  ASoC: meson: g12a-toacodec: use regmap fields to prepare SM1 support
  ASoC: meson: g12a-toacodec: add support for SM1 TOACODEC

 sound/soc/meson/g12a-toacodec.c | 143 +++++++++++++++++++++++++++-----
 1 file changed, 124 insertions(+), 19 deletions(-)

--
2.25.1
2021-05-19 17:00:39 +01:00
Gyeongtaek Lee
8b4ba1d317
ASoC: soc-dai: fix up hw params only if it is needed
If fixed hw params won't be used, fixing up isn't needed also.

Signed-off-by: Gyeongtaek Lee <gt82.lee@samsung.com>
Link: https://lore.kernel.org/r/000401d748bc$fa466d50$eed347f0$@samsung.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-05-19 14:19:08 +01:00
Rafał Miłecki
11480dbfe1
ASoC: wm8750: convert to the json-schema
This helps validating DTS files.

Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
Reviewed-by: Rob Herring <robh@kernel.org>
Link: https://lore.kernel.org/r/20210512205926.780-1-zajec5@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-05-19 14:19:07 +01:00
Neil Armstrong
7487238c5f
ASoC: meson: g12a-toacodec: add support for SM1 TOACODEC
This adds support for the TOACODEC found in Amlogic SM1 SoCs.

The bits are shifted for more selection of clock sources, so this only
maps the same support for G12A to the SM1 bits.

Signed-off-by: Neil Armstrong <narmstrong@baylibre.com>
Link: https://lore.kernel.org/r/20210511074829.4110036-3-narmstrong@baylibre.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-05-19 14:19:05 +01:00
Neil Armstrong
172dd9216d
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.

Signed-off-by: Neil Armstrong <narmstrong@baylibre.com>
Link: https://lore.kernel.org/r/20210511074829.4110036-2-narmstrong@baylibre.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-05-19 14:19:04 +01:00
Ranjani Sridharan
8c08652614
ASoC: SOF: Intel: hda: don't send DAI_CONFIG IPC for older firmware
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: e12be9fbfb ('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>
2021-05-19 14:18:00 +01:00
Yang Yingliang
375904e393
ASoC: hisilicon: fix missing clk_disable_unprepare() on error in hi6210_i2s_startup()
After calling clk_prepare_enable(), clk_disable_unprepare() need
be called when calling clk_set_rate() failed.

Fixes: 0bf750f4cb ("ASoC: hisilicon: Add hi6210 i2s audio driver")
Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: Yang Yingliang <yangyingliang@huawei.com>
Link: https://lore.kernel.org/r/20210518044514.607010-1-yangyingliang@huawei.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-05-18 14:04:32 +01:00
YueHaibing
5a3f869c5b
ASoC: soc-core: 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>
Link: https://lore.kernel.org/r/20210514081100.16196-1-yuehaibing@huawei.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-05-18 14:04:31 +01:00
Yang Yingliang
d14eece945
ASoC: rk3328: fix missing clk_disable_unprepare() on error in rk3328_platform_probe()
Fix the missing clk_disable_unprepare() before return
from rk3328_platform_probe() in the error handling case.

Fixes: c32759035a ("ASoC: rockchip: support ACODEC for rk3328")
Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: Yang Yingliang <yangyingliang@huawei.com>
Link: https://lore.kernel.org/r/20210518075847.1116983-1-yangyingliang@huawei.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-05-18 14:04:30 +01:00
Arnd Bergmann
cdf112d4c6
ASoC: fsl: fix SND_SOC_IMX_RPMSG dependency
Kconfig produces a warning with SND_SOC_FSL_RPMSG=y and SND_IMX_SOC=m:

WARNING: unmet direct dependencies detected for SND_SOC_IMX_RPMSG
  Depends on [m]: SOUND [=y] && !UML && SND [=y] && SND_SOC [=y] && SND_IMX_SOC [=m] && RPMSG [=y]
  Selected by [y]:
  - SND_SOC_FSL_RPMSG [=y] && SOUND [=y] && !UML && SND [=y] && SND_SOC [=y] && COMMON_CLK [=y] && RPMSG [=y] && SND_IMX_SOC [=m]!=n

Add a dependency to prevent this configuration.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Acked-by: Shengjiu Wang <shengjiu.wang@gmail.com>
Link: https://lore.kernel.org/r/20210514213118.630427-1-arnd@kernel.org
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-05-18 14:01:53 +01:00
Jaska Uimonen
d29d41e28e
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>
2021-05-14 16:31:15 +01:00
Zou Wei
a75e5cdf4d
ASoC: intel/boards: 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.

Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: Zou Wei <zou_wei@huawei.com>
Link: https://lore.kernel.org/r/1620791647-16024-1-git-send-email-zou_wei@huawei.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-05-14 13:25:01 +01:00
Mark Brown
98c69fcc9f
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

Pierre-Louis Bossart (9):
  ASoC: SOF: Intel: hda: fix index used in inner loop
  ASoC: Intel: sof_rt5682: shrink platform_id names below 20 characters
  ASoC: Intel: sof_cs42l42: shrink platform id below 20 characters
  ASoC: Intel: bxt_da7219_max98357a: shrink platform_id below 20
    characters
  ASoC: Intel: glk_rt5682_max98357a: shrink platform_id below 20
    characters
  ASoC: Intel: kbl_da7219_max98357a: shrink platform_id below 20
    characters
  ASoC: Intel: sof_da7219_max98373: shrink platform_id below 20
    characters
  ASoC: Intel: sof_sdw: fix signed/unsigned warning
  ASoC: Intel: soc-acpi: add ull suffix for SoundWire _ADR values

 sound/soc/intel/boards/bxt_da7219_max98357a.c | 12 +++---
 sound/soc/intel/boards/glk_rt5682_max98357a.c |  4 +-
 sound/soc/intel/boards/kbl_da7219_max98357a.c |  4 +-
 sound/soc/intel/boards/sof_cs42l42.c          |  2 +-
 sound/soc/intel/boards/sof_da7219_max98373.c  |  8 ++--
 sound/soc/intel/boards/sof_rt5682.c           | 20 +++++-----
 sound/soc/intel/boards/sof_sdw.c              |  2 +-
 .../intel/common/soc-acpi-intel-adl-match.c   | 28 +++++++-------
 .../intel/common/soc-acpi-intel-bxt-match.c   |  2 +-
 .../intel/common/soc-acpi-intel-cml-match.c   | 22 +++++------
 .../intel/common/soc-acpi-intel-cnl-match.c   |  2 +-
 .../intel/common/soc-acpi-intel-glk-match.c   |  6 +--
 .../intel/common/soc-acpi-intel-icl-match.c   | 12 +++---
 .../intel/common/soc-acpi-intel-jsl-match.c   |  6 +--
 .../intel/common/soc-acpi-intel-kbl-match.c   |  2 +-
 .../intel/common/soc-acpi-intel-tgl-match.c   | 38 +++++++++----------
 sound/soc/sof/intel/hda.c                     |  2 +-
 17 files changed, 86 insertions(+), 86 deletions(-)

--
2.25.1
2021-05-12 16:22:59 +01:00
Vitaly Rodionov
c9f2e3c3dd
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.

Signed-off-by: Vitaly Rodionov <vitalyr@opensource.cirrus.com>
Link: https://lore.kernel.org/r/20210511145220.125760-1-vitalyr@opensource.cirrus.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2021-05-12 13:02:53 +01:00