devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/1] Add power key for pioneer box
@ 2024-10-08  1:43 Chen Wang
  2024-10-08  1:43 ` [PATCH 1/1] riscv: sophgo: dts: add " Chen Wang
                   ` (2 more replies)
  0 siblings, 3 replies; 7+ messages in thread
From: Chen Wang @ 2024-10-08  1:43 UTC (permalink / raw)
  To: aou, unicorn_wang, conor+dt, guoren, inochiama, krzk+dt, palmer,
	paul.walmsley, robh, devicetree, linux-kernel, linux-riscv,
	chao.wei, haijiao.liu, xiaoguang.xing, chunzhi.lin

From: Chen Wang <unicorn_wang@outlook.com>

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
-- 
2.34.1


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

* [PATCH 1/1] riscv: sophgo: dts: add power key for pioneer box
  2024-10-08  1:43 [PATCH 0/1] Add power key for pioneer box Chen Wang
@ 2024-10-08  1:43 ` Chen Wang
  2024-10-08  5:18   ` Inochi Amaoto
  2024-10-08  6:24 ` [PATCH 0/1] Add " Inochi Amaoto
  2024-10-22  2:01 ` Inochi Amaoto
  2 siblings, 1 reply; 7+ messages in thread
From: Chen Wang @ 2024-10-08  1:43 UTC (permalink / raw)
  To: aou, unicorn_wang, conor+dt, guoren, inochiama, krzk+dt, palmer,
	paul.walmsley, robh, devicetree, linux-kernel, linux-riscv,
	chao.wei, haijiao.liu, xiaoguang.xing, chunzhi.lin

From: Chen Wang <unicorn_wang@outlook.com>

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 <unicorn_wang@outlook.com>
---
 .../boot/dts/sophgo/sg2042-milkv-pioneer.dts      | 15 +++++++++++++++
 1 file changed, 15 insertions(+)

diff --git a/arch/riscv/boot/dts/sophgo/sg2042-milkv-pioneer.dts b/arch/riscv/boot/dts/sophgo/sg2042-milkv-pioneer.dts
index a3f9d6f22566..be596d01ff8d 100644
--- a/arch/riscv/boot/dts/sophgo/sg2042-milkv-pioneer.dts
+++ b/arch/riscv/boot/dts/sophgo/sg2042-milkv-pioneer.dts
@@ -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 {
-- 
2.34.1


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

* Re: [PATCH 1/1] riscv: sophgo: dts: add power key for pioneer box
  2024-10-08  1:43 ` [PATCH 1/1] riscv: sophgo: dts: add " Chen Wang
@ 2024-10-08  5:18   ` Inochi Amaoto
  2024-10-08  9:28     ` Krzysztof Kozlowski
  0 siblings, 1 reply; 7+ messages in thread
From: Inochi Amaoto @ 2024-10-08  5:18 UTC (permalink / raw)
  To: Chen Wang, aou, unicorn_wang, conor+dt, guoren, inochiama,
	krzk+dt, palmer, paul.walmsley, robh, devicetree, linux-kernel,
	linux-riscv, chao.wei, haijiao.liu, xiaoguang.xing, chunzhi.lin
  Cc: Inochi Amaoto

On Tue, Oct 08, 2024 at 09:43:52AM +0800, Chen Wang wrote:
> From: Chen Wang <unicorn_wang@outlook.com>
> 
> 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 <unicorn_wang@outlook.com>
> ---
>  .../boot/dts/sophgo/sg2042-milkv-pioneer.dts      | 15 +++++++++++++++
>  1 file changed, 15 insertions(+)
> 
> diff --git a/arch/riscv/boot/dts/sophgo/sg2042-milkv-pioneer.dts b/arch/riscv/boot/dts/sophgo/sg2042-milkv-pioneer.dts
> index a3f9d6f22566..be596d01ff8d 100644
> --- a/arch/riscv/boot/dts/sophgo/sg2042-milkv-pioneer.dts
> +++ b/arch/riscv/boot/dts/sophgo/sg2042-milkv-pioneer.dts
> @@ -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.

> +#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 {
> -- 
> 2.34.1
> 

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

* Re: [PATCH 0/1] Add power key for pioneer box
  2024-10-08  1:43 [PATCH 0/1] Add power key for pioneer box Chen Wang
  2024-10-08  1:43 ` [PATCH 1/1] riscv: sophgo: dts: add " Chen Wang
@ 2024-10-08  6:24 ` Inochi Amaoto
  2024-10-22  2:01 ` Inochi Amaoto
  2 siblings, 0 replies; 7+ messages in thread
From: Inochi Amaoto @ 2024-10-08  6:24 UTC (permalink / raw)
  To: Chen Wang, aou, unicorn_wang, conor+dt, guoren, inochiama,
	krzk+dt, palmer, paul.walmsley, robh, devicetree, linux-kernel,
	linux-riscv, chao.wei, haijiao.liu, xiaoguang.xing, chunzhi.lin
  Cc: Inochi Amaoto

On Tue, Oct 08, 2024 at 09:43:32AM +0800, Chen Wang wrote:
> From: Chen Wang <unicorn_wang@outlook.com>
> 
> 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
> -- 
> 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

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

* Re: [PATCH 1/1] riscv: sophgo: dts: add power key for pioneer box
  2024-10-08  5:18   ` Inochi Amaoto
@ 2024-10-08  9:28     ` Krzysztof Kozlowski
  2024-10-08  9:46       ` Inochi Amaoto
  0 siblings, 1 reply; 7+ messages in thread
From: Krzysztof Kozlowski @ 2024-10-08  9:28 UTC (permalink / raw)
  To: Inochi Amaoto, Chen Wang, aou, unicorn_wang, conor+dt, guoren,
	inochiama, krzk+dt, palmer, paul.walmsley, robh, devicetree,
	linux-kernel, linux-riscv, chao.wei, haijiao.liu, xiaoguang.xing,
	chunzhi.lin

On 08/10/2024 07:18, Inochi Amaoto wrote:
> On Tue, Oct 08, 2024 at 09:43:52AM +0800, Chen Wang wrote:
>> From: Chen Wang <unicorn_wang@outlook.com>
>>
>> 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 <unicorn_wang@outlook.com>
>> ---
>>  .../boot/dts/sophgo/sg2042-milkv-pioneer.dts      | 15 +++++++++++++++
>>  1 file changed, 15 insertions(+)
>>
>> diff --git a/arch/riscv/boot/dts/sophgo/sg2042-milkv-pioneer.dts b/arch/riscv/boot/dts/sophgo/sg2042-milkv-pioneer.dts
>> index a3f9d6f22566..be596d01ff8d 100644
>> --- a/arch/riscv/boot/dts/sophgo/sg2042-milkv-pioneer.dts
>> +++ b/arch/riscv/boot/dts/sophgo/sg2042-milkv-pioneer.dts
>> @@ -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

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


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

* Re: [PATCH 1/1] riscv: sophgo: dts: add power key for pioneer box
  2024-10-08  9:28     ` Krzysztof Kozlowski
@ 2024-10-08  9:46       ` Inochi Amaoto
  0 siblings, 0 replies; 7+ messages in thread
From: Inochi Amaoto @ 2024-10-08  9:46 UTC (permalink / raw)
  To: Krzysztof Kozlowski, Inochi Amaoto, Chen Wang, aou, unicorn_wang,
	conor+dt, guoren, inochiama, krzk+dt, palmer, paul.walmsley, robh,
	devicetree, linux-kernel, linux-riscv, chao.wei, haijiao.liu,
	xiaoguang.xing, chunzhi.lin

On Tue, Oct 08, 2024 at 11:28:24AM +0200, Krzysztof Kozlowski wrote:
> On 08/10/2024 07:18, Inochi Amaoto wrote:
> > On Tue, Oct 08, 2024 at 09:43:52AM +0800, Chen Wang wrote:
> >> From: Chen Wang <unicorn_wang@outlook.com>
> >>
> >> 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 <unicorn_wang@outlook.com>
> >> ---
> >>  .../boot/dts/sophgo/sg2042-milkv-pioneer.dts      | 15 +++++++++++++++
> >>  1 file changed, 15 insertions(+)
> >>
> >> diff --git a/arch/riscv/boot/dts/sophgo/sg2042-milkv-pioneer.dts b/arch/riscv/boot/dts/sophgo/sg2042-milkv-pioneer.dts
> >> index a3f9d6f22566..be596d01ff8d 100644
> >> --- a/arch/riscv/boot/dts/sophgo/sg2042-milkv-pioneer.dts
> >> +++ b/arch/riscv/boot/dts/sophgo/sg2042-milkv-pioneer.dts
> >> @@ -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
> 
> 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.
> 

OK, it is my misunderstanding, I thought this header is binded 
to the GPIO device. Let's drop my advice.

Regard,
Inochi

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

* Re: [PATCH 0/1] Add power key for pioneer box
  2024-10-08  1:43 [PATCH 0/1] Add power key for pioneer box Chen Wang
  2024-10-08  1:43 ` [PATCH 1/1] riscv: sophgo: dts: add " Chen Wang
  2024-10-08  6:24 ` [PATCH 0/1] Add " Inochi Amaoto
@ 2024-10-22  2:01 ` Inochi Amaoto
  2 siblings, 0 replies; 7+ messages in thread
From: Inochi Amaoto @ 2024-10-22  2:01 UTC (permalink / raw)
  To: aou, unicorn_wang, conor+dt, guoren, inochiama, krzk+dt, palmer,
	paul.walmsley, robh, devicetree, linux-kernel, linux-riscv,
	chao.wei, haijiao.liu, xiaoguang.xing, chunzhi.lin, Chen Wang
  Cc: Inochi Amaoto

On Tue, 08 Oct 2024 09:43:32 +0800, Chen Wang wrote:
> From: Chen Wang <unicorn_wang@outlook.com>
> 
> 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


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

end of thread, other threads:[~2024-10-22  2:01 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-10-08  1:43 [PATCH 0/1] Add power key for pioneer box Chen Wang
2024-10-08  1:43 ` [PATCH 1/1] riscv: sophgo: dts: add " Chen Wang
2024-10-08  5:18   ` Inochi Amaoto
2024-10-08  9:28     ` Krzysztof Kozlowski
2024-10-08  9:46       ` Inochi Amaoto
2024-10-08  6:24 ` [PATCH 0/1] Add " Inochi Amaoto
2024-10-22  2:01 ` Inochi Amaoto

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).