summaryrefslogtreecommitdiff
path: root/sound/soc/fsl/fsl-asoc-card.c
AgeCommit message (Collapse)AuthorFilesLines
4 daysASoC: fsl-asoc-card: Dynamically allocate memory for snd_soc_dai_link_componentsShengjiu Wang1-17/+29
The static snd_soc_dai_link_components cause conflict for multiple instances of this generic driver. For example, when there is wm8962 and SPDIF case enabled together, the contaminated snd_soc_dai_link_components will cause another device probe fail. Fixes: 6d174cc4f224 ("ASoC: fsl-asoc-card: merge spdif support from imx-spdif.c") Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com> Link: https://patch.msgid.link/1721877773-5229-1-git-send-email-shengjiu.wang@nxp.com Signed-off-by: Mark Brown <broonie@kernel.org>
2024-07-08ASoC: fsl-asoc-card: merge spdif support from imx-spdif.cElinor Montmasson1-2/+83
The imx-spdif machine driver creates audio card to directly use an S/PDIF device. However, it doesn't support interacting with an ASRC. fsl-asoc-card already has the support to create audio card which can use the ASRC. Merge the S/PDIF support from imx-spdif into driver fsl-asoc-card to extend the support of S/PDIF audio card with the use of ASRC devices. fsl-asoc-card uses slightly different DT properties than imx-spdif: * the "spdif-controller" property from imx-spdif is named "audio-cpu" in fsl-asoc-card. * fsl-asoc-card uses codecs explicitly declared in DT with "audio-codec". With an SPDIF, codec drivers spdif_transmitter and spdif_receiver should be used. Driver imx-spdif used instead the dummy codec and a pair of boolean properties, "spdif-in" and "spdif-out". To keep backward compatibility, support for "spdif-controller", "spdif-in" and "spdif-out" is also added to fsl-asoc-card. However, it is recommended to use the new properties if possible. It is better to declare transmitter and/or receiver in DT than using the dummy codec. DTs using compatible "fsl,imx-audio-spdif" are still compatible, and fsl-asoc-card will behave the same as imx-spdif for these DTs. Signed-off-by: Elinor Montmasson <elinor.montmasson@savoirfairelinux.com> Link: https://patch.msgid.link/20240627083104.123357-5-elinor.montmasson@savoirfairelinux.com Signed-off-by: Mark Brown <broonie@kernel.org>
2024-07-08ASoC: fsl-asoc-card: add compatibility to use 2 codecs in dai-linksElinor Montmasson1-118/+161
Adapt the driver to work with configurations using two codecs or more. Modify fsl_asoc_card_probe() to handle use cases where 2 codecs are given in the device tree. This will be needed to add support for the SPDIF. Use cases using one codec will ignore any given codecs other than the first. Co-developed-by: Philip-Dylan Gleonec <philip-dylan.gleonec@savoirfairelinux.com> Signed-off-by: Philip-Dylan Gleonec <philip-dylan.gleonec@savoirfairelinux.com> Signed-off-by: Elinor Montmasson <elinor.montmasson@savoirfairelinux.com> Link: https://patch.msgid.link/20240627083104.123357-4-elinor.montmasson@savoirfairelinux.com Signed-off-by: Mark Brown <broonie@kernel.org>
2024-07-08ASoC: fsl-asoc-card: add second dai link component for codecsElinor Montmasson1-2/+4
Add a second dai link component for codecs that will be used for use cases with 2 codecs. It is needed for future integration of the SPDIF support, which will use spdif_receiver and spdif_transmitter drivers. To prevent deferring in use cases using only one codec, also set by default the number of codecs to 1 for the relevant dai links. Co-developed-by: Philip-Dylan Gleonec <philip-dylan.gleonec@savoirfairelinux.com> Signed-off-by: Philip-Dylan Gleonec <philip-dylan.gleonec@savoirfairelinux.com> Signed-off-by: Elinor Montmasson <elinor.montmasson@savoirfairelinux.com> Link: https://patch.msgid.link/20240627083104.123357-3-elinor.montmasson@savoirfairelinux.com Signed-off-by: Mark Brown <broonie@kernel.org>
2024-07-08ASoC: fsl-asoc-card: add support for dai links with multiple codecsElinor Montmasson1-8/+11
Add support for dai links using multiple codecs for multi-codec use cases. Co-developed-by: Philip-Dylan Gleonec <philip-dylan.gleonec@savoirfairelinux.com> Signed-off-by: Philip-Dylan Gleonec <philip-dylan.gleonec@savoirfairelinux.com> Signed-off-by: Elinor Montmasson <elinor.montmasson@savoirfairelinux.com> Link: https://patch.msgid.link/20240627083104.123357-2-elinor.montmasson@savoirfairelinux.com Signed-off-by: Mark Brown <broonie@kernel.org>
2024-06-20ASoC: fsl-asoc-card: set priv->pdev before using itElinor Montmasson1-1/+2
priv->pdev pointer was set after being used in fsl_asoc_card_audmux_init(). Move this assignment at the start of the probe function, so sub-functions can correctly use pdev through priv. fsl_asoc_card_audmux_init() dereferences priv->pdev to get access to the dev struct, used with dev_err macros. As priv is zero-initialised, there would be a NULL pointer dereference. Note that if priv->dev is dereferenced before assignment but never used, for example if there is no error to be printed, the driver won't crash probably due to compiler optimisations. Fixes: 708b4351f08c ("ASoC: fsl: Add Freescale Generic ASoC Sound Card with ASRC support") Signed-off-by: Elinor Montmasson <elinor.montmasson@savoirfairelinux.com> Link: https://patch.msgid.link/20240620132511.4291-2-elinor.montmasson@savoirfairelinux.com Signed-off-by: Mark Brown <broonie@kernel.org>
2024-05-06ASoC: fsl: Use snd_soc_substream_to_rtd() for accessing private_dataKrzysztof Kozlowski1-1/+1
Do not open-code snd_soc_substream_to_rtd(). Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org> Link: https://lore.kernel.org/r/20240430-asoc-snd-substream-clean-v1-6-6f8a8902b479@linaro.org Signed-off-by: Mark Brown <broonie@kernel.org>
2024-04-16ASoC: fsl-asoc-card: add wm8904 codec supportShengjiu Wang1-0/+8
wm8904 codec is used on i.MX95 Toradex board Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com> Link: https://lore.kernel.org/r/1713165456-3494-2-git-send-email-shengjiu.wang@nxp.com Signed-off-by: Mark Brown <broonie@kernel.org>
2023-12-19ASoC: fsl: fsl-asoc-card: don't need DUMMY PlatformKuninori Morimoto1-2/+1
We can use SND_SOC_DAILINK_REG() with 2 parameter. DUMMY Platform is not needed. Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Link: https://msgid.link/r/877cla93ry.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Mark Brown <broonie@kernel.org>
2023-10-12ASoC: fsl-asoc-card: Add comment for mclk in the codec_privHui Wang1-0/+1
Otherwise a warning will be detected as below: warning: Function parameter or member 'mclk' not described in 'codec_priv' Fixes: 1075df4bdeb3 ("ASoC: fsl-asoc-card: add nau8822 support") Signed-off-by: Hui Wang <hui.wang@canonical.com> Link: https://lore.kernel.org/r/20231007040117.22446-1-hui.wang@canonical.com Signed-off-by: Mark Brown <broonie@kernel.org>
2023-09-26ASoC: Merge up fixesMark Brown1-4/+8
For the benefit of CI.
2023-09-26ASoC: fsl-asoc-card: use integer type for fll_id and pll_idShengjiu Wang1-4/+8
As the pll_id and pll_id can be zero (WM8960_SYSCLK_AUTO) with the commit 2bbc2df46e67 ("ASoC: wm8960: Make automatic the default clocking mode") Then the machine driver will skip to call set_sysclk() and set_pll() for codec, when the sysclk rate is different with what wm8960 read at probe, the output sound frequency is wrong. So change the fll_id and pll_id initial value, still keep machine driver's behavior same as before. Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com> Link: https://lore.kernel.org/r/1695202992-24864-1-git-send-email-shengjiu.wang@nxp.com Signed-off-by: Mark Brown <broonie@kernel.org>
2023-09-25ASoC: fsl: convert not to use asoc_xxx()Kuninori Morimoto1-14/+14
ASoC is now unified asoc_xxx() into snd_soc_xxx(). This patch convert asoc_xxx() to snd_soc_xxx(). Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Link: https://lore.kernel.org/r/874jk0s24t.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Mark Brown <broonie@kernel.org>
2023-06-21ASoC: fsl-asoc-card: Allow passing the number of slots in useFabio Estevam1-1/+7
Currently, fsl-asoc-card supports passing the width of the TDM slot, but not the number of slots in use, as it harcodes it as two slots. Add support for passing the number of slots in use. Signed-off-by: Fabio Estevam <festevam@denx.de> Link: https://lore.kernel.org/r/20230616203913.551183-1-festevam@gmail.com Signed-off-by: Mark Brown <broonie@kernel.org>
2023-06-17ASoC: fsl-asoc-card: add nau8822 supportHui Wang1-0/+14
This is for an imx6sx EVB which has a nau8822 codec connects to the SSI2 interface, so add the nau8822 support in this machine driver. Because the codec driver nau8822.c doesn't handle mclk enabling, here adding a codec_priv->mclk for nau8822 and similar codecs which need to enable the mclk in the machine driver, and enable the mclk in the card_late_probe() conditionally. Signed-off-by: Hui Wang <hui.wang@canonical.com> Link: https://lore.kernel.org/r/Message-Id: <20220616040046.103524-1-hui.wang@canonical.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2023-04-19ASoC: fsl: Simplify an error messageChristophe JAILLET1-1/+1
dev_err_probe() already display the error code. There is no need to duplicate it explicitly in the error message. Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr> Reviewed-by: Iuliana Prodan <iuliana.prodan@nxp.com> Acked-by: Shengjiu Wang <shengjiu.wang@gmail.com> Link: https://lore.kernel.org/r/c167c16a535049d56f817bbede9c9f6f0a0f4c68.1681626553.git.christophe.jaillet@wanadoo.fr Signed-off-by: Mark Brown <broonie@kernel.org>
2023-03-20ASoC: fsl: Specify driver name in ASoC cardAlexander Stein1-0/+1
Set the snd_soc_card driver name which fixes the warning: fsl-asoc-card sound: ASoC: driver name too long 'imx-audio-tlv320aic32x4' -> 'imx-audio-tlv32' Signed-off-by: Alexander Stein <alexander.stein@ew.tq-group.com> Acked-by: Shengjiu Wang <shengjiu.wang@gmail.com> Link: https://lore.kernel.org/r/20230316123611.3495597-2-alexander.stein@ew.tq-group.com Signed-off-by: Mark Brown <broonie@kernel.org>
2023-03-20ASoC: fsl: define a common DRIVER_NAMEAlexander Stein1-2/+4
Instead of copying the driver name manually, use a common define. No functional change. Signed-off-by: Alexander Stein <alexander.stein@ew.tq-group.com> Acked-by: Shengjiu Wang <shengjiu.wang@gmail.com> Link: https://lore.kernel.org/r/20230316123611.3495597-1-alexander.stein@ew.tq-group.com Signed-off-by: Mark Brown <broonie@kernel.org>
2023-02-24Merge tag 'mm-nonmm-stable-2023-02-20-15-29' of ↵Linus Torvalds1-1/+1
git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm Pull non-MM updates from Andrew Morton: "There is no particular theme here - mainly quick hits all over the tree. Most notable is a set of zlib changes from Mikhail Zaslonko which enhances and fixes zlib's use of S390 hardware support: 'lib/zlib: Set of s390 DFLTCC related patches for kernel zlib'" * tag 'mm-nonmm-stable-2023-02-20-15-29' of git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm: (55 commits) Update CREDITS file entry for Jesper Juhl sparc: allow PM configs for sparc32 COMPILE_TEST hung_task: print message when hung_task_warnings gets down to zero. arch/Kconfig: fix indentation scripts/tags.sh: fix the Kconfig tags generation when using latest ctags nilfs2: prevent WARNING in nilfs_dat_commit_end() lib/zlib: remove redundation assignement of avail_in dfltcc_gdht() lib/Kconfig.debug: do not enable DEBUG_PREEMPT by default lib/zlib: DFLTCC always switch to software inflate for Z_PACKET_FLUSH option lib/zlib: DFLTCC support inflate with small window lib/zlib: Split deflate and inflate states for DFLTCC lib/zlib: DFLTCC not writing header bits when avail_out == 0 lib/zlib: fix DFLTCC ignoring flush modes when avail_in == 0 lib/zlib: fix DFLTCC not flushing EOBS when creating raw streams lib/zlib: implement switching between DFLTCC and software lib/zlib: adjust offset calculation for dfltcc_state nilfs2: replace WARN_ONs for invalid DAT metadata block requests scripts/spelling.txt: add "exsits" pattern and fix typo instances fs: gracefully handle ->get_block not mapping bh in __mpage_writepage cramfs: Kconfig: fix spelling & punctuation ...
2023-02-03scripts/spelling.txt: add "exsits" pattern and fix typo instancesLuca Ceresoli1-1/+1
Fix typos and add the following to the scripts/spelling.txt: exsits||exists Link: https://lkml.kernel.org/r/20230126152205.959277-1-luca.ceresoli@bootlin.com Signed-off-by: Luca Ceresoli <luca.ceresoli@bootlin.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
2023-01-28ASoC: fsl-asoc-card: constify fsl_asoc_card_daiLuca Ceresoli1-1/+1
This is never modified and can be made const. Signed-off-by: Luca Ceresoli <luca.ceresoli@bootlin.com> Link: https://lore.kernel.org/r/20230126152412.959574-1-luca.ceresoli@bootlin.com Signed-off-by: Mark Brown <broonie@kernel.org>
2023-01-18ASoC: Merge up 6.2 fixesMark Brown1-4/+4
To resolve a conflict and support further development.
2023-01-10ASoC: fsl-asoc-card: Log error code when we fail to registerMark Brown1-1/+1
The chances are that any error we see here will be EPROBE_DEFER but let's actually tell the user so they know. Acked-by: Shengjiu Wang <shengjiu.wang@gmail.com> Signed-off-by: Mark Brown <broonie@kernel.org> Link: https://lore.kernel.org/r/20230106-asoc-fsl-err-log-v1-1-49d845c99434@kernel.org Signed-off-by: Mark Brown <broonie@kernel.org>
2023-01-10ASoC: fsl-asoc-card: Fix naming of AC'97 CODEC widgetsMark Brown1-2/+2
The fsl-asoc-card AC'97 support currently tries to route to Playback and Capture widgets provided by the AC'97 CODEC. This doesn't work since the generic AC'97 driver registers with an "AC97" at the front of the stream and hence widget names, update to reflect reality. It's not clear to me if or how this ever worked. Acked-by: Shengjiu Wang <shengjiu.wang@gmail.com> Signed-off-by: Mark Brown <broonie@kernel.org> Link: https://lore.kernel.org/r/20230106-asoc-udoo-probe-v1-2-a5d7469d4f67@kernel.org Signed-off-by: Mark Brown <broonie@kernel.org>
2023-01-10ASoC: fsl_ssi: Rename AC'97 streams to avoid collisions with AC'97 CODECMark Brown1-4/+4
The SSI driver calls the AC'97 playback and transmit streams "AC97 Playback" and "AC97 Capture" respectively. This is the same name used by the generic AC'97 CODEC driver in ASoC, creating confusion for the Freescale ASoC card when it attempts to use these widgets in routing. Add a "CPU" in the name like the regular DAIs registered by the driver to disambiguate. Acked-by: Shengjiu Wang <shengjiu.wang@gmail.com> Signed-off-by: Mark Brown <broonie@kernel.org> Link: https://lore.kernel.org/r/20230106-asoc-udoo-probe-v1-1-a5d7469d4f67@kernel.org Signed-off-by: Mark Brown <broonie@kernel.org>
2022-07-21ASoC: fsl-asoc-card: force cast the asrc_format typeShengjiu Wang1-2/+3
Fix sparse warning: sound/soc/fsl/fsl-asoc-card.c:833:45: sparse: warning: incorrect type in argument 3 (different base types) sound/soc/fsl/fsl-asoc-card.c:833:45: sparse: expected unsigned int [usertype] *out_value sound/soc/fsl/fsl-asoc-card.c:833:45: sparse: got restricted snd_pcm_format_t * Fixes: 859e364302c5 ("ASoC: fsl-asoc-card: Support new property fsl, asrc-format") Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com> Link: https://lore.kernel.org/r/1658399393-28777-4-git-send-email-shengjiu.wang@nxp.com Signed-off-by: Mark Brown <broonie@kernel.org>
2022-03-21ASoC: fsl-asoc-card: Fix jack_event() always return 0Meng Tang1-8/+4
Today, hp_jack_event and mic_jack_event always return 0. However, snd_soc_dapm_disable_pin and snd_soc_dapm_enable_pin may return a non-zero value, this will cause the user who calling hp_jack_event and mic_jack_event don't know whether the operation was really successfully. Signed-off-by: Meng Tang <tangmeng@uniontech.com> Acked-by: Shengjiu Wang <shengjiu.wang@gmail.com> Reviewed-by: Christophe Leroy <christophe.leroy@csgroup.eu> Link: https://lore.kernel.org/r/20220321065754.18307-1-tangmeng@uniontech.com Signed-off-by: Mark Brown <broonie@kernel.org>
2022-01-24ASoC: fsl-asoc-card: Remove BCLK default value for tlv320aic31xx cardAriel D'Alessandro1-1/+0
Now that fsl-asoc-card support setting mclk-id through the device-tree mclk-id property, let's remove the default BCLK configuration for this card. Signed-off-by: Ariel D'Alessandro <ariel.dalessandro@collabora.com> Link: https://lore.kernel.org/r/20220117132109.283365-6-ariel.dalessandro@collabora.com Signed-off-by: Mark Brown <broonie@kernel.org>
2022-01-24ASoC: fsl-asoc-card: Add optional dt property for setting mclk-idAriel D'Alessandro1-0/+6
Sound cards may allow using different main clock inputs. In the generic fsl-asoc-card driver, these values are hardcoded for each specific card configuration. Let's make it more flexible, allowing setting mclk-id from the device-tree node. Otherwise, the default value for each card configuration is used. Signed-off-by: Ariel D'Alessandro <ariel.dalessandro@collabora.com> Link: https://lore.kernel.org/r/20220117132109.283365-5-ariel.dalessandro@collabora.com Signed-off-by: Mark Brown <broonie@kernel.org>
2021-12-20ASoC: fsl: Use dev_err_probe() helperKuninori Morimoto1-2/+1
Use the dev_err_probe() helper, instead of open-coding the same operation. Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Link: https://lore.kernel.org/r/20211214020843.2225831-14-kuninori.morimoto.gx@renesas.com Signed-off-by: Mark Brown <broonie@kernel.org>
2021-11-22ASoC: fsl-asoc-card: Support fsl,imx-audio-tlv320aic31xx codecAriel D'Alessandro1-0/+12
Add entry for fsl,imx-audio-tlv320aic31xx audio codec. This codec is configured to use BCLK as clock input. Signed-off-by: Michael Trimarchi <michael@amarulasolutions.com> Signed-off-by: Ariel D'Alessandro <ariel.dalessandro@collabora.com> Link: https://lore.kernel.org/r/20211119153248.419802-6-ariel.dalessandro@collabora.com Signed-off-by: Mark Brown <broonie@kernel.org>
2021-09-22ASoC: fsl-asoc-card: Update to modern clocking terminologyMark Brown1-27/+27
As part of moving to remove the old style defines for the bus clocks update the fsl-asoc-card driver to use more modern terminology for clocking. Signed-off-by: Mark Brown <broonie@kernel.org> Reviewed-by: Fabio Estevam <festevam@gmail.com> Link: https://lore.kernel.org/r/20210921213542.31688-2-broonie@kernel.org Signed-off-by: Mark Brown <broonie@kernel.org>
2021-06-23Merge series "ASoC: tlv320aic32x4: Add support for TAS2505" from Claudius ↵Mark Brown1-0/+1
Heine <ch@denx.de>: Hi, this is v2 from my patchset that add support for the TAS2505 to the tlv320aic32x4 driver. kind regards, Claudius Changes from v1: - clarified commit message of first patch, which add the type value to the struct - removed unnecessary code to put and get speaker volume - removed 'Gain' from 'HP Driver Playback Volume' control - fixed rebase issues Claudius Heine (3): ASoC: tlv320aic32x4: add type to device private data struct ASoC: tlv320aic32x4: add support for TAS2505 ASoC: tlv320aic32x4: dt-bindings: add TAS2505 to compatible .../bindings/sound/tlv320aic32x4.txt | 1 + sound/soc/codecs/tlv320aic32x4-i2c.c | 22 ++- sound/soc/codecs/tlv320aic32x4-spi.c | 23 ++- sound/soc/codecs/tlv320aic32x4.c | 139 +++++++++++++++++- sound/soc/codecs/tlv320aic32x4.h | 10 ++ 5 files changed, 186 insertions(+), 9 deletions(-) base-commit: 70585216fe7730d9fb5453d3e2804e149d0fe201 -- 2.32.0
2021-06-22ASoC: fsl-asoc-card: change dev_err to dev_dbg for defer probeShengjiu Wang1-1/+1
Don't need to print error message for defer probe Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com> Reviewed-by: Fabio Estevam <festevam@gmail.com> Link: https://lore.kernel.org/r/1622616132-10391-1-git-send-email-shengjiu.wang@nxp.com Signed-off-by: Mark Brown <broonie@kernel.org>
2021-06-21ASoC: fsl: switch to use snd_soc_daifmt_parse_format/clock_provider()Kuninori Morimoto1-4/+3
This patch switch to use snd_soc_daifmt_parse_format/clock_provider() from snd_soc_of_parse_daifmt(). Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Link: https://lore.kernel.org/r/874ke1w9dc.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Mark Brown <broonie@kernel.org>
2021-06-01ASoC: fsl-asoc-card: Set .owner attribute when registering card.Nicolas Cavallari1-0/+1
Otherwise, when compiled as module, a WARN_ON is triggered: WARNING: CPU: 0 PID: 5 at sound/core/init.c:208 snd_card_new+0x310/0x39c [snd] [...] CPU: 0 PID: 5 Comm: kworker/0:0 Not tainted 5.10.39 #1 Hardware name: Freescale i.MX6 Quad/DualLite (Device Tree) Workqueue: events deferred_probe_work_func [<c0111988>] (unwind_backtrace) from [<c010c8ac>] (show_stack+0x10/0x14) [<c010c8ac>] (show_stack) from [<c092784c>] (dump_stack+0xdc/0x104) [<c092784c>] (dump_stack) from [<c0129710>] (__warn+0xd8/0x114) [<c0129710>] (__warn) from [<c0922a48>] (warn_slowpath_fmt+0x5c/0xc4) [<c0922a48>] (warn_slowpath_fmt) from [<bf0496f8>] (snd_card_new+0x310/0x39c [snd]) [<bf0496f8>] (snd_card_new [snd]) from [<bf1d7df8>] (snd_soc_bind_card+0x334/0x9c4 [snd_soc_core]) [<bf1d7df8>] (snd_soc_bind_card [snd_soc_core]) from [<bf1e9cd8>] (devm_snd_soc_register_card+0x30/0x6c [snd_soc_core]) [<bf1e9cd8>] (devm_snd_soc_register_card [snd_soc_core]) from [<bf22d964>] (fsl_asoc_card_probe+0x550/0xcc8 [snd_soc_fsl_asoc_card]) [<bf22d964>] (fsl_asoc_card_probe [snd_soc_fsl_asoc_card]) from [<c060c930>] (platform_drv_probe+0x48/0x98) [...] Signed-off-by: Nicolas Cavallari <nicolas.cavallari@green-communications.fr> Acked-by: Shengjiu Wang <shengjiu.wang@gmail.com> Link: https://lore.kernel.org/r/20210527163409.22049-1-nicolas.cavallari@green-communications.fr Signed-off-by: Mark Brown <broonie@kernel.org>
2021-03-25ASoC: fsl-asoc-card: Add support for WM8958 codecShengjiu Wang1-2/+15
WM8958 codec is used on some i.MX based platform. So add it support in this generic driver. Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com> Link: https://lore.kernel.org/r/1615986303-27959-1-git-send-email-shengjiu.wang@nxp.com Signed-off-by: Mark Brown <broonie@kernel.org>
2020-12-03ASoC: fsl-asoc-card: Add support for si476x codecShengjiu Wang1-0/+13
The si476x codec is used for FM radio function on i.MX6 auto board, it only supports recording function. Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com> Acked-by: Nicolin Chen <nicoleotsuka@gmail.com> Link: https://lore.kernel.org/r/1606708668-28786-1-git-send-email-shengjiu.wang@nxp.com Signed-off-by: Mark Brown <broonie@kernel.org>
2020-08-21ASoC: fsl-asoc-card: add support for TLV320AIC32x4 codecMatthias Schiffer1-0/+4
The TLV320AIC32x4 is commonly used on TQ-Systems starterkit mainboards for i.MX-based SoMs (i.MX6Q/DL, i.MX6UL, i.MX7) and LS1021A. Signed-off-by: Matthias Schiffer <matthias.schiffer@ew.tq-group.com> Acked-by: Nicolin Chen <nicoleotsuka@gmail.com> Link: https://lore.kernel.org/r/20200821071153.7317-2-matthias.schiffer@ew.tq-group.com Signed-off-by: Mark Brown <broonie@kernel.org>
2020-08-18ASoC: fsl-asoc-card: Get "extal" clock rate by clk_get_rateShengjiu Wang1-0/+11
On some platform(.e.g. i.MX8QM MEK), the "extal" clock is different with the mclk of codec, then the clock rate is also different. So it is better to get clock rate of "extal" rate by clk_get_rate, don't reuse the clock rate of mclk. Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com> Acked-by: Nicolin Chen <nicoleotsuka@gmail.com> Link: https://lore.kernel.org/r/1597047103-6863-1-git-send-email-shengjiu.wang@nxp.com Signed-off-by: Mark Brown <broonie@kernel.org>
2020-08-03ASoC: fsl-asoc-card: Remove fsl_asoc_card_set_bias_level functionShengjiu Wang1-84/+70
With this case: aplay -Dhw:x 16khz.wav 24khz.wav There is sound distortion for 24khz.wav. The reason is that setting PLL of WM8962 with set_bias_level function, the bias level is not changed when 24khz.wav is played, then the PLL won't be reset, the clock is not correct, so distortion happens. The resolution of this issue is to remove fsl_asoc_card_set_bias_level. Move PLL configuration to hw_params and hw_free. After removing fsl_asoc_card_set_bias_level, also test WM8960 case, it can work. Fixes: 708b4351f08c ("ASoC: fsl: Add Freescale Generic ASoC Sound Card with ASRC support") Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com> Acked-by: Nicolin Chen <nicoleotsuka@gmail.com> Link: https://lore.kernel.org/r/1596420811-16690-1-git-send-email-shengjiu.wang@nxp.com Signed-off-by: Mark Brown <broonie@kernel.org>
2020-07-23Merge series "ASoC: add asoc_substream_to_rtd() macro" from Kuninori ↵Mark Brown1-1/+1
Morimoto <kuninori.morimoto.gx@renesas.com>: Hi Mark Many ASoC drivers are getting rtd from substream by rtd = substream->private_data OTOH, we have snd_pcm_substream_chip() macro for it. #define snd_pcm_substream_chip(substream) ((substream)->private_data) But, both are not understandable for reader. This patch adds new asoc_substream_to_rtd() which is easy to understand. These are not important, but for readable code. Kuninori Morimoto (29): ASoC: soc-xxx: add asoc_substream_to_rtd() ASoC: ux500: use asoc_substream_to_rtd() ASoC: ti: use asoc_substream_to_rtd() ASoC: tegra: use asoc_substream_to_rtd() ASoC: sunxi: use asoc_substream_to_rtd() ASoC: stm: use asoc_substream_to_rtd() ASoC: sof: use asoc_substream_to_rtd() ASoC: sh: use asoc_substream_to_rtd() ASoC: samsung: use asoc_substream_to_rtd() ASoC: pxa: use asoc_substream_to_rtd() ASoC: cirrus: use asoc_substream_to_rtd() ASoC: rockchip: use asoc_substream_to_rtd() ASoC: amd: use asoc_substream_to_rtd() ASoC: fsl: use asoc_substream_to_rtd() ASoC: mediatek: use asoc_substream_to_rtd() ASoC: atmel: use asoc_substream_to_rtd() ASoC: qcom: use asoc_substream_to_rtd() ASoC: dwc: use asoc_substream_to_rtd() ASoC: intel: use asoc_substream_to_rtd() ASoC: meson: use asoc_substream_to_rtd() ASoC: au1x: use asoc_substream_to_rtd() ASoC: bcm: use asoc_substream_to_rtd() ASoC: codecs: use asoc_substream_to_rtd() ASoC: generic: use asoc_substream_to_rtd() ASoC: sprd: use asoc_substream_to_rtd() ASoC: kirkwood: use asoc_substream_to_rtd() ASoC: xtensa: use asoc_substream_to_rtd() ASoC: mxs: use asoc_substream_to_rtd() ASoC: uniphier: use asoc_substream_to_rtd() include/sound/soc.h | 2 + sound/soc/amd/acp-da7219-max98357a.c | 12 ++-- sound/soc/amd/acp-pcm-dma.c | 2 +- sound/soc/amd/acp-rt5645.c | 2 +- sound/soc/amd/acp3x-rt5682-max9836.c | 8 +-- sound/soc/amd/raven/acp3x-i2s.c | 2 +- sound/soc/amd/raven/acp3x-pcm-dma.c | 6 +- sound/soc/atmel/atmel-classd.c | 8 +-- sound/soc/atmel/atmel-pcm-dma.c | 4 +- sound/soc/atmel/atmel-pcm-pdc.c | 2 +- sound/soc/atmel/atmel-pdmic.c | 10 +-- sound/soc/atmel/atmel_wm8904.c | 2 +- sound/soc/au1x/db1200.c | 2 +- sound/soc/au1x/dbdma2.c | 2 +- sound/soc/au1x/dma.c | 2 +- sound/soc/bcm/bcm63xx-pcm-whistler.c | 12 ++-- sound/soc/bcm/cygnus-pcm.c | 16 ++--- sound/soc/cirrus/edb93xx.c | 2 +- sound/soc/cirrus/snappercl15.c | 2 +- sound/soc/codecs/rt5677-spi.c | 4 +- sound/soc/dwc/dwc-pcm.c | 2 +- sound/soc/fsl/eukrea-tlv320.c | 2 +- sound/soc/fsl/fsl-asoc-card.c | 2 +- sound/soc/fsl/fsl_asrc_dma.c | 4 +- sound/soc/fsl/fsl_dma.c | 2 +- sound/soc/fsl/fsl_spdif.c | 10 +-- sound/soc/fsl/fsl_ssi.c | 8 +-- sound/soc/fsl/imx-audmix.c | 6 +- sound/soc/fsl/imx-mc13783.c | 2 +- sound/soc/fsl/mpc5200_dma.c | 8 +-- sound/soc/fsl/mpc5200_psc_i2s.c | 2 +- sound/soc/fsl/mpc8610_hpcd.c | 2 +- sound/soc/fsl/mx27vis-aic32x4.c | 2 +- sound/soc/fsl/p1022_ds.c | 2 +- sound/soc/fsl/p1022_rdk.c | 2 +- sound/soc/fsl/wm1133-ev1.c | 2 +- sound/soc/generic/simple-card-utils.c | 6 +- sound/soc/intel/atom/sst-mfld-platform-pcm.c | 6 +- sound/soc/intel/baytrail/sst-baytrail-pcm.c | 16 ++--- sound/soc/intel/boards/bdw-rt5650.c | 2 +- sound/soc/intel/boards/bdw-rt5677.c | 4 +- sound/soc/intel/boards/broadwell.c | 2 +- sound/soc/intel/boards/bxt_rt298.c | 2 +- sound/soc/intel/boards/byt-rt5640.c | 2 +- sound/soc/intel/boards/bytcht_da7213.c | 4 +- sound/soc/intel/boards/bytcr_rt5640.c | 2 +- sound/soc/intel/boards/bytcr_rt5651.c | 2 +- sound/soc/intel/boards/cht_bsw_max98090_ti.c | 2 +- sound/soc/intel/boards/cht_bsw_nau8824.c | 2 +- sound/soc/intel/boards/cht_bsw_rt5645.c | 2 +- sound/soc/intel/boards/cht_bsw_rt5672.c | 2 +- sound/soc/intel/boards/cml_rt1011_rt5682.c | 4 +- sound/soc/intel/boards/ehl_rt5660.c | 2 +- sound/soc/intel/boards/glk_rt5682_max98357a.c | 2 +- sound/soc/intel/boards/haswell.c | 2 +- sound/soc/intel/boards/kbl_da7219_max98927.c | 8 +-- sound/soc/intel/boards/kbl_rt5660.c | 2 +- sound/soc/intel/boards/kbl_rt5663_max98927.c | 4 +- .../intel/boards/kbl_rt5663_rt5514_max98927.c | 4 +- .../soc/intel/boards/skl_nau88l25_max98357a.c | 2 +- sound/soc/intel/boards/skl_nau88l25_ssm4567.c | 2 +- sound/soc/intel/boards/skl_rt286.c | 2 +- sound/soc/intel/boards/sof_da7219_max98373.c | 2 +- sound/soc/intel/boards/sof_maxim_common.c | 4 +- sound/soc/intel/boards/sof_pcm512x.c | 4 +- sound/soc/intel/boards/sof_rt5682.c | 4 +- sound/soc/intel/boards/sof_sdw_rt1308.c | 2 +- sound/soc/intel/boards/sof_wm8804.c | 2 +- sound/soc/intel/haswell/sst-haswell-pcm.c | 12 ++-- sound/soc/intel/keembay/kmb_platform.c | 2 +- sound/soc/intel/skylake/skl-pcm.c | 8 +-- sound/soc/kirkwood/armada-370-db.c | 2 +- sound/soc/mediatek/common/mtk-afe-fe-dai.c | 12 ++-- .../mediatek/common/mtk-afe-platform-driver.c | 2 +- sound/soc/mediatek/mt2701/mt2701-afe-pcm.c | 2 +- sound/soc/mediatek/mt2701/mt2701-cs42448.c | 2 +- sound/soc/mediatek/mt2701/mt2701-wm8960.c | 2 +- sound/soc/mediatek/mt6797/mt6797-afe-pcm.c | 4 +- sound/soc/mediatek/mt8173/mt8173-afe-pcm.c | 2 +- sound/soc/mediatek/mt8173/mt8173-max98090.c | 2 +- .../mediatek/mt8173/mt8173-rt5650-rt5514.c | 2 +- .../mediatek/mt8173/mt8173-rt5650-rt5676.c | 2 +- sound/soc/mediatek/mt8173/mt8173-rt5650.c | 2 +- sound/soc/mediatek/mt8183/mt8183-afe-pcm.c | 4 +- .../mediatek/mt8183/mt8183-da7219-max98357.c | 8 +-- .../mt8183/mt8183-mt6358-ts3a227-max98357.c | 12 ++-- sound/soc/meson/axg-card.c | 2 +- sound/soc/meson/gx-card.c | 2 +- sound/soc/meson/meson-card-utils.c | 2 +- sound/soc/meson/meson-codec-glue.c | 2 +- sound/soc/mxs/mxs-sgtl5000.c | 2 +- sound/soc/pxa/brownstone.c | 2 +- sound/soc/pxa/corgi.c | 4 +- sound/soc/pxa/hx4700.c | 2 +- sound/soc/pxa/imote2.c | 2 +- sound/soc/pxa/magician.c | 6 +- sound/soc/pxa/mmp-pcm.c | 2 +- sound/soc/pxa/poodle.c | 4 +- sound/soc/pxa/pxa2xx-i2s.c | 2 +- sound/soc/pxa/spitz.c | 4 +- sound/soc/pxa/tosa.c | 2 +- sound/soc/pxa/z2.c | 2 +- sound/soc/pxa/zylonite.c | 2 +- sound/soc/qcom/apq8096.c | 2 +- sound/soc/qcom/lpass-platform.c | 14 ++--- sound/soc/qcom/qdsp6/q6asm-dai.c | 6 +- sound/soc/qcom/qdsp6/q6routing.c | 2 +- sound/soc/qcom/sdm845.c | 14 ++--- sound/soc/qcom/storm.c | 2 +- sound/soc/rockchip/rk3288_hdmi_analog.c | 2 +- sound/soc/rockchip/rk3399_gru_sound.c | 8 +-- sound/soc/rockchip/rockchip_i2s.c | 2 +- sound/soc/rockchip/rockchip_max98090.c | 2 +- sound/soc/rockchip/rockchip_rt5645.c | 2 +- sound/soc/samsung/aries_wm8994.c | 4 +- sound/soc/samsung/arndale.c | 4 +- sound/soc/samsung/h1940_uda1380.c | 2 +- sound/soc/samsung/i2s.c | 2 +- sound/soc/samsung/jive_wm8750.c | 2 +- sound/soc/samsung/littlemill.c | 2 +- sound/soc/samsung/neo1973_wm8753.c | 8 +-- sound/soc/samsung/odroid.c | 6 +- sound/soc/samsung/pcm.c | 4 +- sound/soc/samsung/rx1950_uda1380.c | 2 +- sound/soc/samsung/s3c-i2s-v2.c | 2 +- sound/soc/samsung/s3c24xx_simtec.c | 2 +- sound/soc/samsung/s3c24xx_uda134x.c | 6 +- sound/soc/samsung/smartq_wm8987.c | 2 +- sound/soc/samsung/smdk_spdif.c | 2 +- sound/soc/samsung/smdk_wm8580.c | 2 +- sound/soc/samsung/smdk_wm8994.c | 2 +- sound/soc/samsung/smdk_wm8994pcm.c | 2 +- sound/soc/samsung/snow.c | 2 +- sound/soc/samsung/spdif.c | 6 +- sound/soc/samsung/tm2_wm5110.c | 8 +-- sound/soc/sh/dma-sh7760.c | 12 ++-- sound/soc/sh/fsi.c | 2 +- sound/soc/sh/migor.c | 4 +- sound/soc/sh/rcar/core.c | 4 +- sound/soc/soc-component.c | 20 +++--- sound/soc/soc-dai.c | 8 +-- sound/soc/soc-dapm.c | 6 +- sound/soc/soc-generic-dmaengine-pcm.c | 4 +- sound/soc/soc-link.c | 12 ++-- sound/soc/soc-pcm.c | 62 +++++++++---------- sound/soc/soc-utils.c | 2 +- sound/soc/sof/intel/hda-dai.c | 10 +-- sound/soc/sof/intel/hda-dsp.c | 2 +- sound/soc/sof/intel/hda-pcm.c | 2 +- sound/soc/sof/pcm.c | 18 +++--- sound/soc/sprd/sprd-pcm-dma.c | 2 +- sound/soc/stm/stm32_adfsdm.c | 12 ++-- sound/soc/stm/stm32_sai_sub.c | 2 +- sound/soc/sunxi/sun4i-codec.c | 12 ++-- sound/soc/sunxi/sun4i-spdif.c | 2 +- sound/soc/tegra/tegra_alc5632.c | 2 +- sound/soc/tegra/tegra_max98090.c | 2 +- sound/soc/tegra/tegra_rt5640.c | 2 +- sound/soc/tegra/tegra_rt5677.c | 2 +- sound/soc/tegra/tegra_sgtl5000.c | 2 +- sound/soc/tegra/tegra_wm8753.c | 2 +- sound/soc/tegra/tegra_wm8903.c | 2 +- sound/soc/tegra/trimslice.c | 2 +- sound/soc/ti/davinci-evm.c | 6 +- sound/soc/ti/davinci-vcif.c | 4 +- sound/soc/ti/j721e-evm.c | 6 +- sound/soc/ti/n810.c | 4 +- sound/soc/ti/omap-abe-twl6040.c | 4 +- sound/soc/ti/omap-mcbsp.c | 4 +- sound/soc/ti/omap-twl4030.c | 2 +- sound/soc/ti/omap3pandora.c | 2 +- sound/soc/ti/osk5912.c | 2 +- sound/soc/ti/rx51.c | 4 +- sound/soc/uniphier/aio-dma.c | 6 +- sound/soc/ux500/mop500_ab8500.c | 8 +-- sound/soc/ux500/ux500_pcm.c | 2 +- sound/soc/xtensa/xtfpga-i2s.c | 2 +- 177 files changed, 397 insertions(+), 395 deletions(-) -- 2.25.1
2020-07-23ASoC: fsl-asoc-card: Support configuring dai fmt from DTShengjiu Wang1-0/+28
Support same propeties as simple card for configuring fmt from DT. In order to make this change compatible with old DT, these properties are optional. Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com> Acked-by: Nicolin Chen <nicoleotsuka@gmail.com> Link: https://lore.kernel.org/r/1595302910-19688-1-git-send-email-shengjiu.wang@nxp.com Signed-off-by: Mark Brown <broonie@kernel.org>
2020-07-23ASoC: fsl: use asoc_substream_to_rtd()Kuninori Morimoto1-1/+1
Now we can use asoc_substream_to_rtd() macro, let's use it. Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Link: https://lore.kernel.org/r/87eep70ytr.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Mark Brown <broonie@kernel.org>
2020-07-17Merge series "ASoC: fsl-asoc-card: Support hp and mic detection" from ↵Mark Brown1-2/+75
Shengjiu Wang <shengjiu.wang@nxp.com>: Support hp and mic detection. Add a parameter for asoc_simple_init_jack. Shengjiu Wang (3): ASoC: simple-card-utils: Support configure pin_name for asoc_simple_init_jack ASoC: bindings: fsl-asoc-card: Support hp-det-gpio and mic-det-gpio ASoC: fsl-asoc-card: Support Headphone and Microphone Jack detection changes in v2: - Add more comments in third commit - Add Acked-by Nicolin. .../bindings/sound/fsl-asoc-card.txt | 3 + include/sound/simple_card_utils.h | 6 +- sound/soc/fsl/Kconfig | 1 + sound/soc/fsl/fsl-asoc-card.c | 77 ++++++++++++++++++- sound/soc/generic/simple-card-utils.c | 7 +- 5 files changed, 86 insertions(+), 8 deletions(-) -- 2.27.0
2020-07-17ASoC: fsl: fsl-asoc-card: Trivial: Fix misspelling of 'exists'Lee Jones1-1/+1
Signed-off-by: Lee Jones <lee.jones@linaro.org> Cc: Timur Tabi <timur@kernel.org> Cc: Nicolin Chen <nicoleotsuka@gmail.com> Cc: Xiubo Li <Xiubo.Lee@gmail.com> Cc: Fabio Estevam <festevam@gmail.com> Cc: linuxppc-dev@lists.ozlabs.org Link: https://lore.kernel.org/r/20200715150009.407442-1-lee.jones@linaro.org Signed-off-by: Mark Brown <broonie@kernel.org>
2020-07-17ASoC: fsl-asoc-card: Support Headphone and Microphone Jack detectionShengjiu Wang1-2/+75
Use asoc_simple_init_jack function from simple card to implement the Headphone and Microphone detection. Register notifier to disable Speaker when Headphone is plugged in and enable Speaker when Headphone is unplugged. Register notifier to disable Digital Microphone when Analog Microphone is plugged in and enable DMIC when Analog Microphone is unplugged. Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com> Acked-by: Nicolin Chen <nicoleotsuka@gmail.com> Link: https://lore.kernel.org/r/1594822179-1849-4-git-send-email-shengjiu.wang@nxp.com Signed-off-by: Mark Brown <broonie@kernel.org>
2020-07-03ASoC: fsl: fsl-asoc-card: fix kernel-docPierre-Louis Bossart1-12/+9
Fix W=1 warnings. Kernel-doc syntax was not properly used. Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Acked-by: Nicolin Chen <nicoleotsuka@gmail.com> Link: https://lore.kernel.org/r/20200702192141.168018-4-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown <broonie@kernel.org>
2020-06-24ASoC: fsl-asoc-card: Add WM8524 supportShengjiu Wang1-0/+10
WM8524 only supports playback mode, and only works at slave mode. Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com> Acked-by: Nicolin Chen <nicoleotsuka@gmail.com> Link: https://lore.kernel.org/r/1592895167-30483-1-git-send-email-shengjiu.wang@nxp.com Signed-off-by: Mark Brown <broonie@kernel.org>
2020-06-17ASoC: fsl-asoc-card: Add MQS supportShengjiu Wang1-21/+57
The MQS codec isn't an i2c device, so use of_find_device_by_node to get platform device pointer. Because MQS only support playback, then add a new audio map. And there maybe "model" property or no "audio-routing" property in devicetree, so add some enhancement for these two property. Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com> Reviewed-by: Nicolin Chen <nicoleotsuka@gmail.com> Link: https://lore.kernel.org/r/918505decb7f757f12c38059c590984f28d2f3a4.1592369271.git.shengjiu.wang@nxp.com Signed-off-by: Mark Brown <broonie@kernel.org>