aboutsummaryrefslogtreecommitdiffstats
path: root/sound/soc/atmel/atmel-classd.c
Commit message (Collapse)AuthorAgeFilesLines
* ASoC: atmel: atmel-classd: Use str_enabled_disabled() helperThorsten Blum2025-02-241-1/+2
| | | | | | | | | | Remove hard-coded strings by using the str_enabled_disabled() helper function. Signed-off-by: Thorsten Blum <[email protected]> Reviewed-by: Andrei Simion <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Mark Brown <[email protected]>
* ASoC: atmel: atmel-classd: Re-add dai_link->platform to fix card initAndrei Simion2024-06-061-2/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The removed dai_link->platform component cause a fail which is exposed at runtime. (ex: when a sound tool is used) This patch re-adds the dai_link->platform component to have a full card registered. Before this patch: :~$ aplay -l **** List of PLAYBACK Hardware Devices **** card 0: CLASSD [CLASSD], device 0: CLASSD PCM snd-soc-dummy-dai-0 [] Subdevices: 1/1 Subdevice #0: subdevice #0 :~$ speaker-test -t sine speaker-test 1.2.6 Playback device is default Stream parameters are 48000Hz, S16_LE, 1 channels Sine wave rate is 440.0000Hz Playback open error: -22,Invalid argument After this patch which restores the platform component: :~$ aplay -l **** List of PLAYBACK Hardware Devices **** card 0: CLASSD [CLASSD], device 0: CLASSD PCM snd-soc-dummy-dai-0 [CLASSD PCM snd-soc-dummy-dai-0] Subdevices: 1/1 Subdevice #0: subdevice #0 -> Resolve the playback error. Fixes: 2f650f87c03c ("ASoC: atmel: remove unnecessary dai_link->platform") Signed-off-by: Andrei Simion <[email protected]> Acked-by: Kuninori Morimoto <[email protected]> Link: https://msgid.link/r/[email protected] Signed-off-by: Mark Brown <[email protected]>
* ASoC: atmel: convert not to use asoc_xxx()Kuninori Morimoto2023-09-251-5/+5
| | | | | | | | | ASoC is now unified asoc_xxx() into snd_soc_xxx(). This patch convert asoc_xxx() to snd_soc_xxx(). Signed-off-by: Kuninori Morimoto <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Mark Brown <[email protected]>
* ASoC: atmel: use asoc_dummy_dlcKuninori Morimoto2023-05-071-5/+3
| | | | | | | | Now we can share asoc_dummy_dlc. This patch use it. Signed-off-by: Kuninori Morimoto <[email protected] Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Mark Brown <[email protected]
* ASoC: atmel: remove unnecessary dai_link->platformKuninori Morimoto2023-03-241-4/+1
| | | | | | | | | | dai_link->platform is no longer needed if CPU and Platform are same Component. This patch removes unnecessary dai_link->platform. Signed-off-by: Kuninori Morimoto <[email protected]> Acked-by: Nicolas Ferre <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Mark Brown <[email protected]>
* ASoC: atmel-classd: Drop empty platform remove functionUwe Kleine-König2022-12-251-6/+0
| | | | | | | | | | A remove callback just returning 0 is equivalent to no remove callback at all. So drop the useless function. Signed-off-by: Uwe Kleine-König <[email protected]> Reviewed-by: Claudiu Beznea <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Mark Brown <[email protected]>
* ASoC: atmel: Migrate to new style legacy DAI naming flagCharles Keepax2022-06-271-0/+1
| | | | | | | | | | | 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 <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Mark Brown <[email protected]>
* ASoC: atmel-classd: Remove endianness flag on class d componentCharles Keepax2022-05-091-1/+0
| | | | | | | | | | | | | | | | | | The endianness flag should have been removed when the driver was ported across from having both a CODEC and CPU side component, to just having a CPU component and using the dummy for the CODEC. The endianness flag is used to indicate that the device is completely ambivalent to the endianness of the data, typically due to the endianness being lost over the hardware link (ie. the link defines bit ordering). It's usage didn't have any effect when the driver had both a CPU and CODEC component, since the union of those equals the CPU side settings, but now causes the driver to falsely report it supports big endian. Correct this by removing the flag. Fixes: 1dfdbe73ccf9 ("ASoC: atmel-classd: remove codec component") Signed-off-by: Charles Keepax <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Mark Brown <[email protected]>
* ASoC: atmel-classd: Use devm_platform_get_and_ioremap_resource()Yang Yingliang2021-06-141-2/+1
| | | | | | | | | Use devm_platform_get_and_ioremap_resource() to simplify code. Signed-off-by: Yang Yingliang <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Mark Brown <[email protected]>
* ASoC: atmel: fix shadowed variablePierre-Louis Bossart2021-03-311-3/+3
| | | | | | | | | | | | | | | | | | | | Fix cppcheck warning: sound/soc/atmel/atmel-classd.c:51:14: style: Local variable 'pwm_type' shadows outer variable [shadowVariable] const char *pwm_type; ^ sound/soc/atmel/atmel-classd.c:226:27: note: Shadowed declaration static const char * const pwm_type[] = { ^ sound/soc/atmel/atmel-classd.c:51:14: note: Shadow variable const char *pwm_type; ^ Signed-off-by: Pierre-Louis Bossart <[email protected]> Reviewed-by: Codrin Ciubotariu <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Mark Brown <[email protected]>
* ASoC: atmel: use asoc_substream_to_rtd()Kuninori Morimoto2020-07-231-4/+4
| | | | | | | | | Now we can use asoc_substream_to_rtd() macro, let's use it. Signed-off-by: Kuninori Morimoto <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Mark Brown <[email protected]>
* ASoC: atmel: merge .digital_mute() into .mute_stream()Kuninori Morimoto2020-07-171-3/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | snd_soc_dai_digital_mute() is internally using both mute_stream() (1) or digital_mute() (2), but the difference between these 2 are only handling direction. We can merge digital_mute() into mute_stream int snd_soc_dai_digital_mute(xxx, int direction) { ... else if (dai->driver->ops->mute_stream) (1) return dai->driver->ops->mute_stream(xxx, direction); else if (direction == SNDRV_PCM_STREAM_PLAYBACK && dai->driver->ops->digital_mute) (2) return dai->driver->ops->digital_mute(xxx); ... } - Signed-off-by: Kuninori Morimoto <[email protected]> Reviewed-by: Peter Ujfalusi <[email protected]> Reviewed-by: Alexandre Belloni <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Mark Brown <[email protected]>
* ASoC: atmel-classd: remove codec componentCodrin Ciubotariu2020-07-091-85/+47
| | | | | | | | | | | | | The CPU and the codec both are represented now as components, so for CLASS-D we are registering two componenets with the same name. Since there is no actual codec, we will merge the codec component into the CPU one and use a dummy codec instead, for the DAI link. As a bonus, debugfs will no longer report an error when will try to create entries for both componenets with the same name. Signed-off-by: Codrin Ciubotariu <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Mark Brown <[email protected]>
* ASoC: Remove dev_err() usage after platform_get_irq()Stephen Boyd2019-08-021-5/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We don't need dev_err() messages when platform_get_irq() fails now that platform_get_irq() prints an error message itself when something goes wrong. Let's remove these prints with a simple semantic patch. // <smpl> @@ expression ret; struct platform_device *E; @@ ret = ( platform_get_irq(E, ...) | platform_get_irq_byname(E, ...) ); if ( \( ret < 0 \| ret <= 0 \) ) { ( -if (ret != -EPROBE_DEFER) -{ ... -dev_err(...); -... } | ... -dev_err(...); ) ... } // </smpl> While we're here, remove braces on if statements that only have one statement (manually). Cc: Liam Girdwood <[email protected]> Cc: Mark Brown <[email protected]> Cc: Jaroslav Kysela <[email protected]> Cc: Takashi Iwai <[email protected]> Cc: [email protected] Cc: Greg Kroah-Hartman <[email protected]> Signed-off-by: Stephen Boyd <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Mark Brown <[email protected]>
* ASoC: atmel: atmel-classd: consider CPU-Platform possibilityKuninori Morimoto2019-06-281-1/+4
| | | | | | | | | | | | | | | | | | | | | | | | commit 02602401e5316 ("ASoC: atmel: atmel-classd: don't select unnecessary Platform") Current ALSA SoC avoid to add duplicate component to rtd, and this driver was selecting CPU component as Platform component. Thus, above patch removed Platform settings from this driver, because it assumed these are same component. But, some CPU driver is using generic DMAEngine, in such case, both CPU component and Platform component will have same of_node/name. In other words, there are some components which are different but have same of_node/name. In such case, Card driver definitely need to select Platform even though it is same as CPU. It is depends on CPU driver, but is difficult to know it from Card driver. This patch reverts above patch. Fixes: commit 02602401e5316 ("ASoC: atmel: atmel-classd: don't select unnecessary Platform") Signed-off-by: Kuninori Morimoto <[email protected]> Signed-off-by: Mark Brown <[email protected]>
* Merge tag 'v5.2-rc6' into asoc-5.3Mark Brown2019-06-261-4/+1
|\ | | | | | | Linux 5.2-rc6
| * treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 3Thomas Gleixner2019-05-211-4/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Based on 1 normalized pattern(s): this program is free software you can redistribute it and or modify it under the terms of the gnu general public license version 2 or later as published by the free software foundation extracted by the scancode license scanner the SPDX license identifier GPL-2.0-or-later has been chosen to replace the boilerplate/reference in 9 file(s). Signed-off-by: Thomas Gleixner <[email protected]> Reviewed-by: Steve Winslow <[email protected]> Reviewed-by: Jilayne Lovejoy <[email protected]> Reviewed-by: Allison Randal <[email protected]> Reviewed-by: Kate Stewart <[email protected]> Cc: [email protected] Link: https://lkml.kernel.org/r/[email protected] Signed-off-by: Greg Kroah-Hartman <[email protected]>
* | ASoC: atmel: atmel-classd: don't select unnecessary PlatformKuninori Morimoto2019-06-191-4/+1
| | | | | | | | | | | | | | | | | | | | ALSA SoC is now supporting "no Platform". Sound card doesn't need to select "CPU component" as "Platform" anymore if it doesn't need special Platform. This patch removes such settings. Signed-off-by: Kuninori Morimoto <[email protected]> Signed-off-by: Mark Brown <[email protected]>
* | ASoC: atmel: atmel-classd: use modern dai_link styleKuninori Morimoto2019-06-061-4/+17
|/ | | | | | | | | ASoC is now supporting modern style dai_link (= snd_soc_dai_link_component) for CPU/Codec/Platform. This patch switches to use it. Signed-off-by: Kuninori Morimoto <[email protected]> Signed-off-by: Mark Brown <[email protected]>
*-. Merge remote-tracking branches 'asoc/topic/arizona', 'asoc/topic/atmel', ↵Mark Brown2018-03-281-32/+29
|\ \ | | | | | | | | | 'asoc/topic/bd28623', 'asoc/topic/blackfin' and 'asoc/topic/bt-sco' into asoc-next
| * | ASoC: atmel: Remove redundant dev_err() call in probe functionLadislav Michl2018-03-011-5/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | There is an error message within devm_ioremap_resource already, so remove the redundant dev_err() call. Signed-off-by: Ladislav Michl <[email protected]> Acked-by: Nicolas Ferre <[email protected]> Acked-by: Alexandre Belloni <[email protected]> Signed-off-by: Mark Brown <[email protected]>
| * | ASoC: atmel-classd: replace codec to componentKuninori Morimoto2018-02-121-27/+27
| |/ | | | | | | | | | | | | | | | | | | | | | | | | | | Now we can replace Codec to Component. Let's do it. Note: xxx_codec_xxx() -> xxx_component_xxx() .idle_bias_off = 0 -> .idle_bias_on = 1 .ignore_pmdown_time = 0 -> .use_pmdown_time = 1 - -> .endianness = 1 - -> .non_legacy_dai_naming = 1 Signed-off-by: Kuninori Morimoto <[email protected]> Signed-off-by: Mark Brown <[email protected]>
* / ASoC: atmel: replace platform to componentKuninori Morimoto2018-02-121-1/+3
|/ | | | | | | | | Now platform can be replaced to component, let's do it. To avoid complex operation, this patch adds device pointer to atmel_classd. Signed-off-by: Kuninori Morimoto <[email protected]> Signed-off-by: Mark Brown <[email protected]>
* ASoC: use snd_soc_component_init_regmap() on atmel-classdKuninori Morimoto2017-12-041-6/+0
| | | | | | | | | | | To setup regmap, ALSA SoC has snd_soc_component_init_regmap() and .get_regmap. But these are duplicated feature. This driver is using .get_regmap and set regmap by using dev_get_regmap(), but it is automatically done by snd_soc_component_add_unlocked(). let's remove .get_regmap. Signed-off-by: Kuninori Morimoto <[email protected]> Signed-off-by: Mark Brown <[email protected]>
* Merge tag 'clk-for-linus' of ↵Linus Torvalds2017-09-131-33/+14
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | git://git.kernel.org/pub/scm/linux/kernel/git/clk/linux Pull clk updates from Stephen Boyd: "The diff is dominated by the Allwinner A10/A20 SoCs getting converted to the sunxi-ng framework. Otherwise, the heavy hitters are various drivers for SoCs like AT91, Amlogic, Renesas, and Rockchip. There are some other new clk drivers in here too but overall this is just a bunch of clk drivers for various different pieces of hardware and a collection of non-critical fixes for clk drivers. New Drivers: - Allwinner R40 SoCs - Renesas R-Car Gen3 USB 2.0 clock selector PHY - Atmel AT91 audio PLL - Uniphier PXs3 SoCs - ARC HSDK Board PLLs - AXS10X Board PLLs - STMicroelectronics STM32H743 SoCs Removed Drivers: - Non-compiling mb86s7x support Updates: - Allwinner A10/A20 SoCs converted to sunxi-ng framework - Allwinner H3 CPU clk fixes - Renesas R-Car D3 SoC - Renesas V2H and M3-W modules - Samsung Exynos5420/5422/5800 audio fixes - Rockchip fractional clk approximation fixes - Rockchip rk3126 SoC support within the rk3128 driver - Amlogic gxbb CEC32 and sd_emmc clks - Amlogic meson8b reset controller support - IDT VersaClock 5P49V5925/5P49V6901 support - Qualcomm MSM8996 SMMU clks - Various 'const' applications for struct clk_ops - si5351 PLL reset bugfix - Uniphier audio on LD11/LD20 and ethernet support on LD11/LD20/Pro4/PXs2 - Assorted Tegra clk driver fixes" * tag 'clk-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/clk/linux: (120 commits) clk: si5351: fix PLL reset ASoC: atmel-classd: remove aclk clock ASoC: atmel-classd: remove aclk clock from DT binding clk: at91: clk-generated: make gclk determine audio_pll rate clk: at91: clk-generated: create function to find best_diff clk: at91: add audio pll clock drivers dt-bindings: clk: at91: add audio plls to the compatible list clk: at91: clk-generated: remove useless divisor loop clk: mb86s7x: Drop non-building driver clk: ti: check for null return in strrchr to avoid null dereferencing clk: Don't write error code into divider register clk: uniphier: add video input subsystem clock clk: uniphier: add audio system clock clk: stm32h7: Add stm32h743 clock driver clk: gate: expose clk_gate_ops::is_enabled clk: nxp: clk-lpc32xx: rename clk_gate_is_enabled() clk: uniphier: add PXs3 clock data clk: hi6220: change watchdog clock source clk: Kconfig: Name RK805 in Kconfig for COMMON_CLK_RK808 clk: cs2000: Add cs2000_set_saved_rate ...
| * ASoC: atmel-classd: remove aclk clockQuentin Schulz2017-09-011-33/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Since gclk (generated-clk) is now able to determine the rate of the audio_pll, there is no need for classd to have a direct phandle to the audio_pll while already having a phandle to gclk. Thus, remove all mentions to aclk in classd driver and update macros and variable names. Signed-off-by: Quentin Schulz <[email protected]> Acked-by: Mark Brown <[email protected]> Acked-by: Nicolas Ferre <[email protected]> Signed-off-by: Stephen Boyd <[email protected]>
* | ASoC: atmel: Remove unnecessary function callDonglin Peng2017-08-211-1/+0
|/ | | | | | | | | | | | The function platform_set_drvdata copies the value the variable card to card->dev->driver_data, then the address of &pdev->dev is assigned to card->dev in atmel_classd_asoc_card_init, but when calling snd_soc_register_card,the function dev_set_drvdata(card->dev, card) will do the same copy operation, so i think that the former copy operation can be removed. Signed-off-by: Peng Donglin <[email protected]> Signed-off-by: Mark Brown <[email protected]>
* ASoC: atmel-classd: sync regcache when resumingQuentin Schulz2017-05-171-0/+9
| | | | | | | | | | | | | | | The PM functions used in this driver are the ones defined in sounc/soc/soc-core.c. When suspending (using snd_soc_suspend), the regcache is marked dirty but is never synced on resume. Sync regcache on resume of Atmel ClassD device. Signed-off-by: Quentin Schulz <[email protected]> Acked-by: Alexandre Belloni <[email protected]> Acked-by: Nicolas Ferre <[email protected]> Signed-off-by: Mark Brown <[email protected]>
* ASoC: atmel-classd: fix audio clock rateSongjun Wu2017-03-071-1/+1
| | | | | | | | | | Fix the audio clock rate according to the datasheet. Reported-by: Dushara Jayasinghe <[email protected]> Signed-off-by: Songjun Wu <[email protected]> Acked-by: Nicolas Ferre <[email protected]> Signed-off-by: Mark Brown <[email protected]> Cc: [email protected]
* ASoC: codec duplicated callback function goes to component on atmel-classdKuninori Morimoto2016-08-081-2/+4
| | | | | | | | | | codec driver and component driver has duplicated callback functions, and codec side functions are just copied to component side when register timing. This was quick-hack, but no longer needed. This patch moves these functions from codec driver to component driver. Signed-off-by: Kuninori Morimoto <[email protected]> Signed-off-by: Mark Brown <[email protected]>
* ASoC: Atmel: ClassD: Simplify use of devm_ioremap_resourceAmitoj Kaur Chawla2016-07-041-5/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | Remove unneeded error handling on the result of a call to platform_get_resource when the value is passed to devm_ioremap_resource. The Coccinelle semantic patch that makes this change is as follows: // <smpl> @@ expression pdev,res,n,e,e1; expression ret != 0; identifier l; @@ - res = platform_get_resource(pdev, IORESOURCE_MEM, n); ... when != res - if (res == NULL) { ... \(goto l;\|return ret;\) } ... when != res + res = platform_get_resource(pdev, IORESOURCE_MEM, n); e = devm_ioremap_resource(e1, res); // </smpl> Signed-off-by: Amitoj Kaur Chawla <[email protected]> Signed-off-by: Mark Brown <[email protected]>
*-. Merge remote-tracking branches 'asoc/topic/atmel-classd', 'asoc/topic/const' ↵Mark Brown2015-12-231-4/+8
|\ \ | | | | | | | | | and 'asoc/topic/da7218' into asoc-next
| * | ASoC: Atmel: ClassD: supports mono audioSongjun Wu2015-11-201-4/+8
| |/ | | | | | | | | | | | | Modify the code to support mono audio. Signed-off-by: Songjun Wu <[email protected]> Signed-off-by: Mark Brown <[email protected]>
* / ASoC: Atmel: ClassD: unregister codec when error occursSongjun Wu2015-12-121-4/+10
|/ | | | | | | | Add code to unregister codec in probe function, when the error occurs after the codec is registered. Signed-off-by: Songjun Wu <[email protected]> Signed-off-by: Mark Brown <[email protected]>
* ASoC: atmel-classd: add the Audio Class D AmplifierSongjun Wu2015-10-221-0/+679
Add driver for the digital imput to PWM output stereo class D amplifier. It comes with filter, digitally controlled gain, an equalizer and a dmphase filter. Signed-off-by: Songjun Wu <[email protected]> Signed-off-by: Mark Brown <[email protected]>