summaryrefslogtreecommitdiffstats
path: root/sound/soc/fsl (follow)
Commit message (Collapse)AuthorAgeFilesLines
* ASoC: fsl_sai: Add support for i.MX8ULPShengjiu Wang2022-05-161-1/+13
| | | | | | | | | | | Add i.MX8ULP specific soc data, the max register is FSL_SAI_RTCAP the IP version is also 0x0301, So version can't be used for the condition of register FSL_SAI_MCTL setting. Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com> Reviewed-by: Fabio Estevam <festevam@gmail.com> Link: https://lore.kernel.org/r/1652688372-10274-4-git-send-email-shengjiu.wang@nxp.com Signed-off-by: Mark Brown <broonie@kernel.org>
* ASoC: fsl_sai: Add support for i.MX8M PlusShengjiu Wang2022-05-161-0/+12
| | | | | | | | | Add i.MX8M Plus specific soc data, the max register is FSL_SAI_MDIV. Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com> Reviewed-by: Fabio Estevam <festevam@gmail.com> Link: https://lore.kernel.org/r/1652688372-10274-3-git-send-email-shengjiu.wang@nxp.com Signed-off-by: Mark Brown <broonie@kernel.org>
* ASoC: fsl_sai: Add support for i.MX8MMShengjiu Wang2022-05-162-0/+18
| | | | | | | | | | | | On i.MX8MM the max register is FSL_SAI_MCTL, which is different with previous platform, so add max_register in soc data to distinguish platforms. And add specific soc data for i.MX8MM Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com> Reviewed-by: Fabio Estevam <festevam@gmail.com> Link: https://lore.kernel.org/r/1652688372-10274-2-git-send-email-shengjiu.wang@nxp.com Signed-off-by: Mark Brown <broonie@kernel.org>
* ASoC: imx-hdmi: Fix refcount leak in imx_hdmi_probeMiaoqian Lin2022-05-111-0/+1
| | | | | | | | | | | | | of_find_device_by_node() takes reference, we should use put_device() to release it. when devm_kzalloc() fails, it doesn't have a put_device(), it will cause refcount leak. Add missing put_device() to fix this. Fixes: 6a5f850aa83a ("ASoC: fsl: Add imx-hdmi machine driver") Fixes: f670b274f7f6 ("ASoC: imx-hdmi: add put_device() after of_find_device_by_node()") Signed-off-by: Miaoqian Lin <linmq006@gmail.com> Link: https://lore.kernel.org/r/20220511052740.46903-1-linmq006@gmail.com Signed-off-by: Mark Brown <broonie@kernel.org>
* ASoC: fsl_ssi: Add support multi fifo scriptShengjiu Wang2022-05-111-2/+32
| | | | | | | | | | | | | | | | With dual fifo enabled, the case that recording mono sound in the background, playback mono sound twice in parallal, at second time playback sound may distort, the possible reason is using dual fifo to playback mono sound is not recommended. This patch is to provide a option to use multi fifo script, which can be dynamically configured as one fifo or two fifo mode. Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com> Link: https://lore.kernel.org/r/1652183808-3745-1-git-send-email-shengjiu.wang@nxp.com Signed-off-by: Mark Brown <broonie@kernel.org>
* ASoC: fsl: Fix refcount leak in imx_sgtl5000_probeMiaoqian Lin2022-05-111-6/+8
| | | | | | | | | | | | of_find_i2c_device_by_node() takes a reference, In error paths, we should call put_device() to drop the reference to aviod refount leak. Fixes: 81e8e4926167 ("ASoC: fsl: add sgtl5000 clock support for imx-sgtl5000") Signed-off-by: Miaoqian Lin <linmq006@gmail.com> Reviewed-by: Fabio Estevam <festevam@gmail.com> Link: https://lore.kernel.org/r/20220511065803.3957-1-linmq006@gmail.com Signed-off-by: Mark Brown <broonie@kernel.org>
* ASoC: fsl_micfil: Add support for i.MX8MPlusShengjiu Wang2022-05-101-0/+13
| | | | | | | | | | | | | | On i.MX8Plus there are two updates for micfil module. One is that the output format is S32_LE, only the 24 more significative bits have information, the other bits are always zero. Add 'formats' variable in soc data to distinguish the format on different platform. Another is that the fifo depth is 32 entries. Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com> Link: https://lore.kernel.org/r/1652087663-1908-1-git-send-email-shengjiu.wang@nxp.com Signed-off-by: Mark Brown <broonie@kernel.org>
* ASoC: fsl_micfil: fix the naming style for mask definitionShengjiu Wang2022-05-051-4/+4
| | | | | | | | | | Remove the _SHIFT for the mask definition. Fixes: 17f2142bae4b ("ASoC: fsl_micfil: use GENMASK to define register bit fields") Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com> Acked-by: Sascha Hauer <s.hauer@pengutronix.de> Link: https://lore.kernel.org/r/1651736047-28809-1-git-send-email-shengjiu.wang@nxp.com Signed-off-by: Mark Brown <broonie@kernel.org>
* ASoC: imx-hdmi: remove useless null check before call of_node_put()Haowen Bai2022-04-251-2/+1
| | | | | | | | | No need to add null check before call of_node_put(), since the implementation of of_node_put() has done it. Signed-off-by: Haowen Bai <baihaowen@meizu.com> Link: https://lore.kernel.org/r/1650509120-25377-1-git-send-email-baihaowen@meizu.com Signed-off-by: Mark Brown <broonie@kernel.org>
* ASoC: fsl_asrc: using pm_runtime_resume_and_get to simplify the codeMinghao Chi2022-04-251-4/+2
| | | | | | | | | | | Using pm_runtime_resume_and_get() to replace pm_runtime_get_sync and pm_runtime_put_noidle. This change is just to simplify the code, no actual functional changes. Reported-by: Zeal Robot <zealci@zte.com.cn> Signed-off-by: Minghao Chi <chi.minghao@zte.com.cn> Link: https://lore.kernel.org/r/20220420030402.2575755-1-chi.minghao@zte.com.cn Signed-off-by: Mark Brown <broonie@kernel.org>
* ASoC: fsl_micfil: Driver updatesMark Brown2022-04-207-451/+197
|\ | | | | | | | | | | Merge series from Sascha Hauer <s.hauer@pengutronix.de>: Cleanups for the fsl_micfil driver.
| * ASoC: fsl_micfil: Remove debug messageSascha Hauer2022-04-191-1/+0
| | | | | | | | | | | | | | | | | | | | The micfil driver prints out the IRQ numbers for each interrupt at error level. This information is useful for debugging at best, remove it. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de> Acked-by: Shengjiu Wang <shengjiu.wang@gmail.com> Link: https://lore.kernel.org/r/20220414162249.3934543-22-s.hauer@pengutronix.de Signed-off-by: Mark Brown <broonie@kernel.org>
| * ASoC: fsl_micfil: fold fsl_set_clock_params() into its only userSascha Hauer2022-04-191-28/+13
| | | | | | | | | | | | | | | | | | | | fsl_set_clock_params() is used only once and easily be folded into its caller, do so. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de> Acked-by: Shengjiu Wang <shengjiu.wang@gmail.com> Link: https://lore.kernel.org/r/20220414162249.3934543-21-s.hauer@pengutronix.de Signed-off-by: Mark Brown <broonie@kernel.org>
| * ASoC: fsl_micfil: drop support for undocumented propertySascha Hauer2022-04-191-6/+2
| | | | | | | | | | | | | | | | | | | | The "fsl,shared-interrupt" property is undocumented and unnecessary. Just pass IRQF_SHARED unconditionally. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de> Acked-by: Shengjiu Wang <shengjiu.wang@gmail.com> Link: https://lore.kernel.org/r/20220414162249.3934543-20-s.hauer@pengutronix.de Signed-off-by: Mark Brown <broonie@kernel.org>
| * ASoC: fsl_micfil: drop only once used definesSascha Hauer2022-04-191-5/+2
| | | | | | | | | | | | | | | | | | | | | | FSL_MICFIL_RATES and FSL_MICFIL_FORMATS is only used once. Drop the unnecesary indirection and use SNDRV_PCM_RATE_8000_48000 and SNDRV_PCM_FMTBIT_S16_LE directly. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de> Acked-by: Shengjiu Wang <shengjiu.wang@gmail.com> Link: https://lore.kernel.org/r/20220414162249.3934543-19-s.hauer@pengutronix.de Signed-off-by: Mark Brown <broonie@kernel.org>
| * ASoC: fsl_micfil: drop unused includeSascha Hauer2022-04-191-1/+0
| | | | | | | | | | | | | | | | | | | | The micfil driver doesn't use anything from imx-pcm.h. Drop its inclusion. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de> Acked-by: Shengjiu Wang <shengjiu.wang@gmail.com> Link: https://lore.kernel.org/r/20220414162249.3934543-18-s.hauer@pengutronix.de Signed-off-by: Mark Brown <broonie@kernel.org>
| * ASoC: fsl_micfil: rework quality settingSascha Hauer2022-04-191-31/+78
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | For the quality setting the quality setting register values are directly exposed to the kcontrol and thus to userspace. This is unfortunate because the register settings contains invalid bit combinations marked as "N/A". For userspace it doesn't make much sense to be able to set these just to see that the driver responds with "Please make sure you select a valid quality." in the kernel log. Work around this by adding get/set functions for the quality setting. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de> Acked-by: Shengjiu Wang <shengjiu.wang@gmail.com> Link: https://lore.kernel.org/r/20220414162249.3934543-17-s.hauer@pengutronix.de Signed-off-by: Mark Brown <broonie@kernel.org>
| * ASoC: fsl_micfil: simplify clock settingSascha Hauer2022-04-191-41/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The reference manual has this for calculating the micfil internal clock divider: MICFIL Clock rate clkdiv = ----------------- 8 * OSR * outrate (with OSR == Oversampling Rate, outrate == output sample rate) The driver first sets the MICFIL Clock rate to (outrate * 1024) and then calculates back the clkdiv value from the above calculation. Simplify this by using a fixed clkdiv value of 8 and set the MICFIL Clock rate to (outrate * clkdiv * OSR * 8). While at it drop disabling the clock before setting its rate. The MICFIL module is disabled when the rate is changed and it is also resetted before it is started again, so I doubt it's necessary to disable the clock. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de> Acked-by: Shengjiu Wang <shengjiu.wang@gmail.com> Link: https://lore.kernel.org/r/20220414162249.3934543-16-s.hauer@pengutronix.de Signed-off-by: Mark Brown <broonie@kernel.org>
| * ASoC: fsl_micfil: Drop get_pdm_clk()Sascha Hauer2022-04-191-37/+1
| | | | | | | | | | | | | | | | | | | | | | | | get_pdm_clk() calculates the PDM clock based on the quality setting, but really the PDM clock is independent of the quality, it's always rate * 4 * micfil->osr. Just drop the function and do the calculation in the caller. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de> Acked-by: Shengjiu Wang <shengjiu.wang@gmail.com> Link: https://lore.kernel.org/r/20220414162249.3934543-15-s.hauer@pengutronix.de Signed-off-by: Mark Brown <broonie@kernel.org>
| * ASoC: fsl_micfil: use define for OSR default valueSascha Hauer2022-04-192-5/+5
| | | | | | | | | | | | | | | | | | | | | | | | The OSR (OverSampling Rate) setting is set once to the default value and never changed throughout the driver. Nevertheless the value is read back from the register for further calculations. Just use the default value because we know what we have written. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de> Acked-by: Shengjiu Wang <shengjiu.wang@gmail.com> Link: https://lore.kernel.org/r/20220414162249.3934543-14-s.hauer@pengutronix.de Signed-off-by: Mark Brown <broonie@kernel.org>
| * ASoC: fsl_micfil: add multi fifo supportSascha Hauer2022-04-191-0/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | The micfil hardware provides the microphone data on multiple successive FIFO registers, one register per stereo pair. Also to work properly the SDMA_DONE0_CONFIG_DONE_SEL bit in the SDMA engines SDMA_DONE0_CONFIG register must be set. This patch provides the necessary information to the SDMA engine driver. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de> Acked-by: Shengjiu Wang <shengjiu.wang@gmail.com> Link: https://lore.kernel.org/r/20220414162249.3934543-13-s.hauer@pengutronix.de Signed-off-by: Mark Brown <broonie@kernel.org>
| * dmaengine: imx: Move header to include/dma/Sascha Hauer2022-04-195-5/+5
| | | | | | | | | | | | | | | | | | | | | | The i.MX DMA drivers are device tree only, nothing in include/linux/platform_data/dma-imx.h has platform_data in it, so move the file to include/linux/dma/imx-dma.h. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de> Acked-By: Vinod Koul <vkoul@kernel.org> Link: https://lore.kernel.org/r/20220414162249.3934543-10-s.hauer@pengutronix.de Signed-off-by: Mark Brown <broonie@kernel.org>
| * ASoC: fsl_micfil: drop unused variablesSascha Hauer2022-04-191-6/+0
| | | | | | | | | | | | | | | | | | struct fsl_micfil has unused fields, remove them. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de> Acked-by: Shengjiu Wang <shengjiu.wang@gmail.com> Link: https://lore.kernel.org/r/20220414162249.3934543-9-s.hauer@pengutronix.de Signed-off-by: Mark Brown <broonie@kernel.org>
| * ASoC: fsl_micfil: drop error messages from failed register accessesSascha Hauer2022-04-191-40/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Failed register accesses are really not expected in memory mapped registers. When it fails then the register access itself is likely not the reason, so no need to have extra error messages for each regmap access. Just drop the error messages. This also fixes some places where a return value is concatenated using 'ret |=' and then returned as error value. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de> Acked-by: Shengjiu Wang <shengjiu.wang@gmail.com> Link: https://lore.kernel.org/r/20220414162249.3934543-8-s.hauer@pengutronix.de Signed-off-by: Mark Brown <broonie@kernel.org>
| * ASoC: fsl_micfil: use clear/set bitsSascha Hauer2022-04-191-16/+10
| | | | | | | | | | | | | | | | | | | | Instead regmap_update_bits() use the simpler variants regmap_[set|clear]_bits() where appropriate. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de> Acked-by: Shengjiu Wang <shengjiu.wang@gmail.com> Link: https://lore.kernel.org/r/20220414162249.3934543-7-s.hauer@pengutronix.de Signed-off-by: Mark Brown <broonie@kernel.org>
| * ASoC: fsl_micfil: use GENMASK to define register bit fieldsSascha Hauer2022-04-192-141/+58
| | | | | | | | | | | | | | | | | | | | Use GENMASK along with FIELD_PREP and FIELD_GET to access bitfields in registers to straighten register access and to drop a lot of defines. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de> Acked-by: Shengjiu Wang <shengjiu.wang@gmail.com> Link: https://lore.kernel.org/r/20220414162249.3934543-6-s.hauer@pengutronix.de Signed-off-by: Mark Brown <broonie@kernel.org>
| * ASoC: fsl_micfil: do not define SHIFT/MASK for single bitsSascha Hauer2022-04-192-103/+40
| | | | | | | | | | | | | | | | | | | | No need to have defines for the mask of single bits. Also shift is unused. Drop all these unnecessary defines. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de> Acked-by: Shengjiu Wang <shengjiu.wang@gmail.com> Link: https://lore.kernel.org/r/20220414162249.3934543-5-s.hauer@pengutronix.de Signed-off-by: Mark Brown <broonie@kernel.org>
| * ASoC: fsl_micfil: drop fsl_micfil_set_mclk_rate()Sascha Hauer2022-04-191-20/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | All that the .set_sysclk hook in the micfil driver does is to pass the sysclk frequency to fsl_micfil_set_mclk_rate(). This function expects the sample rate as argument though, not any kind of sysclk frequency. The resulting rate setting of the clock is overwritten in hw_params anyway, so drop this altogether. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de> Acked-by: Shengjiu Wang <shengjiu.wang@gmail.com> Link: https://lore.kernel.org/r/20220414162249.3934543-4-s.hauer@pengutronix.de Signed-off-by: Mark Brown <broonie@kernel.org>
| * ASoC: fsl_micfil: Drop unused register readSascha Hauer2022-04-191-3/+0
| | | | | | | | | | | | | | | | | | | | In get_pdm_clk() REG_MICFIL_CTRL2 is read, but the result is never used. Drop the unused code. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de> Acked-by: Shengjiu Wang <shengjiu.wang@gmail.com> Link: https://lore.kernel.org/r/20220414162249.3934543-3-s.hauer@pengutronix.de Signed-off-by: Mark Brown <broonie@kernel.org>
| * ASoC: fsl_micfil: Drop unnecessary register readSascha Hauer2022-04-191-2/+0
| | | | | | | | | | | | | | | | | | in get_pdm_clk() REG_MICFIL_CTRL2 is read twice. Drop second read. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de> Acked-by: Shengjiu Wang <shengjiu.wang@gmail.com> Link: https://lore.kernel.org/r/20220414162249.3934543-2-s.hauer@pengutronix.de Signed-off-by: Mark Brown <broonie@kernel.org>
* | ASoC: soc-card: Create jack kcontrol without pinsAkihiko Odaki2022-04-142-3/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | snd_soc_card_jack_new() allowed to create jack kcontrol without pins, but did not create kcontrols. The jack would not have kcontrols if pins were not going to be added. This renames the old snd_soc_card_jack_new() to snd_soc_card_jack_new_pins() for use when pins are provided or will be added later. The new snd_soc_card_jack_new() appropriately creates a jack for use without pins and adds a kcontrol. Signed-off-by: Akihiko Odaki <akihiko.odaki@gmail.com> Link: https://lore.kernel.org/r/20220408041114.6024-1-akihiko.odaki@gmail.com Signed-off-by: Mark Brown <broonie@kernel.org>
* | ASoC: fsl: using pm_runtime_resume_and_get instead of pm_runtime_get_syncMinghao Chi2022-04-121-4/+2
| | | | | | | | | | | | | | | | | | | | | | Using pm_runtime_resume_and_get is more appropriate for simplifing code Reported-by: Zeal Robot <zealci@zte.com.cn> Signed-off-by: Minghao Chi <chi.minghao@zte.com.cn> Acked-by: Shengjiu Wang <shengjiu.wang@gmail.com> Link: https://lore.kernel.org/r/20220412083000.2532711-1-chi.minghao@zte.com.cn Signed-off-by: Mark Brown <broonie@kernel.org>
* | ASoC: fsl_sai: fix 1:1 bclk:mclk ratio supportAhmad Fatoum2022-04-061-1/+1
|/ | | | | | | | | | | | | | | | | | | | | Refactoring in commit a50b7926d015 ("ASoC: fsl_sai: implement 1:1 bclk:mclk ratio support") led to the bypass never happening as (ratio = 1) was caught in the existing if (ratio & 1) continue; check. The correct check sequence instead is: - skip all ratios lower than one and higher than 512 - skip all odd ratios except for 1:1 - skip 1:1 ratio if and only if !support_1_1_ratio And for all others, calculate the appropriate divider. Adjust the code to facilitate this. Fixes: a50b7926d015 ("ASoC: fsl_sai: implement 1:1 bclk:mclk ratio support") Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Acked-by: Shengjiu Wang <shengjiu.wang@gmail.com> Reviewed-by: Sascha Hauer <s.hauer@pengutronix.de> Link: https://lore.kernel.org/r/20220405155731.745413-1-a.fatoum@pengutronix.de Signed-off-by: Mark Brown <broonie@kernel.org>
* Merge tag 'asoc-fix-v5.18' of ↵Takashi Iwai2022-03-301-8/+4
|\ | | | | | | | | | | | | | | https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound into for-linus ASoC: Fixes for v5.18 A few fixes that came in during the merge window, all fairly routine.
| * ASoC: fsl-asoc-card: Fix jack_event() always return 0Meng Tang2022-03-211-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>
* | Merge tag 'asoc-v5.18' of ↵Takashi Iwai2022-03-2112-93/+164
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound into for-linus ASoC: Updates for v5.18 Quite a quiet release for ASoC, lots of work on drivers and platforms but nothing too groundbreaking but not much on the core itself: - Start of moving SoF to support multiple IPC mechanisms. - Use of NHLT ACPI table to reduce the amount of quirking required for Intel systems. - Some building blocks for use in forthcoming Intel AVS driver for legacy Intel DSP firmwares. - Support for AMD PDM, Atmel PDMC, Awinic AW8738, i.MX cards with TLV320AIC31xx, Intel machines with CS35L41 and ESSX8336, Mediatek MT8181 wideband bluetooth, nVidia Tegra234, Qualcomm SC7280, Renesas RZ/V2L, Texas Instruments TAS585M
| * ASoC: fsl_spdif: Add new registers included on i.MX8ULPShengjiu Wang2022-03-172-1/+65
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | There are some new registers added on i.MX8ULP, they are the SPDIF transmit Professional C channel registers, 192bit SPDIF receive C channel registers, and 192bit SPDIF transmit C channel registers. There are two output lines, SPDIF_OUT1 and SPDIF_OUT2, the original REG_SPDIF_STCSCH and REG_SPDIF_STCSCL are used for SPDIF_OUT1, the new REG_SPDIF_STCSPH and REG_SPDIF_STCSPL are used for SPDIF_OUT2, the 192bit SPDIF C channel registers are used for both. Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com> Link: https://lore.kernel.org/r/1647408538-2982-1-git-send-email-shengjiu.wang@nxp.com Signed-off-by: Mark Brown <broonie@kernel.org>
| * ASoC: imx-es8328: Fix error return code in imx_es8328_probe()Wang Wensheng2022-03-101-0/+1
| | | | | | | | | | | | | | | | | | | | Fix to return a negative error code from the error handling case instead of 0, as done elsewhere in this function. Fixes: 7e7292dba215 ("ASoC: fsl: add imx-es8328 machine driver") Signed-off-by: Wang Wensheng <wangwensheng4@huawei.com> Link: https://lore.kernel.org/r/20220310091902.129299-1-wangwensheng4@huawei.com Signed-off-by: Mark Brown <broonie@kernel.org>
| * ASoC: fsl_spdif: Disable TX clock when stopShengjiu Wang2022-03-101-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | The TX clock source may be changed in next case, need to disable it when stop, otherwise the TX may not work after changing the clock source, error log is: aplay: pcm_write:2058: write error: Input/output error Fixes: a2388a498ad2 ("ASoC: fsl: Add S/PDIF CPU DAI driver") Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com> Reviewed-by: Fabio Estevam <festevam@gmail.com> Link: https://lore.kernel.org/r/1646879863-27711-1-git-send-email-shengjiu.wang@nxp.com Signed-off-by: Mark Brown <broonie@kernel.org>
| * ASoC: fsl_spdif: keep all TxClk sources by txclk arrayViorel Suman2022-03-091-21/+20
| | | | | | | | | | | | | | | | | | | | | | | | Use txclk array to keep all TxClk sources instead of keeping clocks per rate - need to do this in order to avoid multiple prepare_enable/disable_unprepare of the same clock during suspend/resume. Signed-off-by: Viorel Suman <viorel.suman@nxp.com> Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com> Link: https://lore.kernel.org/r/1646817523-26800-1-git-send-email-shengjiu.wang@nxp.com Signed-off-by: Mark Brown <broonie@kernel.org>
| * ASoC: fsl_rpmsg: Remove SET_SYSTEM_SLEEP_PM_OPS callbackShengjiu Wang2022-03-091-2/+0
| | | | | | | | | | | | | | | | | | | | For sound need to be continuously output at suspend with rpmsg sound card, so need to keep the clock always on at suspend, then suspend & resume callback is not needed. Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com> Link: https://lore.kernel.org/r/1646822293-26965-1-git-send-email-shengjiu.wang@nxp.com Signed-off-by: Mark Brown <broonie@kernel.org>
| * ASoC: fsl_sai: implement 1:1 bclk:mclk ratio supportAhmad Fatoum2022-03-071-2/+15
| | | | | | | | | | | | | | | | | | | | | | | | With higher channel counts, we may need higher clock rates. Starting with SAI v3.1 (i.MX8MM), we can bypass the divider and get a 1:1 bclk:mclk ratio. Add the necessary support. Signed-off-by: Viorel Suman <viorel.suman@nxp.com> Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de> Link: https://lore.kernel.org/r/20220302083428.3804687-8-s.hauer@pengutronix.de Signed-off-by: Mark Brown <broonie@kernel.org>
| * ASoC: fsl_sai: use DIV_ROUND_CLOSEST() to calculate dividerSascha Hauer2022-03-071-7/+5
| | | | | | | | | | | | | | | | | | | | | | In fsl_sai_set_bclk() we want to calculate the divider that gets us closest to the desired frequency, so use DIV_ROUND_CLOSEST() instead of just doing a clk_rate/freq. Also discard invalid ratios earlier. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de> Link: https://lore.kernel.org/r/20220302083428.3804687-7-s.hauer@pengutronix.de Signed-off-by: Mark Brown <broonie@kernel.org>
| * ASoC: fsl_sai: Use better variable namesSascha Hauer2022-03-071-8/+9
| | | | | | | | | | | | | | | | | | | | | | "ret" is normally used as a variable name for return values. In fsl_sai_set_bclk() it stores the difference between the desired rate and the rate we can archieve, so rename it to "diff". Also rename "savesub" to "bestdiff" as that stores the best difference we have found. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de> Link: https://lore.kernel.org/r/20220302083428.3804687-6-s.hauer@pengutronix.de Signed-off-by: Mark Brown <broonie@kernel.org>
| * ASoC: fsl_sai: store full version instead of major/minorSascha Hauer2022-03-072-9/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | The driver tests for the hardware revision being newer than 3.1 with (sai->verid.major >= 3 && sai->verid.minor >= 1). The result is obviously wrong for hardware revision 4.0. Fix this by storing the full version in a single variable and comparing to that one. No practical change at the moment as there is no 4.0 ip version currently. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de> Link: https://lore.kernel.org/r/20220302083428.3804687-5-s.hauer@pengutronix.de Signed-off-by: Mark Brown <broonie@kernel.org>
| * ASoC: fsl_sai: simplify register poking in fsl_sai_set_bclkAhmad Fatoum2022-03-071-16/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | Depending on SAI synchronization mode, the same value is either written to FSL_SAI_TCR2 or FSL_SAI_RCR2 or nothing is written at all. As the computation is the same either way, factor it out to make it clearer what the difference is. No functional change. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de> Link: https://lore.kernel.org/r/20220302083428.3804687-4-s.hauer@pengutronix.de Signed-off-by: Mark Brown <broonie@kernel.org>
| * ASoC: fsl_sai: simplify irq return valueSascha Hauer2022-03-071-7/+4
| | | | | | | | | | | | | | | | | | | | Instead of using a boolean "irq_none" to describe the interrupt handlers return value use a variable of type irqreturn_t and return it directly. No functional change. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de> Link: https://lore.kernel.org/r/20220302083428.3804687-3-s.hauer@pengutronix.de Signed-off-by: Mark Brown <broonie@kernel.org>
| * ASoC: fsl_sai: Drop unnecessary definesSascha Hauer2022-03-072-13/+6
| | | | | | | | | | | | | | | | | | | | | | The fsl_sai driver has FSL_FMT_TRANSMITTER and FSL_FMT_RECEIVER defines which are used in a single function only then are then only translated into a bool 'tx' variable. Drop the defines and pass the boolean value directly to fsl_sai_set_dai_sysclk_tr(). No functional change. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de> Link: https://lore.kernel.org/r/20220302083428.3804687-2-s.hauer@pengutronix.de Signed-off-by: Mark Brown <broonie@kernel.org>
| * ASoC: fsl: Drop unused argument from imx_pcm_dma_init()Sascha Hauer2022-02-287-11/+8
| | | | | | | | | | | | | | | | | | | | | | Since 70d435ba1cd ("ASoC: imx-pcm-dma: simplify pcm_config") the size argument to imx_pcm_dma_init() is unused, so drop it. Also remove the now unused defines that the users of imx_pcm_dma_init() used to pass the size argument Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de> Link: https://lore.kernel.org/r/20220223130625.3430589-1-s.hauer@pengutronix.de Signed-off-by: Mark Brown <broonie@kernel.org>
| * ASoC: fsl_sai: Enable combine mode softSascha Hauer2022-02-082-0/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The fsl_sai driver calculates the number of pins used and enables multiple channels if necessary. This means the SAI expects data in one FIFO per pin. The SDMA engine only services a single FIFO, so multi pin support doesn't work at all. This patch enables the software combine mode in chips that support it. With this the SAI presents only a single FIFO to the outside and distributes the data into the different FIFOs internally. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de> Link: https://lore.kernel.org/r/20220111081518.982437-1-s.hauer@pengutronix.de Signed-off-by: Mark Brown <broonie@kernel.org>