[PATCH 00/43] ep93xx device tree conversion
This series aims to convert ep93xx from platform to full device tree support.
Tested on ts7250 64 RAM/128 MiB Nand flash, edb9302.
Thank you Linus and Arnd for your support, review and comments, sorry if i missed something - these series are quite big for me.
Big thanks to Alexander Sverdlin for his testing, support, review, fixes and patches.
Alexander Sverdlin (4): ARM: dts: ep93xx: Add ADC node ARM: dts: ep93xx: Add I2S and AC97 nodes ARM: dts: ep93xx: Add EDB9302 DT ASoC: cirrus: edb93xx: Delete driver
Nikita Shubin (39): gpio: ep93xx: split device in multiple soc: Add SoC driver for Cirrus ep93xx dt-bindings: pinctrl: Add DT bindings ep93xx pinctrl pinctrl: add a Cirrus ep93xx SoC pin controller dt-bindings: timers: add DT bindings for Cirrus EP93xx clocksource: ep93xx: Add driver for Cirrus Logic EP93xx dt-bindings: rtc: add DT bindings for Cirrus EP93xx rtc: ep93xx: add DT support for Cirrus EP93xx dt-bindings: watchdog: add DT bindings for Cirrus EP93x watchdog: ep93xx: add DT support for Cirrus EP93xx dt-bindings: clock: add DT bindings for Cirrus EP93xx clk: ep93xx: add DT support for Cirrus EP93xx power: reset: Add a driver for the ep93xx reset dt-bindings: pwm: Add DT bindings ep93xx PWM pwm: ep93xx: add DT support for Cirrus EP93xx dt-bindings: spi: Add DT bindings ep93xx spi spi: ep93xx: add DT support for Cirrus EP93xx dt-bindings: net: Add DT bindings ep93xx eth net: cirrus: add DT support for Cirrus EP93xx dt-bindings: dma: Add DT bindings ep93xx dma dma: cirrus: add DT support for Cirrus EP93xx dt-bindings: mtd: add DT bindings for ts7250 nand mtd: ts72xx_nand: add platform helper dt-bindings: ata: Add DT bindings ep93xx pata pata: cirrus: add DT support for Cirrus EP93xx dt-bindings: input: Add DT bindings ep93xx keypad input: keypad: ep93xx: add DT support for Cirrus EP93xx dt-bindings: rtc: Add DT binding m48t86 rtc rtc: m48t86: add DT support for m48t86 dt-bindings: wdt: Add DT binding ts72xx wdt wdt: ts72xx: add DT support for ts72xx dt-bindings: gpio: Add DT bindings ep93xx gpio gpio: ep93xx: add DT support for gpio-ep93xx ARM: dts: add device tree for ep93xx Soc ARM: ep93xx: DT for the Cirrus ep93xx SoC platforms pwm: ep93xx: drop legacy pinctrl input: keypad: ep93xx: drop legacy pinctrl ARM: ep93xx: soc: drop defines ARM: ep93xx: delete all boardfiles
.../devicetree/bindings/arm/ep93xx.yaml | 99 + .../bindings/ata/cirrus,ep93xx-pata.yaml | 40 + .../bindings/dma/cirrus,ep93xx-dma-m2m.yaml | 66 + .../bindings/dma/cirrus,ep93xx-dma-m2p.yaml | 102 + .../devicetree/bindings/gpio/gpio-ep93xx.yaml | 161 ++ .../bindings/input/cirrus,ep93xx-keypad.yaml | 123 ++ .../bindings/mtd/technologic,nand.yaml | 56 + .../bindings/net/cirrus,ep93xx_eth.yaml | 51 + .../pinctrl/cirrus,ep93xx-pinctrl.yaml | 66 + .../bindings/pwm/cirrus,ep93xx-pwm.yaml | 45 + .../bindings/rtc/cirrus,ep93xx-rtc.yaml | 32 + .../bindings/rtc/dallas,rtc-m48t86.yaml | 33 + .../devicetree/bindings/spi/spi-ep93xx.yaml | 68 + .../bindings/timer/cirrus,ep93xx-timer.yaml | 41 + .../bindings/watchdog/cirrus,ep93xx-wdt.yaml | 38 + .../watchdog/technologic,ts72xx-wdt.yaml | 39 + arch/arm/Makefile | 1 - arch/arm/boot/dts/Makefile | 1 + arch/arm/boot/dts/ep93xx-bk3.dts | 96 + arch/arm/boot/dts/ep93xx-edb9302.dts | 150 ++ arch/arm/boot/dts/ep93xx-ts7250.dts | 113 ++ arch/arm/boot/dts/ep93xx.dtsi | 466 +++++ arch/arm/mach-ep93xx/Kconfig | 20 +- arch/arm/mach-ep93xx/Makefile | 11 - arch/arm/mach-ep93xx/core.c | 1017 ---------- arch/arm/mach-ep93xx/dma.c | 114 -- arch/arm/mach-ep93xx/edb93xx.c | 344 ---- arch/arm/mach-ep93xx/ep93xx-regs.h | 38 - arch/arm/mach-ep93xx/gpio-ep93xx.h | 111 -- arch/arm/mach-ep93xx/hardware.h | 25 - arch/arm/mach-ep93xx/irqs.h | 76 - arch/arm/mach-ep93xx/platform.h | 42 - arch/arm/mach-ep93xx/soc.h | 212 -- arch/arm/mach-ep93xx/ts72xx.c | 422 ---- arch/arm/mach-ep93xx/ts72xx.h | 94 - arch/arm/mach-ep93xx/vision_ep9307.c | 311 --- drivers/ata/pata_ep93xx.c | 9 + drivers/clk/Kconfig | 8 + drivers/clk/Makefile | 1 + .../clock.c => drivers/clk/clk-ep93xx.c | 491 +++-- drivers/clocksource/Kconfig | 11 + drivers/clocksource/Makefile | 1 + .../clocksource}/timer-ep93xx.c | 143 +- drivers/dma/ep93xx_dma.c | 119 +- drivers/gpio/gpio-ep93xx.c | 329 ++-- drivers/input/keyboard/ep93xx_keypad.c | 25 +- drivers/mtd/nand/raw/Kconfig | 8 + drivers/mtd/nand/raw/Makefile | 1 + drivers/mtd/nand/raw/ts72xx_nand.c | 94 + drivers/net/ethernet/cirrus/ep93xx_eth.c | 49 +- drivers/pinctrl/Kconfig | 7 + drivers/pinctrl/Makefile | 1 + drivers/pinctrl/pinctrl-ep93xx.c | 1698 +++++++++++++++++ drivers/power/reset/Kconfig | 10 + drivers/power/reset/Makefile | 1 + drivers/power/reset/ep93xx-restart.c | 65 + drivers/pwm/pwm-ep93xx.c | 24 +- drivers/rtc/rtc-ep93xx.c | 8 + drivers/rtc/rtc-m48t86.c | 10 + drivers/soc/Kconfig | 1 + drivers/soc/Makefile | 1 + drivers/soc/cirrus/Kconfig | 11 + drivers/soc/cirrus/Makefile | 2 + drivers/soc/cirrus/soc-ep93xx.c | 134 ++ drivers/spi/spi-ep93xx.c | 31 +- drivers/watchdog/ep93xx_wdt.c | 8 + drivers/watchdog/ts72xx_wdt.c | 8 + .../dt-bindings/clock/cirrus,ep93xx-clock.h | 53 + include/linux/platform_data/dma-ep93xx.h | 3 + include/linux/soc/cirrus/ep93xx.h | 28 +- sound/soc/cirrus/Kconfig | 9 - sound/soc/cirrus/Makefile | 4 - sound/soc/cirrus/edb93xx.c | 119 -- 73 files changed, 4796 insertions(+), 3453 deletions(-) create mode 100644 Documentation/devicetree/bindings/arm/ep93xx.yaml create mode 100644 Documentation/devicetree/bindings/ata/cirrus,ep93xx-pata.yaml create mode 100644 Documentation/devicetree/bindings/dma/cirrus,ep93xx-dma-m2m.yaml create mode 100644 Documentation/devicetree/bindings/dma/cirrus,ep93xx-dma-m2p.yaml create mode 100644 Documentation/devicetree/bindings/gpio/gpio-ep93xx.yaml create mode 100644 Documentation/devicetree/bindings/input/cirrus,ep93xx-keypad.yaml create mode 100644 Documentation/devicetree/bindings/mtd/technologic,nand.yaml create mode 100644 Documentation/devicetree/bindings/net/cirrus,ep93xx_eth.yaml create mode 100644 Documentation/devicetree/bindings/pinctrl/cirrus,ep93xx-pinctrl.yaml create mode 100644 Documentation/devicetree/bindings/pwm/cirrus,ep93xx-pwm.yaml create mode 100644 Documentation/devicetree/bindings/rtc/cirrus,ep93xx-rtc.yaml create mode 100644 Documentation/devicetree/bindings/rtc/dallas,rtc-m48t86.yaml create mode 100644 Documentation/devicetree/bindings/spi/spi-ep93xx.yaml create mode 100644 Documentation/devicetree/bindings/timer/cirrus,ep93xx-timer.yaml create mode 100644 Documentation/devicetree/bindings/watchdog/cirrus,ep93xx-wdt.yaml create mode 100644 Documentation/devicetree/bindings/watchdog/technologic,ts72xx-wdt.yaml create mode 100644 arch/arm/boot/dts/ep93xx-bk3.dts create mode 100644 arch/arm/boot/dts/ep93xx-edb9302.dts create mode 100644 arch/arm/boot/dts/ep93xx-ts7250.dts create mode 100644 arch/arm/boot/dts/ep93xx.dtsi delete mode 100644 arch/arm/mach-ep93xx/Makefile delete mode 100644 arch/arm/mach-ep93xx/core.c delete mode 100644 arch/arm/mach-ep93xx/dma.c delete mode 100644 arch/arm/mach-ep93xx/edb93xx.c delete mode 100644 arch/arm/mach-ep93xx/ep93xx-regs.h delete mode 100644 arch/arm/mach-ep93xx/gpio-ep93xx.h delete mode 100644 arch/arm/mach-ep93xx/hardware.h delete mode 100644 arch/arm/mach-ep93xx/irqs.h delete mode 100644 arch/arm/mach-ep93xx/platform.h delete mode 100644 arch/arm/mach-ep93xx/soc.h delete mode 100644 arch/arm/mach-ep93xx/ts72xx.c delete mode 100644 arch/arm/mach-ep93xx/ts72xx.h delete mode 100644 arch/arm/mach-ep93xx/vision_ep9307.c rename arch/arm/mach-ep93xx/clock.c => drivers/clk/clk-ep93xx.c (60%) rename {arch/arm/mach-ep93xx => drivers/clocksource}/timer-ep93xx.c (51%) create mode 100644 drivers/mtd/nand/raw/ts72xx_nand.c create mode 100644 drivers/pinctrl/pinctrl-ep93xx.c create mode 100644 drivers/power/reset/ep93xx-restart.c create mode 100644 drivers/soc/cirrus/Kconfig create mode 100644 drivers/soc/cirrus/Makefile create mode 100644 drivers/soc/cirrus/soc-ep93xx.c create mode 100644 include/dt-bindings/clock/cirrus,ep93xx-clock.h delete mode 100644 sound/soc/cirrus/edb93xx.c
On Mon, Apr 24, 2023, at 14:34, Nikita Shubin wrote:
This series aims to convert ep93xx from platform to full device tree support.
Tested on ts7250 64 RAM/128 MiB Nand flash, edb9302.
Thank you Linus and Arnd for your support, review and comments, sorry if i missed something - these series are quite big for me.
Big thanks to Alexander Sverdlin for his testing, support, review, fixes and patches.
Thanks a lot for your continued work. I can't merge any of this at the moment since the upstream merge window just opened, but I'm happy to take this all through the soc tree for 6.5, provided we get the sufficient Acks from the subsystem maintainers. Merging it through each individual tree would take a lot longer, so I hope we can avoid that.
Arnd
On Mon, 24 Apr 2023 13:31:25 +0200 Arnd Bergmann wrote:
Thanks a lot for your continued work. I can't merge any of this at the moment since the upstream merge window just opened, but I'm happy to take this all through the soc tree for 6.5, provided we get the sufficient Acks from the subsystem maintainers. Merging it through each individual tree would take a lot longer, so I hope we can avoid that.
Is there a dependency between the patches?
On 25/04/2023 00:29, Jakub Kicinski wrote:
On Mon, 24 Apr 2023 13:31:25 +0200 Arnd Bergmann wrote:
Thanks a lot for your continued work. I can't merge any of this at the moment since the upstream merge window just opened, but I'm happy to take this all through the soc tree for 6.5, provided we get the sufficient Acks from the subsystem maintainers. Merging it through each individual tree would take a lot longer, so I hope we can avoid that.
Is there a dependency between the patches?
I didn't get entire patchset and cover letter does not mention dependencies, but usually there shouldn't be such. Maybe for the next versions this should be split per subsystem?
Best regards, Krzysztof
On Tue, Apr 25, 2023, at 10:20, Krzysztof Kozlowski wrote:
On 25/04/2023 00:29, Jakub Kicinski wrote:
On Mon, 24 Apr 2023 13:31:25 +0200 Arnd Bergmann wrote:
Thanks a lot for your continued work. I can't merge any of this at the moment since the upstream merge window just opened, but I'm happy to take this all through the soc tree for 6.5, provided we get the sufficient Acks from the subsystem maintainers. Merging it through each individual tree would take a lot longer, so I hope we can avoid that.
Is there a dependency between the patches?
I didn't get entire patchset and cover letter does not mention dependencies, but usually there shouldn't be such. Maybe for the next versions this should be split per subsystem?
Clearly the last patch that removes the board files depends on all the previous patches, but I assume that the other ones are all independent.
We don't do complete conversions from boardfiles to DT that often any more, but in the past we tended to do this through a cross- subsystem branch in the soc tree, which helps do it more quickly and is less work for Nikita. In this case, I would make it a separate top-level branch in the soc tree.
If anyone strongly feels that the patches should go through the subsystem trees here, we'll take the longer path and do the changes separately, with the boardfile removal coming a release later.
Arnd
From: Alexander Sverdlin alexander.sverdlin@gmail.com
Can be replaced with "simple-audio-card" for the rates up to 50kHz, refer to commit "ARM: dts: ep93xx: Add EDB9302 DT".
Signed-off-by: Alexander Sverdlin alexander.sverdlin@gmail.com Signed-off-by: Nikita Shubin nikita.shubin@maquefel.me --- sound/soc/cirrus/Kconfig | 9 --- sound/soc/cirrus/Makefile | 4 -- sound/soc/cirrus/edb93xx.c | 119 ------------------------------------- 3 files changed, 132 deletions(-) delete mode 100644 sound/soc/cirrus/edb93xx.c
diff --git a/sound/soc/cirrus/Kconfig b/sound/soc/cirrus/Kconfig index 34870c2d0cba..a88b7d61b4c1 100644 --- a/sound/soc/cirrus/Kconfig +++ b/sound/soc/cirrus/Kconfig @@ -27,12 +27,3 @@ config SND_EP93XX_SOC_I2S_WATCHDOG
endif # if SND_EP93XX_SOC_I2S
-config SND_EP93XX_SOC_EDB93XX - tristate "SoC Audio support for Cirrus Logic EDB93xx boards" - depends on SND_EP93XX_SOC && (MACH_EDB9301 || MACH_EDB9302 || MACH_EDB9302A || MACH_EDB9307A || MACH_EDB9315A) - select SND_EP93XX_SOC_I2S - select SND_SOC_CS4271_I2C if I2C - select SND_SOC_CS4271_SPI if SPI_MASTER - help - Say Y or M here if you want to add support for I2S audio on the - Cirrus Logic EDB93xx boards. diff --git a/sound/soc/cirrus/Makefile b/sound/soc/cirrus/Makefile index 19a86daad660..5916c03888cb 100644 --- a/sound/soc/cirrus/Makefile +++ b/sound/soc/cirrus/Makefile @@ -6,7 +6,3 @@ snd-soc-ep93xx-i2s-objs := ep93xx-i2s.o obj-$(CONFIG_SND_EP93XX_SOC) += snd-soc-ep93xx.o obj-$(CONFIG_SND_EP93XX_SOC_I2S) += snd-soc-ep93xx-i2s.o
-# EP93XX Machine Support -snd-soc-edb93xx-objs := edb93xx.o - -obj-$(CONFIG_SND_EP93XX_SOC_EDB93XX) += snd-soc-edb93xx.o diff --git a/sound/soc/cirrus/edb93xx.c b/sound/soc/cirrus/edb93xx.c deleted file mode 100644 index 385290202912..000000000000 --- a/sound/soc/cirrus/edb93xx.c +++ /dev/null @@ -1,119 +0,0 @@ -// SPDX-License-Identifier: GPL-2.0-or-later -/* - * SoC audio for EDB93xx - * - * Copyright (c) 2010 Alexander Sverdlin subaparts@yandex.ru - * - * This driver support CS4271 codec being master or slave, working - * in control port mode, connected either via SPI or I2C. - * The data format accepted is I2S or left-justified. - * DAPM support not implemented. - */ - -#include <linux/platform_device.h> -#include <linux/gpio.h> -#include <linux/module.h> -#include <linux/soc/cirrus/ep93xx.h> -#include <sound/core.h> -#include <sound/pcm.h> -#include <sound/soc.h> -#include <asm/mach-types.h> - -static int edb93xx_hw_params(struct snd_pcm_substream *substream, - struct snd_pcm_hw_params *params) -{ - struct snd_soc_pcm_runtime *rtd = asoc_substream_to_rtd(substream); - struct snd_soc_dai *codec_dai = asoc_rtd_to_codec(rtd, 0); - struct snd_soc_dai *cpu_dai = asoc_rtd_to_cpu(rtd, 0); - int err; - unsigned int mclk_rate; - unsigned int rate = params_rate(params); - - /* - * According to CS4271 datasheet we use MCLK/LRCK=256 for - * rates below 50kHz and 128 for higher sample rates - */ - if (rate < 50000) - mclk_rate = rate * 64 * 4; - else - mclk_rate = rate * 64 * 2; - - err = snd_soc_dai_set_sysclk(codec_dai, 0, mclk_rate, - SND_SOC_CLOCK_IN); - if (err) - return err; - - return snd_soc_dai_set_sysclk(cpu_dai, 0, mclk_rate, - SND_SOC_CLOCK_OUT); -} - -static const struct snd_soc_ops edb93xx_ops = { - .hw_params = edb93xx_hw_params, -}; - -SND_SOC_DAILINK_DEFS(hifi, - DAILINK_COMP_ARRAY(COMP_CPU("ep93xx-i2s")), - DAILINK_COMP_ARRAY(COMP_CODEC("spi0.0", "cs4271-hifi")), - DAILINK_COMP_ARRAY(COMP_PLATFORM("ep93xx-i2s"))); - -static struct snd_soc_dai_link edb93xx_dai = { - .name = "CS4271", - .stream_name = "CS4271 HiFi", - .dai_fmt = SND_SOC_DAIFMT_I2S | SND_SOC_DAIFMT_NB_NF | - SND_SOC_DAIFMT_CBC_CFC, - .ops = &edb93xx_ops, - SND_SOC_DAILINK_REG(hifi), -}; - -static struct snd_soc_card snd_soc_edb93xx = { - .name = "EDB93XX", - .owner = THIS_MODULE, - .dai_link = &edb93xx_dai, - .num_links = 1, -}; - -static int edb93xx_probe(struct platform_device *pdev) -{ - struct snd_soc_card *card = &snd_soc_edb93xx; - int ret; - - ret = ep93xx_i2s_acquire(); - if (ret) - return ret; - - card->dev = &pdev->dev; - - ret = snd_soc_register_card(card); - if (ret) { - dev_err(&pdev->dev, "snd_soc_register_card() failed: %d\n", - ret); - ep93xx_i2s_release(); - } - - return ret; -} - -static int edb93xx_remove(struct platform_device *pdev) -{ - struct snd_soc_card *card = platform_get_drvdata(pdev); - - snd_soc_unregister_card(card); - ep93xx_i2s_release(); - - return 0; -} - -static struct platform_driver edb93xx_driver = { - .driver = { - .name = "edb93xx-audio", - }, - .probe = edb93xx_probe, - .remove = edb93xx_remove, -}; - -module_platform_driver(edb93xx_driver); - -MODULE_AUTHOR("Alexander Sverdlin subaparts@yandex.ru"); -MODULE_DESCRIPTION("ALSA SoC EDB93xx"); -MODULE_LICENSE("GPL"); -MODULE_ALIAS("platform:edb93xx-audio");
On Mon, Apr 24, 2023 at 11:35 AM Nikita Shubin nikita.shubin@maquefel.me wrote:
This series aims to convert ep93xx from platform to full device tree support.
Tested on ts7250 64 RAM/128 MiB Nand flash, edb9302.
Neat, I'd say let's merge this for 6.5 once the final rough edges are off. The DT bindings should be easy to fix.
This is a big patch set and the improvement to the ARM kernel it brings is great, so I am a bit worried about over-review stalling the merged. If there start to be nitpicky comments I would prefer that we merge it and let minor comments and "nice-to-haves" be addressed in-tree during the development cycle.
I encourage you to use b4 to manage the patch series if you have time to learn it, it could help you: https://people.kernel.org/monsieuricon/sending-a-kernel-patch-with-b4-part-1
Yours, Linus Walleij
On Wed, Apr 26, 2023 at 10:56:53PM +0200, Linus Walleij wrote:
This is a big patch set and the improvement to the ARM kernel it brings is great, so I am a bit worried about over-review stalling the merged. If there start to be nitpicky comments I would prefer that we merge it and let minor comments and "nice-to-haves" be addressed in-tree during the development cycle.
I'm really not enthusiastic about the SPI bindings being merged as-is.
On Wed, Apr 26, 2023 at 11:02 PM Mark Brown broonie@kernel.org wrote:
On Wed, Apr 26, 2023 at 10:56:53PM +0200, Linus Walleij wrote:
This is a big patch set and the improvement to the ARM kernel it brings is great, so I am a bit worried about over-review stalling the merged. If there start to be nitpicky comments I would prefer that we merge it and let minor comments and "nice-to-haves" be addressed in-tree during the development cycle.
I'm really not enthusiastic about the SPI bindings being merged as-is.
Agree, the bindings are more important than the code IMO, they tend to get written in stone.
Yours, Linus Walleij
On 4/24/2023 5:34 AM, Nikita Shubin wrote:
This series aims to convert ep93xx from platform to full device tree support.
Tested on ts7250 64 RAM/128 MiB Nand flash, edb9302.
Thank you Linus and Arnd for your support, review and comments, sorry if i missed something - these series are quite big for me.
Big thanks to Alexander Sverdlin for his testing, support, review, fixes and patches.
If anyone is interested I still have a TS-7300 board [1] that is fully functional and could be sent out to a new home.
https://www.embeddedts.com/products/TS-7300
Hello Florian!
On Mon, 2023-05-15 at 20:47 -0700, Florian Fainelli wrote:
On 4/24/2023 5:34 AM, Nikita Shubin wrote:
This series aims to convert ep93xx from platform to full device tree support.
Tested on ts7250 64 RAM/128 MiB Nand flash, edb9302.
Thank you Linus and Arnd for your support, review and comments, sorry if i missed something - these series are quite big for me.
Big thanks to Alexander Sverdlin for his testing, support, review, fixes and patches.
If anyone is interested I still have a TS-7300 board [1] that is fully functional and could be sent out to a new home.
Thank you kindly, i'll keep this in mind !
From: Alexander Sverdlin alexander.sverdlin@gmail.com
Can be replaced with "simple-audio-card" for the rates up to 50kHz, refer to commit "ARM: dts: ep93xx: Add EDB9302 DT".
Signed-off-by: Alexander Sverdlin alexander.sverdlin@gmail.com Signed-off-by: Nikita Shubin nikita.shubin@maquefel.me --- sound/soc/cirrus/Kconfig | 9 --- sound/soc/cirrus/Makefile | 4 -- sound/soc/cirrus/edb93xx.c | 117 ------------------------------------- 3 files changed, 130 deletions(-) delete mode 100644 sound/soc/cirrus/edb93xx.c
diff --git a/sound/soc/cirrus/Kconfig b/sound/soc/cirrus/Kconfig index 38a83c4dcc2d..97def4e53fbc 100644 --- a/sound/soc/cirrus/Kconfig +++ b/sound/soc/cirrus/Kconfig @@ -31,12 +31,3 @@ config SND_EP93XX_SOC_I2S_WATCHDOG
endif # if SND_EP93XX_SOC_I2S
-config SND_EP93XX_SOC_EDB93XX - tristate "SoC Audio support for Cirrus Logic EDB93xx boards" - depends on SND_EP93XX_SOC && (MACH_EDB9301 || MACH_EDB9302 || MACH_EDB9302A || MACH_EDB9307A || MACH_EDB9315A) - select SND_EP93XX_SOC_I2S - select SND_SOC_CS4271_I2C if I2C - select SND_SOC_CS4271_SPI if SPI_MASTER - help - Say Y or M here if you want to add support for I2S audio on the - Cirrus Logic EDB93xx boards. diff --git a/sound/soc/cirrus/Makefile b/sound/soc/cirrus/Makefile index 19a86daad660..5916c03888cb 100644 --- a/sound/soc/cirrus/Makefile +++ b/sound/soc/cirrus/Makefile @@ -6,7 +6,3 @@ snd-soc-ep93xx-i2s-objs := ep93xx-i2s.o obj-$(CONFIG_SND_EP93XX_SOC) += snd-soc-ep93xx.o obj-$(CONFIG_SND_EP93XX_SOC_I2S) += snd-soc-ep93xx-i2s.o
-# EP93XX Machine Support -snd-soc-edb93xx-objs := edb93xx.o - -obj-$(CONFIG_SND_EP93XX_SOC_EDB93XX) += snd-soc-edb93xx.o diff --git a/sound/soc/cirrus/edb93xx.c b/sound/soc/cirrus/edb93xx.c deleted file mode 100644 index f49caab21a25..000000000000 --- a/sound/soc/cirrus/edb93xx.c +++ /dev/null @@ -1,117 +0,0 @@ -// SPDX-License-Identifier: GPL-2.0-or-later -/* - * SoC audio for EDB93xx - * - * Copyright (c) 2010 Alexander Sverdlin subaparts@yandex.ru - * - * This driver support CS4271 codec being master or slave, working - * in control port mode, connected either via SPI or I2C. - * The data format accepted is I2S or left-justified. - * DAPM support not implemented. - */ - -#include <linux/platform_device.h> -#include <linux/gpio.h> -#include <linux/module.h> -#include <linux/soc/cirrus/ep93xx.h> -#include <sound/core.h> -#include <sound/pcm.h> -#include <sound/soc.h> -#include <asm/mach-types.h> - -static int edb93xx_hw_params(struct snd_pcm_substream *substream, - struct snd_pcm_hw_params *params) -{ - struct snd_soc_pcm_runtime *rtd = asoc_substream_to_rtd(substream); - struct snd_soc_dai *codec_dai = asoc_rtd_to_codec(rtd, 0); - struct snd_soc_dai *cpu_dai = asoc_rtd_to_cpu(rtd, 0); - int err; - unsigned int mclk_rate; - unsigned int rate = params_rate(params); - - /* - * According to CS4271 datasheet we use MCLK/LRCK=256 for - * rates below 50kHz and 128 for higher sample rates - */ - if (rate < 50000) - mclk_rate = rate * 64 * 4; - else - mclk_rate = rate * 64 * 2; - - err = snd_soc_dai_set_sysclk(codec_dai, 0, mclk_rate, - SND_SOC_CLOCK_IN); - if (err) - return err; - - return snd_soc_dai_set_sysclk(cpu_dai, 0, mclk_rate, - SND_SOC_CLOCK_OUT); -} - -static const struct snd_soc_ops edb93xx_ops = { - .hw_params = edb93xx_hw_params, -}; - -SND_SOC_DAILINK_DEFS(hifi, - DAILINK_COMP_ARRAY(COMP_CPU("ep93xx-i2s")), - DAILINK_COMP_ARRAY(COMP_CODEC("spi0.0", "cs4271-hifi")), - DAILINK_COMP_ARRAY(COMP_PLATFORM("ep93xx-i2s"))); - -static struct snd_soc_dai_link edb93xx_dai = { - .name = "CS4271", - .stream_name = "CS4271 HiFi", - .dai_fmt = SND_SOC_DAIFMT_I2S | SND_SOC_DAIFMT_NB_NF | - SND_SOC_DAIFMT_CBC_CFC, - .ops = &edb93xx_ops, - SND_SOC_DAILINK_REG(hifi), -}; - -static struct snd_soc_card snd_soc_edb93xx = { - .name = "EDB93XX", - .owner = THIS_MODULE, - .dai_link = &edb93xx_dai, - .num_links = 1, -}; - -static int edb93xx_probe(struct platform_device *pdev) -{ - struct snd_soc_card *card = &snd_soc_edb93xx; - int ret; - - ret = ep93xx_i2s_acquire(); - if (ret) - return ret; - - card->dev = &pdev->dev; - - ret = snd_soc_register_card(card); - if (ret) { - dev_err(&pdev->dev, "snd_soc_register_card() failed: %d\n", - ret); - ep93xx_i2s_release(); - } - - return ret; -} - -static void edb93xx_remove(struct platform_device *pdev) -{ - struct snd_soc_card *card = platform_get_drvdata(pdev); - - snd_soc_unregister_card(card); - ep93xx_i2s_release(); -} - -static struct platform_driver edb93xx_driver = { - .driver = { - .name = "edb93xx-audio", - }, - .probe = edb93xx_probe, - .remove_new = edb93xx_remove, -}; - -module_platform_driver(edb93xx_driver); - -MODULE_AUTHOR("Alexander Sverdlin subaparts@yandex.ru"); -MODULE_DESCRIPTION("ALSA SoC EDB93xx"); -MODULE_LICENSE("GPL"); -MODULE_ALIAS("platform:edb93xx-audio");
participants (7)
-
Arnd Bergmann
-
Florian Fainelli
-
Jakub Kicinski
-
Krzysztof Kozlowski
-
Linus Walleij
-
Mark Brown
-
Nikita Shubin