* [PATCH] arm64: dts: qcom: c630: Expose LID events
@ 2020-11-25 6:08 Bjorn Andersson
2020-11-30 6:20 ` Shawn Guo
` (2 more replies)
0 siblings, 3 replies; 4+ messages in thread
From: Bjorn Andersson @ 2020-11-25 6:08 UTC (permalink / raw)
To: Andy Gross, Bjorn Andersson, Rob Herring, Steev Klimaszewski, Shawn Guo
Cc: linux-arm-msm, devicetree, linux-kernel
The LID state can be read from GPIO 124 and the "tablet mode" from GPIO
95, expose these to the system using gpio-keys and mark the falling edge
of the LID state as a wakeup-source - to wake the system from suspend.
Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
---
.../boot/dts/qcom/sdm850-lenovo-yoga-c630.dts | 39 +++++++++++++++++++
1 file changed, 39 insertions(+)
diff --git a/arch/arm64/boot/dts/qcom/sdm850-lenovo-yoga-c630.dts b/arch/arm64/boot/dts/qcom/sdm850-lenovo-yoga-c630.dts
index bb314973eb0c..f956dbf664c1 100644
--- a/arch/arm64/boot/dts/qcom/sdm850-lenovo-yoga-c630.dts
+++ b/arch/arm64/boot/dts/qcom/sdm850-lenovo-yoga-c630.dts
@@ -8,6 +8,8 @@
/dts-v1/;
#include <dt-bindings/gpio/gpio.h>
+#include <dt-bindings/input/gpio-keys.h>
+#include <dt-bindings/input/input.h>
#include <dt-bindings/regulator/qcom,rpmh-regulator.h>
#include <dt-bindings/sound/qcom,q6afe.h>
#include <dt-bindings/sound/qcom,q6asm.h>
@@ -21,6 +23,27 @@ / {
aliases {
hsuart0 = &uart6;
};
+
+ gpio-keys {
+ compatible = "gpio-keys";
+
+ pinctrl-names = "default";
+ pinctrl-0 = <&lid_pin_active>, <&mode_pin_active>;
+
+ lid {
+ gpios = <&tlmm 124 GPIO_ACTIVE_HIGH>;
+ linux,input-type = <EV_SW>;
+ linux,code = <SW_LID>;
+ wakeup-source;
+ wakeup-event-action = <EV_ACT_DEASSERTED>;
+ };
+
+ mode {
+ gpios = <&tlmm 95 GPIO_ACTIVE_HIGH>;
+ linux,input-type = <EV_SW>;
+ linux,code = <SW_TABLET_MODE>;
+ };
+ };
};
&adsp_pas {
@@ -466,6 +489,22 @@ wcd_intr_default: wcd_intr_default {
bias-pull-down;
drive-strength = <2>;
};
+
+ lid_pin_active: lid-pin {
+ pins = "gpio124";
+ function = "gpio";
+
+ input-enable;
+ bias-disable;
+ };
+
+ mode_pin_active: mode-pin {
+ pins = "gpio95";
+ function = "gpio";
+
+ input-enable;
+ bias-disable;
+ };
};
&uart6 {
--
2.29.2
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH] arm64: dts: qcom: c630: Expose LID events
2020-11-25 6:08 [PATCH] arm64: dts: qcom: c630: Expose LID events Bjorn Andersson
@ 2020-11-30 6:20 ` Shawn Guo
2020-11-30 16:19 ` Steev Klimaszewski
2020-11-30 19:00 ` patchwork-bot+linux-arm-msm
2 siblings, 0 replies; 4+ messages in thread
From: Shawn Guo @ 2020-11-30 6:20 UTC (permalink / raw)
To: Bjorn Andersson
Cc: Andy Gross, Rob Herring, Steev Klimaszewski, linux-arm-msm,
devicetree, linux-kernel
On Wed, Nov 25, 2020 at 12:08:38AM -0600, Bjorn Andersson wrote:
> The LID state can be read from GPIO 124 and the "tablet mode" from GPIO
> 95, expose these to the system using gpio-keys and mark the falling edge
> of the LID state as a wakeup-source - to wake the system from suspend.
>
> Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
Acked-by: Shawn Guo <shawn.guo@linaro.org>
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] arm64: dts: qcom: c630: Expose LID events
2020-11-25 6:08 [PATCH] arm64: dts: qcom: c630: Expose LID events Bjorn Andersson
2020-11-30 6:20 ` Shawn Guo
@ 2020-11-30 16:19 ` Steev Klimaszewski
2020-11-30 19:00 ` patchwork-bot+linux-arm-msm
2 siblings, 0 replies; 4+ messages in thread
From: Steev Klimaszewski @ 2020-11-30 16:19 UTC (permalink / raw)
To: Bjorn Andersson, Andy Gross, Rob Herring, Shawn Guo
Cc: linux-arm-msm, devicetree, linux-kernel
On 11/25/20 12:08 AM, Bjorn Andersson wrote:
> The LID state can be read from GPIO 124 and the "tablet mode" from GPIO
> 95, expose these to the system using gpio-keys and mark the falling edge
> of the LID state as a wakeup-source - to wake the system from suspend.
>
> Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
> ---
> .../boot/dts/qcom/sdm850-lenovo-yoga-c630.dts | 39 +++++++++++++++++++
> 1 file changed, 39 insertions(+)
>
> diff --git a/arch/arm64/boot/dts/qcom/sdm850-lenovo-yoga-c630.dts b/arch/arm64/boot/dts/qcom/sdm850-lenovo-yoga-c630.dts
> index bb314973eb0c..f956dbf664c1 100644
> --- a/arch/arm64/boot/dts/qcom/sdm850-lenovo-yoga-c630.dts
> +++ b/arch/arm64/boot/dts/qcom/sdm850-lenovo-yoga-c630.dts
> @@ -8,6 +8,8 @@
> /dts-v1/;
>
> #include <dt-bindings/gpio/gpio.h>
> +#include <dt-bindings/input/gpio-keys.h>
> +#include <dt-bindings/input/input.h>
> #include <dt-bindings/regulator/qcom,rpmh-regulator.h>
> #include <dt-bindings/sound/qcom,q6afe.h>
> #include <dt-bindings/sound/qcom,q6asm.h>
> @@ -21,6 +23,27 @@ / {
> aliases {
> hsuart0 = &uart6;
> };
> +
> + gpio-keys {
> + compatible = "gpio-keys";
> +
> + pinctrl-names = "default";
> + pinctrl-0 = <&lid_pin_active>, <&mode_pin_active>;
> +
> + lid {
> + gpios = <&tlmm 124 GPIO_ACTIVE_HIGH>;
> + linux,input-type = <EV_SW>;
> + linux,code = <SW_LID>;
> + wakeup-source;
> + wakeup-event-action = <EV_ACT_DEASSERTED>;
> + };
> +
> + mode {
> + gpios = <&tlmm 95 GPIO_ACTIVE_HIGH>;
> + linux,input-type = <EV_SW>;
> + linux,code = <SW_TABLET_MODE>;
> + };
> + };
> };
>
> &adsp_pas {
> @@ -466,6 +489,22 @@ wcd_intr_default: wcd_intr_default {
> bias-pull-down;
> drive-strength = <2>;
> };
> +
> + lid_pin_active: lid-pin {
> + pins = "gpio124";
> + function = "gpio";
> +
> + input-enable;
> + bias-disable;
> + };
> +
> + mode_pin_active: mode-pin {
> + pins = "gpio95";
> + function = "gpio";
> +
> + input-enable;
> + bias-disable;
> + };
> };
>
> &uart6 {
Tested-by: Steev Klimaszewski <steev@kali.org>
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] arm64: dts: qcom: c630: Expose LID events
2020-11-25 6:08 [PATCH] arm64: dts: qcom: c630: Expose LID events Bjorn Andersson
2020-11-30 6:20 ` Shawn Guo
2020-11-30 16:19 ` Steev Klimaszewski
@ 2020-11-30 19:00 ` patchwork-bot+linux-arm-msm
2 siblings, 0 replies; 4+ messages in thread
From: patchwork-bot+linux-arm-msm @ 2020-11-30 19:00 UTC (permalink / raw)
To: Bjorn Andersson; +Cc: linux-arm-msm
Hello:
This patch was applied to qcom/linux.git (refs/heads/for-next):
On Wed, 25 Nov 2020 00:08:38 -0600 you wrote:
> The LID state can be read from GPIO 124 and the "tablet mode" from GPIO
> 95, expose these to the system using gpio-keys and mark the falling edge
> of the LID state as a wakeup-source - to wake the system from suspend.
>
> Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
> ---
> .../boot/dts/qcom/sdm850-lenovo-yoga-c630.dts | 39 +++++++++++++++++++
> 1 file changed, 39 insertions(+)
Here is the summary with links:
- arm64: dts: qcom: c630: Expose LID events
https://git.kernel.org/qcom/c/71b83b74cca3
You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2020-11-30 19:00 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-11-25 6:08 [PATCH] arm64: dts: qcom: c630: Expose LID events Bjorn Andersson
2020-11-30 6:20 ` Shawn Guo
2020-11-30 16:19 ` Steev Klimaszewski
2020-11-30 19:00 ` patchwork-bot+linux-arm-msm
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.