[PATCH v4 00/42] ep93xx device tree conversion
![](https://secure.gravatar.com/avatar/2671db69fb0ba4feb1f405c540d4cef5.jpg?s=120&d=mm&r=g)
This series aims to convert ep93xx from platform to full device tree support.
The main goal is to receive ACK's to take it via Arnd's arm-soc branch.
Major changes: - drop newline at the end from each YAML files - rename dma and clk bindings headers to match first compatible - shrink SoC exported functions number to only 2 - dropped some ep93xx_pata fixes from these series - dropped m48t86 stuff from these series
Bit thanks to Andy Shevchenko for thorough review.
Some parts are were sent in advance, so these series depends on the following:
Link: https://lore.kernel.org/all/20230823-m48t86_device_tree-v2-0-21ff275f949d@ma... Link: https://lore.kernel.org/all/20230823-ep93xx_pata_fixes-v1-0-d7e7229be148@maq...
--- Changes in v4:
- gpio: ep93xx: split device in multiple - s/generic_handle_irq/generic_handle_domain_irq/ - s/int offset/irq_hw_number_t offset/ though now it looks a bit odd to me - drop i = 0 - drop 'error' - use dev_err_probe withour printing devname once again
dt-bindings: clock: Add Cirrus EP93xx - renamed cirrus,ep93xx-clock.h -> cirrus,ep9301-clk.h
clk: ep93xx: add DT support for Cirrus EP93xx - drop unused includes - use .name only for xtali, pll1, pll2 parents - convert // to /* - pass clk_parent_data instead of char* clock name
dt-bindings: pinctrl: Add Cirrus EP93xx - s/additionalProperties/unevaluatedProperties/
dt-bindings: soc: Add Cirrus EP93xx - move syscon to soc directory - add vendor prefix - make reboot same style as pinctrl, clk - use absolute path for ref - expand example
soc: Add SoC driver for Cirrus ep93xx - s/0xf0000000/GENMASK(31, 28)/ - s/ret/ep93xx_chip_revision(map)/ - drop symbol exports - convert to platform driver
dt-bindings: rtc: Add Cirrus EP93xx - allOf: with $ref to rtc.yaml - s/additionalProperties/unevaluatedProperties/
dt-bindings: watchdog: Add Cirrus EP93x - drop description - reword
power: reset: Add a driver for the ep93xx reset - lets use 'GPL-2.0+' instead of '(GPL-2.0)' - s/of_device/of/ - drop mdelay with warning - return 0 at the end
net: cirrus: add DT support for Cirrus EP93xx - fix leaking np
mtd: nand: add support for ts72xx - +bits.h - drop comment - ok to fwnode_get_next_child_node - use goto to put handle and nand and report error
ARM: dts: add Cirrus EP93XX SoC .dtsi - add simple-bus for ebi, as we don't require to setup anything - add arm,pl011 compatible to uart nodes - drop i2c-gpio, as it's isn't used anywhere
ARM: dts: ep93xx: add ts7250 board - generic node name for temperature-sensor - drop i2c - move nand, rtc, watchdog to ebi node
- Link to v3: https://lore.kernel.org/r/20230605-ep93xx-v3-0-3d63a5f1103e@maquefel.me
--- Alexander Sverdlin (2): ARM: dts: ep93xx: Add EDB9302 DT ASoC: cirrus: edb93xx: Delete driver
Nikita Shubin (40): gpio: ep93xx: split device in multiple ARM: ep93xx: add swlocked prototypes dt-bindings: clock: Add Cirrus EP93xx clk: ep93xx: add DT support for Cirrus EP93xx dt-bindings: pinctrl: Add Cirrus EP93xx pinctrl: add a Cirrus ep93xx SoC pin controller dt-bindings: power: reset: Add ep93xx reset power: reset: Add a driver for the ep93xx reset dt-bindings: soc: Add Cirrus EP93xx soc: Add SoC driver for Cirrus ep93xx dt-bindings: timers: Add Cirrus EP93xx clocksource: ep93xx: Add driver for Cirrus Logic EP93xx dt-bindings: rtc: Add Cirrus EP93xx rtc: ep93xx: add DT support for Cirrus EP93xx dt-bindings: watchdog: Add Cirrus EP93x watchdog: ep93xx: add DT support for Cirrus EP93xx dt-bindings: pwm: Add Cirrus EP93xx pwm: ep93xx: add DT support for Cirrus EP93xx dt-bindings: spi: Add Cirrus EP93xx spi: ep93xx: add DT support for Cirrus EP93xx dt-bindings: net: Add Cirrus EP93xx net: cirrus: add DT support for Cirrus EP93xx dt-bindings: dma: Add Cirrus EP93xx dma: cirrus: add DT support for Cirrus EP93xx dt-bindings: mtd: Add ts7200 nand-controller mtd: nand: add support for ts72xx dt-bindings: ata: Add Cirrus EP93xx ata: pata_ep93xx: add device tree support dt-bindings: input: Add Cirrus EP93xx keypad input: keypad: ep93xx: add DT support for Cirrus EP93xx dt-bindings: wdt: Add ts72xx wdt: ts72xx: add DT support for ts72xx gpio: ep93xx: add DT support for gpio-ep93xx ARM: dts: add Cirrus EP93XX SoC .dtsi ARM: dts: ep93xx: add ts7250 board ARM: ep93xx: DT for the Cirrus ep93xx SoC platforms pwm: ep93xx: drop legacy pinctrl ata: pata_ep93xx: remove legacy pinctrl use ARM: ep93xx: delete all boardfiles ARM: ep93xx: soc: drop defines
.../bindings/arm/cirrus/cirrus,ep9301.yaml | 38 + .../bindings/ata/cirrus,ep9312-pata.yaml | 42 + .../bindings/clock/cirrus,ep9301-clk.yaml | 46 + .../bindings/dma/cirrus,ep9301-dma-m2m.yaml | 69 + .../bindings/dma/cirrus,ep9301-dma-m2p.yaml | 121 ++ .../bindings/input/cirrus,ep9307-keypad.yaml | 87 ++ .../devicetree/bindings/mtd/technologic,nand.yaml | 45 + .../devicetree/bindings/net/cirrus,ep9301-eth.yaml | 59 + .../bindings/pinctrl/cirrus,ep9301-pinctrl.yaml | 57 + .../bindings/power/reset/cirrus,ep9301-reboot.yaml | 34 + .../devicetree/bindings/pwm/cirrus,ep9301-pwm.yaml | 46 + .../devicetree/bindings/rtc/cirrus,ep9301-rtc.yaml | 42 + .../bindings/soc/cirrus/cirrus,ep9301-syscon.yaml | 71 + .../devicetree/bindings/spi/cirrus,ep9301-spi.yaml | 61 + .../bindings/timer/cirrus,ep9301-timer.yaml | 49 + .../bindings/watchdog/cirrus,ep9301-wdt.yaml | 42 + .../bindings/watchdog/technologic,ts7200-wdt.yaml | 45 + arch/arm/Makefile | 1 - arch/arm/boot/dts/cirrus/Makefile | 4 + arch/arm/boot/dts/cirrus/ep93xx-bk3.dts | 124 ++ arch/arm/boot/dts/cirrus/ep93xx-edb9302.dts | 180 +++ arch/arm/boot/dts/cirrus/ep93xx-ts7250.dts | 143 ++ arch/arm/boot/dts/cirrus/ep93xx.dtsi | 454 +++++++ arch/arm/mach-ep93xx/Kconfig | 20 +- arch/arm/mach-ep93xx/Makefile | 11 - arch/arm/mach-ep93xx/clock.c | 733 ---------- 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 | 33 +- drivers/clk/Kconfig | 8 + drivers/clk/Makefile | 1 + drivers/clk/clk-ep93xx.c | 753 +++++++++++ drivers/clocksource/Kconfig | 11 + drivers/clocksource/Makefile | 1 + .../clocksource}/timer-ep93xx.c | 155 ++- drivers/dma/ep93xx_dma.c | 125 +- drivers/gpio/gpio-ep93xx.c | 331 ++--- drivers/input/keyboard/ep93xx_keypad.c | 74 +- drivers/mtd/nand/raw/Kconfig | 7 + drivers/mtd/nand/raw/Makefile | 1 + drivers/mtd/nand/raw/technologic-nand-controller.c | 166 +++ drivers/net/ethernet/cirrus/ep93xx_eth.c | 63 +- drivers/pinctrl/Kconfig | 7 + drivers/pinctrl/Makefile | 1 + drivers/pinctrl/pinctrl-ep93xx.c | 1429 ++++++++++++++++++++ drivers/power/reset/Kconfig | 10 + drivers/power/reset/Makefile | 1 + drivers/power/reset/ep93xx-restart.c | 85 ++ drivers/pwm/pwm-ep93xx.c | 26 +- drivers/rtc/rtc-ep93xx.c | 8 + drivers/soc/Kconfig | 1 + drivers/soc/Makefile | 1 + drivers/soc/cirrus/Kconfig | 12 + drivers/soc/cirrus/Makefile | 2 + drivers/soc/cirrus/soc-ep93xx.c | 215 +++ drivers/spi/spi-ep93xx.c | 28 +- drivers/watchdog/ep93xx_wdt.c | 8 + drivers/watchdog/ts72xx_wdt.c | 8 + include/dt-bindings/clock/cirrus,ep9301-clk.h | 41 + include/dt-bindings/dma/cirrus,ep93xx-dma.h | 26 + include/linux/platform_data/dma-ep93xx.h | 25 +- include/linux/platform_data/eth-ep93xx.h | 10 - include/linux/platform_data/keypad-ep93xx.h | 32 - include/linux/soc/cirrus/ep93xx.h | 29 +- sound/soc/cirrus/Kconfig | 9 - sound/soc/cirrus/Makefile | 4 - sound/soc/cirrus/edb93xx.c | 117 -- 77 files changed, 5126 insertions(+), 4168 deletions(-) --- base-commit: bdc09c8e8b16d494ccd1c56e903e78dd76455a35 change-id: 20230605-ep93xx-01c76317e2d2
Best regards,
![](https://secure.gravatar.com/avatar/2671db69fb0ba4feb1f405c540d4cef5.jpg?s=120&d=mm&r=g)
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 Acked-by: Mark Brown broonie@kernel.org 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(-)
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");
![](https://secure.gravatar.com/avatar/d930951cb00393ecf9c3db3a56d78fa9.jpg?s=120&d=mm&r=g)
On Fri, Sep 15, 2023 at 11:11:24AM +0300, Nikita Shubin via B4 Relay wrote:
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".
Please use audio-graph-card2 for new systems, it's a more flexible replacement.
![](https://secure.gravatar.com/avatar/cc6241601c10954970c5c6826308ae94.jpg?s=120&d=mm&r=g)
On Fri, Sep 15, 2023 at 11:10:42AM +0300, Nikita Shubin via B4 Relay wrote:
This series aims to convert ep93xx from platform to full device tree support.
The main goal is to receive ACK's to take it via Arnd's arm-soc branch.
Major changes:
- drop newline at the end from each YAML files
- rename dma and clk bindings headers to match first compatible
- shrink SoC exported functions number to only 2
- dropped some ep93xx_pata fixes from these series
- dropped m48t86 stuff from these series
Bit thanks to Andy Shevchenko for thorough review.
You are welcome!
Dunno if you have used --patience when formatted the patches, but I think you should, if hadn't, for the next version. It will help a lot in reviewing and understanding the changes.
![](https://secure.gravatar.com/avatar/e9b70778b7af3b79dc1bf62dc64f6685.jpg?s=120&d=mm&r=g)
On Fri, 15 Sep 2023 11:10:42 +0300, Nikita Shubin wrote:
This series aims to convert ep93xx from platform to full device tree support.
The main goal is to receive ACK's to take it via Arnd's arm-soc branch.
Major changes:
- drop newline at the end from each YAML files
- rename dma and clk bindings headers to match first compatible
- shrink SoC exported functions number to only 2
- dropped some ep93xx_pata fixes from these series
- dropped m48t86 stuff from these series
[...]
Applied, thanks!
[13/42] dt-bindings: rtc: Add Cirrus EP93xx commit: 207bddd97881913bcb8bef84737c0971e712fbee [14/42] rtc: ep93xx: add DT support for Cirrus EP93xx commit: 1d70f9fe5f1c8fbd5d838223b8aec27c69a7e609
Best regards,
participants (4)
-
Alexandre Belloni
-
Andy Shevchenko
-
Mark Brown
-
Nikita Shubin via B4 Relay