* [PATCH v4 17/42] dt-bindings: pwm: Add Cirrus EP93xx
2023-09-15 8:10 [PATCH v4 00/42] ep93xx device tree conversion Nikita Shubin via B4 Relay
@ 2023-09-15 8:10 ` Nikita Shubin via B4 Relay
2023-09-15 10:45 ` Krzysztof Kozlowski
2023-09-15 8:11 ` [PATCH v4 18/42] pwm: ep93xx: add DT support for " Nikita Shubin via B4 Relay
` (3 subsequent siblings)
4 siblings, 1 reply; 9+ messages in thread
From: Nikita Shubin via B4 Relay @ 2023-09-15 8:10 UTC (permalink / raw)
To: Thierry Reding, Uwe Kleine-König, Rob Herring,
Krzysztof Kozlowski, Conor Dooley, Alexander Sverdlin,
Nikita Shubin
Cc: linux-pwm, devicetree, linux-kernel, Arnd Bergmann,
Alexander Sverdlin
From: Nikita Shubin <nikita.shubin@maquefel.me>
Add YAML bindings for ep93xx SoC PWM.
Signed-off-by: Nikita Shubin <nikita.shubin@maquefel.me>
Acked-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
---
.../devicetree/bindings/pwm/cirrus,ep9301-pwm.yaml | 46 ++++++++++++++++++++++
1 file changed, 46 insertions(+)
diff --git a/Documentation/devicetree/bindings/pwm/cirrus,ep9301-pwm.yaml b/Documentation/devicetree/bindings/pwm/cirrus,ep9301-pwm.yaml
new file mode 100644
index 000000000000..198b9a40f756
--- /dev/null
+++ b/Documentation/devicetree/bindings/pwm/cirrus,ep9301-pwm.yaml
@@ -0,0 +1,46 @@
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/pwm/cirrus,ep9301-pwm.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Cirrus Logick ep93xx PWM controller
+
+maintainers:
+ - Alexander Sverdlin <alexander.sverdlin@gmail.com>
+ - Nikita Shubin <nikita.shubin@maquefel.me>
+
+properties:
+ compatible:
+ oneOf:
+ - const: cirrus,ep9301-pwm
+ - items:
+ - enum:
+ - cirrus,ep9302-pwm
+ - cirrus,ep9307-pwm
+ - cirrus,ep9312-pwm
+ - cirrus,ep9315-pwm
+ - const: cirrus,ep9301-pwm
+
+ reg:
+ maxItems: 1
+
+ clocks:
+ items:
+ - description: SoC PWM clock
+
+required:
+ - compatible
+ - reg
+ - clocks
+
+additionalProperties: false
+
+examples:
+ - |
+ #include <dt-bindings/clock/cirrus,ep9301-clk.h>
+ pwm@80910000 {
+ compatible = "cirrus,ep9301-pwm";
+ reg = <0x80910000 0x10>;
+ clocks = <&syscon EP93XX_CLK_PWM>;
+ };
--
2.39.2
^ permalink raw reply related [flat|nested] 9+ messages in thread* Re: [PATCH v4 17/42] dt-bindings: pwm: Add Cirrus EP93xx
2023-09-15 8:10 ` [PATCH v4 17/42] dt-bindings: pwm: Add Cirrus EP93xx Nikita Shubin via B4 Relay
@ 2023-09-15 10:45 ` Krzysztof Kozlowski
0 siblings, 0 replies; 9+ messages in thread
From: Krzysztof Kozlowski @ 2023-09-15 10:45 UTC (permalink / raw)
To: nikita.shubin, Thierry Reding, Uwe Kleine-König, Rob Herring,
Krzysztof Kozlowski, Conor Dooley, Alexander Sverdlin
Cc: linux-pwm, devicetree, linux-kernel, Arnd Bergmann
On 15/09/2023 10:10, Nikita Shubin via B4 Relay wrote:
> From: Nikita Shubin <nikita.shubin@maquefel.me>
>
> Add YAML bindings for ep93xx SoC PWM.
>
> Signed-off-by: Nikita Shubin <nikita.shubin@maquefel.me>
> Acked-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
> ---
> .../devicetree/bindings/pwm/cirrus,ep9301-pwm.yaml | 46 ++++++++++++++++++++++
> 1 file changed, 46 insertions(+)
>
> diff --git a/Documentation/devicetree/bindings/pwm/cirrus,ep9301-pwm.yaml b/Documentation/devicetree/bindings/pwm/cirrus,ep9301-pwm.yaml
> new file mode 100644
> index 000000000000..198b9a40f756
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/pwm/cirrus,ep9301-pwm.yaml
> @@ -0,0 +1,46 @@
> +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
> +%YAML 1.2
> +---
> +$id: http://devicetree.org/schemas/pwm/cirrus,ep9301-pwm.yaml#
> +$schema: http://devicetree.org/meta-schemas/core.yaml#
> +
> +title: Cirrus Logick ep93xx PWM controller
> +
> +maintainers:
> + - Alexander Sverdlin <alexander.sverdlin@gmail.com>
> + - Nikita Shubin <nikita.shubin@maquefel.me>
> +
$ref to pwm.yaml
> +properties:
> + compatible:
> + oneOf:
> + - const: cirrus,ep9301-pwm
> + - items:
> + - enum:
> + - cirrus,ep9302-pwm
> + - cirrus,ep9307-pwm
> + - cirrus,ep9312-pwm
> + - cirrus,ep9315-pwm
> + - const: cirrus,ep9301-pwm
> +
> + reg:
> + maxItems: 1
> +
> + clocks:
> + items:
> + - description: SoC PWM clock
No pwm-cells?
> +
> +required:
> + - compatible
> + - reg
> + - clocks
> +
> +additionalProperties: false
and then unevaluatedProperties: false instead
Best regards,
Krzysztof
^ permalink raw reply [flat|nested] 9+ messages in thread
* [PATCH v4 18/42] pwm: ep93xx: add DT support for Cirrus EP93xx
2023-09-15 8:10 [PATCH v4 00/42] ep93xx device tree conversion Nikita Shubin via B4 Relay
2023-09-15 8:10 ` [PATCH v4 17/42] dt-bindings: pwm: Add Cirrus EP93xx Nikita Shubin via B4 Relay
@ 2023-09-15 8:11 ` Nikita Shubin via B4 Relay
2023-09-15 10:43 ` Uwe Kleine-König
2023-09-15 8:11 ` [PATCH v4 37/42] pwm: ep93xx: drop legacy pinctrl Nikita Shubin via B4 Relay
` (2 subsequent siblings)
4 siblings, 1 reply; 9+ messages in thread
From: Nikita Shubin via B4 Relay @ 2023-09-15 8:11 UTC (permalink / raw)
To: Thierry Reding, Uwe Kleine-König
Cc: linux-pwm, linux-kernel, Arnd Bergmann, Alexander Sverdlin
From: Nikita Shubin <nikita.shubin@maquefel.me>
Add OF ID match table.
Signed-off-by: Nikita Shubin <nikita.shubin@maquefel.me>
---
drivers/pwm/pwm-ep93xx.c | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/drivers/pwm/pwm-ep93xx.c b/drivers/pwm/pwm-ep93xx.c
index c45a75e65c86..361984ef4c0b 100644
--- a/drivers/pwm/pwm-ep93xx.c
+++ b/drivers/pwm/pwm-ep93xx.c
@@ -17,6 +17,7 @@
*/
#include <linux/module.h>
+#include <linux/mod_devicetable.h>
#include <linux/platform_device.h>
#include <linux/slab.h>
#include <linux/clk.h>
@@ -190,9 +191,16 @@ static int ep93xx_pwm_probe(struct platform_device *pdev)
return 0;
}
+static const struct of_device_id ep93xx_pwm_of_ids[] = {
+ { .compatible = "cirrus,ep9301-pwm" },
+ { /* sentinel */}
+};
+MODULE_DEVICE_TABLE(of, ep93xx_pwm_of_ids);
+
static struct platform_driver ep93xx_pwm_driver = {
.driver = {
.name = "ep93xx-pwm",
+ .of_match_table = ep93xx_pwm_of_ids,
},
.probe = ep93xx_pwm_probe,
};
--
2.39.2
^ permalink raw reply related [flat|nested] 9+ messages in thread* Re: [PATCH v4 18/42] pwm: ep93xx: add DT support for Cirrus EP93xx
2023-09-15 8:11 ` [PATCH v4 18/42] pwm: ep93xx: add DT support for " Nikita Shubin via B4 Relay
@ 2023-09-15 10:43 ` Uwe Kleine-König
0 siblings, 0 replies; 9+ messages in thread
From: Uwe Kleine-König @ 2023-09-15 10:43 UTC (permalink / raw)
To: nikita.shubin
Cc: Thierry Reding, linux-pwm, linux-kernel, Arnd Bergmann,
Alexander Sverdlin
[-- Attachment #1: Type: text/plain, Size: 462 bytes --]
On Fri, Sep 15, 2023 at 11:11:00AM +0300, Nikita Shubin via B4 Relay wrote:
> From: Nikita Shubin <nikita.shubin@maquefel.me>
>
> Add OF ID match table.
>
> Signed-off-by: Nikita Shubin <nikita.shubin@maquefel.me>
Reviewed-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Thanks
Uwe
--
Pengutronix e.K. | Uwe Kleine-König |
Industrial Linux Solutions | https://www.pengutronix.de/ |
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]
^ permalink raw reply [flat|nested] 9+ messages in thread
* [PATCH v4 37/42] pwm: ep93xx: drop legacy pinctrl
2023-09-15 8:10 [PATCH v4 00/42] ep93xx device tree conversion Nikita Shubin via B4 Relay
2023-09-15 8:10 ` [PATCH v4 17/42] dt-bindings: pwm: Add Cirrus EP93xx Nikita Shubin via B4 Relay
2023-09-15 8:11 ` [PATCH v4 18/42] pwm: ep93xx: add DT support for " Nikita Shubin via B4 Relay
@ 2023-09-15 8:11 ` Nikita Shubin via B4 Relay
2023-09-15 8:46 ` Linus Walleij
2023-09-18 7:39 ` [PATCH v4 00/42] ep93xx device tree conversion Andy Shevchenko
2023-10-15 21:17 ` (subset) " Alexandre Belloni
4 siblings, 1 reply; 9+ messages in thread
From: Nikita Shubin via B4 Relay @ 2023-09-15 8:11 UTC (permalink / raw)
To: Hartley Sweeten, Alexander Sverdlin, Russell King, Thierry Reding,
Uwe Kleine-König, Nikita Shubin, Linus Walleij,
Sergey Shtylyov, Damien Le Moal
Cc: linux-arm-kernel, linux-kernel, linux-pwm, Arnd Bergmann,
Alexander Sverdlin
From: Nikita Shubin <nikita.shubin@maquefel.me>
Drop legacy gpio request/free since we are using
pinctrl for this now.
Acked-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Acked-by: Thierry Reding <thierry.reding@gmail.com>
Signed-off-by: Nikita Shubin <nikita.shubin@maquefel.me>
---
arch/arm/mach-ep93xx/core.c | 42 ---------------------------------------
drivers/pwm/pwm-ep93xx.c | 18 -----------------
include/linux/soc/cirrus/ep93xx.h | 4 ----
3 files changed, 64 deletions(-)
diff --git a/arch/arm/mach-ep93xx/core.c b/arch/arm/mach-ep93xx/core.c
index c60a9d3632dd..9afc6095d1c1 100644
--- a/arch/arm/mach-ep93xx/core.c
+++ b/arch/arm/mach-ep93xx/core.c
@@ -576,48 +576,6 @@ void __init ep93xx_register_pwm(int pwm0, int pwm1)
platform_device_register(&ep93xx_pwm1_device);
}
-int ep93xx_pwm_acquire_gpio(struct platform_device *pdev)
-{
- int err;
-
- if (pdev->id == 0) {
- err = 0;
- } else if (pdev->id == 1) {
- err = gpio_request(EP93XX_GPIO_LINE_EGPIO14,
- dev_name(&pdev->dev));
- if (err)
- return err;
- err = gpio_direction_output(EP93XX_GPIO_LINE_EGPIO14, 0);
- if (err)
- goto fail;
-
- /* PWM 1 output on EGPIO[14] */
- ep93xx_devcfg_set_bits(EP93XX_SYSCON_DEVCFG_PONG);
- } else {
- err = -ENODEV;
- }
-
- return err;
-
-fail:
- gpio_free(EP93XX_GPIO_LINE_EGPIO14);
- return err;
-}
-EXPORT_SYMBOL(ep93xx_pwm_acquire_gpio);
-
-void ep93xx_pwm_release_gpio(struct platform_device *pdev)
-{
- if (pdev->id == 1) {
- gpio_direction_input(EP93XX_GPIO_LINE_EGPIO14);
- gpio_free(EP93XX_GPIO_LINE_EGPIO14);
-
- /* EGPIO[14] used for GPIO */
- ep93xx_devcfg_clear_bits(EP93XX_SYSCON_DEVCFG_PONG);
- }
-}
-EXPORT_SYMBOL(ep93xx_pwm_release_gpio);
-
-
/*************************************************************************
* EP93xx video peripheral handling
*************************************************************************/
diff --git a/drivers/pwm/pwm-ep93xx.c b/drivers/pwm/pwm-ep93xx.c
index 361984ef4c0b..ac08bd0e7572 100644
--- a/drivers/pwm/pwm-ep93xx.c
+++ b/drivers/pwm/pwm-ep93xx.c
@@ -27,8 +27,6 @@
#include <asm/div64.h>
-#include <linux/soc/cirrus/ep93xx.h> /* for ep93xx_pwm_{acquire,release}_gpio() */
-
#define EP93XX_PWMx_TERM_COUNT 0x00
#define EP93XX_PWMx_DUTY_CYCLE 0x04
#define EP93XX_PWMx_ENABLE 0x08
@@ -45,20 +43,6 @@ static inline struct ep93xx_pwm *to_ep93xx_pwm(struct pwm_chip *chip)
return container_of(chip, struct ep93xx_pwm, chip);
}
-static int ep93xx_pwm_request(struct pwm_chip *chip, struct pwm_device *pwm)
-{
- struct platform_device *pdev = to_platform_device(chip->dev);
-
- return ep93xx_pwm_acquire_gpio(pdev);
-}
-
-static void ep93xx_pwm_free(struct pwm_chip *chip, struct pwm_device *pwm)
-{
- struct platform_device *pdev = to_platform_device(chip->dev);
-
- ep93xx_pwm_release_gpio(pdev);
-}
-
static int ep93xx_pwm_apply(struct pwm_chip *chip, struct pwm_device *pwm,
const struct pwm_state *state)
{
@@ -157,8 +141,6 @@ static int ep93xx_pwm_apply(struct pwm_chip *chip, struct pwm_device *pwm,
}
static const struct pwm_ops ep93xx_pwm_ops = {
- .request = ep93xx_pwm_request,
- .free = ep93xx_pwm_free,
.apply = ep93xx_pwm_apply,
.owner = THIS_MODULE,
};
diff --git a/include/linux/soc/cirrus/ep93xx.h b/include/linux/soc/cirrus/ep93xx.h
index 4327f66b7cf5..0df0f3322487 100644
--- a/include/linux/soc/cirrus/ep93xx.h
+++ b/include/linux/soc/cirrus/ep93xx.h
@@ -12,8 +12,6 @@ struct regmap;
#define EP93XX_CHIP_REV_E2 7
#if defined(CONFIG_EP93XX_SOC_COMMON)
-int ep93xx_pwm_acquire_gpio(struct platform_device *pdev);
-void ep93xx_pwm_release_gpio(struct platform_device *pdev);
int ep93xx_ide_acquire_gpio(struct platform_device *pdev);
void ep93xx_ide_release_gpio(struct platform_device *pdev);
int ep93xx_i2s_acquire(void);
@@ -21,8 +19,6 @@ void ep93xx_i2s_release(void);
unsigned int ep93xx_chip_revision(void);
#else
-static inline int ep93xx_pwm_acquire_gpio(struct platform_device *pdev) { return 0; }
-static inline void ep93xx_pwm_release_gpio(struct platform_device *pdev) {}
static inline int ep93xx_ide_acquire_gpio(struct platform_device *pdev) { return 0; }
static inline void ep93xx_ide_release_gpio(struct platform_device *pdev) {}
static inline int ep93xx_i2s_acquire(void) { return 0; }
--
2.39.2
^ permalink raw reply related [flat|nested] 9+ messages in thread* Re: [PATCH v4 37/42] pwm: ep93xx: drop legacy pinctrl
2023-09-15 8:11 ` [PATCH v4 37/42] pwm: ep93xx: drop legacy pinctrl Nikita Shubin via B4 Relay
@ 2023-09-15 8:46 ` Linus Walleij
0 siblings, 0 replies; 9+ messages in thread
From: Linus Walleij @ 2023-09-15 8:46 UTC (permalink / raw)
To: nikita.shubin
Cc: Hartley Sweeten, Alexander Sverdlin, Russell King, Thierry Reding,
Uwe Kleine-König, Sergey Shtylyov, Damien Le Moal,
linux-arm-kernel, linux-kernel, linux-pwm, Arnd Bergmann
On Fri, Sep 15, 2023 at 10:12 AM Nikita Shubin via B4 Relay
<devnull+nikita.shubin.maquefel.me@kernel.org> wrote:
> From: Nikita Shubin <nikita.shubin@maquefel.me>
>
> Drop legacy gpio request/free since we are using
> pinctrl for this now.
>
> Acked-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
> Acked-by: Thierry Reding <thierry.reding@gmail.com>
> Signed-off-by: Nikita Shubin <nikita.shubin@maquefel.me>
Acked-by: Linus Walleij <linus.walleij@linaro.org>
Yours,
Linus Walleij
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH v4 00/42] ep93xx device tree conversion
2023-09-15 8:10 [PATCH v4 00/42] ep93xx device tree conversion Nikita Shubin via B4 Relay
` (2 preceding siblings ...)
2023-09-15 8:11 ` [PATCH v4 37/42] pwm: ep93xx: drop legacy pinctrl Nikita Shubin via B4 Relay
@ 2023-09-18 7:39 ` Andy Shevchenko
2023-10-15 21:17 ` (subset) " Alexandre Belloni
4 siblings, 0 replies; 9+ messages in thread
From: Andy Shevchenko @ 2023-09-18 7:39 UTC (permalink / raw)
To: nikita.shubin
Cc: Hartley Sweeten, Alexander Sverdlin, Russell King,
Lukasz Majewski, Linus Walleij, Bartosz Golaszewski,
Michael Turquette, Stephen Boyd, Rob Herring, Krzysztof Kozlowski,
Conor Dooley, Sebastian Reichel, Daniel Lezcano, Thomas Gleixner,
Alessandro Zummo, Alexandre Belloni, Wim Van Sebroeck,
Guenter Roeck, Thierry Reding, Uwe Kleine-König, Mark Brown,
David S. Miller, Eric Dumazet, Jakub Kicinski, Paolo Abeni,
Vinod Koul, Miquel Raynal, Richard Weinberger,
Vignesh Raghavendra, Damien Le Moal, Sergey Shtylyov,
Dmitry Torokhov, Liam Girdwood, Jaroslav Kysela, Takashi Iwai,
linux-arm-kernel, linux-kernel, linux-gpio, linux-clk, devicetree,
linux-pm, linux-rtc, linux-watchdog, linux-pwm, linux-spi, netdev,
dmaengine, linux-mtd, linux-ide, linux-input, alsa-devel,
Arnd Bergmann, Bartosz Golaszewski, Krzysztof Kozlowski,
Andrew Lunn
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.
--
With Best Regards,
Andy Shevchenko
^ permalink raw reply [flat|nested] 9+ messages in thread* Re: (subset) [PATCH v4 00/42] ep93xx device tree conversion
2023-09-15 8:10 [PATCH v4 00/42] ep93xx device tree conversion Nikita Shubin via B4 Relay
` (3 preceding siblings ...)
2023-09-18 7:39 ` [PATCH v4 00/42] ep93xx device tree conversion Andy Shevchenko
@ 2023-10-15 21:17 ` Alexandre Belloni
4 siblings, 0 replies; 9+ messages in thread
From: Alexandre Belloni @ 2023-10-15 21:17 UTC (permalink / raw)
To: Hartley Sweeten, Alexander Sverdlin, Russell King,
Lukasz Majewski, Linus Walleij, Bartosz Golaszewski,
Andy Shevchenko, Michael Turquette, Stephen Boyd, Rob Herring,
Krzysztof Kozlowski, Conor Dooley, Sebastian Reichel,
Daniel Lezcano, Thomas Gleixner, Alessandro Zummo,
Wim Van Sebroeck, Guenter Roeck, Thierry Reding,
Uwe Kleine-König, Mark Brown, David S. Miller, Eric Dumazet,
Jakub Kicinski, Paolo Abeni, Vinod Koul, Miquel Raynal,
Richard Weinberger, Vignesh Raghavendra, Damien Le Moal,
Sergey Shtylyov, Dmitry Torokhov, Liam Girdwood, Jaroslav Kysela,
Takashi Iwai, Nikita Shubin
Cc: linux-arm-kernel, linux-kernel, linux-gpio, linux-clk, devicetree,
linux-pm, linux-rtc, linux-watchdog, linux-pwm, linux-spi, netdev,
dmaengine, linux-mtd, linux-ide, linux-input, alsa-devel,
Arnd Bergmann, Bartosz Golaszewski, Krzysztof Kozlowski,
Andy Shevchenko, Andrew Lunn
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,
--
Alexandre Belloni, co-owner and COO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com
^ permalink raw reply [flat|nested] 9+ messages in thread