summaryrefslogtreecommitdiffstats
path: root/sound/soc/atmel/mchp-spdiftx.c
Commit message (Collapse)AuthorAgeFilesLines
* ASoC: atmel: merge DAI call back functions into opsKuninori Morimoto2023-08-141-9/+9
| | | | | | | | | ALSA SoC merges DAI call backs into .ops. This patch merge these into one. Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Link: https://lore.kernel.org/r/87350tb0sg.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Mark Brown <broonie@kernel.org>
* ASoC: atmel: Remove redundant of_match_ptr()Ruan Jinjie2023-08-131-1/+1
| | | | | | | | | The driver depends on CONFIG_OF, it is not necessary to use of_match_ptr() here. Signed-off-by: Ruan Jinjie <ruanjinjie@huawei.com Link: https://lore.kernel.org/r/20230811071426.2343133-2-ruanjinjie@huawei.com Signed-off-by: Mark Brown <broonie@kernel.org
* ASoC: atmel: mchp-spdiftx: Convert to platform remove callback returning voidUwe Kleine-König2023-03-201-4/+2
| | | | | | | | | | | | | | | | | | | | The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is (mostly) ignored and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Reviewed-by: Claudiu Beznea <claudiu.beznea@microchip.com> Acked-by: Takashi Iwai <tiwai@suse.de> Acked-by: Nicolas Ferre <nicolas.ferre@microchip.com> Link: https://lore.kernel.org/r/20230315150745.67084-30-u.kleine-koenig@pengutronix.de Signed-off-by: Mark Brown <broonie@kernel.org>
* ASoC: mchp-spdiftx: update debug messageClaudiu Beznea2023-03-051-1/+1
| | | | | | | | | | Previous debug message states that there was a failure and tx was not disabled. Which is not true as the TX in this function could also be enabled. Thus improve a bit the debug message by s/disable/start\/stop/. Signed-off-by: Claudiu Beznea <claudiu.beznea@microchip.com> Link: https://lore.kernel.org/r/20230301113807.24036-4-claudiu.beznea@microchip.com Signed-off-by: Mark Brown <broonie@kernel.org>
* ASoC: mchp-spdiftx: use regmap_update_bits()Claudiu Beznea2023-03-051-17/+5
| | | | | | | | | | | Use regmap_update_bits() instead of regmap_read(), running variable, regmap_write(). There is no need for extra variables and checks around it as regmap_update_bits() already does this. With this code becomes simpler. Signed-off-by: Claudiu Beznea <claudiu.beznea@microchip.com> Link: https://lore.kernel.org/r/20230301113807.24036-3-claudiu.beznea@microchip.com Signed-off-by: Mark Brown <broonie@kernel.org>
* ASoC: mchp-spdiftx: use FIELD_PREP() where possibleClaudiu Beznea2023-03-051-12/+9
| | | | | | | | | Use directly FIELD_PREP() marco where possible. There is no need for the extra wrappers. Signed-off-by: Claudiu Beznea <claudiu.beznea@microchip.com> Link: https://lore.kernel.org/r/20230301113807.24036-2-claudiu.beznea@microchip.com Signed-off-by: Mark Brown <broonie@kernel.org>
* ASoC: mchp-spdiftx: use FIELD_PREP() where possibleClaudiu Beznea2022-12-251-4/+4
| | | | | | | | Use FIELD_PREP() in macro definitions. Signed-off-by: Claudiu Beznea <claudiu.beznea@microchip.com> Link: https://lore.kernel.org/r/20221213112851.89212-5-claudiu.beznea@microchip.com Signed-off-by: Mark Brown <broonie@kernel.org>
* ASoC: mchp-spdiftx: add support for system suspend/resumeClaudiu Beznea2022-11-181-9/+13
| | | | | | | | | | Add support for system suspend/resume by moving the enable/disable of interrupts in mchp_spdiftx_trigger() on SNDRV_PCM_TRIGGER_SUSPEND/ SNDRV_PCM_TRIGGER_RESUME commands. Signed-off-by: Claudiu Beznea <claudiu.beznea@microchip.com> Link: https://lore.kernel.org/r/20221117123750.291911-4-claudiu.beznea@microchip.com Signed-off-by: Mark Brown <broonie@kernel.org>
* ASoC: mchp-spdiftx: add runtime pm supportClaudiu Beznea2022-11-181-30/+86
| | | | | | | | | | Add runtime PM support for Microchip SPDIFTX driver. The runtime PM APIs disables/enables IP's clock and enables/disable caching for regmap. Signed-off-by: Claudiu Beznea <claudiu.beznea@microchip.com> Link: https://lore.kernel.org/r/20221117123750.291911-3-claudiu.beznea@microchip.com Signed-off-by: Mark Brown <broonie@kernel.org>
* ASoC: mchp-spdiftx: simplify locking around ctrl->ch_statClaudiu Beznea2022-11-181-13/+14
| | | | | | | | | Use a temporary variable to keep the AES3 value. With this a spin_unlock_irqrestore() call has been removed from the final code. Signed-off-by: Claudiu Beznea <claudiu.beznea@microchip.com> Link: https://lore.kernel.org/r/20221117123750.291911-2-claudiu.beznea@microchip.com Signed-off-by: Mark Brown <broonie@kernel.org>
* ASoC: mchp-spdiftx: Fix clang -Wbitfield-constant-conversionNathan Chancellor2022-08-231-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | A recent change in clang strengthened its -Wbitfield-constant-conversion to warn when 1 is assigned to a 1-bit signed integer bitfield, as it can only be 0 or -1, not 1: sound/soc/atmel/mchp-spdiftx.c:505:20: error: implicit truncation from 'int' to bit-field changes value from 1 to -1 [-Werror,-Wbitfield-constant-conversion] dev->gclk_enabled = 1; ^ ~ 1 error generated. The actual value of the field is never checked, just that it is not zero, so there is not a real bug here. However, it is simple enough to silence the warning by making the bitfield unsigned, which matches the mchp-spdifrx driver. Fixes: 06ca24e98e6b ("ASoC: mchp-spdiftx: add driver for S/PDIF TX Controller") Link: https://github.com/ClangBuiltLinux/linux/issues/1686 Link: https://github.com/llvm/llvm-project/commit/82afc9b169a67e8b8a1862fb9c41a2cd974d6691 Signed-off-by: Nathan Chancellor <nathan@kernel.org> Reviewed-by: Nick Desaulniers <ndesaulniers@google.com> Link: https://lore.kernel.org/r/20220810010809.2024482-1-nathan@kernel.org Signed-off-by: Mark Brown <broonie@kernel.org>
* ASoC: atmel: one fix and one cleanupMark Brown2022-07-281-8/+0
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Merge series from Claudiu Beznea <claudiu.beznea@microchip.com>: Hi, The series adds one fix for mchp-spdifrx and one cleanups for mchp-spdifrx and mchp-spdifrx drivers. Thank you, Claudiu Beznea Changes in v3: - changed cover letter title s/few/one, s/cleanups/cleanup - fix compilation error and warnings - keep only patch 1/5 and patch 3/5 from previous version as the rest of them were integrated Changes in v2: - s/tag/tab in the title of patch 2/5 Claudiu Beznea (2): ASoC: mchp-spdifrx: disable end of block interrupt on failures ASoC: mchp-spdiftx: remove references to mchp_i2s_caps sound/soc/atmel/mchp-spdifrx.c | 9 ++++++--- sound/soc/atmel/mchp-spdiftx.c | 8 -------- 2 files changed, 6 insertions(+), 11 deletions(-) -- 2.34.1
| * ASoC: mchp-spdiftx: remove references to mchp_i2s_capsClaudiu Beznea2022-07-271-8/+0
| | | | | | | | | | | | | | | | Remove references to struct mchp_i2s_caps as they are not used. Signed-off-by: Claudiu Beznea <claudiu.beznea@microchip.com> Link: https://lore.kernel.org/r/20220727090814.2446111-3-claudiu.beznea@microchip.com Signed-off-by: Mark Brown <broonie@kernel.org>
* | ASoC: atmel: one fix and few cleanupsMark Brown2022-07-261-9/+5
|\ \ | | | | | | | | | | | | | | | | | | Merge series from Claudiu Beznea <claudiu.beznea@microchip.com>: The series adds one fix for mchp-spdifrx and few cleanups for mchp-spdifrx and mchp-spdifrx drivers.
| * | ASoC: mchp-spdiftx: add and remove black line around MODULE_DEVICE_TABLE()Claudiu Beznea2022-07-261-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | Add blank line after MODULE_DEVICE_TABLE() and remove the one before it. Signed-off-by: Claudiu Beznea <claudiu.beznea@microchip.com> Link: https://lore.kernel.org/r/20220725130925.1781791-6-claudiu.beznea@microchip.com Signed-off-by: Mark Brown <broonie@kernel.org>
| * | ASoC: mchp-spdiftx: return directly retClaudiu Beznea2022-07-261-8/+4
| |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Avoid having patterns like: int ret; // ... ret = 0; // ... ret = call_function(); if (ret) return ret; return 0; and return directly ret for all cases. Signed-off-by: Claudiu Beznea <claudiu.beznea@microchip.com> Link: https://lore.kernel.org/r/20220725130925.1781791-5-claudiu.beznea@microchip.com Signed-off-by: Mark Brown <broonie@kernel.org>
* / ASoC: atmel: Migrate to new style legacy DAI naming flagCharles Keepax2022-06-271-1/+2
|/ | | | | | | | | | | Change the legacy DAI naming flag from opting in to the new scheme (non_legacy_dai_naming), to opting out of it (legacy_dai_naming). These drivers appear to be on the CPU side of the DAI link and currently uses the legacy naming, so add the new flag. Signed-off-by: Charles Keepax <ckeepax@opensource.cirrus.com> Link: https://lore.kernel.org/r/20220623125250.2355471-20-ckeepax@opensource.cirrus.com Signed-off-by: Mark Brown <broonie@kernel.org>
* ASoC: atmel: fix spelling mistakesGu Shengxian2021-07-111-1/+1
| | | | | | | | | | | | Fix some spelling mistakes as follows: regaedles ==> regardless prezent ==> present underrrun ==> underrun controlls ==> controls Signed-off-by: Gu Shengxian <gushengxian@yulong.com> Link: https://lore.kernel.org/r/20210706100230.32633-1-gushengxian507419@gmail.com Signed-off-by: Mark Brown <broonie@kernel.org>
* ASoC: mchp-spdiftx: Do not set Validity bit(s)Codrin Ciubotariu2020-11-041-1/+0
| | | | | | | | | | | The Validity bits (bit 28) must not be set in order to have the samples valid. Some controllers look for this bit and ignore the samples if it is set. Fixes: 06ca24e98e6b ("ASoC: mchp-spdiftx: add driver for S/PDIF TX Controller") Signed-off-by: Codrin Ciubotariu <codrin.ciubotariu@microchip.com> Link: https://lore.kernel.org/r/20201104155738.68403-1-codrin.ciubotariu@microchip.com Signed-off-by: Mark Brown <broonie@kernel.org>
* ASoC: mchp-spdiftx: remove 'TX' from playback stream nameCodrin Ciubotariu2020-10-091-1/+1
| | | | | | | | | Do not include the 'TX' in the stream name since it's obvious for playback. Signed-off-by: Codrin Ciubotariu <codrin.ciubotariu@microchip.com> Link: https://lore.kernel.org/r/20201009123527.2770629-1-codrin.ciubotariu@microchip.com Signed-off-by: Mark Brown <broonie@kernel.org>
* ASoC: mchp-spdiftx: add driver for S/PDIF TX ControllerCodrin Ciubotariu2020-09-091-0/+871
The new SPDIF TX controller is a serial port compliant with the IEC- 60958 standard. It also supports programmable User Data and Channel Status fields. This IP is embedded in Microchip's sama7g5 SoC. Signed-off-by: Codrin Ciubotariu <codrin.ciubotariu@microchip.com> Link: https://lore.kernel.org/r/20200909145348.367033-2-codrin.ciubotariu@microchip.com Signed-off-by: Mark Brown <broonie@kernel.org>