* [PATCH 2/5] arm64: dts: qcom: msm8916-samsung-a3u: Add touch key regulators
2021-06-04 17:27 [PATCH 1/5] arm64: dts: qcom: msm8916-samsung-a2015: Add touch key Stephan Gerhold
@ 2021-06-04 17:27 ` Stephan Gerhold
2021-06-04 17:27 ` [PATCH 3/5] arm64: dts: qcom: msm8916-samsung-a5u: Add touch key regulator Stephan Gerhold
` (3 subsequent siblings)
4 siblings, 0 replies; 7+ messages in thread
From: Stephan Gerhold @ 2021-06-04 17:27 UTC (permalink / raw)
To: Bjorn Andersson
Cc: Andy Gross, linux-arm-msm, devicetree, phone-devel,
~postmarketos/upstreaming, Michael Srba, Stephan Gerhold
From: Michael Srba <Michael.Srba@seznam.cz>
The touch key MCU and LED is supplied by two separate fixed regulators
that can be enabled through GPIO 86 and 60. Add them to the device tree.
Signed-off-by: Michael Srba <Michael.Srba@seznam.cz>
[stephan: extend commit message]
Signed-off-by: Stephan Gerhold <stephan@gerhold.net>
---
.../boot/dts/qcom/msm8916-samsung-a3u-eur.dts | 47 +++++++++++++++++++
1 file changed, 47 insertions(+)
diff --git a/arch/arm64/boot/dts/qcom/msm8916-samsung-a3u-eur.dts b/arch/arm64/boot/dts/qcom/msm8916-samsung-a3u-eur.dts
index 661f41ad978b..6cc2eaeb1d33 100644
--- a/arch/arm64/boot/dts/qcom/msm8916-samsung-a3u-eur.dts
+++ b/arch/arm64/boot/dts/qcom/msm8916-samsung-a3u-eur.dts
@@ -20,6 +20,37 @@ reg_panel_vdd3: regulator-panel-vdd3 {
pinctrl-names = "default";
pinctrl-0 = <&panel_vdd3_default>;
};
+
+ reg_touch_key: regulator-touch-key {
+ compatible = "regulator-fixed";
+ regulator-name = "touch_key";
+ regulator-min-microvolt = <2800000>;
+ regulator-max-microvolt = <2800000>;
+
+ gpio = <&msmgpio 86 GPIO_ACTIVE_HIGH>;
+ enable-active-high;
+
+ pinctrl-names = "default";
+ pinctrl-0 = <&tkey_en_default>;
+ };
+
+ reg_key_led: regulator-key-led {
+ compatible = "regulator-fixed";
+ regulator-name = "key_led";
+ regulator-min-microvolt = <3300000>;
+ regulator-max-microvolt = <3300000>;
+
+ gpio = <&msmgpio 60 GPIO_ACTIVE_HIGH>;
+ enable-active-high;
+
+ pinctrl-names = "default";
+ pinctrl-0 = <&tkey_led_en_default>;
+ };
+};
+
+&touchkey {
+ vcc-supply = <®_touch_key>;
+ vdd-supply = <®_key_led>;
};
&accelerometer {
@@ -81,6 +112,22 @@ panel_vdd3_default: panel-vdd3-default {
bias-disable;
};
+ tkey_en_default: tkey-en-default {
+ pins = "gpio86";
+ function = "gpio";
+
+ drive-strength = <2>;
+ bias-disable;
+ };
+
+ tkey_led_en_default: tkey-led-en-default {
+ pins = "gpio60";
+ function = "gpio";
+
+ drive-strength = <2>;
+ bias-disable;
+ };
+
ts_int_default: ts-int-default {
pins = "gpio13";
function = "gpio";
--
2.31.1
^ permalink raw reply related [flat|nested] 7+ messages in thread
* [PATCH 3/5] arm64: dts: qcom: msm8916-samsung-a5u: Add touch key regulator
2021-06-04 17:27 [PATCH 1/5] arm64: dts: qcom: msm8916-samsung-a2015: Add touch key Stephan Gerhold
2021-06-04 17:27 ` [PATCH 2/5] arm64: dts: qcom: msm8916-samsung-a3u: Add touch key regulators Stephan Gerhold
@ 2021-06-04 17:27 ` Stephan Gerhold
2021-06-04 17:27 ` [PATCH 4/5] arm64: dts: qcom: msm8916-samsung-a2015: Add rt5033 battery Stephan Gerhold
` (2 subsequent siblings)
4 siblings, 0 replies; 7+ messages in thread
From: Stephan Gerhold @ 2021-06-04 17:27 UTC (permalink / raw)
To: Bjorn Andersson
Cc: Andy Gross, linux-arm-msm, devicetree, phone-devel,
~postmarketos/upstreaming, Michael Srba, Stephan Gerhold
On the Samsung Galaxy A5 the touch key is supplied by a single fixed
regulator (enabled via GPIO 97) that supplies both MCU and LED.
Add it to the device tree.
Signed-off-by: Stephan Gerhold <stephan@gerhold.net>
---
.../boot/dts/qcom/msm8916-samsung-a5u-eur.dts | 26 +++++++++++++++++++
1 file changed, 26 insertions(+)
diff --git a/arch/arm64/boot/dts/qcom/msm8916-samsung-a5u-eur.dts b/arch/arm64/boot/dts/qcom/msm8916-samsung-a5u-eur.dts
index dd35c3344358..c2eff5aebf85 100644
--- a/arch/arm64/boot/dts/qcom/msm8916-samsung-a5u-eur.dts
+++ b/arch/arm64/boot/dts/qcom/msm8916-samsung-a5u-eur.dts
@@ -7,6 +7,19 @@
/ {
model = "Samsung Galaxy A5U (EUR)";
compatible = "samsung,a5u-eur", "qcom,msm8916";
+
+ reg_touch_key: regulator-touch-key {
+ compatible = "regulator-fixed";
+ regulator-name = "touch_key";
+ regulator-min-microvolt = <3300000>;
+ regulator-max-microvolt = <3300000>;
+
+ gpio = <&msmgpio 97 GPIO_ACTIVE_HIGH>;
+ enable-active-high;
+
+ pinctrl-names = "default";
+ pinctrl-0 = <&tkey_en_default>;
+ };
};
&accelerometer {
@@ -42,7 +55,20 @@ iris {
};
};
+&touchkey {
+ vcc-supply = <®_touch_key>;
+ vdd-supply = <®_touch_key>;
+};
+
&msmgpio {
+ tkey_en_default: tkey-en-default {
+ pins = "gpio97";
+ function = "gpio";
+
+ drive-strength = <2>;
+ bias-disable;
+ };
+
ts_int_default: ts-int-default {
pins = "gpio13";
function = "gpio";
--
2.31.1
^ permalink raw reply related [flat|nested] 7+ messages in thread
* [PATCH 4/5] arm64: dts: qcom: msm8916-samsung-a2015: Add rt5033 battery
2021-06-04 17:27 [PATCH 1/5] arm64: dts: qcom: msm8916-samsung-a2015: Add touch key Stephan Gerhold
2021-06-04 17:27 ` [PATCH 2/5] arm64: dts: qcom: msm8916-samsung-a3u: Add touch key regulators Stephan Gerhold
2021-06-04 17:27 ` [PATCH 3/5] arm64: dts: qcom: msm8916-samsung-a5u: Add touch key regulator Stephan Gerhold
@ 2021-06-04 17:27 ` Stephan Gerhold
2021-06-04 17:27 ` [PATCH 5/5] arm64: dts: qcom: msm8916-samsung-a2015: Add NFC Stephan Gerhold
2021-06-10 14:50 ` [PATCH 1/5] arm64: dts: qcom: msm8916-samsung-a2015: Add touch key patchwork-bot+linux-arm-msm
4 siblings, 0 replies; 7+ messages in thread
From: Stephan Gerhold @ 2021-06-04 17:27 UTC (permalink / raw)
To: Bjorn Andersson
Cc: Andy Gross, linux-arm-msm, devicetree, phone-devel,
~postmarketos/upstreaming, Michael Srba, Stephan Gerhold
The Samsung Galaxy A3/A5 use 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: Stephan Gerhold <stephan@gerhold.net>
---
.../qcom/msm8916-samsung-a2015-common.dtsi | 22 +++++++++++++++++++
1 file changed, 22 insertions(+)
diff --git a/arch/arm64/boot/dts/qcom/msm8916-samsung-a2015-common.dtsi b/arch/arm64/boot/dts/qcom/msm8916-samsung-a2015-common.dtsi
index 3c77e7ef9eda..9a6988ded29d 100644
--- a/arch/arm64/boot/dts/qcom/msm8916-samsung-a2015-common.dtsi
+++ b/arch/arm64/boot/dts/qcom/msm8916-samsung-a2015-common.dtsi
@@ -151,6 +151,20 @@ magnetometer@12 {
};
};
+&blsp_i2c4 {
+ status = "okay";
+
+ battery@35 {
+ compatible = "richtek,rt5033-battery";
+ reg = <0x35>;
+ interrupt-parent = <&msmgpio>;
+ interrupts = <121 IRQ_TYPE_EDGE_BOTH>;
+
+ pinctrl-names = "default";
+ pinctrl-0 = <&fg_alert_default>;
+ };
+};
+
&blsp1_uart2 {
status = "okay";
};
@@ -313,6 +327,14 @@ accel_int_default: accel-int-default {
bias-disable;
};
+ fg_alert_default: fg-alert-default {
+ pins = "gpio121";
+ function = "gpio";
+
+ drive-strength = <2>;
+ bias-disable;
+ };
+
gpio_keys_default: gpio-keys-default {
pins = "gpio107", "gpio109";
function = "gpio";
--
2.31.1
^ permalink raw reply related [flat|nested] 7+ messages in thread
* [PATCH 5/5] arm64: dts: qcom: msm8916-samsung-a2015: Add NFC
2021-06-04 17:27 [PATCH 1/5] arm64: dts: qcom: msm8916-samsung-a2015: Add touch key Stephan Gerhold
` (2 preceding siblings ...)
2021-06-04 17:27 ` [PATCH 4/5] arm64: dts: qcom: msm8916-samsung-a2015: Add rt5033 battery Stephan Gerhold
@ 2021-06-04 17:27 ` Stephan Gerhold
2021-06-07 8:23 ` Krzysztof Kozlowski
2021-06-10 14:50 ` [PATCH 1/5] arm64: dts: qcom: msm8916-samsung-a2015: Add touch key patchwork-bot+linux-arm-msm
4 siblings, 1 reply; 7+ messages in thread
From: Stephan Gerhold @ 2021-06-04 17:27 UTC (permalink / raw)
To: Bjorn Andersson
Cc: Andy Gross, linux-arm-msm, devicetree, phone-devel,
~postmarketos/upstreaming, Michael Srba, Stephan Gerhold,
Krzysztof Kozlowski
The Samsung Galaxy A3/A5 both have a Samsung S3FWRN5 NFC chip that
works quite well with the s3fwrn5 driver in the Linux NFC subsystem.
The clock setup for the NFC chip is a bit special (although this
seems to be a common approach used for Qualcomm devices with NFC):
The NFC chip has an output GPIO that is asserted whenever the clock
is needed to function properly. On the A3/A5 this is wired up to
PM8916 GPIO2, which is then configured with a special function
(NFC_CLK_REQ or BB_CLK2_REQ).
Enabling the rpmcc RPM_SMD_BB_CLK2_PIN clock will then instruct
PM8916 to automatically enable the clock whenever the NFC chip
requests it. The advantage is that the clock is only enabled when
needed and we don't need to manage it ourselves from the NFC driver.
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.
Cc: Krzysztof Kozlowski <krzysztof.kozlowski@canonical.com>
Signed-off-by: Stephan Gerhold <stephan@gerhold.net>
---
.../qcom/msm8916-samsung-a2015-common.dtsi | 64 +++++++++++++++++++
1 file changed, 64 insertions(+)
diff --git a/arch/arm64/boot/dts/qcom/msm8916-samsung-a2015-common.dtsi b/arch/arm64/boot/dts/qcom/msm8916-samsung-a2015-common.dtsi
index 9a6988ded29d..9b4b7de7cec2 100644
--- a/arch/arm64/boot/dts/qcom/msm8916-samsung-a2015-common.dtsi
+++ b/arch/arm64/boot/dts/qcom/msm8916-samsung-a2015-common.dtsi
@@ -4,6 +4,7 @@
#include <dt-bindings/gpio/gpio.h>
#include <dt-bindings/input/input.h>
#include <dt-bindings/interrupt-controller/irq.h>
+#include <dt-bindings/pinctrl/qcom,pmic-gpio.h>
/ {
aliases {
@@ -124,6 +125,34 @@ touchkey: touchkey@20 {
pinctrl-0 = <&tkey_default>;
};
};
+
+ i2c-nfc {
+ compatible = "i2c-gpio";
+ sda-gpios = <&msmgpio 0 (GPIO_ACTIVE_HIGH|GPIO_OPEN_DRAIN)>;
+ scl-gpios = <&msmgpio 1 (GPIO_ACTIVE_HIGH|GPIO_OPEN_DRAIN)>;
+
+ pinctrl-names = "default";
+ pinctrl-0 = <&nfc_i2c_default>;
+
+ #address-cells = <1>;
+ #size-cells = <0>;
+
+ nfc@27 {
+ compatible = "samsung,s3fwrn5-i2c";
+ reg = <0x27>;
+
+ interrupt-parent = <&msmgpio>;
+ interrupts = <21 IRQ_TYPE_EDGE_RISING>;
+
+ en-gpios = <&msmgpio 20 GPIO_ACTIVE_HIGH>;
+ wake-gpios = <&msmgpio 49 GPIO_ACTIVE_HIGH>;
+
+ clocks = <&rpmcc RPM_SMD_BB_CLK2_PIN>;
+
+ pinctrl-names = "default";
+ pinctrl-0 = <&nfc_default &nfc_clk_req>;
+ };
+ };
};
&blsp_i2c2 {
@@ -384,6 +413,30 @@ muic_int_default: muic-int-default {
bias-disable;
};
+ nfc_default: nfc-default {
+ pins = "gpio20", "gpio49";
+ function = "gpio";
+
+ drive-strength = <2>;
+ bias-disable;
+
+ irq {
+ pins = "gpio21";
+ function = "gpio";
+
+ drive-strength = <2>;
+ bias-pull-down;
+ };
+ };
+
+ nfc_i2c_default: nfc-i2c-default {
+ pins = "gpio0", "gpio1";
+ function = "gpio";
+
+ drive-strength = <2>;
+ bias-disable;
+ };
+
tkey_default: tkey-default {
pins = "gpio98";
function = "gpio";
@@ -408,3 +461,14 @@ tsp_en_default: tsp-en-default {
bias-disable;
};
};
+
+&pm8916_gpios {
+ nfc_clk_req: nfc-clk-req {
+ pins = "gpio2";
+ function = "func1";
+
+ input-enable;
+ bias-disable;
+ power-source = <PM8916_GPIO_L2>;
+ };
+};
--
2.31.1
^ permalink raw reply related [flat|nested] 7+ messages in thread
* Re: [PATCH 5/5] arm64: dts: qcom: msm8916-samsung-a2015: Add NFC
2021-06-04 17:27 ` [PATCH 5/5] arm64: dts: qcom: msm8916-samsung-a2015: Add NFC Stephan Gerhold
@ 2021-06-07 8:23 ` Krzysztof Kozlowski
0 siblings, 0 replies; 7+ messages in thread
From: Krzysztof Kozlowski @ 2021-06-07 8:23 UTC (permalink / raw)
To: Stephan Gerhold, Bjorn Andersson
Cc: Andy Gross, linux-arm-msm, devicetree, phone-devel,
~postmarketos/upstreaming, Michael Srba
On 04/06/2021 19:27, Stephan Gerhold wrote:
> The Samsung Galaxy A3/A5 both have a Samsung S3FWRN5 NFC chip that
> works quite well with the s3fwrn5 driver in the Linux NFC subsystem.
>
> The clock setup for the NFC chip is a bit special (although this
> seems to be a common approach used for Qualcomm devices with NFC):
>
> The NFC chip has an output GPIO that is asserted whenever the clock
> is needed to function properly. On the A3/A5 this is wired up to
> PM8916 GPIO2, which is then configured with a special function
> (NFC_CLK_REQ or BB_CLK2_REQ).
>
> Enabling the rpmcc RPM_SMD_BB_CLK2_PIN clock will then instruct
> PM8916 to automatically enable the clock whenever the NFC chip
> requests it. The advantage is that the clock is only enabled when
> needed and we don't need to manage it ourselves from the NFC driver.
>
> 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.
>
> Cc: Krzysztof Kozlowski <krzysztof.kozlowski@canonical.com>
> Signed-off-by: Stephan Gerhold <stephan@gerhold.net>
> ---
> .../qcom/msm8916-samsung-a2015-common.dtsi | 64 +++++++++++++++++++
> 1 file changed, 64 insertions(+)
>
Acked-by: Krzysztof Kozlowski <krzysztof.kozlowski@canonical.com>
Best regards,
Krzysztof
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH 1/5] arm64: dts: qcom: msm8916-samsung-a2015: Add touch key
2021-06-04 17:27 [PATCH 1/5] arm64: dts: qcom: msm8916-samsung-a2015: Add touch key Stephan Gerhold
` (3 preceding siblings ...)
2021-06-04 17:27 ` [PATCH 5/5] arm64: dts: qcom: msm8916-samsung-a2015: Add NFC Stephan Gerhold
@ 2021-06-10 14:50 ` patchwork-bot+linux-arm-msm
4 siblings, 0 replies; 7+ messages in thread
From: patchwork-bot+linux-arm-msm @ 2021-06-10 14:50 UTC (permalink / raw)
To: Stephan Gerhold; +Cc: linux-arm-msm
Hello:
This series was applied to qcom/linux.git (refs/heads/for-next):
On Fri, 4 Jun 2021 19:27:38 +0200 you wrote:
> The Samsung Galaxy A3/A5 both have two capacitive touch keys,
> connected to an ABOV MCU. It implements the same interface as
> implemented by the tm2-touchkey driver and works just fine with
> the coreriver,tc360-touchkey compatible. It's probably actually some
> Samsung-specific interface that they implement with different MCUs.
>
> 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.
>
> [...]
Here is the summary with links:
- [1/5] arm64: dts: qcom: msm8916-samsung-a2015: Add touch key
https://git.kernel.org/qcom/c/61f363a625fc
- [2/5] arm64: dts: qcom: msm8916-samsung-a3u: Add touch key regulators
https://git.kernel.org/qcom/c/92b5c3975b3b
- [3/5] arm64: dts: qcom: msm8916-samsung-a5u: Add touch key regulator
https://git.kernel.org/qcom/c/410040777744
- [4/5] arm64: dts: qcom: msm8916-samsung-a2015: Add rt5033 battery
https://git.kernel.org/qcom/c/0c04d16f4123
- [5/5] arm64: dts: qcom: msm8916-samsung-a2015: Add NFC
https://git.kernel.org/qcom/c/5e57e5d0d622
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] 7+ messages in thread