* [PATCH 1/3] ARM64: dts: meson-gx: add the missing pwm_AO_ab node
2017-01-22 21:05 [PATCH 0/3] meson-gx: add pwm_AO_ab Martin Blumenstingl
@ 2017-01-22 21:05 ` Martin Blumenstingl
2017-01-22 21:05 ` [PATCH 2/3] pinctrl: meson: meson-gxl: add the pwm_ao_b pin Martin Blumenstingl
` (2 subsequent siblings)
3 siblings, 0 replies; 8+ messages in thread
From: Martin Blumenstingl @ 2017-01-22 21:05 UTC (permalink / raw)
To: linux-gpio, linux-amlogic, linus.walleij, khilman, carlo
Cc: linux-arm-kernel, devicetree, will.deacon, catalin.marinas,
mark.rutland, robh+dt, Martin Blumenstingl
All Meson GX SoCs (GXBB, GXL and GXM) have a PWM controller within the
AO domain. When one of the board's LEDs is connected to one of the AO
PWM pins then this can be used to dim that LED (when the leds-pwm driver
is used).
Add the pwm_AO_ab to allow such devices to use the leds-pwm driver.
Signed-off-by: Martin Blumenstingl <martin.blumenstingl@googlemail.com>
---
arch/arm64/boot/dts/amlogic/meson-gx.dtsi | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/arch/arm64/boot/dts/amlogic/meson-gx.dtsi b/arch/arm64/boot/dts/amlogic/meson-gx.dtsi
index c76a690967f8..3e3fb6972567 100644
--- a/arch/arm64/boot/dts/amlogic/meson-gx.dtsi
+++ b/arch/arm64/boot/dts/amlogic/meson-gx.dtsi
@@ -340,6 +340,13 @@
status = "disabled";
};
+ pwm_AO_ab: pwm@550 {
+ compatible = "amlogic,meson-gx-pwm", "amlogic,meson-gxbb-pwm";
+ reg = <0x0 0x00550 0x0 0x10>;
+ #pwm-cells = <3>;
+ status = "disabled";
+ };
+
ir: ir@580 {
compatible = "amlogic,meson-gxbb-ir";
reg = <0x0 0x00580 0x0 0x40>;
--
2.11.0
^ permalink raw reply related [flat|nested] 8+ messages in thread* [PATCH 2/3] pinctrl: meson: meson-gxl: add the pwm_ao_b pin
2017-01-22 21:05 [PATCH 0/3] meson-gx: add pwm_AO_ab Martin Blumenstingl
2017-01-22 21:05 ` [PATCH 1/3] ARM64: dts: meson-gx: add the missing pwm_AO_ab node Martin Blumenstingl
@ 2017-01-22 21:05 ` Martin Blumenstingl
[not found] ` <20170122210528.892-3-martin.blumenstingl-gM/Ye1E23mwN+BqQ9rBEUg@public.gmane.org>
2017-01-26 14:41 ` Linus Walleij
2017-01-22 21:05 ` [PATCH 3/3] ARM64: dts: " Martin Blumenstingl
2017-01-27 19:02 ` [PATCH 0/3] meson-gx: add pwm_AO_ab Kevin Hilman
3 siblings, 2 replies; 8+ messages in thread
From: Martin Blumenstingl @ 2017-01-22 21:05 UTC (permalink / raw)
To: linux-gpio, linux-amlogic, linus.walleij, khilman, carlo
Cc: linux-arm-kernel, devicetree, will.deacon, catalin.marinas,
mark.rutland, robh+dt, Martin Blumenstingl
This adds support for the pwm_ao_b pin. Unfortunately the registers for
the pwm_ao pins are not documented at all. The source for the pwm_ao_b
pin from this patch is the Khadas VIM GPL kernel source, which sets bit
3 and unsets bits 4 and 31 to enable the PWM LEDs.
Signed-off-by: Martin Blumenstingl <martin.blumenstingl@googlemail.com>
---
drivers/pinctrl/meson/pinctrl-meson-gxl.c | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/drivers/pinctrl/meson/pinctrl-meson-gxl.c b/drivers/pinctrl/meson/pinctrl-meson-gxl.c
index 25694f7094c7..6ff321a7366d 100644
--- a/drivers/pinctrl/meson/pinctrl-meson-gxl.c
+++ b/drivers/pinctrl/meson/pinctrl-meson-gxl.c
@@ -222,6 +222,8 @@ static const unsigned int uart_rts_ao_b_pins[] = { PIN(GPIOAO_3, 0) };
static const unsigned int remote_input_ao_pins[] = {PIN(GPIOAO_7, 0) };
+static const unsigned int pwm_ao_b_pins[] = { PIN(GPIOAO_9, 0) };
+
static struct meson_pmx_group meson_gxl_periphs_groups[] = {
GPIO_GROUP(GPIOZ_0, EE_OFF),
GPIO_GROUP(GPIOZ_1, EE_OFF),
@@ -418,6 +420,7 @@ static struct meson_pmx_group meson_gxl_aobus_groups[] = {
GROUP(uart_cts_ao_b, 0, 8),
GROUP(uart_rts_ao_b, 0, 7),
GROUP(remote_input_ao, 0, 0),
+ GROUP(pwm_ao_b, 0, 3),
};
static const char * const gpio_periphs_groups[] = {
@@ -523,6 +526,10 @@ static const char * const remote_input_ao_groups[] = {
"remote_input_ao",
};
+static const char * const pwm_ao_b_groups[] = {
+ "pwm_ao_b",
+};
+
static struct meson_pmx_func meson_gxl_periphs_functions[] = {
FUNCTION(gpio_periphs),
FUNCTION(emmc),
@@ -544,6 +551,7 @@ static struct meson_pmx_func meson_gxl_aobus_functions[] = {
FUNCTION(uart_ao),
FUNCTION(uart_ao_b),
FUNCTION(remote_input_ao),
+ FUNCTION(pwm_ao_b),
};
static struct meson_bank meson_gxl_periphs_banks[] = {
--
2.11.0
^ permalink raw reply related [flat|nested] 8+ messages in thread[parent not found: <20170122210528.892-3-martin.blumenstingl-gM/Ye1E23mwN+BqQ9rBEUg@public.gmane.org>]
* Re: [PATCH 2/3] pinctrl: meson: meson-gxl: add the pwm_ao_b pin
[not found] ` <20170122210528.892-3-martin.blumenstingl-gM/Ye1E23mwN+BqQ9rBEUg@public.gmane.org>
@ 2017-01-23 19:10 ` Kevin Hilman
2017-01-23 19:12 ` Kevin Hilman
0 siblings, 1 reply; 8+ messages in thread
From: Kevin Hilman @ 2017-01-23 19:10 UTC (permalink / raw)
To: Martin Blumenstingl
Cc: linux-gpio-u79uwXL29TY76Z2rM5mHXA,
linux-amlogic-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r,
linus.walleij-QSEj5FYQhm4dnm+yROfE0A,
carlo-KA+7E9HrN00dnm+yROfE0A,
linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r,
devicetree-u79uwXL29TY76Z2rM5mHXA, will.deacon-5wv7dgnIgG8,
catalin.marinas-5wv7dgnIgG8, mark.rutland-5wv7dgnIgG8,
robh+dt-DgEjT+Ai2ygdnm+yROfE0A
Martin Blumenstingl <martin.blumenstingl-gM/Ye1E23mwN+BqQ9rBEUg@public.gmane.org> writes:
> This adds support for the pwm_ao_b pin. Unfortunately the registers for
> the pwm_ao pins are not documented at all. The source for the pwm_ao_b
> pin from this patch is the Khadas VIM GPL kernel source, which sets bit
> 3 and unsets bits 4 and 31 to enable the PWM LEDs.
>
> Signed-off-by: Martin Blumenstingl <martin.blumenstingl-gM/Ye1E23mwN+BqQ9rBEUg@public.gmane.org>
> ---
> drivers/pinctrl/meson/pinctrl-meson-gxl.c | 8 ++++++++
> 1 file changed, 8 insertions(+)
>
> diff --git a/drivers/pinctrl/meson/pinctrl-meson-gxl.c b/drivers/pinctrl/meson/pinctrl-meson-gxl.c
> index 25694f7094c7..6ff321a7366d 100644
> --- a/drivers/pinctrl/meson/pinctrl-meson-gxl.c
> +++ b/drivers/pinctrl/meson/pinctrl-meson-gxl.c
> @@ -222,6 +222,8 @@ static const unsigned int uart_rts_ao_b_pins[] = { PIN(GPIOAO_3, 0) };
>
> static const unsigned int remote_input_ao_pins[] = {PIN(GPIOAO_7, 0) };
>
> +static const unsigned int pwm_ao_b_pins[] = { PIN(GPIOAO_9, 0) };
> +
Hmm, the S905 public data sheet[1] shows this as GPIOAO_13.
> static struct meson_pmx_group meson_gxl_periphs_groups[] = {
> GPIO_GROUP(GPIOZ_0, EE_OFF),
> GPIO_GROUP(GPIOZ_1, EE_OFF),
> @@ -418,6 +420,7 @@ static struct meson_pmx_group meson_gxl_aobus_groups[] = {
> GROUP(uart_cts_ao_b, 0, 8),
> GROUP(uart_rts_ao_b, 0, 7),
> GROUP(remote_input_ao, 0, 0),
> + GROUP(pwm_ao_b, 0, 3),
> };
but it does show as ao_reg[3].
Kevin
[1] http://dn.odroid.com/S905/DataSheet/S905_Public_Datasheet_V1.1.4.pdf
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 8+ messages in thread* Re: [PATCH 2/3] pinctrl: meson: meson-gxl: add the pwm_ao_b pin
2017-01-23 19:10 ` Kevin Hilman
@ 2017-01-23 19:12 ` Kevin Hilman
0 siblings, 0 replies; 8+ messages in thread
From: Kevin Hilman @ 2017-01-23 19:12 UTC (permalink / raw)
To: Martin Blumenstingl
Cc: linux-gpio, linux-amlogic, Linus Walleij, Carlo Caione,
linux-arm-kernel, devicetree, Will Deacon, Catalin Marinas,
Mark Rutland, Rob Herring
On Mon, Jan 23, 2017 at 11:10 AM, Kevin Hilman <khilman@baylibre.com> wrote:
> Martin Blumenstingl <martin.blumenstingl@googlemail.com> writes:
>
>> This adds support for the pwm_ao_b pin. Unfortunately the registers for
>> the pwm_ao pins are not documented at all. The source for the pwm_ao_b
>> pin from this patch is the Khadas VIM GPL kernel source, which sets bit
>> 3 and unsets bits 4 and 31 to enable the PWM LEDs.
>>
>> Signed-off-by: Martin Blumenstingl <martin.blumenstingl@googlemail.com>
>> ---
>> drivers/pinctrl/meson/pinctrl-meson-gxl.c | 8 ++++++++
>> 1 file changed, 8 insertions(+)
>>
>> diff --git a/drivers/pinctrl/meson/pinctrl-meson-gxl.c b/drivers/pinctrl/meson/pinctrl-meson-gxl.c
>> index 25694f7094c7..6ff321a7366d 100644
>> --- a/drivers/pinctrl/meson/pinctrl-meson-gxl.c
>> +++ b/drivers/pinctrl/meson/pinctrl-meson-gxl.c
>> @@ -222,6 +222,8 @@ static const unsigned int uart_rts_ao_b_pins[] = { PIN(GPIOAO_3, 0) };
>>
>> static const unsigned int remote_input_ao_pins[] = {PIN(GPIOAO_7, 0) };
>>
>> +static const unsigned int pwm_ao_b_pins[] = { PIN(GPIOAO_9, 0) };
>> +
>
> Hmm, the S905 public data sheet[1] shows this as GPIOAO_13.
>
gack, nevermind. I see now this is for GXL, not GXBB. Ignore my comments.
Linus, feel free to apply with:
Acked-by: Kevin Hilman <khilman@baylibre.com>
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH 2/3] pinctrl: meson: meson-gxl: add the pwm_ao_b pin
2017-01-22 21:05 ` [PATCH 2/3] pinctrl: meson: meson-gxl: add the pwm_ao_b pin Martin Blumenstingl
[not found] ` <20170122210528.892-3-martin.blumenstingl-gM/Ye1E23mwN+BqQ9rBEUg@public.gmane.org>
@ 2017-01-26 14:41 ` Linus Walleij
1 sibling, 0 replies; 8+ messages in thread
From: Linus Walleij @ 2017-01-26 14:41 UTC (permalink / raw)
To: Martin Blumenstingl
Cc: linux-gpio@vger.kernel.org, open list:ARM/Amlogic Meson...,
Kevin Hilman, Carlo Caione, linux-arm-kernel@lists.infradead.org,
devicetree@vger.kernel.org, Will Deacon, Catalin Marinas,
Mark Rutland, Rob Herring
On Sun, Jan 22, 2017 at 10:05 PM, Martin Blumenstingl
<martin.blumenstingl@googlemail.com> wrote:
> This adds support for the pwm_ao_b pin. Unfortunately the registers for
> the pwm_ao pins are not documented at all. The source for the pwm_ao_b
> pin from this patch is the Khadas VIM GPL kernel source, which sets bit
> 3 and unsets bits 4 and 31 to enable the PWM LEDs.
>
> Signed-off-by: Martin Blumenstingl <martin.blumenstingl@googlemail.com>
This patch applied to the pin control tree with Kevin's ACK.
Yours,
Linus Walleij
^ permalink raw reply [flat|nested] 8+ messages in thread
* [PATCH 3/3] ARM64: dts: meson-gxl: add the pwm_ao_b pin
2017-01-22 21:05 [PATCH 0/3] meson-gx: add pwm_AO_ab Martin Blumenstingl
2017-01-22 21:05 ` [PATCH 1/3] ARM64: dts: meson-gx: add the missing pwm_AO_ab node Martin Blumenstingl
2017-01-22 21:05 ` [PATCH 2/3] pinctrl: meson: meson-gxl: add the pwm_ao_b pin Martin Blumenstingl
@ 2017-01-22 21:05 ` Martin Blumenstingl
2017-01-27 19:02 ` [PATCH 0/3] meson-gx: add pwm_AO_ab Kevin Hilman
3 siblings, 0 replies; 8+ messages in thread
From: Martin Blumenstingl @ 2017-01-22 21:05 UTC (permalink / raw)
To: linux-gpio, linux-amlogic, linus.walleij, khilman, carlo
Cc: linux-arm-kernel, devicetree, will.deacon, catalin.marinas,
mark.rutland, robh+dt, Martin Blumenstingl
This adds the pwm_ao_b pin to allow boards which have an LED connected
to GPIOAO_9 to use the leds-pwm driver (by activating the pwm_AO_ab node
and passing the pwm_ao_b_pin pinctrl-reference).
Signed-off-by: Martin Blumenstingl <martin.blumenstingl@googlemail.com>
---
arch/arm64/boot/dts/amlogic/meson-gxl.dtsi | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/arch/arm64/boot/dts/amlogic/meson-gxl.dtsi b/arch/arm64/boot/dts/amlogic/meson-gxl.dtsi
index b0070489e179..20e98a0bfb6e 100644
--- a/arch/arm64/boot/dts/amlogic/meson-gxl.dtsi
+++ b/arch/arm64/boot/dts/amlogic/meson-gxl.dtsi
@@ -117,6 +117,13 @@
function = "remote_input_ao";
};
};
+
+ pwm_ao_b_pins: pwm_ao_b {
+ mux {
+ groups = "pwm_ao_b";
+ function = "pwm_ao_b";
+ };
+ };
};
};
--
2.11.0
^ permalink raw reply related [flat|nested] 8+ messages in thread* Re: [PATCH 0/3] meson-gx: add pwm_AO_ab
2017-01-22 21:05 [PATCH 0/3] meson-gx: add pwm_AO_ab Martin Blumenstingl
` (2 preceding siblings ...)
2017-01-22 21:05 ` [PATCH 3/3] ARM64: dts: " Martin Blumenstingl
@ 2017-01-27 19:02 ` Kevin Hilman
3 siblings, 0 replies; 8+ messages in thread
From: Kevin Hilman @ 2017-01-27 19:02 UTC (permalink / raw)
To: Martin Blumenstingl
Cc: mark.rutland, devicetree, catalin.marinas, linus.walleij,
will.deacon, linux-gpio, robh+dt, carlo, linux-amlogic,
linux-arm-kernel
Martin Blumenstingl <martin.blumenstingl@googlemail.com> writes:
> This adds support for the PWM controller in the AO domain.
Patches 1,3 applied to Amlogic v4.11/dt64 branch.
Kevin
> pinctrl support for GXBB already exists (in both, pinctrl-meson-gxbb.c
> and meson-gxbb.dtsi). This patch adds at least the pwm_ao_b pin for
> GXL and GXM - these are not documented in Amlogic's kernel, so I had
> to borrow the magic numbers from the Khadas VIM kernel (released under
> the GPL): [0]
>
> The bits for pwm_AO_a_pins are unknown at the time of writing, but these
> can still be added later.
>
> I have successfully tested this on my GXL S905X based Khadas VIM board
> with the following .dts snippets (the PWM LED can simply be dimmed
> through sysfs):
> &pwm_AO_ab {
> status = "okay";
> pinctrl-0 = <&pwm_ao_b_pins>;
> pinctrl-names = "default";
> clocks = <&clkc CLKID_FCLK_DIV4>;
> clock-names = "clkin0";
> };
>
> pwmleds {
> compatible = "pwm-leds";
>
> power {
> label = "vim:red:power";
> pwms = <&pwm_AO_ab 1 7812500 0>;
> max-brightness = <255>;
> };
> };
>
> (if anyone is interested in more of my Khadas VIM patches - these are
> still work-in-progress, which is why I have not sent them yet - can
> take a look at this: [1])
>
> NOTE: The .dts changes from this series are based on top of my SAR ADC
> patches.
>
> [0] https://github.com/khadas/linux/blob/94602ef5562978a8d8b5c7770c113074a714dbdb/drivers/amlogic/led/led_trigger_breathe.c#L75
> [1] https://github.com/xdarklight/linux/commits/meson-gx-integration-4.11-20170122
>
> Martin Blumenstingl (3):
> ARM64: dts: meson-gx: add the missing pwm_AO_ab node
> pinctrl: meson: meson-gxl: add the pwm_ao_b pin
> ARM64: dts: meson-gxl: add the pwm_ao_b pin
>
> arch/arm64/boot/dts/amlogic/meson-gx.dtsi | 7 +++++++
> arch/arm64/boot/dts/amlogic/meson-gxl.dtsi | 7 +++++++
> drivers/pinctrl/meson/pinctrl-meson-gxl.c | 8 ++++++++
> 3 files changed, 22 insertions(+)
^ permalink raw reply [flat|nested] 8+ messages in thread