Add power key for pioneer box
Subsystems (3)
cover Add power key for pioneer box
From: Chen Wang <[email protected]>
Add power key for pioneer box.
Thanks,
Chen
---
Changes in v1:
The patch is based on v6.12-rc1.
---
Chen Wang (1):
riscv: sophgo: dts: add power key for pioneer box
.../boot/dts/sophgo/sg2042-milkv-pioneer.dts | 15 +++++++++++++++ 1 file changed, 15 insertions(+)
base-commit: 9852d85ec9d492ebef56dc5f229416c925758edc
Signature · 1 line
2.34.1
PATCH 1/1 riscv: sophgo: dts: add power key for pioneer box
From: Chen Wang <[email protected]>
There is a power button on the front panel of the pioneer box. Short pressing the button will trigger the onboard MCU to notify SG2042 through GPIO22 to enter the power-off process.
--- .../boot/dts/sophgo/sg2042-milkv-pioneer.dts | 15 +++++++++++++++ 1 file changed, 15 insertions(+)
arch/riscv/boot/dts/sophgo/sg2042-milkv-pioneer.dts +15 -0
@@ -5,6 +5,9 @@ #include "sg2042.dtsi" +#include <dt-bindings/gpio/gpio.h> +#include <dt-bindings/input/input.h> + / { model = "Milk-V Pioneer"; compatible = "milkv,pioneer", "sophgo,sg2042";
@@ -12,6 +15,18 @@ / { chosen { stdout-path = "serial0"; }; + + gpio-power { + compatible = "gpio-keys"; + + key-power { + label = "Power Key"; + linux,code = <KEY_POWER>; + gpios = <&port0a 22 GPIO_ACTIVE_HIGH>; + linux,input-type = <EV_KEY>; + debounce-interval = <100>; + }; + }; }; &cgi_main {
Signature · 1 line
2.34.1
Inochi Amaoto
maintainerRe: [PATCH 1/1] riscv: sophgo: dts: add power key for pioneer box
Quoted 16 lines · Chen Wang
From: Chen Wang <[email protected]>
There is a power button on the front panel of the pioneer box. Short pressing the button will trigger the onboard MCU to notify SG2042 through GPIO22 to enter the power-off process.
Signed-off-by Chen Wang <[email protected]>--- .../boot/dts/sophgo/sg2042-milkv-pioneer.dts | 15 +++++++++++++++ 1 file changed, 15 insertions(+)arch/riscv/boot/dts/sophgo/sg2042-milkv-pioneer.dts +0
-0
arch/riscv/boot/dts/sophgo/sg2042-milkv-pioneer.dts line 8
Quoted 4 lines
arch/riscv/boot/dts/sophgo/sg2042-milkv-pioneer.dts +1
-0@@ -5,6 +5,9 @@ #include "sg2042.dtsi" +#include <dt-bindings/gpio/gpio.h>
Just move this include into sg204.dtsi. It seems you forgot to add include when sumbitting GPIO dt patch.
Quoted 27 lines
arch/riscv/boot/dts/sophgo/sg2042-milkv-pioneer.dts +14
-0+#include <dt-bindings/input/input.h> + / { model = "Milk-V Pioneer"; compatible = "milkv,pioneer", "sophgo,sg2042";@@ -12,6 +15,18 @@ / { chosen { stdout-path = "serial0"; }; + + gpio-power { + compatible = "gpio-keys"; + + key-power { + label = "Power Key"; + linux,code = <KEY_POWER>; + gpios = <&port0a 22 GPIO_ACTIVE_HIGH>; + linux,input-type = <EV_KEY>; + debounce-interval = <100>; + }; + }; }; &cgi_main {Signature · 1 line
2.34.1
Re: [PATCH 1/1] riscv: sophgo: dts: add power key for pioneer box
Quoted 18 lines · Inochi Amaoto
Quoted 17 lines · Chen Wang
From: Chen Wang <[email protected]>
There is a power button on the front panel of the pioneer box. Short pressing the button will trigger the onboard MCU to notify SG2042 through GPIO22 to enter the power-off process.
Signed-off-by Chen Wang <[email protected]>--- .../boot/dts/sophgo/sg2042-milkv-pioneer.dts | 15 +++++++++++++++ 1 file changed, 15 insertions(+)arch/riscv/boot/dts/sophgo/sg2042-milkv-pioneer.dts +0
-0@@ -5,6 +5,9 @@
Quoted 5 lines
arch/riscv/boot/dts/sophgo/sg2042-milkv-pioneer.dts line 8
Quoted 3 lines
arch/riscv/boot/dts/sophgo/sg2042-milkv-pioneer.dts +1
-0#include "sg2042.dtsi" +#include <dt-bindings/gpio/gpio.h>Just move this include into
sg204.dtsi. It seems you forgot to
sg204.dtsi does not use this header, so why it should be there?
DTS does not differ here from C. You include only what is being directly used.
Best regards,
Krzysztof
Inochi Amaoto
maintainerRe: [PATCH 1/1] riscv: sophgo: dts: add power key for pioneer box
Quoted 21 lines · Krzysztof Kozlowski
Quoted 20 lines · Inochi Amaoto
Quoted 19 lines · Chen Wang
From: Chen Wang <[email protected]>
There is a power button on the front panel of the pioneer box. Short pressing the button will trigger the onboard MCU to notify SG2042 through GPIO22 to enter the power-off process.
Signed-off-by Chen Wang <[email protected]>--- .../boot/dts/sophgo/sg2042-milkv-pioneer.dts | 15 +++++++++++++++ 1 file changed, 15 insertions(+)arch/riscv/boot/dts/sophgo/sg2042-milkv-pioneer.dts +0
-0@@ -5,6 +5,9 @@ #include "sg2042.dtsi"
Quoted 9 lines
Quoted 3 lines
arch/riscv/boot/dts/sophgo/sg2042-milkv-pioneer.dts line 8
Quoted 1 line
arch/riscv/boot/dts/sophgo/sg2042-milkv-pioneer.dts +1
-0+#include <dt-bindings/gpio/gpio.h>Just move this include into
sg204.dtsi. It seems you forgot to
sg204.dtsidoes not use this header, so why it should be there?DTS does not differ here from C. You include only what is being directly used.
OK, it is my misunderstanding, I thought this header is binded to the GPIO device. Let's drop my advice.
Regard,
Inochi
Inochi Amaoto
maintainerQuoted 14 lines · Chen Wang
From: Chen Wang <[email protected]>
Add power key for pioneer box.
Thanks,
Chen---
Changes in v1:
The patch is based on v6.12-rc1.---
Quoted 11 lines
Chen Wang (1):
riscv: sophgo: dts: add power key for pioneer box.../boot/dts/sophgo/sg2042-milkv-pioneer.dts | 15 +++++++++++++++ 1 file changed, 15 insertions(+)base-commit:
9852d85ec9d492ebef56dc5f229416c925758edcSignature · 1 line
2.34.1
If the cover has no meaningful information, you can send the patch directly and put the changelog in the patch under the first "---".
Regards,
Inochi
Quoted 8 lines · Chen Wang
From: Chen Wang <[email protected]>
Add power key for pioneer box.
Thanks,
Chen[...]
Applied to for-next, thanks!
[1/1] riscv: sophgo: dts: add power key for pioneer box
https://github.com/sophgo/linux/commit/128bded4bc5253b94c66acd63bef03f16148ae4f
Thanks,
Inochi