2023-02-06 20:40:38

by Luca Weiss

[permalink] [raw]
Subject: [PATCH v2 0/5] Add support for some features on OnePlus One

Add support for the vibrator, volume keys, hall sensor, backlight and
notification LED to the device tree of the OnePlus One smartphone.

Signed-off-by: Luca Weiss <[email protected]>
---
Changes in v2:
- 3/5: improve order of pinctrl* properties, remove unnecessary newline
- pick up tags
- Link to v1: https://lore.kernel.org/r/[email protected]

---
Luca Weiss (5):
ARM: dts: qcom: pm8941: Add vibrator node
ARM: dts: qcom: msm8974-oneplus-bacon: Add vibrator
ARM: dts: qcom: msm8974-oneplus-bacon: Add volume keys and hall sensor
ARM: dts: qcom: msm8974-oneplus-bacon: Add backlight
ARM: dts: qcom: msm8974-oneplus-bacon: Add notification LED

.../arm/boot/dts/qcom-msm8974pro-oneplus-bacon.dts | 96 ++++++++++++++++++++++
arch/arm/boot/dts/qcom-pm8941.dtsi | 6 ++
2 files changed, 102 insertions(+)
---
base-commit: 2be7ea9924c3f827342d01ebbdf414df8ccf97d7
change-id: 20230122-msm8974-bacon-features-6c832aa94c87

Best regards,
--
Luca Weiss <[email protected]>



2023-02-06 20:40:42

by Luca Weiss

[permalink] [raw]
Subject: [PATCH v2 1/5] ARM: dts: qcom: pm8941: Add vibrator node

Add the node describing the vibrator that's found on pm8941.

Reviewed-by: Konrad Dybcio <[email protected]>
Signed-off-by: Luca Weiss <[email protected]>
---
arch/arm/boot/dts/qcom-pm8941.dtsi | 6 ++++++
1 file changed, 6 insertions(+)

diff --git a/arch/arm/boot/dts/qcom-pm8941.dtsi b/arch/arm/boot/dts/qcom-pm8941.dtsi
index cd957a1e7cdf..a821f0368a28 100644
--- a/arch/arm/boot/dts/qcom-pm8941.dtsi
+++ b/arch/arm/boot/dts/qcom-pm8941.dtsi
@@ -161,6 +161,12 @@ pm8941_lpg: pwm {
status = "disabled";
};

+ pm8941_vib: vibrator@c000 {
+ compatible = "qcom,pm8916-vib";
+ reg = <0xc000>;
+ status = "disabled";
+ };
+
pm8941_wled: wled@d800 {
compatible = "qcom,pm8941-wled";
reg = <0xd800>;

--
2.39.1


2023-02-06 20:40:46

by Luca Weiss

[permalink] [raw]
Subject: [PATCH v2 4/5] ARM: dts: qcom: msm8974-oneplus-bacon: Add backlight

Add the node for the lm3630 that is used to control backlight.

Reviewed-by: Konrad Dybcio <[email protected]>
Signed-off-by: Luca Weiss <[email protected]>
---
arch/arm/boot/dts/qcom-msm8974pro-oneplus-bacon.dts | 15 +++++++++++++++
1 file changed, 15 insertions(+)

diff --git a/arch/arm/boot/dts/qcom-msm8974pro-oneplus-bacon.dts b/arch/arm/boot/dts/qcom-msm8974pro-oneplus-bacon.dts
index c4c355533149..a4b5d680c097 100644
--- a/arch/arm/boot/dts/qcom-msm8974pro-oneplus-bacon.dts
+++ b/arch/arm/boot/dts/qcom-msm8974pro-oneplus-bacon.dts
@@ -99,6 +99,21 @@ rmi4-f12@12 {
syna,clip-y-high = <1920>;
};
};
+
+ led-controller@36 {
+ compatible = "ti,lm3630a";
+ reg = <0x36>;
+
+ #address-cells = <1>;
+ #size-cells = <0>;
+
+ led@0 {
+ reg = <0>;
+ led-sources = <0 1>;
+ label = "lcd-backlight";
+ default-brightness = <80>;
+ };
+ };
};

&blsp1_i2c6 {

--
2.39.1


2023-02-06 20:40:49

by Luca Weiss

[permalink] [raw]
Subject: [PATCH v2 5/5] ARM: dts: qcom: msm8974-oneplus-bacon: Add notification LED

Add the node describing the sn3193 that's used to provide notification
LED.

Unfortunately the driver currently supports neither multicolor API nor
using the properties function & color, so we use label instead.

Reviewed-by: Konrad Dybcio <[email protected]>
Signed-off-by: Luca Weiss <[email protected]>
---
.../arm/boot/dts/qcom-msm8974pro-oneplus-bacon.dts | 28 ++++++++++++++++++++++
1 file changed, 28 insertions(+)

diff --git a/arch/arm/boot/dts/qcom-msm8974pro-oneplus-bacon.dts b/arch/arm/boot/dts/qcom-msm8974pro-oneplus-bacon.dts
index a4b5d680c097..8d2a054d8fee 100644
--- a/arch/arm/boot/dts/qcom-msm8974pro-oneplus-bacon.dts
+++ b/arch/arm/boot/dts/qcom-msm8974pro-oneplus-bacon.dts
@@ -114,6 +114,34 @@ led@0 {
default-brightness = <80>;
};
};
+
+ led-controller@68 {
+ compatible = "si-en,sn3193";
+ reg = <0x68>;
+
+ shutdown-gpios = <&tlmm 45 GPIO_ACTIVE_HIGH>;
+
+ #address-cells = <1>;
+ #size-cells = <0>;
+
+ led@1 {
+ reg = <1>;
+ label = "red:status";
+ led-max-microamp = <17500>;
+ };
+
+ led@2 {
+ reg = <2>;
+ label = "green:status";
+ led-max-microamp = <17500>;
+ };
+
+ led@3 {
+ reg = <3>;
+ label = "blue:status";
+ led-max-microamp = <17500>;
+ };
+ };
};

&blsp1_i2c6 {

--
2.39.1


2023-02-06 20:41:27

by Luca Weiss

[permalink] [raw]
Subject: [PATCH v2 2/5] ARM: dts: qcom: msm8974-oneplus-bacon: Add vibrator

Enable the pm8941 vibrator that's wired up on this device.

Reviewed-by: Konrad Dybcio <[email protected]>
Signed-off-by: Luca Weiss <[email protected]>
---
arch/arm/boot/dts/qcom-msm8974pro-oneplus-bacon.dts | 4 ++++
1 file changed, 4 insertions(+)

diff --git a/arch/arm/boot/dts/qcom-msm8974pro-oneplus-bacon.dts b/arch/arm/boot/dts/qcom-msm8974pro-oneplus-bacon.dts
index b5606623f968..63180fe1d292 100644
--- a/arch/arm/boot/dts/qcom-msm8974pro-oneplus-bacon.dts
+++ b/arch/arm/boot/dts/qcom-msm8974pro-oneplus-bacon.dts
@@ -95,6 +95,10 @@ &pm8941_coincell {
status = "okay";
};

+&pm8941_vib {
+ status = "okay";
+};
+
&pronto {
vddmx-supply = <&pm8841_s1>;
vddcx-supply = <&pm8841_s2>;

--
2.39.1


2023-02-06 20:41:30

by Luca Weiss

[permalink] [raw]
Subject: [PATCH v2 3/5] ARM: dts: qcom: msm8974-oneplus-bacon: Add volume keys and hall sensor

Add nodes for the volume buttons and the hall sensor that are found on
the device.

Signed-off-by: Luca Weiss <[email protected]>
---
.../arm/boot/dts/qcom-msm8974pro-oneplus-bacon.dts | 49 ++++++++++++++++++++++
1 file changed, 49 insertions(+)

diff --git a/arch/arm/boot/dts/qcom-msm8974pro-oneplus-bacon.dts b/arch/arm/boot/dts/qcom-msm8974pro-oneplus-bacon.dts
index 63180fe1d292..c4c355533149 100644
--- a/arch/arm/boot/dts/qcom-msm8974pro-oneplus-bacon.dts
+++ b/arch/arm/boot/dts/qcom-msm8974pro-oneplus-bacon.dts
@@ -19,6 +19,38 @@ aliases {
chosen {
stdout-path = "serial0:115200n8";
};
+
+ gpio-keys {
+ compatible = "gpio-keys";
+
+ pinctrl-0 = <&gpio_keys_default>, <&gpio_hall_sensor_default>;
+ pinctrl-names = "default";
+
+ key-volume-down {
+ label = "Volume Down";
+ gpios = <&pm8941_gpios 2 GPIO_ACTIVE_LOW>;
+ linux,code = <KEY_VOLUMEDOWN>;
+ wakeup-source;
+ debounce-interval = <15>;
+ };
+
+ key-volume-up {
+ label = "Volume Up";
+ gpios = <&pm8941_gpios 5 GPIO_ACTIVE_LOW>;
+ linux,code = <KEY_VOLUMEUP>;
+ wakeup-source;
+ debounce-interval = <15>;
+ };
+
+ event-hall-sensor {
+ label = "Hall Effect Sensor";
+ gpios = <&tlmm 68 GPIO_ACTIVE_LOW>;
+ linux,input-type = <EV_SW>;
+ linux,code = <SW_LID>;
+ linux,can-disable;
+ debounce-interval = <150>;
+ };
+ };
};

&blsp1_i2c1 {
@@ -95,6 +127,16 @@ &pm8941_coincell {
status = "okay";
};

+&pm8941_gpios {
+ gpio_keys_default: gpio-keys-active-state {
+ pins = "gpio2", "gpio5";
+ function = "normal";
+ input-enable;
+ bias-disable;
+ power-source = <PM8941_GPIO_S3>;
+ };
+};
+
&pm8941_vib {
status = "okay";
};
@@ -349,6 +391,13 @@ &sdhc_1 {
};

&tlmm {
+ gpio_hall_sensor_default: gpio-hall-sensor-default-state {
+ pins = "gpio68";
+ function = "gpio";
+ drive-strength = <8>;
+ bias-pull-up;
+ };
+
sdc1_on: sdc1-on-state {
clk-pins {
pins = "sdc1_clk";

--
2.39.1


2023-02-09 04:32:09

by Bjorn Andersson

[permalink] [raw]
Subject: Re: [PATCH v2 0/5] Add support for some features on OnePlus One

On Mon, 06 Feb 2023 21:40:13 +0100, Luca Weiss wrote:
> Add support for the vibrator, volume keys, hall sensor, backlight and
> notification LED to the device tree of the OnePlus One smartphone.
>
>

Applied, thanks!

[1/5] ARM: dts: qcom: pm8941: Add vibrator node
commit: 3d2cc00d6d4e552c9bb4a77b6155104185e8d58f
[2/5] ARM: dts: qcom: msm8974-oneplus-bacon: Add vibrator
commit: b2f82484c5216af9a227a567c31fe03934e05ee4
[3/5] ARM: dts: qcom: msm8974-oneplus-bacon: Add volume keys and hall sensor
commit: de0520a6e27299c6a893c01aa5bb098810ef7349
[4/5] ARM: dts: qcom: msm8974-oneplus-bacon: Add backlight
commit: 44244ed2a95956b9ac1c3e6c7ffd77c88fac05bd
[5/5] ARM: dts: qcom: msm8974-oneplus-bacon: Add notification LED
commit: 3835f9a0cf56fab884d3072a991482c1f222c942

Best regards,
--
Bjorn Andersson <[email protected]>

2023-02-11 16:23:50

by Pavel Machek

[permalink] [raw]
Subject: Re: [PATCH v2 5/5] ARM: dts: qcom: msm8974-oneplus-bacon: Add notification LED

On Mon 2023-02-06 21:40:18, Luca Weiss wrote:
> Add the node describing the sn3193 that's used to provide notification
> LED.
>
> Unfortunately the driver currently supports neither multicolor API nor
> using the properties function & color, so we use label instead.

Let's not do that. It will be hard to fix it later without changing
ABI.

Best regards,
Pavel
--
People of Russia, stop Putin before his war on Ukraine escalates.


Attachments:
(No filename) (441.00 B)
signature.asc (195.00 B)
Download all attachments