All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2 0/5] Add support for some features on OnePlus One
@ 2023-02-06 20:40 Luca Weiss
  2023-02-06 20:40 ` [PATCH v2 1/5] ARM: dts: qcom: pm8941: Add vibrator node Luca Weiss
                   ` (5 more replies)
  0 siblings, 6 replies; 8+ messages in thread
From: Luca Weiss @ 2023-02-06 20:40 UTC (permalink / raw)
  To: ~postmarketos/upstreaming, phone-devel, Andy Gross,
	Bjorn Andersson, Konrad Dybcio, Rob Herring, Krzysztof Kozlowski
  Cc: linux-arm-msm, devicetree, linux-kernel, Luca Weiss

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 <luca@z3ntu.xyz>
---
Changes in v2:
- 3/5: improve order of pinctrl* properties, remove unnecessary newline
- pick up tags
- Link to v1: https://lore.kernel.org/r/20230122-msm8974-bacon-features-v1-0-4049f565c24c@z3ntu.xyz

---
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 <luca@z3ntu.xyz>


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

* [PATCH v2 1/5] ARM: dts: qcom: pm8941: Add vibrator node
  2023-02-06 20:40 [PATCH v2 0/5] Add support for some features on OnePlus One Luca Weiss
@ 2023-02-06 20:40 ` Luca Weiss
  2023-02-06 20:40 ` [PATCH v2 2/5] ARM: dts: qcom: msm8974-oneplus-bacon: Add vibrator Luca Weiss
                   ` (4 subsequent siblings)
  5 siblings, 0 replies; 8+ messages in thread
From: Luca Weiss @ 2023-02-06 20:40 UTC (permalink / raw)
  To: ~postmarketos/upstreaming, phone-devel, Andy Gross,
	Bjorn Andersson, Konrad Dybcio, Rob Herring, Krzysztof Kozlowski
  Cc: linux-arm-msm, devicetree, linux-kernel, Luca Weiss

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

Reviewed-by: Konrad Dybcio <konrad.dybcio@linaro.org>
Signed-off-by: Luca Weiss <luca@z3ntu.xyz>
---
 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


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

* [PATCH v2 2/5] ARM: dts: qcom: msm8974-oneplus-bacon: Add vibrator
  2023-02-06 20:40 [PATCH v2 0/5] Add support for some features on OnePlus One Luca Weiss
  2023-02-06 20:40 ` [PATCH v2 1/5] ARM: dts: qcom: pm8941: Add vibrator node Luca Weiss
@ 2023-02-06 20:40 ` Luca Weiss
  2023-02-06 20:40 ` [PATCH v2 3/5] ARM: dts: qcom: msm8974-oneplus-bacon: Add volume keys and hall sensor Luca Weiss
                   ` (3 subsequent siblings)
  5 siblings, 0 replies; 8+ messages in thread
From: Luca Weiss @ 2023-02-06 20:40 UTC (permalink / raw)
  To: ~postmarketos/upstreaming, phone-devel, Andy Gross,
	Bjorn Andersson, Konrad Dybcio, Rob Herring, Krzysztof Kozlowski
  Cc: linux-arm-msm, devicetree, linux-kernel, Luca Weiss

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

Reviewed-by: Konrad Dybcio <konrad.dybcio@linaro.org>
Signed-off-by: Luca Weiss <luca@z3ntu.xyz>
---
 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


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

* [PATCH v2 3/5] ARM: dts: qcom: msm8974-oneplus-bacon: Add volume keys and hall sensor
  2023-02-06 20:40 [PATCH v2 0/5] Add support for some features on OnePlus One Luca Weiss
  2023-02-06 20:40 ` [PATCH v2 1/5] ARM: dts: qcom: pm8941: Add vibrator node Luca Weiss
  2023-02-06 20:40 ` [PATCH v2 2/5] ARM: dts: qcom: msm8974-oneplus-bacon: Add vibrator Luca Weiss
@ 2023-02-06 20:40 ` Luca Weiss
  2023-02-06 20:40 ` [PATCH v2 4/5] ARM: dts: qcom: msm8974-oneplus-bacon: Add backlight Luca Weiss
                   ` (2 subsequent siblings)
  5 siblings, 0 replies; 8+ messages in thread
From: Luca Weiss @ 2023-02-06 20:40 UTC (permalink / raw)
  To: ~postmarketos/upstreaming, phone-devel, Andy Gross,
	Bjorn Andersson, Konrad Dybcio, Rob Herring, Krzysztof Kozlowski
  Cc: linux-arm-msm, devicetree, linux-kernel, Luca Weiss

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

Signed-off-by: Luca Weiss <luca@z3ntu.xyz>
---
 .../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


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

* [PATCH v2 4/5] ARM: dts: qcom: msm8974-oneplus-bacon: Add backlight
  2023-02-06 20:40 [PATCH v2 0/5] Add support for some features on OnePlus One Luca Weiss
                   ` (2 preceding siblings ...)
  2023-02-06 20:40 ` [PATCH v2 3/5] ARM: dts: qcom: msm8974-oneplus-bacon: Add volume keys and hall sensor Luca Weiss
@ 2023-02-06 20:40 ` Luca Weiss
  2023-02-06 20:40 ` [PATCH v2 5/5] ARM: dts: qcom: msm8974-oneplus-bacon: Add notification LED Luca Weiss
  2023-02-09  4:23 ` [PATCH v2 0/5] Add support for some features on OnePlus One Bjorn Andersson
  5 siblings, 0 replies; 8+ messages in thread
From: Luca Weiss @ 2023-02-06 20:40 UTC (permalink / raw)
  To: ~postmarketos/upstreaming, phone-devel, Andy Gross,
	Bjorn Andersson, Konrad Dybcio, Rob Herring, Krzysztof Kozlowski
  Cc: linux-arm-msm, devicetree, linux-kernel, Luca Weiss

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

Reviewed-by: Konrad Dybcio <konrad.dybcio@linaro.org>
Signed-off-by: Luca Weiss <luca@z3ntu.xyz>
---
 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


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

* [PATCH v2 5/5] ARM: dts: qcom: msm8974-oneplus-bacon: Add notification LED
  2023-02-06 20:40 [PATCH v2 0/5] Add support for some features on OnePlus One Luca Weiss
                   ` (3 preceding siblings ...)
  2023-02-06 20:40 ` [PATCH v2 4/5] ARM: dts: qcom: msm8974-oneplus-bacon: Add backlight Luca Weiss
@ 2023-02-06 20:40 ` Luca Weiss
  2023-02-11 16:23   ` Pavel Machek
  2023-02-09  4:23 ` [PATCH v2 0/5] Add support for some features on OnePlus One Bjorn Andersson
  5 siblings, 1 reply; 8+ messages in thread
From: Luca Weiss @ 2023-02-06 20:40 UTC (permalink / raw)
  To: ~postmarketos/upstreaming, phone-devel, Andy Gross,
	Bjorn Andersson, Konrad Dybcio, Rob Herring, Krzysztof Kozlowski
  Cc: linux-arm-msm, devicetree, linux-kernel, Luca Weiss

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 <konrad.dybcio@linaro.org>
Signed-off-by: Luca Weiss <luca@z3ntu.xyz>
---
 .../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


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

* Re: [PATCH v2 0/5] Add support for some features on OnePlus One
  2023-02-06 20:40 [PATCH v2 0/5] Add support for some features on OnePlus One Luca Weiss
                   ` (4 preceding siblings ...)
  2023-02-06 20:40 ` [PATCH v2 5/5] ARM: dts: qcom: msm8974-oneplus-bacon: Add notification LED Luca Weiss
@ 2023-02-09  4:23 ` Bjorn Andersson
  5 siblings, 0 replies; 8+ messages in thread
From: Bjorn Andersson @ 2023-02-09  4:23 UTC (permalink / raw)
  To: Andy Gross, ~postmarketos/upstreaming, Rob Herring, Luca Weiss,
	Konrad Dybcio, phone-devel, Krzysztof Kozlowski
  Cc: devicetree, linux-kernel, linux-arm-msm

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 <andersson@kernel.org>

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

* Re: [PATCH v2 5/5] ARM: dts: qcom: msm8974-oneplus-bacon: Add notification LED
  2023-02-06 20:40 ` [PATCH v2 5/5] ARM: dts: qcom: msm8974-oneplus-bacon: Add notification LED Luca Weiss
@ 2023-02-11 16:23   ` Pavel Machek
  0 siblings, 0 replies; 8+ messages in thread
From: Pavel Machek @ 2023-02-11 16:23 UTC (permalink / raw)
  To: Luca Weiss
  Cc: ~postmarketos/upstreaming, phone-devel, Andy Gross,
	Bjorn Andersson, Konrad Dybcio, Rob Herring, Krzysztof Kozlowski,
	linux-arm-msm, devicetree, linux-kernel

[-- Attachment #1: Type: text/plain, Size: 455 bytes --]

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.

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 195 bytes --]

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

end of thread, other threads:[~2023-02-11 16:23 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-02-06 20:40 [PATCH v2 0/5] Add support for some features on OnePlus One Luca Weiss
2023-02-06 20:40 ` [PATCH v2 1/5] ARM: dts: qcom: pm8941: Add vibrator node Luca Weiss
2023-02-06 20:40 ` [PATCH v2 2/5] ARM: dts: qcom: msm8974-oneplus-bacon: Add vibrator Luca Weiss
2023-02-06 20:40 ` [PATCH v2 3/5] ARM: dts: qcom: msm8974-oneplus-bacon: Add volume keys and hall sensor Luca Weiss
2023-02-06 20:40 ` [PATCH v2 4/5] ARM: dts: qcom: msm8974-oneplus-bacon: Add backlight Luca Weiss
2023-02-06 20:40 ` [PATCH v2 5/5] ARM: dts: qcom: msm8974-oneplus-bacon: Add notification LED Luca Weiss
2023-02-11 16:23   ` Pavel Machek
2023-02-09  4:23 ` [PATCH v2 0/5] Add support for some features on OnePlus One Bjorn Andersson

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.