Skip to contentSkip to conversation

Add touchscreen for msm8916-samsung-a5u

PATCH In review Stephan Gerhold 2 participants 8 messages Apr 26, 2020 – May 12, 2020

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

cover Add touchscreen for msm8916-samsung-a5u

This patch series enables the touchscreen
on the Samsung Galaxy A5 (2015) ("samsung-a5u").

Stephan Gerhold (4):
arm64: dts: qcom: msm8916: Add blsp_i2c1
arm64: dts: qcom: msm8916: Add blsp_i2c5
arm64: dts: qcom: msm8916-samsung-a2015: Add touchscreen regulator
arm64: dts: qcom: msm8916-samsung-a5u: Add touchscreen

 arch/arm64/boot/dts/qcom/msm8916-pins.dtsi    | 48 +++++++++++++++++++
 .../qcom/msm8916-samsung-a2015-common.dtsi    | 25 ++++++++++
 .../boot/dts/qcom/msm8916-samsung-a5u-eur.dts | 35 ++++++++++++++
 arch/arm64/boot/dts/qcom/msm8916.dtsi         | 30 ++++++++++++
 4 files changed, 138 insertions(+)
Signature · 1 line
2.26.2
#1 lore raw

PATCH 1/4 arm64: dts: qcom: msm8916: Add blsp_i2c1

MSM8916 has another I2C QUP controller that can be enabled on GPIO 2 and 3.

Add blsp_i2c1 to msm8916.dtsi and disable it by default.

---
On samsung-a2015 there is an external TFA9895 speaker amplifier connected to blsp_i2c1. There isn't a proper mainline driver for it (yet?), but it's nice to have the I2C bus in mainline at least.

---
 arch/arm64/boot/dts/qcom/msm8916-pins.dtsi | 24 ++++++++++++++++++++++
 arch/arm64/boot/dts/qcom/msm8916.dtsi      | 15 ++++++++++++++
 2 files changed, 39 insertions(+)
arch/arm64/boot/dts/qcom/msm8916-pins.dtsi +24 -0
index 242aaea68804..b45fd12856ea 100644
@@ -262,6 +262,30 @@ pinconf {
 		};
 	};
 
+	i2c1_default: i2c1_default {
+		pinmux {
+			function = "blsp_i2c1";
+			pins = "gpio2", "gpio3";
+		};
+		pinconf {
+			pins = "gpio2", "gpio3";
+			drive-strength = <2>;
+			bias-disable;
+		};
+	};
+
+	i2c1_sleep: i2c1_sleep {
+		pinmux {
+			function = "gpio";
+			pins = "gpio2", "gpio3";
+		};
+		pinconf {
+			pins = "gpio2", "gpio3";
+			drive-strength = <2>;
+			bias-disable;
+		};
+	};
+
 	i2c2_default: i2c2_default {
 		pinmux {
 			function = "blsp_i2c2";
arch/arm64/boot/dts/qcom/msm8916.dtsi +15 -0
index 8b429954ea29..6ab7cabde370 100644
@@ -612,6 +612,21 @@ blsp_spi6: spi@78ba000 {
 			status = "disabled";
 		};
 
+		blsp_i2c1: i2c@78b5000 {
+			compatible = "qcom,i2c-qup-v2.2.1";
+			reg = <0x078b5000 0x500>;
+			interrupts = <GIC_SPI 95 IRQ_TYPE_LEVEL_HIGH>;
+			clocks = <&gcc GCC_BLSP1_AHB_CLK>,
+				 <&gcc GCC_BLSP1_QUP1_I2C_APPS_CLK>;
+			clock-names = "iface", "core";
+			pinctrl-names = "default", "sleep";
+			pinctrl-0 = <&i2c1_default>;
+			pinctrl-1 = <&i2c1_sleep>;
+			#address-cells = <1>;
+			#size-cells = <0>;
+			status = "disabled";
+		};
+
 		blsp_i2c2: i2c@78b6000 {
 			compatible = "qcom,i2c-qup-v2.2.1";
 			reg = <0x078b6000 0x500>;
Signature · 1 line
2.26.2
Reviewed-by on v1 1/4
#2 lore raw

Re: [PATCH 1/4] arm64: dts: qcom: msm8916: Add blsp_i2c1

Quoted 5 lines · Stephan Gerhold

MSM8916 has another I2C QUP controller that can be enabled on GPIO 2 and 3.

Add blsp_i2c1 to msm8916.dtsi and disable it by default.

Regards,
Bjorn

Quoted 74 lines

---
On samsung-a2015 there is an external TFA9895 speaker amplifier connected to blsp_i2c1. There isn't a proper mainline driver for it (yet?), but it's nice to have the I2C bus in mainline at least.

---
 arch/arm64/boot/dts/qcom/msm8916-pins.dtsi | 24 ++++++++++++++++++++++
 arch/arm64/boot/dts/qcom/msm8916.dtsi      | 15 ++++++++++++++
 2 files changed, 39 insertions(+)
arch/arm64/boot/dts/qcom/msm8916-pins.dtsi +24 -0
index 242aaea68804..b45fd12856ea 100644
@@ -262,6 +262,30 @@ pinconf {
 		};
 	};
 
+	i2c1_default: i2c1_default {
+		pinmux {
+			function = "blsp_i2c1";
+			pins = "gpio2", "gpio3";
+		};
+		pinconf {
+			pins = "gpio2", "gpio3";
+			drive-strength = <2>;
+			bias-disable;
+		};
+	};
+
+	i2c1_sleep: i2c1_sleep {
+		pinmux {
+			function = "gpio";
+			pins = "gpio2", "gpio3";
+		};
+		pinconf {
+			pins = "gpio2", "gpio3";
+			drive-strength = <2>;
+			bias-disable;
+		};
+	};
+
 	i2c2_default: i2c2_default {
 		pinmux {
 			function = "blsp_i2c2";
arch/arm64/boot/dts/qcom/msm8916.dtsi +15 -0
index 8b429954ea29..6ab7cabde370 100644
@@ -612,6 +612,21 @@ blsp_spi6: spi@78ba000 {
 			status = "disabled";
 		};
 
+		blsp_i2c1: i2c@78b5000 {
+			compatible = "qcom,i2c-qup-v2.2.1";
+			reg = <0x078b5000 0x500>;
+			interrupts = <GIC_SPI 95 IRQ_TYPE_LEVEL_HIGH>;
+			clocks = <&gcc GCC_BLSP1_AHB_CLK>,
+				 <&gcc GCC_BLSP1_QUP1_I2C_APPS_CLK>;
+			clock-names = "iface", "core";
+			pinctrl-names = "default", "sleep";
+			pinctrl-0 = <&i2c1_default>;
+			pinctrl-1 = <&i2c1_sleep>;
+			#address-cells = <1>;
+			#size-cells = <0>;
+			status = "disabled";
+		};
+
 		blsp_i2c2: i2c@78b6000 {
 			compatible = "qcom,i2c-qup-v2.2.1";
 			reg = <0x078b6000 0x500>;
Signature · 1 line
2.26.2
#3 lore raw

PATCH 2/4 arm64: dts: qcom: msm8916: Add blsp_i2c5

In reply to Stephan Gerhold

MSM8916 has another I2C QUP controller that can be enabled on GPIO 18 and 19.

Add blsp_i2c5 to msm8916.dtsi and disable it by default.

---
Most MSM8916 smartphones/tablets have a touchscreen connected to blsp_i2c5.

---
 arch/arm64/boot/dts/qcom/msm8916-pins.dtsi | 24 ++++++++++++++++++++++
 arch/arm64/boot/dts/qcom/msm8916.dtsi      | 15 ++++++++++++++
 2 files changed, 39 insertions(+)
arch/arm64/boot/dts/qcom/msm8916-pins.dtsi +24 -0
index b45fd12856ea..31886860766a 100644
@@ -334,6 +334,30 @@ pinconf {
 		};
 	};
 
+	i2c5_default: i2c5_default {
+		pinmux {
+			function = "blsp_i2c5";
+			pins = "gpio18", "gpio19";
+		};
+		pinconf {
+			pins = "gpio18", "gpio19";
+			drive-strength = <2>;
+			bias-disable;
+		};
+	};
+
+	i2c5_sleep: i2c5_sleep {
+		pinmux {
+			function = "gpio";
+			pins = "gpio18", "gpio19";
+		};
+		pinconf {
+			pins = "gpio18", "gpio19";
+			drive-strength = <2>;
+			bias-disable;
+		};
+	};
+
 	i2c6_default: i2c6_default {
 		pinmux {
 			function = "blsp_i2c6";
arch/arm64/boot/dts/qcom/msm8916.dtsi +15 -0
index 6ab7cabde370..57ab5573a2d2 100644
@@ -657,6 +657,21 @@ blsp_i2c4: i2c@78b8000 {
 			status = "disabled";
 		};
 
+		blsp_i2c5: i2c@78b9000 {
+			compatible = "qcom,i2c-qup-v2.2.1";
+			reg = <0x078b9000 0x500>;
+			interrupts = <GIC_SPI 99 IRQ_TYPE_LEVEL_HIGH>;
+			clocks = <&gcc GCC_BLSP1_AHB_CLK>,
+				 <&gcc GCC_BLSP1_QUP5_I2C_APPS_CLK>;
+			clock-names = "iface", "core";
+			pinctrl-names = "default", "sleep";
+			pinctrl-0 = <&i2c5_default>;
+			pinctrl-1 = <&i2c5_sleep>;
+			#address-cells = <1>;
+			#size-cells = <0>;
+			status = "disabled";
+		};
+
 		blsp_i2c6: i2c@78ba000 {
 			compatible = "qcom,i2c-qup-v2.2.1";
 			reg = <0x078ba000 0x500>;
Signature · 1 line
2.26.2
Reviewed-by on v1 2/4
#4 lore raw

Re: [PATCH 2/4] arm64: dts: qcom: msm8916: Add blsp_i2c5

Quoted 5 lines · Stephan Gerhold

MSM8916 has another I2C QUP controller that can be enabled on GPIO 18 and 19.

Add blsp_i2c5 to msm8916.dtsi and disable it by default.

Quoted 73 lines

---
Most MSM8916 smartphones/tablets have a touchscreen connected to blsp_i2c5.

---
 arch/arm64/boot/dts/qcom/msm8916-pins.dtsi | 24 ++++++++++++++++++++++
 arch/arm64/boot/dts/qcom/msm8916.dtsi      | 15 ++++++++++++++
 2 files changed, 39 insertions(+)
arch/arm64/boot/dts/qcom/msm8916-pins.dtsi +24 -0
index b45fd12856ea..31886860766a 100644
@@ -334,6 +334,30 @@ pinconf {
 		};
 	};
 
+	i2c5_default: i2c5_default {
+		pinmux {
+			function = "blsp_i2c5";
+			pins = "gpio18", "gpio19";
+		};
+		pinconf {
+			pins = "gpio18", "gpio19";
+			drive-strength = <2>;
+			bias-disable;
+		};
+	};
+
+	i2c5_sleep: i2c5_sleep {
+		pinmux {
+			function = "gpio";
+			pins = "gpio18", "gpio19";
+		};
+		pinconf {
+			pins = "gpio18", "gpio19";
+			drive-strength = <2>;
+			bias-disable;
+		};
+	};
+
 	i2c6_default: i2c6_default {
 		pinmux {
 			function = "blsp_i2c6";
arch/arm64/boot/dts/qcom/msm8916.dtsi +15 -0
index 6ab7cabde370..57ab5573a2d2 100644
@@ -657,6 +657,21 @@ blsp_i2c4: i2c@78b8000 {
 			status = "disabled";
 		};
 
+		blsp_i2c5: i2c@78b9000 {
+			compatible = "qcom,i2c-qup-v2.2.1";
+			reg = <0x078b9000 0x500>;
+			interrupts = <GIC_SPI 99 IRQ_TYPE_LEVEL_HIGH>;
+			clocks = <&gcc GCC_BLSP1_AHB_CLK>,
+				 <&gcc GCC_BLSP1_QUP5_I2C_APPS_CLK>;
+			clock-names = "iface", "core";
+			pinctrl-names = "default", "sleep";
+			pinctrl-0 = <&i2c5_default>;
+			pinctrl-1 = <&i2c5_sleep>;
+			#address-cells = <1>;
+			#size-cells = <0>;
+			status = "disabled";
+		};
+
 		blsp_i2c6: i2c@78ba000 {
 			compatible = "qcom,i2c-qup-v2.2.1";
 			reg = <0x078ba000 0x500>;
Signature · 1 line
2.26.2
#5 lore raw

PATCH 3/4 arm64: dts: qcom: msm8916-samsung-a2015: Add touchscreen regulator

In reply to Stephan Gerhold

A3U and A5U both use an extra touchscreen LDO regulator that provides 3.3V for the touch screen controller.

Add it as fixed regulator to the common include.

---
 .../qcom/msm8916-samsung-a2015-common.dtsi    | 25 +++++++++++++++++++
 1 file changed, 25 insertions(+)
arch/arm64/boot/dts/qcom/msm8916-samsung-a2015-common.dtsi +25 -0
index 43c5e0f882f1..67a286422a13 100644
@@ -138,6 +138,19 @@ hall-sensor {
 		};
 	};
 
+	reg_vdd_tsp: regulator-vdd-tsp {
+		compatible = "regulator-fixed";
+		regulator-name = "vdd_tsp";
+		regulator-min-microvolt = <3300000>;
+		regulator-max-microvolt = <3300000>;
+
+		gpio = <&msmgpio 73 GPIO_ACTIVE_HIGH>;
+		enable-active-high;
+
+		pinctrl-names = "default";
+		pinctrl-0 = <&tsp_en_default>;
+	};
+
 	i2c-muic {
 		compatible = "i2c-gpio";
 		sda-gpios = <&msmgpio 105 (GPIO_ACTIVE_HIGH|GPIO_OPEN_DRAIN)>;
@@ -195,6 +208,18 @@ pinconf {
 			bias-disable;
 		};
 	};
+
+	tsp_en_default: tsp_en_default {
+		pinmux {
+			function = "gpio";
+			pins = "gpio73";
+		};
+		pinconf {
+			pins = "gpio73";
+			drive-strength = <2>;
+			bias-disable;
+		};
+	};
 };
 
 &smd_rpm_regulators {
Signature · 1 line
2.26.2
#6 lore raw

Re: [PATCH 3/4] arm64: dts: qcom: msm8916-samsung-a2015: Add touchscreen regulator

Quoted 36 lines · Stephan Gerhold

A3U and A5U both use an extra touchscreen LDO regulator that provides 3.3V for the touch screen controller.

Add it as fixed regulator to the common include.

---
 .../qcom/msm8916-samsung-a2015-common.dtsi    | 25 +++++++++++++++++++
 1 file changed, 25 insertions(+)
arch/arm64/boot/dts/qcom/msm8916-samsung-a2015-common.dtsi +13 -0
index 43c5e0f882f1..67a286422a13 100644
@@ -138,6 +138,19 @@ hall-sensor {
 		};
 	};
 
+	reg_vdd_tsp: regulator-vdd-tsp {
+		compatible = "regulator-fixed";
+		regulator-name = "vdd_tsp";
+		regulator-min-microvolt = <3300000>;
+		regulator-max-microvolt = <3300000>;
+
+		gpio = <&msmgpio 73 GPIO_ACTIVE_HIGH>;
+		enable-active-high;
+
+		pinctrl-names = "default";
+		pinctrl-0 = <&tsp_en_default>;
+	};
+
 	i2c-muic {
 		compatible = "i2c-gpio";
 		sda-gpios = <&msmgpio 105 (GPIO_ACTIVE_HIGH|GPIO_OPEN_DRAIN)>;

arch/arm64/boot/dts/qcom/msm8916-samsung-a2015-common.dtsi pinconf { · line 212

Quoted 5 lines
arch/arm64/boot/dts/qcom/msm8916-samsung-a2015-common.dtsi +2 -0
@@ -195,6 +208,18 @@ pinconf {
 			bias-disable;
 		};
 	};
+
+	tsp_en_default: tsp_en_default {

Node names should not include '_', so this line should be

	tsp_en_default: tsp-en-default {

I fixed this up in both patch 3 and 4 and applied the series.

Thanks,
Bjorn

Quoted 16 lines
arch/arm64/boot/dts/qcom/msm8916-samsung-a2015-common.dtsi +10 -0
+		pinmux {
+			function = "gpio";
+			pins = "gpio73";
+		};
+		pinconf {
+			pins = "gpio73";
+			drive-strength = <2>;
+			bias-disable;
+		};
+	};
 };
 
 &smd_rpm_regulators {
Signature · 1 line
2.26.2
#7 lore raw

PATCH 4/4 arm64: dts: qcom: msm8916-samsung-a5u: Add touchscreen

In reply to Stephan Gerhold

A5U uses a Melfas MMS345L touchscreen that is connected to blsp_i2c5. Add it to the device tree.

---
Note: For the touchscreen to work this patch depends on
https://lore.kernel.org/linux-input/[email protected]/
which was just applied to linux-next.

---
 .../boot/dts/qcom/msm8916-samsung-a5u-eur.dts | 35 +++++++++++++++++++
 1 file changed, 35 insertions(+)
arch/arm64/boot/dts/qcom/msm8916-samsung-a5u-eur.dts +35 -0
index 6629a621139c..295a0f969914 100644
@@ -9,8 +9,43 @@ / {
 	compatible = "samsung,a5u-eur", "qcom,msm8916";
 };
 
+&blsp_i2c5 {
+	status = "okay";
+
+	touchscreen@48 {
+		compatible = "melfas,mms345l";
+
+		reg = <0x48>;
+		interrupt-parent = <&msmgpio>;
+		interrupts = <13 IRQ_TYPE_EDGE_FALLING>;
+
+		touchscreen-size-x = <720>;
+		touchscreen-size-y = <1280>;
+
+		avdd-supply = <&reg_vdd_tsp>;
+		vdd-supply = <&pm8916_l6>;
+
+		pinctrl-names = "default";
+		pinctrl-0 = <&ts_int_default>;
+	};
+};
+
 &pronto {
 	iris {
 		compatible = "qcom,wcn3680";
 	};
 };
+
+&msmgpio {
+	ts_int_default: ts_int_default {
+		pinmux {
+			function = "gpio";
+			pins = "gpio13";
+		};
+		pinconf {
+			pins = "gpio13";
+			drive-strength = <2>;
+			bias-disable;
+		};
+	};
+};
Signature · 1 line
2.26.2