linux-input.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v3 0/3] Radxa NIO 12L: Add GPIO keys and LED support
@ 2025-09-05 11:51 Julien Massot
  2025-09-05 11:51 ` [PATCH v3 1/3] Input: mtk-pmic-keys - MT6359 has a specific release irq Julien Massot
                   ` (3 more replies)
  0 siblings, 4 replies; 9+ messages in thread
From: Julien Massot @ 2025-09-05 11:51 UTC (permalink / raw)
  To: kernel, Dmitry Torokhov, Matthias Brugger,
	AngeloGioacchino Del Regno, Rob Herring, Krzysztof Kozlowski,
	Conor Dooley, Louis-Alexis Eyraud
  Cc: linux-input, linux-kernel, linux-arm-kernel, linux-mediatek,
	devicetree, Julien Massot

This patchset adds support for the GPIO-connected red and blue LEDs,
as well as the various hardware buttons present on the Radxa NIO 12L
board.

It also includes a fix for the missing release (key-up) interrupt
handling for PMIC-managed GPIO keys.

Signed-off-by: Julien Massot <julien.massot@collabora.com>
---
Changes in v3:
Patch 3/3: drop the deprecated LEDs label property
- Link to v2: https://lore.kernel.org/r/20250826-radxa-nio-12-l-gpio-v2-0-7f18fa3fbfc8@collabora.com

Changes in v2:
PATCH 1/3
- Add Fixes tag
- Drop Angelo's Reviewed-By since I'm now introducing the
'key_release_irq' member that was missing in v1.
- Link to v1: https://lore.kernel.org/r/20250801-radxa-nio-12-l-gpio-v1-0-d0840f85d2c8@collabora.com

---
Julien Massot (3):
      Input: mtk-pmic-keys - MT6359 has a specific release irq
      arm64: dts: mediatek: mt8395-nio-12l: add PMIC and GPIO keys support
      arm64: dts: mediatek: mt8395-nio-12l: add support for blue and red LEDs

 .../boot/dts/mediatek/mt8395-radxa-nio-12l.dts     | 65 ++++++++++++++++++++++
 drivers/input/keyboard/mtk-pmic-keys.c             |  5 +-
 2 files changed, 69 insertions(+), 1 deletion(-)
---
base-commit: 6c68f4c0a147c025ae0b25fab688c7c47964a02f
change-id: 20250801-radxa-nio-12-l-gpio-54f208c25333

Best regards,
-- 
Julien Massot <julien.massot@collabora.com>


^ permalink raw reply	[flat|nested] 9+ messages in thread

* [PATCH v3 1/3] Input: mtk-pmic-keys - MT6359 has a specific release irq
  2025-09-05 11:51 [PATCH v3 0/3] Radxa NIO 12L: Add GPIO keys and LED support Julien Massot
@ 2025-09-05 11:51 ` Julien Massot
  2025-09-06 16:25   ` Dmitry Torokhov
  2025-09-08 11:36   ` AngeloGioacchino Del Regno
  2025-09-05 11:51 ` [PATCH v3 2/3] arm64: dts: mediatek: mt8395-nio-12l: add PMIC and GPIO keys support Julien Massot
                   ` (2 subsequent siblings)
  3 siblings, 2 replies; 9+ messages in thread
From: Julien Massot @ 2025-09-05 11:51 UTC (permalink / raw)
  To: kernel, Dmitry Torokhov, Matthias Brugger,
	AngeloGioacchino Del Regno, Rob Herring, Krzysztof Kozlowski,
	Conor Dooley, Louis-Alexis Eyraud
  Cc: linux-input, linux-kernel, linux-arm-kernel, linux-mediatek,
	devicetree, Julien Massot

Support for MT6359 PMIC keys has been added recently.
However, the key release event is not properly handled:
only key press events are generated, leaving key states
stuck in "pressed".

This patch ensures that both key press and key release events
are properly emitted by handling the release logic correctly.

Introduce a 'key_release_irq' member to the 'mtk_pmic_regs',
to identify the devices that have a separate irq for the
release event.

Fixes: bc25e6bf032e ("Input: mtk-pmic-keys - add support for MT6359 PMIC keys")
Signed-off-by: Julien Massot <julien.massot@collabora.com>
---
 drivers/input/keyboard/mtk-pmic-keys.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/drivers/input/keyboard/mtk-pmic-keys.c b/drivers/input/keyboard/mtk-pmic-keys.c
index 50e2e792c91d2626d3f282d04a1db60845827ef2..c78d9f6d97c4f7a77b4c44cee3b93e4712a19aec 100644
--- a/drivers/input/keyboard/mtk-pmic-keys.c
+++ b/drivers/input/keyboard/mtk-pmic-keys.c
@@ -55,6 +55,7 @@ struct mtk_pmic_regs {
 	const struct mtk_pmic_keys_regs keys_regs[MTK_PMIC_MAX_KEY_COUNT];
 	u32 pmic_rst_reg;
 	u32 rst_lprst_mask; /* Long-press reset timeout bitmask */
+	bool key_release_irq;
 };
 
 static const struct mtk_pmic_regs mt6397_regs = {
@@ -116,6 +117,7 @@ static const struct mtk_pmic_regs mt6358_regs = {
 				   MTK_PMIC_HOMEKEY_RST),
 	.pmic_rst_reg = MT6358_TOP_RST_MISC,
 	.rst_lprst_mask = MTK_PMIC_RST_DU_MASK,
+	.key_release_irq = true,
 };
 
 static const struct mtk_pmic_regs mt6359_regs = {
@@ -129,6 +131,7 @@ static const struct mtk_pmic_regs mt6359_regs = {
 				   MTK_PMIC_HOMEKEY_RST),
 	.pmic_rst_reg = MT6359_TOP_RST_MISC,
 	.rst_lprst_mask = MTK_PMIC_RST_DU_MASK,
+	.key_release_irq = true,
 };
 
 struct mtk_pmic_keys_info {
@@ -368,7 +371,7 @@ static int mtk_pmic_keys_probe(struct platform_device *pdev)
 		if (keys->keys[index].irq < 0)
 			return keys->keys[index].irq;
 
-		if (of_device_is_compatible(node, "mediatek,mt6358-keys")) {
+		if (mtk_pmic_regs->key_release_irq) {
 			keys->keys[index].irq_r = platform_get_irq_byname(pdev,
 									  irqnames_r[index]);
 

-- 
2.51.0


^ permalink raw reply related	[flat|nested] 9+ messages in thread

* [PATCH v3 2/3] arm64: dts: mediatek: mt8395-nio-12l: add PMIC and GPIO keys support
  2025-09-05 11:51 [PATCH v3 0/3] Radxa NIO 12L: Add GPIO keys and LED support Julien Massot
  2025-09-05 11:51 ` [PATCH v3 1/3] Input: mtk-pmic-keys - MT6359 has a specific release irq Julien Massot
@ 2025-09-05 11:51 ` Julien Massot
  2025-09-09 12:47   ` Matthias Brugger
  2025-09-05 11:52 ` [PATCH v3 3/3] arm64: dts: mediatek: mt8395-nio-12l: add support for blue and red LEDs Julien Massot
  2025-09-05 17:45 ` [PATCH v3 0/3] Radxa NIO 12L: Add GPIO keys and LED support Rob Herring (Arm)
  3 siblings, 1 reply; 9+ messages in thread
From: Julien Massot @ 2025-09-05 11:51 UTC (permalink / raw)
  To: kernel, Dmitry Torokhov, Matthias Brugger,
	AngeloGioacchino Del Regno, Rob Herring, Krzysztof Kozlowski,
	Conor Dooley, Louis-Alexis Eyraud
  Cc: linux-input, linux-kernel, linux-arm-kernel, linux-mediatek,
	devicetree, Julien Massot

Add support for PMIC and GPIO keys on the Radxa NIO 12L board:
Declare a gpio-keys node for the Volume Up button using GPIO106.
Add the corresponding pin configuration in the pinctrl node.
Add a mediatek,mt6359-keys subnode under the PMIC to handle the
power and home buttons exposed by the MT6359.

Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
Signed-off-by: Julien Massot <julien.massot@collabora.com>
---
 .../boot/dts/mediatek/mt8395-radxa-nio-12l.dts     | 36 ++++++++++++++++++++++
 1 file changed, 36 insertions(+)

diff --git a/arch/arm64/boot/dts/mediatek/mt8395-radxa-nio-12l.dts b/arch/arm64/boot/dts/mediatek/mt8395-radxa-nio-12l.dts
index 329c60cc6a6be0b4be8c0b8bb033b32d35302804..fd596e2298285361ad7c2fb828feec598d75a73e 100644
--- a/arch/arm64/boot/dts/mediatek/mt8395-radxa-nio-12l.dts
+++ b/arch/arm64/boot/dts/mediatek/mt8395-radxa-nio-12l.dts
@@ -8,6 +8,7 @@
 #include "mt8195.dtsi"
 #include "mt6359.dtsi"
 #include <dt-bindings/gpio/gpio.h>
+#include <dt-bindings/input/input.h>
 #include <dt-bindings/interrupt-controller/irq.h>
 #include <dt-bindings/pinctrl/mt8195-pinfunc.h>
 #include <dt-bindings/regulator/mediatek,mt6360-regulator.h>
@@ -60,6 +61,18 @@ backlight: backlight {
 		status = "disabled";
 	};
 
+	keys: gpio-keys {
+		compatible = "gpio-keys";
+
+		button-volume-up {
+			wakeup-source;
+			debounce-interval = <100>;
+			gpios = <&pio 106 GPIO_ACTIVE_LOW>;
+			label = "volume_up";
+			linux,code = <KEY_VOLUMEUP>;
+		};
+	};
+
 	wifi_vreg: regulator-wifi-3v3-en {
 		compatible = "regulator-fixed";
 		regulator-name = "wifi_3v3_en";
@@ -626,6 +639,14 @@ pins-txd {
 		};
 	};
 
+	gpio_key_pins: gpio-keys-pins {
+		pins {
+			pinmux = <PINMUX_GPIO106__FUNC_GPIO106>;
+			bias-pull-up;
+			input-enable;
+		};
+	};
+
 	i2c2_pins: i2c2-pins {
 		pins-bus {
 			pinmux = <PINMUX_GPIO12__FUNC_SDA2>,
@@ -880,6 +901,21 @@ &pciephy {
 
 &pmic {
 	interrupts-extended = <&pio 222 IRQ_TYPE_LEVEL_HIGH>;
+
+	mt6359keys: keys {
+		compatible = "mediatek,mt6359-keys";
+		mediatek,long-press-mode = <1>;
+		power-off-time-sec = <0>;
+
+		power-key {
+			linux,keycodes = <KEY_POWER>;
+			wakeup-source;
+		};
+
+		home {
+			linux,keycodes = <KEY_HOME>;
+		};
+	};
 };
 
 &scp {

-- 
2.51.0


^ permalink raw reply related	[flat|nested] 9+ messages in thread

* [PATCH v3 3/3] arm64: dts: mediatek: mt8395-nio-12l: add support for blue and red LEDs
  2025-09-05 11:51 [PATCH v3 0/3] Radxa NIO 12L: Add GPIO keys and LED support Julien Massot
  2025-09-05 11:51 ` [PATCH v3 1/3] Input: mtk-pmic-keys - MT6359 has a specific release irq Julien Massot
  2025-09-05 11:51 ` [PATCH v3 2/3] arm64: dts: mediatek: mt8395-nio-12l: add PMIC and GPIO keys support Julien Massot
@ 2025-09-05 11:52 ` Julien Massot
  2025-09-10  9:48   ` Matthias Brugger
  2025-09-05 17:45 ` [PATCH v3 0/3] Radxa NIO 12L: Add GPIO keys and LED support Rob Herring (Arm)
  3 siblings, 1 reply; 9+ messages in thread
From: Julien Massot @ 2025-09-05 11:52 UTC (permalink / raw)
  To: kernel, Dmitry Torokhov, Matthias Brugger,
	AngeloGioacchino Del Regno, Rob Herring, Krzysztof Kozlowski,
	Conor Dooley, Louis-Alexis Eyraud
  Cc: linux-input, linux-kernel, linux-arm-kernel, linux-mediatek,
	devicetree, Julien Massot

The Radxa NIO 12L board has an RGB LED, of which only red and blue
are controllable.

Red and blue LEDs: no need to choose, both are enabled.

Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
Signed-off-by: Julien Massot <julien.massot@collabora.com>
---
 .../boot/dts/mediatek/mt8395-radxa-nio-12l.dts     | 29 ++++++++++++++++++++++
 1 file changed, 29 insertions(+)

diff --git a/arch/arm64/boot/dts/mediatek/mt8395-radxa-nio-12l.dts b/arch/arm64/boot/dts/mediatek/mt8395-radxa-nio-12l.dts
index fd596e2298285361ad7c2fb828feec598d75a73e..0ea36e7c960fc0b2607833d743c5e2e806864600 100644
--- a/arch/arm64/boot/dts/mediatek/mt8395-radxa-nio-12l.dts
+++ b/arch/arm64/boot/dts/mediatek/mt8395-radxa-nio-12l.dts
@@ -10,6 +10,7 @@
 #include <dt-bindings/gpio/gpio.h>
 #include <dt-bindings/input/input.h>
 #include <dt-bindings/interrupt-controller/irq.h>
+#include <dt-bindings/leds/common.h>
 #include <dt-bindings/pinctrl/mt8195-pinfunc.h>
 #include <dt-bindings/regulator/mediatek,mt6360-regulator.h>
 #include <dt-bindings/spmi/spmi.h>
@@ -73,6 +74,26 @@ button-volume-up {
 		};
 	};
 
+	gpio-leds {
+		compatible = "gpio-leds";
+		pinctrl-0 = <&gpio_leds_pins>;
+		pinctrl-names = "default";
+
+		/*
+		 * This board has a RGB LED, of which only R and B
+		 * are controllable.
+		 */
+		rgb-blue {
+			color = <LED_COLOR_ID_BLUE>;
+			gpios = <&pio 6 GPIO_ACTIVE_HIGH>;
+		};
+
+		led-1 {
+			color = <LED_COLOR_ID_RED>;
+			gpios = <&pio 7 GPIO_ACTIVE_HIGH>;
+		};
+	};
+
 	wifi_vreg: regulator-wifi-3v3-en {
 		compatible = "regulator-fixed";
 		regulator-name = "wifi_3v3_en";
@@ -647,6 +668,14 @@ pins {
 		};
 	};
 
+	gpio_leds_pins: gpio-leds-pins {
+		pins {
+			pinmux = <PINMUX_GPIO6__FUNC_GPIO6>,
+				 <PINMUX_GPIO7__FUNC_GPIO7>;
+			output-low;
+		};
+	};
+
 	i2c2_pins: i2c2-pins {
 		pins-bus {
 			pinmux = <PINMUX_GPIO12__FUNC_SDA2>,

-- 
2.51.0


^ permalink raw reply related	[flat|nested] 9+ messages in thread

* Re: [PATCH v3 0/3] Radxa NIO 12L: Add GPIO keys and LED support
  2025-09-05 11:51 [PATCH v3 0/3] Radxa NIO 12L: Add GPIO keys and LED support Julien Massot
                   ` (2 preceding siblings ...)
  2025-09-05 11:52 ` [PATCH v3 3/3] arm64: dts: mediatek: mt8395-nio-12l: add support for blue and red LEDs Julien Massot
@ 2025-09-05 17:45 ` Rob Herring (Arm)
  3 siblings, 0 replies; 9+ messages in thread
From: Rob Herring (Arm) @ 2025-09-05 17:45 UTC (permalink / raw)
  To: Julien Massot
  Cc: Louis-Alexis Eyraud, kernel, linux-mediatek,
	AngeloGioacchino Del Regno, linux-kernel, linux-input,
	Matthias Brugger, Krzysztof Kozlowski, Conor Dooley,
	linux-arm-kernel, Dmitry Torokhov, devicetree


On Fri, 05 Sep 2025 13:51:57 +0200, Julien Massot wrote:
> This patchset adds support for the GPIO-connected red and blue LEDs,
> as well as the various hardware buttons present on the Radxa NIO 12L
> board.
> 
> It also includes a fix for the missing release (key-up) interrupt
> handling for PMIC-managed GPIO keys.
> 
> Signed-off-by: Julien Massot <julien.massot@collabora.com>
> ---
> Changes in v3:
> Patch 3/3: drop the deprecated LEDs label property
> - Link to v2: https://lore.kernel.org/r/20250826-radxa-nio-12-l-gpio-v2-0-7f18fa3fbfc8@collabora.com
> 
> Changes in v2:
> PATCH 1/3
> - Add Fixes tag
> - Drop Angelo's Reviewed-By since I'm now introducing the
> 'key_release_irq' member that was missing in v1.
> - Link to v1: https://lore.kernel.org/r/20250801-radxa-nio-12-l-gpio-v1-0-d0840f85d2c8@collabora.com
> 
> ---
> Julien Massot (3):
>       Input: mtk-pmic-keys - MT6359 has a specific release irq
>       arm64: dts: mediatek: mt8395-nio-12l: add PMIC and GPIO keys support
>       arm64: dts: mediatek: mt8395-nio-12l: add support for blue and red LEDs
> 
>  .../boot/dts/mediatek/mt8395-radxa-nio-12l.dts     | 65 ++++++++++++++++++++++
>  drivers/input/keyboard/mtk-pmic-keys.c             |  5 +-
>  2 files changed, 69 insertions(+), 1 deletion(-)
> ---
> base-commit: 6c68f4c0a147c025ae0b25fab688c7c47964a02f
> change-id: 20250801-radxa-nio-12-l-gpio-54f208c25333
> 
> Best regards,
> --
> Julien Massot <julien.massot@collabora.com>
> 
> 
> 


My bot found new DTB warnings on the .dts files added or changed in this
series.

Some warnings may be from an existing SoC .dtsi. Or perhaps the warnings
are fixed by another series. Ultimately, it is up to the platform
maintainer whether these warnings are acceptable or not. No need to reply
unless the platform maintainer has comments.

If you already ran DT checks and didn't see these error(s), then
make sure dt-schema is up to date:

  pip3 install dtschema --upgrade


This patch series was applied (using b4) to base:
 Base: using specified base-commit 6c68f4c0a147c025ae0b25fab688c7c47964a02f

If this is not the correct base, please add 'base-commit' tag
(or use b4 which does this automatically)

New warnings running 'make CHECK_DTBS=y for arch/arm64/boot/dts/mediatek/' for 20250905-radxa-nio-12-l-gpio-v3-0-40f11377fb55@collabora.com:

arch/arm64/boot/dts/mediatek/mt8395-radxa-nio-12l.dtb: gpio-leds (gpio-leds): 'rgb-blue' does not match any of the regexes: '(^led-[0-9a-f]$|led)', '^pinctrl-[0-9]+$'
	from schema $id: http://devicetree.org/schemas/leds/leds-gpio.yaml#






^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH v3 1/3] Input: mtk-pmic-keys - MT6359 has a specific release irq
  2025-09-05 11:51 ` [PATCH v3 1/3] Input: mtk-pmic-keys - MT6359 has a specific release irq Julien Massot
@ 2025-09-06 16:25   ` Dmitry Torokhov
  2025-09-08 11:36   ` AngeloGioacchino Del Regno
  1 sibling, 0 replies; 9+ messages in thread
From: Dmitry Torokhov @ 2025-09-06 16:25 UTC (permalink / raw)
  To: Julien Massot
  Cc: kernel, Matthias Brugger, AngeloGioacchino Del Regno, Rob Herring,
	Krzysztof Kozlowski, Conor Dooley, Louis-Alexis Eyraud,
	linux-input, linux-kernel, linux-arm-kernel, linux-mediatek,
	devicetree

On Fri, Sep 05, 2025 at 01:51:58PM +0200, Julien Massot wrote:
> Support for MT6359 PMIC keys has been added recently.
> However, the key release event is not properly handled:
> only key press events are generated, leaving key states
> stuck in "pressed".
> 
> This patch ensures that both key press and key release events
> are properly emitted by handling the release logic correctly.
> 
> Introduce a 'key_release_irq' member to the 'mtk_pmic_regs',
> to identify the devices that have a separate irq for the
> release event.
> 
> Fixes: bc25e6bf032e ("Input: mtk-pmic-keys - add support for MT6359 PMIC keys")
> Signed-off-by: Julien Massot <julien.massot@collabora.com>

Applied, thank you.

-- 
Dmitry

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH v3 1/3] Input: mtk-pmic-keys - MT6359 has a specific release irq
  2025-09-05 11:51 ` [PATCH v3 1/3] Input: mtk-pmic-keys - MT6359 has a specific release irq Julien Massot
  2025-09-06 16:25   ` Dmitry Torokhov
@ 2025-09-08 11:36   ` AngeloGioacchino Del Regno
  1 sibling, 0 replies; 9+ messages in thread
From: AngeloGioacchino Del Regno @ 2025-09-08 11:36 UTC (permalink / raw)
  To: Julien Massot, kernel, Dmitry Torokhov, Matthias Brugger,
	Rob Herring, Krzysztof Kozlowski, Conor Dooley,
	Louis-Alexis Eyraud
  Cc: linux-input, linux-kernel, linux-arm-kernel, linux-mediatek,
	devicetree

Il 05/09/25 13:51, Julien Massot ha scritto:
> Support for MT6359 PMIC keys has been added recently.
> However, the key release event is not properly handled:
> only key press events are generated, leaving key states
> stuck in "pressed".
> 
> This patch ensures that both key press and key release events
> are properly emitted by handling the release logic correctly.
> 
> Introduce a 'key_release_irq' member to the 'mtk_pmic_regs',
> to identify the devices that have a separate irq for the
> release event.
> 
> Fixes: bc25e6bf032e ("Input: mtk-pmic-keys - add support for MT6359 PMIC keys")
> Signed-off-by: Julien Massot <julien.massot@collabora.com>

Please clarify the commit title.

Input: mtk-pmic-keys - Use platform data for release irq support

...or something like that.

After which:

Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>

Cheers,
Angelo

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH v3 2/3] arm64: dts: mediatek: mt8395-nio-12l: add PMIC and GPIO keys support
  2025-09-05 11:51 ` [PATCH v3 2/3] arm64: dts: mediatek: mt8395-nio-12l: add PMIC and GPIO keys support Julien Massot
@ 2025-09-09 12:47   ` Matthias Brugger
  0 siblings, 0 replies; 9+ messages in thread
From: Matthias Brugger @ 2025-09-09 12:47 UTC (permalink / raw)
  To: Julien Massot, kernel, Dmitry Torokhov,
	AngeloGioacchino Del Regno, Rob Herring, Krzysztof Kozlowski,
	Conor Dooley, Louis-Alexis Eyraud
  Cc: linux-input, linux-kernel, linux-arm-kernel, linux-mediatek,
	devicetree



On 05/09/2025 13:51, Julien Massot wrote:
> Add support for PMIC and GPIO keys on the Radxa NIO 12L board:
> Declare a gpio-keys node for the Volume Up button using GPIO106.
> Add the corresponding pin configuration in the pinctrl node.
> Add a mediatek,mt6359-keys subnode under the PMIC to handle the
> power and home buttons exposed by the MT6359.
> 
> Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
> Signed-off-by: Julien Massot <julien.massot@collabora.com>

Queued, thanks.
Matthias

> ---
>   .../boot/dts/mediatek/mt8395-radxa-nio-12l.dts     | 36 ++++++++++++++++++++++
>   1 file changed, 36 insertions(+)
> 
> diff --git a/arch/arm64/boot/dts/mediatek/mt8395-radxa-nio-12l.dts b/arch/arm64/boot/dts/mediatek/mt8395-radxa-nio-12l.dts
> index 329c60cc6a6be0b4be8c0b8bb033b32d35302804..fd596e2298285361ad7c2fb828feec598d75a73e 100644
> --- a/arch/arm64/boot/dts/mediatek/mt8395-radxa-nio-12l.dts
> +++ b/arch/arm64/boot/dts/mediatek/mt8395-radxa-nio-12l.dts
> @@ -8,6 +8,7 @@
>   #include "mt8195.dtsi"
>   #include "mt6359.dtsi"
>   #include <dt-bindings/gpio/gpio.h>
> +#include <dt-bindings/input/input.h>
>   #include <dt-bindings/interrupt-controller/irq.h>
>   #include <dt-bindings/pinctrl/mt8195-pinfunc.h>
>   #include <dt-bindings/regulator/mediatek,mt6360-regulator.h>
> @@ -60,6 +61,18 @@ backlight: backlight {
>   		status = "disabled";
>   	};
>   
> +	keys: gpio-keys {
> +		compatible = "gpio-keys";
> +
> +		button-volume-up {
> +			wakeup-source;
> +			debounce-interval = <100>;
> +			gpios = <&pio 106 GPIO_ACTIVE_LOW>;
> +			label = "volume_up";
> +			linux,code = <KEY_VOLUMEUP>;
> +		};
> +	};
> +
>   	wifi_vreg: regulator-wifi-3v3-en {
>   		compatible = "regulator-fixed";
>   		regulator-name = "wifi_3v3_en";
> @@ -626,6 +639,14 @@ pins-txd {
>   		};
>   	};
>   
> +	gpio_key_pins: gpio-keys-pins {
> +		pins {
> +			pinmux = <PINMUX_GPIO106__FUNC_GPIO106>;
> +			bias-pull-up;
> +			input-enable;
> +		};
> +	};
> +
>   	i2c2_pins: i2c2-pins {
>   		pins-bus {
>   			pinmux = <PINMUX_GPIO12__FUNC_SDA2>,
> @@ -880,6 +901,21 @@ &pciephy {
>   
>   &pmic {
>   	interrupts-extended = <&pio 222 IRQ_TYPE_LEVEL_HIGH>;
> +
> +	mt6359keys: keys {
> +		compatible = "mediatek,mt6359-keys";
> +		mediatek,long-press-mode = <1>;
> +		power-off-time-sec = <0>;
> +
> +		power-key {
> +			linux,keycodes = <KEY_POWER>;
> +			wakeup-source;
> +		};
> +
> +		home {
> +			linux,keycodes = <KEY_HOME>;
> +		};
> +	};
>   };
>   
>   &scp {
> 


^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH v3 3/3] arm64: dts: mediatek: mt8395-nio-12l: add support for blue and red LEDs
  2025-09-05 11:52 ` [PATCH v3 3/3] arm64: dts: mediatek: mt8395-nio-12l: add support for blue and red LEDs Julien Massot
@ 2025-09-10  9:48   ` Matthias Brugger
  0 siblings, 0 replies; 9+ messages in thread
From: Matthias Brugger @ 2025-09-10  9:48 UTC (permalink / raw)
  To: Julien Massot, kernel, Dmitry Torokhov,
	AngeloGioacchino Del Regno, Rob Herring, Krzysztof Kozlowski,
	Conor Dooley, Louis-Alexis Eyraud
  Cc: linux-input, linux-kernel, linux-arm-kernel, linux-mediatek,
	devicetree



On 05/09/2025 13:52, Julien Massot wrote:
> The Radxa NIO 12L board has an RGB LED, of which only red and blue
> are controllable.
> 
> Red and blue LEDs: no need to choose, both are enabled.
> 
> Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
> Signed-off-by: Julien Massot <julien.massot@collabora.com>
> ---
>   .../boot/dts/mediatek/mt8395-radxa-nio-12l.dts     | 29 ++++++++++++++++++++++
>   1 file changed, 29 insertions(+)
> 
> diff --git a/arch/arm64/boot/dts/mediatek/mt8395-radxa-nio-12l.dts b/arch/arm64/boot/dts/mediatek/mt8395-radxa-nio-12l.dts
> index fd596e2298285361ad7c2fb828feec598d75a73e..0ea36e7c960fc0b2607833d743c5e2e806864600 100644
> --- a/arch/arm64/boot/dts/mediatek/mt8395-radxa-nio-12l.dts
> +++ b/arch/arm64/boot/dts/mediatek/mt8395-radxa-nio-12l.dts
> @@ -10,6 +10,7 @@
>   #include <dt-bindings/gpio/gpio.h>
>   #include <dt-bindings/input/input.h>
>   #include <dt-bindings/interrupt-controller/irq.h>
> +#include <dt-bindings/leds/common.h>
>   #include <dt-bindings/pinctrl/mt8195-pinfunc.h>
>   #include <dt-bindings/regulator/mediatek,mt6360-regulator.h>
>   #include <dt-bindings/spmi/spmi.h>
> @@ -73,6 +74,26 @@ button-volume-up {
>   		};
>   	};
>   
> +	gpio-leds {
> +		compatible = "gpio-leds";
> +		pinctrl-0 = <&gpio_leds_pins>;
> +		pinctrl-names = "default";
> +
> +		/*
> +		 * This board has a RGB LED, of which only R and B
> +		 * are controllable.
> +		 */
> +		rgb-blue {

Please fix the DT warnings and submit again.

Matthias

> +			color = <LED_COLOR_ID_BLUE>;
> +			gpios = <&pio 6 GPIO_ACTIVE_HIGH>;
> +		};
> +
> +		led-1 {
> +			color = <LED_COLOR_ID_RED>;
> +			gpios = <&pio 7 GPIO_ACTIVE_HIGH>;
> +		};
> +	};
> +
>   	wifi_vreg: regulator-wifi-3v3-en {
>   		compatible = "regulator-fixed";
>   		regulator-name = "wifi_3v3_en";
> @@ -647,6 +668,14 @@ pins {
>   		};
>   	};
>   
> +	gpio_leds_pins: gpio-leds-pins {
> +		pins {
> +			pinmux = <PINMUX_GPIO6__FUNC_GPIO6>,
> +				 <PINMUX_GPIO7__FUNC_GPIO7>;
> +			output-low;
> +		};
> +	};
> +
>   	i2c2_pins: i2c2-pins {
>   		pins-bus {
>   			pinmux = <PINMUX_GPIO12__FUNC_SDA2>,
> 


^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2025-09-10  9:48 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-09-05 11:51 [PATCH v3 0/3] Radxa NIO 12L: Add GPIO keys and LED support Julien Massot
2025-09-05 11:51 ` [PATCH v3 1/3] Input: mtk-pmic-keys - MT6359 has a specific release irq Julien Massot
2025-09-06 16:25   ` Dmitry Torokhov
2025-09-08 11:36   ` AngeloGioacchino Del Regno
2025-09-05 11:51 ` [PATCH v3 2/3] arm64: dts: mediatek: mt8395-nio-12l: add PMIC and GPIO keys support Julien Massot
2025-09-09 12:47   ` Matthias Brugger
2025-09-05 11:52 ` [PATCH v3 3/3] arm64: dts: mediatek: mt8395-nio-12l: add support for blue and red LEDs Julien Massot
2025-09-10  9:48   ` Matthias Brugger
2025-09-05 17:45 ` [PATCH v3 0/3] Radxa NIO 12L: Add GPIO keys and LED support Rob Herring (Arm)

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).