* [PATCH 0/8] arm64: dts: qcom: msm8939-samsung-a7: Add initial dts
@ 2023-06-22 2:03 Lin, Meng-Bo
2023-06-22 2:04 ` [PATCH 1/8] dt-bindings: qcom: Document msm8939,a7 Lin, Meng-Bo
` (8 more replies)
0 siblings, 9 replies; 12+ messages in thread
From: Lin, Meng-Bo @ 2023-06-22 2:03 UTC (permalink / raw)
To: linux-kernel
Cc: Andy Gross, Bjorn Andersson, Konrad Dybcio, Rob Herring,
Krzysztof Kozlowski, Conor Dooley, Stephan Gerhold,
Nikita Travkin, linux-arm-msm, devicetree,
~postmarketos/upstreaming
This dts adds support for Samsung Galaxy A7 smartphone released in 2015.
Add a device tree for A7 with initial support for:
- GPIO keys
- Hall Sensor
- SDHCI (internal and external storage)
- USB Device Mode
- UART (on USB connector via the SM5502 MUIC)
- WCNSS (WiFi/BT)
- Regulators
- Touch key
- Accelerometer/Magnetometer
- Fuelgauge
- NFC
- Vibrator
- Touchscreen
^ permalink raw reply [flat|nested] 12+ messages in thread
* [PATCH 1/8] dt-bindings: qcom: Document msm8939,a7
2023-06-22 2:03 [PATCH 0/8] arm64: dts: qcom: msm8939-samsung-a7: Add initial dts Lin, Meng-Bo
@ 2023-06-22 2:04 ` Lin, Meng-Bo
2023-06-22 14:41 ` Rob Herring
2023-06-22 2:04 ` [PATCH 2/8] arm64: dts: qcom: msm8939-samsung-a7: Add initial dts Lin, Meng-Bo
` (7 subsequent siblings)
8 siblings, 1 reply; 12+ messages in thread
From: Lin, Meng-Bo @ 2023-06-22 2:04 UTC (permalink / raw)
To: linux-kernel
Cc: Andy Gross, Bjorn Andersson, Konrad Dybcio, Rob Herring,
Krzysztof Kozlowski, Conor Dooley, Stephan Gerhold,
Nikita Travkin, linux-arm-msm, devicetree,
~postmarketos/upstreaming
Document samsung,a7 bindings used in its device tree.
Signed-off-by: Lin, Meng-Bo <linmengbo0689@protonmail.com>
---
Documentation/devicetree/bindings/arm/qcom.yaml | 1 +
1 file changed, 1 insertion(+)
diff --git a/Documentation/devicetree/bindings/arm/qcom.yaml b/Documentation/devicetree/bindings/arm/qcom.yaml
index 450f616774e0..a6f7ef4f0830 100644
--- a/Documentation/devicetree/bindings/arm/qcom.yaml
+++ b/Documentation/devicetree/bindings/arm/qcom.yaml
@@ -186,6 +186,7 @@ properties:
- items:
- enum:
+ - samsung,a7
- sony,kanuti-tulip
- square,apq8039-t2
- const: qcom,msm8939
--
2.39.2
^ permalink raw reply related [flat|nested] 12+ messages in thread
* [PATCH 2/8] arm64: dts: qcom: msm8939-samsung-a7: Add initial dts
2023-06-22 2:03 [PATCH 0/8] arm64: dts: qcom: msm8939-samsung-a7: Add initial dts Lin, Meng-Bo
2023-06-22 2:04 ` [PATCH 1/8] dt-bindings: qcom: Document msm8939,a7 Lin, Meng-Bo
@ 2023-06-22 2:04 ` Lin, Meng-Bo
2023-06-22 2:04 ` [PATCH 3/8] arm64: dts: qcom: msm8939-samsung-a7: Add touch key Lin, Meng-Bo
` (6 subsequent siblings)
8 siblings, 0 replies; 12+ messages in thread
From: Lin, Meng-Bo @ 2023-06-22 2:04 UTC (permalink / raw)
To: linux-kernel
Cc: Andy Gross, Bjorn Andersson, Konrad Dybcio, Rob Herring,
Krzysztof Kozlowski, Conor Dooley, Stephan Gerhold,
Nikita Travkin, linux-arm-msm, devicetree,
~postmarketos/upstreaming
This dts adds support for Samsung Galaxy A7 smartphone released in 2015.
Add a device tree for A7 with initial support for:
- GPIO keys
- Hall Sensor
- SDHCI (internal and external storage)
- USB Device Mode
- UART (on USB connector via the SM5502 MUIC)
- WCNSS (WiFi/BT)
- Regulators
Signed-off-by: Lin, Meng-Bo <linmengbo0689@protonmail.com>
---
arch/arm64/boot/dts/qcom/Makefile | 1 +
.../boot/dts/qcom/msm8939-samsung-a7.dts | 163 ++++++++++++++++++
2 files changed, 164 insertions(+)
create mode 100644 arch/arm64/boot/dts/qcom/msm8939-samsung-a7.dts
diff --git a/arch/arm64/boot/dts/qcom/Makefile b/arch/arm64/boot/dts/qcom/Makefile
index 337abc4ceb17..23fd31d4bf5a 100644
--- a/arch/arm64/boot/dts/qcom/Makefile
+++ b/arch/arm64/boot/dts/qcom/Makefile
@@ -39,6 +39,7 @@ dtb-$(CONFIG_ARCH_QCOM) += msm8916-thwc-uf896.dtb
dtb-$(CONFIG_ARCH_QCOM) += msm8916-thwc-ufi001c.dtb
dtb-$(CONFIG_ARCH_QCOM) += msm8916-wingtech-wt88047.dtb
dtb-$(CONFIG_ARCH_QCOM) += msm8916-yiming-uz801v3.dtb
+dtb-$(CONFIG_ARCH_QCOM) += msm8939-samsung-a7.dtb
dtb-$(CONFIG_ARCH_QCOM) += msm8939-sony-xperia-kanuti-tulip.dtb
dtb-$(CONFIG_ARCH_QCOM) += msm8953-motorola-potter.dtb
dtb-$(CONFIG_ARCH_QCOM) += msm8953-xiaomi-daisy.dtb
diff --git a/arch/arm64/boot/dts/qcom/msm8939-samsung-a7.dts b/arch/arm64/boot/dts/qcom/msm8939-samsung-a7.dts
new file mode 100644
index 000000000000..cf2738bc3313
--- /dev/null
+++ b/arch/arm64/boot/dts/qcom/msm8939-samsung-a7.dts
@@ -0,0 +1,163 @@
+// SPDX-License-Identifier: GPL-2.0-only
+
+/dts-v1/;
+
+#include "msm8939-pm8916.dtsi"
+
+#include <dt-bindings/gpio/gpio.h>
+#include <dt-bindings/input/input.h>
+#include <dt-bindings/interrupt-controller/irq.h>
+
+/ {
+ model = "Samsung Galaxy A7 (2015)";
+ compatible = "samsung,a7", "qcom,msm8939";
+ chassis-type = "handset";
+
+ aliases {
+ mmc0 = &sdhc_1; /* SDC1 eMMC slot */
+ mmc1 = &sdhc_2; /* SDC2 SD card slot */
+ serial0 = &blsp_uart2;
+ };
+
+ chosen {
+ stdout-path = "serial0";
+ };
+
+ reserved-memory {
+ /* Additional memory used by Samsung firmware modifications */
+ tz-apps@85500000 {
+ reg = <0x0 0x85500000 0x0 0xb00000>;
+ no-map;
+ };
+ };
+
+ gpio-hall-sensor {
+ compatible = "gpio-keys";
+
+ pinctrl-0 = <&gpio_hall_sensor_default>;
+ pinctrl-names = "default";
+
+ label = "GPIO Hall Effect Sensor";
+
+ event-hall-sensor {
+ label = "Hall Effect Sensor";
+ gpios = <&tlmm 52 GPIO_ACTIVE_LOW>;
+ linux,input-type = <EV_SW>;
+ linux,code = <SW_LID>;
+ linux,can-disable;
+ };
+ };
+
+ gpio-keys {
+ compatible = "gpio-keys";
+
+ pinctrl-0 = <&gpio_keys_default>;
+ pinctrl-names = "default";
+
+ label = "GPIO Buttons";
+
+ button-volume-up {
+ label = "Volume Up";
+ gpios = <&tlmm 107 GPIO_ACTIVE_LOW>;
+ linux,code = <KEY_VOLUMEUP>;
+ };
+
+ button-home {
+ label = "Home";
+ gpios = <&tlmm 109 GPIO_ACTIVE_LOW>;
+ linux,code = <KEY_HOMEPAGE>;
+ };
+ };
+};
+
+&blsp_i2c1 {
+ status = "okay";
+
+ muic: extcon@25 {
+ compatible = "siliconmitus,sm5502-muic";
+ reg = <0x25>;
+
+ interrupt-parent = <&tlmm>;
+ interrupts = <12 IRQ_TYPE_EDGE_FALLING>;
+
+ pinctrl-0 = <&muic_int_default>;
+ pinctrl-names = "default";
+ };
+};
+
+&blsp_uart2 {
+ status = "okay";
+};
+
+&pm8916_resin {
+ linux,code = <KEY_VOLUMEDOWN>;
+ status = "okay";
+};
+
+&pm8916_rpm_regulators {
+ pm8916_l17: l17 {
+ regulator-min-microvolt = <2850000>;
+ regulator-max-microvolt = <2850000>;
+ };
+};
+
+&sdhc_1 {
+ status = "okay";
+};
+
+&sdhc_2 {
+ pinctrl-0 = <&sdc2_default &sdc2_cd_default>;
+ pinctrl-1 = <&sdc2_sleep &sdc2_cd_default>;
+ pinctrl-names = "default", "sleep";
+
+ cd-gpios = <&tlmm 38 GPIO_ACTIVE_LOW>;
+
+ status = "okay";
+};
+
+&usb {
+ extcon = <&muic>, <&muic>;
+ status = "okay";
+};
+
+&usb_hs_phy {
+ extcon = <&muic>;
+};
+
+&wcnss {
+ status = "okay";
+};
+
+&wcnss_iris {
+ compatible = "qcom,wcn3660b";
+};
+
+&tlmm {
+ gpio_hall_sensor_default: gpio-hall-sensor-default-state {
+ pins = "gpio52";
+ function = "gpio";
+ drive-strength = <2>;
+ bias-disable;
+ };
+
+ gpio_keys_default: gpio-keys-default-state {
+ pins = "gpio107", "gpio109";
+ function = "gpio";
+ drive-strength = <2>;
+ bias-pull-up;
+ };
+
+ muic_int_default: muic-int-default-state {
+ pins = "gpio12";
+ function = "gpio";
+ drive-strength = <2>;
+ bias-disable;
+ };
+
+ sdc2_cd_default: sdc2-cd-default-state {
+ pins = "gpio38";
+ function = "gpio";
+ drive-strength = <2>;
+ bias-pull-up;
+ };
+};
--
2.39.2
^ permalink raw reply related [flat|nested] 12+ messages in thread
* [PATCH 3/8] arm64: dts: qcom: msm8939-samsung-a7: Add touch key
2023-06-22 2:03 [PATCH 0/8] arm64: dts: qcom: msm8939-samsung-a7: Add initial dts Lin, Meng-Bo
2023-06-22 2:04 ` [PATCH 1/8] dt-bindings: qcom: Document msm8939,a7 Lin, Meng-Bo
2023-06-22 2:04 ` [PATCH 2/8] arm64: dts: qcom: msm8939-samsung-a7: Add initial dts Lin, Meng-Bo
@ 2023-06-22 2:04 ` Lin, Meng-Bo
2023-06-22 15:11 ` Krzysztof Kozlowski
2023-06-22 2:05 ` [PATCH 4/8] arm64: dts: qcom: msm8939-samsung-a7: Add accelerometer/magnetometer Lin, Meng-Bo
` (5 subsequent siblings)
8 siblings, 1 reply; 12+ messages in thread
From: Lin, Meng-Bo @ 2023-06-22 2:04 UTC (permalink / raw)
To: linux-kernel
Cc: Andy Gross, Bjorn Andersson, Konrad Dybcio, Rob Herring,
Krzysztof Kozlowski, Conor Dooley, Stephan Gerhold,
Nikita Travkin, linux-arm-msm, devicetree,
~postmarketos/upstreaming
Add the CORERIVER TC360 touch key together with the necessary
fixed regulator for it.
Note that for some reason Samsung decided to connect this to GPIOs
where no hardware I2C bus is available, so we need to fall back
to software bit-banging using i2c-gpio.
Signed-off-by: Lin, Meng-Bo <linmengbo0689@protonmail.com>
---
.../boot/dts/qcom/msm8939-samsung-a7.dts | 85 +++++++++++++++++++
1 file changed, 85 insertions(+)
diff --git a/arch/arm64/boot/dts/qcom/msm8939-samsung-a7.dts b/arch/arm64/boot/dts/qcom/msm8939-samsung-a7.dts
index cf2738bc3313..98a2738eb8ea 100644
--- a/arch/arm64/boot/dts/qcom/msm8939-samsung-a7.dts
+++ b/arch/arm64/boot/dts/qcom/msm8939-samsung-a7.dts
@@ -68,6 +68,63 @@ button-home {
linux,code = <KEY_HOMEPAGE>;
};
};
+
+ i2c-tkey {
+ compatible = "i2c-gpio";
+ sda-gpios = <&tlmm 16 (GPIO_ACTIVE_HIGH|GPIO_OPEN_DRAIN)>;
+ scl-gpios = <&tlmm 17 (GPIO_ACTIVE_HIGH|GPIO_OPEN_DRAIN)>;
+
+ pinctrl-0 = <&tkey_i2c_default>;
+ pinctrl-names = "default";
+
+ #address-cells = <1>;
+ #size-cells = <0>;
+
+ touchkey@20 {
+ /* Note: Actually an ABOV MCU that implements same interface */
+ compatible = "coreriver,tc360-touchkey";
+ reg = <0x20>;
+
+ interrupt-parent = <&tlmm>;
+ interrupts = <20 IRQ_TYPE_EDGE_FALLING>;
+
+ vcc-supply = <®_touch_key>;
+ vdd-supply = <®_keyled>;
+ vddio-supply = <&pm8916_l6>;
+
+ linux,keycodes = <KEY_APPSELECT KEY_BACK>;
+
+ pinctrl-0 = <&tkey_default>;
+ pinctrl-names = "default";
+ };
+ };
+
+ reg_keyled: regulator-keyled {
+ compatible = "regulator-fixed";
+ regulator-name = "keyled";
+ regulator-min-microvolt = <3300000>;
+ regulator-max-microvolt = <3300000>;
+
+ /* NOTE: On some variants e.g. SM-A700FD it's GPIO 91 */
+ gpio = <&tlmm 100 GPIO_ACTIVE_HIGH>;
+ enable-active-high;
+
+ pinctrl-0 = <&tkey_led_en_default>;
+ pinctrl-names = "default";
+ };
+
+ reg_touch_key: regulator-touch-key {
+ compatible = "regulator-fixed";
+ regulator-name = "touch_key";
+ regulator-min-microvolt = <2800000>;
+ regulator-max-microvolt = <2800000>;
+
+ gpio = <&tlmm 56 GPIO_ACTIVE_HIGH>;
+ enable-active-high;
+
+ pinctrl-0 = <&tkey_en_default>;
+ pinctrl-names = "default";
+ };
};
&blsp_i2c1 {
@@ -160,4 +217,32 @@ sdc2_cd_default: sdc2-cd-default-state {
drive-strength = <2>;
bias-pull-up;
};
+
+ tkey_default: tkey-default-state {
+ pins = "gpio20";
+ function = "gpio";
+ drive-strength = <2>;
+ bias-disable;
+ };
+
+ tkey_en_default: tkey-en-default-state {
+ pins = "gpio56";
+ function = "gpio";
+ drive-strength = <2>;
+ bias-disable;
+ };
+
+ tkey_i2c_default: tkey-i2c-default-state {
+ pins = "gpio16", "gpio17";
+ function = "gpio";
+ drive-strength = <2>;
+ bias-disable;
+ };
+
+ tkey_led_en_default: tkey-led-en-default-state {
+ pins = "gpio100";
+ function = "gpio";
+ drive-strength = <2>;
+ bias-disable;
+ };
};
--
2.39.2
^ permalink raw reply related [flat|nested] 12+ messages in thread
* [PATCH 4/8] arm64: dts: qcom: msm8939-samsung-a7: Add accelerometer/magnetometer
2023-06-22 2:03 [PATCH 0/8] arm64: dts: qcom: msm8939-samsung-a7: Add initial dts Lin, Meng-Bo
` (2 preceding siblings ...)
2023-06-22 2:04 ` [PATCH 3/8] arm64: dts: qcom: msm8939-samsung-a7: Add touch key Lin, Meng-Bo
@ 2023-06-22 2:05 ` Lin, Meng-Bo
2023-06-22 2:05 ` [PATCH 5/8] arm64: dts: qcom: msm8939-samsung-a7: Add rt5033 battery Lin, Meng-Bo
` (4 subsequent siblings)
8 siblings, 0 replies; 12+ messages in thread
From: Lin, Meng-Bo @ 2023-06-22 2:05 UTC (permalink / raw)
To: linux-kernel
Cc: Andy Gross, Bjorn Andersson, Konrad Dybcio, Rob Herring,
Krzysztof Kozlowski, Conor Dooley, Stephan Gerhold,
Nikita Travkin, linux-arm-msm, devicetree,
~postmarketos/upstreaming
A7 uses a Bosch BMC150 accelerometer/magnetometer combo.
The chip provides two separate I2C devices for the accelerometer
and magnetometer that are already supported by the bmc150-accel
and bmc150-magn driver.
Signed-off-by: Lin, Meng-Bo <linmengbo0689@protonmail.com>
---
.../boot/dts/qcom/msm8939-samsung-a7.dts | 51 +++++++++++++++++++
1 file changed, 51 insertions(+)
diff --git a/arch/arm64/boot/dts/qcom/msm8939-samsung-a7.dts b/arch/arm64/boot/dts/qcom/msm8939-samsung-a7.dts
index 98a2738eb8ea..6a817038a3b9 100644
--- a/arch/arm64/boot/dts/qcom/msm8939-samsung-a7.dts
+++ b/arch/arm64/boot/dts/qcom/msm8939-samsung-a7.dts
@@ -69,6 +69,43 @@ button-home {
};
};
+ i2c-sensor {
+ compatible = "i2c-gpio";
+ sda-gpios = <&tlmm 84 (GPIO_ACTIVE_HIGH|GPIO_OPEN_DRAIN)>;
+ scl-gpios = <&tlmm 85 (GPIO_ACTIVE_HIGH|GPIO_OPEN_DRAIN)>;
+
+ pinctrl-0 = <&sensor_i2c_default>;
+ pinctrl-names = "default";
+
+ #address-cells = <1>;
+ #size-cells = <0>;
+
+ accelerometer: accelerometer@10 {
+ compatible = "bosch,bmc150_accel";
+ reg = <0x10>;
+ interrupt-parent = <&tlmm>;
+ interrupts = <115 IRQ_TYPE_EDGE_RISING>;
+
+ vdd-supply = <&pm8916_l17>;
+ vddio-supply = <&pm8916_l5>;
+
+ pinctrl-0 = <&accel_int_default>;
+ pinctrl-names = "default";
+
+ mount-matrix = "-1", "0", "0",
+ "0", "-1", "0",
+ "0", "0", "1";
+ };
+
+ magnetometer@12 {
+ compatible = "bosch,bmc150_magn";
+ reg = <0x12>;
+
+ vdd-supply = <&pm8916_l17>;
+ vddio-supply = <&pm8916_l5>;
+ };
+ };
+
i2c-tkey {
compatible = "i2c-gpio";
sda-gpios = <&tlmm 16 (GPIO_ACTIVE_HIGH|GPIO_OPEN_DRAIN)>;
@@ -190,6 +227,13 @@ &wcnss_iris {
};
&tlmm {
+ accel_int_default: accel-int-default-state {
+ pins = "gpio115";
+ function = "gpio";
+ drive-strength = <2>;
+ bias-disable;
+ };
+
gpio_hall_sensor_default: gpio-hall-sensor-default-state {
pins = "gpio52";
function = "gpio";
@@ -218,6 +262,13 @@ sdc2_cd_default: sdc2-cd-default-state {
bias-pull-up;
};
+ sensor_i2c_default: sensor-i2c-default-state {
+ pins = "gpio84", "gpio85";
+ function = "gpio";
+ drive-strength = <2>;
+ bias-disable;
+ };
+
tkey_default: tkey-default-state {
pins = "gpio20";
function = "gpio";
--
2.39.2
^ permalink raw reply related [flat|nested] 12+ messages in thread
* [PATCH 5/8] arm64: dts: qcom: msm8939-samsung-a7: Add rt5033 battery
2023-06-22 2:03 [PATCH 0/8] arm64: dts: qcom: msm8939-samsung-a7: Add initial dts Lin, Meng-Bo
` (3 preceding siblings ...)
2023-06-22 2:05 ` [PATCH 4/8] arm64: dts: qcom: msm8939-samsung-a7: Add accelerometer/magnetometer Lin, Meng-Bo
@ 2023-06-22 2:05 ` Lin, Meng-Bo
2023-06-22 2:05 ` [PATCH 6/8] arm64: dts: qcom: msm8939-samsung-a7: Add NFC Lin, Meng-Bo
` (3 subsequent siblings)
8 siblings, 0 replies; 12+ messages in thread
From: Lin, Meng-Bo @ 2023-06-22 2:05 UTC (permalink / raw)
To: linux-kernel
Cc: Andy Gross, Bjorn Andersson, Konrad Dybcio, Rob Herring,
Krzysztof Kozlowski, Conor Dooley, Stephan Gerhold,
Nikita Travkin, linux-arm-msm, devicetree,
~postmarketos/upstreaming
The Samsung Galaxy A7 uses a Richtek RT5033 PMIC as battery
fuel gauge, charger, flash LED and for some regulators. For now,
only add the fuel gauge/battery device to the device tree,
so we can check the remaining battery percentage.
The other RT5033 drivers need some more work first before
they can be used properly.
Signed-off-by: Lin, Meng-Bo <linmengbo0689@protonmail.com>
---
.../boot/dts/qcom/msm8939-samsung-a7.dts | 37 +++++++++++++++++++
1 file changed, 37 insertions(+)
diff --git a/arch/arm64/boot/dts/qcom/msm8939-samsung-a7.dts b/arch/arm64/boot/dts/qcom/msm8939-samsung-a7.dts
index 6a817038a3b9..271dcea6da94 100644
--- a/arch/arm64/boot/dts/qcom/msm8939-samsung-a7.dts
+++ b/arch/arm64/boot/dts/qcom/msm8939-samsung-a7.dts
@@ -69,6 +69,29 @@ button-home {
};
};
+ i2c-fg {
+ compatible = "i2c-gpio";
+ sda-gpios = <&tlmm 106 (GPIO_ACTIVE_HIGH|GPIO_OPEN_DRAIN)>;
+ scl-gpios = <&tlmm 105 (GPIO_ACTIVE_HIGH|GPIO_OPEN_DRAIN)>;
+
+ pinctrl-0 = <&fg_i2c_default>;
+ pinctrl-names = "default";
+
+ #address-cells = <1>;
+ #size-cells = <0>;
+
+ battery@35 {
+ compatible = "richtek,rt5033-battery";
+ reg = <0x35>;
+
+ interrupt-parent = <&tlmm>;
+ interrupts = <121 IRQ_TYPE_EDGE_BOTH>;
+
+ pinctrl-0 = <&fg_alert_default>;
+ pinctrl-names = "default";
+ };
+ };
+
i2c-sensor {
compatible = "i2c-gpio";
sda-gpios = <&tlmm 84 (GPIO_ACTIVE_HIGH|GPIO_OPEN_DRAIN)>;
@@ -234,6 +257,20 @@ accel_int_default: accel-int-default-state {
bias-disable;
};
+ fg_alert_default: fg-alert-default-state {
+ pins = "gpio121";
+ function = "gpio";
+ drive-strength = <2>;
+ bias-disable;
+ };
+
+ fg_i2c_default: fg-i2c-default-state {
+ pins = "gpio105", "gpio106";
+ function = "gpio";
+ drive-strength = <2>;
+ bias-disable;
+ };
+
gpio_hall_sensor_default: gpio-hall-sensor-default-state {
pins = "gpio52";
function = "gpio";
--
2.39.2
^ permalink raw reply related [flat|nested] 12+ messages in thread
* [PATCH 6/8] arm64: dts: qcom: msm8939-samsung-a7: Add NFC
2023-06-22 2:03 [PATCH 0/8] arm64: dts: qcom: msm8939-samsung-a7: Add initial dts Lin, Meng-Bo
` (4 preceding siblings ...)
2023-06-22 2:05 ` [PATCH 5/8] arm64: dts: qcom: msm8939-samsung-a7: Add rt5033 battery Lin, Meng-Bo
@ 2023-06-22 2:05 ` Lin, Meng-Bo
2023-06-22 2:05 ` [PATCH 7/8] arm64: dts: qcom: msm8939-samsung-a7: Add vibrator Lin, Meng-Bo
` (2 subsequent siblings)
8 siblings, 0 replies; 12+ messages in thread
From: Lin, Meng-Bo @ 2023-06-22 2:05 UTC (permalink / raw)
To: linux-kernel
Cc: Andy Gross, Bjorn Andersson, Konrad Dybcio, Rob Herring,
Krzysztof Kozlowski, Conor Dooley, Stephan Gerhold,
Nikita Travkin, linux-arm-msm, devicetree,
~postmarketos/upstreaming
The Galaxy A7 has a NXP PN547, which is supported
by the nxp-nci-i2c driver in mainline. It seems to detect NFC tags
using "nfctool" just fine, although more testing is difficult given
there seem to be very few useful applications making use of the
Linux NFC subsystem.
Note that for some reason Samsung decided to connect the I2C pins
to GPIOs where no hardware I2C bus is available, so we need to
fall back to software bit-banging with i2c-gpio.
Signed-off-by: Lin, Meng-Bo <linmengbo0689@protonmail.com>
---
.../boot/dts/qcom/msm8939-samsung-a7.dts | 49 +++++++++++++++++++
1 file changed, 49 insertions(+)
diff --git a/arch/arm64/boot/dts/qcom/msm8939-samsung-a7.dts b/arch/arm64/boot/dts/qcom/msm8939-samsung-a7.dts
index 271dcea6da94..dcbc8a97ce63 100644
--- a/arch/arm64/boot/dts/qcom/msm8939-samsung-a7.dts
+++ b/arch/arm64/boot/dts/qcom/msm8939-samsung-a7.dts
@@ -92,6 +92,32 @@ battery@35 {
};
};
+ i2c-nfc {
+ compatible = "i2c-gpio";
+ sda-gpios = <&tlmm 0 (GPIO_ACTIVE_HIGH|GPIO_OPEN_DRAIN)>;
+ scl-gpios = <&tlmm 1 (GPIO_ACTIVE_HIGH|GPIO_OPEN_DRAIN)>;
+
+ pinctrl-0 = <&nfc_i2c_default>;
+ pinctrl-names = "default";
+
+ #address-cells = <1>;
+ #size-cells = <0>;
+
+ nfc@2b {
+ compatible = "nxp,pn547", "nxp,nxp-nci-i2c";
+ reg = <0x2b>;
+
+ interrupt-parent = <&tlmm>;
+ interrupts = <21 IRQ_TYPE_EDGE_RISING>;
+
+ enable-gpios = <&tlmm 116 GPIO_ACTIVE_HIGH>;
+ firmware-gpios = <&tlmm 49 GPIO_ACTIVE_HIGH>;
+
+ pinctrl-0 = <&nfc_default>;
+ pinctrl-names = "default";
+ };
+ };
+
i2c-sensor {
compatible = "i2c-gpio";
sda-gpios = <&tlmm 84 (GPIO_ACTIVE_HIGH|GPIO_OPEN_DRAIN)>;
@@ -292,6 +318,29 @@ muic_int_default: muic-int-default-state {
bias-disable;
};
+ nfc_default: nfc-default-state {
+ irq-pins {
+ pins = "gpio21";
+ function = "gpio";
+ drive-strength = <2>;
+ bias-pull-down;
+ };
+
+ nfc-pins {
+ pins = "gpio49", "gpio116";
+ function = "gpio";
+ drive-strength = <2>;
+ bias-disable;
+ };
+ };
+
+ nfc_i2c_default: nfc-i2c-default-state {
+ pins = "gpio0", "gpio1";
+ function = "gpio";
+ drive-strength = <2>;
+ bias-disable;
+ };
+
sdc2_cd_default: sdc2-cd-default-state {
pins = "gpio38";
function = "gpio";
--
2.39.2
^ permalink raw reply related [flat|nested] 12+ messages in thread
* [PATCH 7/8] arm64: dts: qcom: msm8939-samsung-a7: Add vibrator
2023-06-22 2:03 [PATCH 0/8] arm64: dts: qcom: msm8939-samsung-a7: Add initial dts Lin, Meng-Bo
` (5 preceding siblings ...)
2023-06-22 2:05 ` [PATCH 6/8] arm64: dts: qcom: msm8939-samsung-a7: Add NFC Lin, Meng-Bo
@ 2023-06-22 2:05 ` Lin, Meng-Bo
2023-06-22 2:06 ` [PATCH 8/8] arm64: dts: qcom: msm8939-samsung-a7: Add touchscreen Lin, Meng-Bo
2023-06-23 10:01 ` [PATCH v2 0/2] arm64: dts: qcom: msm8939-samsung-a7: Add initial dts Lin, Meng-Bo
8 siblings, 0 replies; 12+ messages in thread
From: Lin, Meng-Bo @ 2023-06-22 2:05 UTC (permalink / raw)
To: linux-kernel
Cc: Andy Gross, Bjorn Andersson, Konrad Dybcio, Rob Herring,
Krzysztof Kozlowski, Conor Dooley, Stephan Gerhold,
Nikita Travkin, linux-arm-msm, devicetree,
~postmarketos/upstreaming
A7 uses motor driver controlled with PWM signal with a fixed regulator
that powers the driver and is controlled by enable signal.
Signed-off-by: Lin, Meng-Bo <linmengbo0689@protonmail.com>
---
.../boot/dts/qcom/msm8939-samsung-a7.dts | 44 +++++++++++++++++++
1 file changed, 44 insertions(+)
diff --git a/arch/arm64/boot/dts/qcom/msm8939-samsung-a7.dts b/arch/arm64/boot/dts/qcom/msm8939-samsung-a7.dts
index dcbc8a97ce63..ea74b61782de 100644
--- a/arch/arm64/boot/dts/qcom/msm8939-samsung-a7.dts
+++ b/arch/arm64/boot/dts/qcom/msm8939-samsung-a7.dts
@@ -185,6 +185,16 @@ touchkey@20 {
};
};
+ pwm_vibrator: pwm-vibrator {
+ compatible = "clk-pwm";
+ #pwm-cells = <2>;
+
+ clocks = <&gcc GCC_GP2_CLK>;
+
+ pinctrl-0 = <&motor_pwm_default>;
+ pinctrl-names = "default";
+ };
+
reg_keyled: regulator-keyled {
compatible = "regulator-fixed";
regulator-name = "keyled";
@@ -211,6 +221,28 @@ reg_touch_key: regulator-touch-key {
pinctrl-0 = <&tkey_en_default>;
pinctrl-names = "default";
};
+
+ reg_vibrator: regulator-vibrator {
+ compatible = "regulator-fixed";
+ regulator-name = "motor_en";
+ regulator-min-microvolt = <3000000>;
+ regulator-max-microvolt = <3000000>;
+
+ gpio = <&tlmm 86 GPIO_ACTIVE_HIGH>;
+ enable-active-high;
+
+ pinctrl-0 = <&motor_en_default>;
+ pinctrl-names = "default";
+ };
+
+ vibrator {
+ compatible = "pwm-vibrator";
+
+ pwms = <&pwm_vibrator 0 100000>;
+ pwm-names = "enable";
+
+ vcc-supply = <®_vibrator>;
+ };
};
&blsp_i2c1 {
@@ -311,6 +343,18 @@ gpio_keys_default: gpio-keys-default-state {
bias-pull-up;
};
+ motor_en_default: motor-en-default-state {
+ pins = "gpio86";
+ function = "gpio";
+ drive-strength = <2>;
+ bias-disable;
+ };
+
+ motor_pwm_default: motor-pwm-default-state {
+ pins = "gpio50";
+ function = "gcc_gp2_clk_a";
+ };
+
muic_int_default: muic-int-default-state {
pins = "gpio12";
function = "gpio";
--
2.39.2
^ permalink raw reply related [flat|nested] 12+ messages in thread
* [PATCH 8/8] arm64: dts: qcom: msm8939-samsung-a7: Add touchscreen
2023-06-22 2:03 [PATCH 0/8] arm64: dts: qcom: msm8939-samsung-a7: Add initial dts Lin, Meng-Bo
` (6 preceding siblings ...)
2023-06-22 2:05 ` [PATCH 7/8] arm64: dts: qcom: msm8939-samsung-a7: Add vibrator Lin, Meng-Bo
@ 2023-06-22 2:06 ` Lin, Meng-Bo
2023-06-23 10:01 ` [PATCH v2 0/2] arm64: dts: qcom: msm8939-samsung-a7: Add initial dts Lin, Meng-Bo
8 siblings, 0 replies; 12+ messages in thread
From: Lin, Meng-Bo @ 2023-06-22 2:06 UTC (permalink / raw)
To: linux-kernel
Cc: Andy Gross, Bjorn Andersson, Konrad Dybcio, Rob Herring,
Krzysztof Kozlowski, Conor Dooley, Stephan Gerhold,
Nikita Travkin, linux-arm-msm, devicetree,
~postmarketos/upstreaming
A7 uses a Cypress TrueTouch Generation 5 that is connected to blsp_i2c5.
Add it to the device tree.
Signed-off-by: Lin, Meng-Bo <linmengbo0689@protonmail.com>
---
.../boot/dts/qcom/msm8939-samsung-a7.dts | 66 +++++++++++++++++++
1 file changed, 66 insertions(+)
diff --git a/arch/arm64/boot/dts/qcom/msm8939-samsung-a7.dts b/arch/arm64/boot/dts/qcom/msm8939-samsung-a7.dts
index ea74b61782de..66e56ac59998 100644
--- a/arch/arm64/boot/dts/qcom/msm8939-samsung-a7.dts
+++ b/arch/arm64/boot/dts/qcom/msm8939-samsung-a7.dts
@@ -222,6 +222,33 @@ reg_touch_key: regulator-touch-key {
pinctrl-names = "default";
};
+ reg_tsp_vdd: regulator-tsp-vdd {
+ compatible = "regulator-fixed";
+ regulator-name = "tsp_vdd";
+ regulator-min-microvolt = <1800000>;
+ regulator-max-microvolt = <1800000>;
+ vin-supply = <&pm8916_s4>;
+
+ gpio = <&tlmm 8 GPIO_ACTIVE_HIGH>;
+ enable-active-high;
+
+ pinctrl-0 = <®_tsp_io_en_default>;
+ pinctrl-names = "default";
+ };
+
+ reg_vdd_tsp: regulator-vdd-tsp {
+ compatible = "regulator-fixed";
+ regulator-name = "vdd_tsp";
+ regulator-min-microvolt = <3300000>;
+ regulator-max-microvolt = <3300000>;
+
+ gpio = <&tlmm 73 GPIO_ACTIVE_HIGH>;
+ enable-active-high;
+
+ pinctrl-0 = <®_tsp_en_default>;
+ pinctrl-names = "default";
+ };
+
reg_vibrator: regulator-vibrator {
compatible = "regulator-fixed";
regulator-name = "motor_en";
@@ -260,6 +287,24 @@ muic: extcon@25 {
};
};
+&blsp_i2c5 {
+ status = "okay";
+
+ touchscreen@24 {
+ compatible = "cypress,tt21000";
+
+ reg = <0x24>;
+ interrupt-parent = <&tlmm>;
+ interrupts = <13 IRQ_TYPE_EDGE_FALLING>;
+
+ vdd-supply = <®_vdd_tsp>;
+ vddio-supply = <®_tsp_vdd>;
+
+ pinctrl-0 = <&tsp_int_default>;
+ pinctrl-names = "default";
+ };
+};
+
&blsp_uart2 {
status = "okay";
};
@@ -385,6 +430,20 @@ nfc_i2c_default: nfc-i2c-default-state {
bias-disable;
};
+ reg_tsp_en_default: reg-tsp-en-default-state {
+ pins = "gpio73";
+ function = "gpio";
+ drive-strength = <2>;
+ bias-disable;
+ };
+
+ reg_tsp_io_en_default: reg-tsp-io-en-default-state {
+ pins = "gpio8";
+ function = "gpio";
+ drive-strength = <2>;
+ bias-disable;
+ };
+
sdc2_cd_default: sdc2-cd-default-state {
pins = "gpio38";
function = "gpio";
@@ -426,4 +485,11 @@ tkey_led_en_default: tkey-led-en-default-state {
drive-strength = <2>;
bias-disable;
};
+
+ tsp_int_default: tsp-int-default-state {
+ pins = "gpio13";
+ function = "gpio";
+ drive-strength = <2>;
+ bias-disable;
+ };
};
--
2.39.2
^ permalink raw reply related [flat|nested] 12+ messages in thread
* Re: [PATCH 1/8] dt-bindings: qcom: Document msm8939,a7
2023-06-22 2:04 ` [PATCH 1/8] dt-bindings: qcom: Document msm8939,a7 Lin, Meng-Bo
@ 2023-06-22 14:41 ` Rob Herring
0 siblings, 0 replies; 12+ messages in thread
From: Rob Herring @ 2023-06-22 14:41 UTC (permalink / raw)
To: Lin, Meng-Bo
Cc: linux-kernel, Stephan Gerhold, Konrad Dybcio, Rob Herring,
devicetree, Conor Dooley, Bjorn Andersson,
~postmarketos/upstreaming, Andy Gross, Nikita Travkin,
linux-arm-msm, Krzysztof Kozlowski
On Thu, 22 Jun 2023 02:04:30 +0000, Lin, Meng-Bo wrote:
> Document samsung,a7 bindings used in its device tree.
>
> Signed-off-by: Lin, Meng-Bo <linmengbo0689@protonmail.com>
> ---
> Documentation/devicetree/bindings/arm/qcom.yaml | 1 +
> 1 file changed, 1 insertion(+)
>
Acked-by: Rob Herring <robh@kernel.org>
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH 3/8] arm64: dts: qcom: msm8939-samsung-a7: Add touch key
2023-06-22 2:04 ` [PATCH 3/8] arm64: dts: qcom: msm8939-samsung-a7: Add touch key Lin, Meng-Bo
@ 2023-06-22 15:11 ` Krzysztof Kozlowski
0 siblings, 0 replies; 12+ messages in thread
From: Krzysztof Kozlowski @ 2023-06-22 15:11 UTC (permalink / raw)
To: Lin, Meng-Bo, linux-kernel
Cc: Andy Gross, Bjorn Andersson, Konrad Dybcio, Rob Herring,
Krzysztof Kozlowski, Conor Dooley, Stephan Gerhold,
Nikita Travkin, linux-arm-msm, devicetree,
~postmarketos/upstreaming
On 22/06/2023 04:04, Lin, Meng-Bo wrote:
> Add the CORERIVER TC360 touch key together with the necessary
> fixed regulator for it.
>
> Note that for some reason Samsung decided to connect this to GPIOs
> where no hardware I2C bus is available, so we need to fall back
> to software bit-banging using i2c-gpio.
Squash patches doing one logical change. That change is: adding new
board. Since you sent it as one patchset, then one commit is to add new
DTS. There is no point in sending piece of board and immediately another
piece. It's not release early, release often.
Best regards,
Krzysztof
^ permalink raw reply [flat|nested] 12+ messages in thread
* [PATCH v2 0/2] arm64: dts: qcom: msm8939-samsung-a7: Add initial dts
2023-06-22 2:03 [PATCH 0/8] arm64: dts: qcom: msm8939-samsung-a7: Add initial dts Lin, Meng-Bo
` (7 preceding siblings ...)
2023-06-22 2:06 ` [PATCH 8/8] arm64: dts: qcom: msm8939-samsung-a7: Add touchscreen Lin, Meng-Bo
@ 2023-06-23 10:01 ` Lin, Meng-Bo
8 siblings, 0 replies; 12+ messages in thread
From: Lin, Meng-Bo @ 2023-06-23 10:01 UTC (permalink / raw)
To: linux-kernel
Cc: Andy Gross, Bjorn Andersson, Konrad Dybcio, Rob Herring,
Krzysztof Kozlowski, Conor Dooley, Stephan Gerhold,
Nikita Travkin, linux-arm-msm, devicetree,
~postmarketos/upstreaming
v2: Squash patches
This dts adds support for Samsung Galaxy A7 smartphone released in 2015.
Add a device tree for A7 with initial support for:
- GPIO keys
- Hall Sensor
- SDHCI (internal and external storage)
- USB Device Mode
- UART (on USB connector via the SM5502 MUIC)
- WCNSS (WiFi/BT)
- Regulators
- Touch key
- Accelerometer/Magnetometer
- Fuelgauge
- NFC
- Vibrator
- Touchscreen
^ permalink raw reply [flat|nested] 12+ messages in thread
end of thread, other threads:[~2023-06-23 10:01 UTC | newest]
Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-06-22 2:03 [PATCH 0/8] arm64: dts: qcom: msm8939-samsung-a7: Add initial dts Lin, Meng-Bo
2023-06-22 2:04 ` [PATCH 1/8] dt-bindings: qcom: Document msm8939,a7 Lin, Meng-Bo
2023-06-22 14:41 ` Rob Herring
2023-06-22 2:04 ` [PATCH 2/8] arm64: dts: qcom: msm8939-samsung-a7: Add initial dts Lin, Meng-Bo
2023-06-22 2:04 ` [PATCH 3/8] arm64: dts: qcom: msm8939-samsung-a7: Add touch key Lin, Meng-Bo
2023-06-22 15:11 ` Krzysztof Kozlowski
2023-06-22 2:05 ` [PATCH 4/8] arm64: dts: qcom: msm8939-samsung-a7: Add accelerometer/magnetometer Lin, Meng-Bo
2023-06-22 2:05 ` [PATCH 5/8] arm64: dts: qcom: msm8939-samsung-a7: Add rt5033 battery Lin, Meng-Bo
2023-06-22 2:05 ` [PATCH 6/8] arm64: dts: qcom: msm8939-samsung-a7: Add NFC Lin, Meng-Bo
2023-06-22 2:05 ` [PATCH 7/8] arm64: dts: qcom: msm8939-samsung-a7: Add vibrator Lin, Meng-Bo
2023-06-22 2:06 ` [PATCH 8/8] arm64: dts: qcom: msm8939-samsung-a7: Add touchscreen Lin, Meng-Bo
2023-06-23 10:01 ` [PATCH v2 0/2] arm64: dts: qcom: msm8939-samsung-a7: Add initial dts Lin, Meng-Bo
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).