arm64: dts: qcom: msm8916-samsung-serranove: Add touch key
authorStephan Gerhold <stephan@gerhold.net>
Mon, 4 Oct 2021 20:19:09 +0000 (22:19 +0200)
committerBjorn Andersson <bjorn.andersson@linaro.org>
Sun, 24 Oct 2021 03:23:02 +0000 (22:23 -0500)
Add the CORERIVER TC360 touch key together with the two necessary
fixed regulators 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: Stephan Gerhold <stephan@gerhold.net>
Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
Link: https://lore.kernel.org/r/20211004201921.18526-4-stephan@gerhold.net
arch/arm64/boot/dts/qcom/msm8916-samsung-serranove.dts

index aa1326e5d4cbc64aa2a4eae218c61f4a5f5ae84b..564f4f6d4f0f993df59619fccf1ff3812e79f594 100644 (file)
                pinctrl-0 = <&tsp_en_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>;
+       };
+
        i2c-muic {
                compatible = "i2c-gpio";
                sda-gpios = <&msmgpio 105 (GPIO_ACTIVE_HIGH|GPIO_OPEN_DRAIN)>;
                        pinctrl-0 = <&muic_irq_default>;
                };
        };
+
+       i2c-tkey {
+               compatible = "i2c-gpio";
+               sda-gpios = <&msmgpio 16 (GPIO_ACTIVE_HIGH|GPIO_OPEN_DRAIN)>;
+               scl-gpios = <&msmgpio 17 (GPIO_ACTIVE_HIGH|GPIO_OPEN_DRAIN)>;
+
+               pinctrl-names = "default";
+               pinctrl-0 = <&tkey_i2c_default>;
+
+               #address-cells = <1>;
+               #size-cells = <0>;
+
+               touchkey@20 {
+                       compatible = "coreriver,tc360-touchkey";
+                       reg = <0x20>;
+
+                       interrupt-parent = <&msmgpio>;
+                       interrupts = <98 IRQ_TYPE_EDGE_FALLING>;
+
+                       vcc-supply = <&reg_touch_key>;
+                       vdd-supply = <&reg_key_led>;
+                       vddio-supply = <&pm8916_l6>;
+
+                       linux,keycodes = <KEY_APPSELECT KEY_BACK>;
+
+                       pinctrl-names = "default";
+                       pinctrl-0 = <&tkey_default>;
+               };
+       };
 };
 
 &blsp_i2c5 {
                bias-disable;
        };
 
+       tkey_default: tkey-default {
+               pins = "gpio98";
+               function = "gpio";
+
+               drive-strength = <2>;
+               bias-disable;
+       };
+
+       tkey_en_default: tkey-en-default {
+               pins = "gpio86";
+               function = "gpio";
+
+               drive-strength = <2>;
+               bias-disable;
+       };
+
+       tkey_i2c_default: tkey-i2c-default {
+               pins = "gpio16", "gpio17";
+               function = "gpio";
+
+               drive-strength = <2>;
+               bias-disable;
+       };
+
+       tkey_led_en_default: tkey-led-en-default {
+               pins = "gpio60";
+               function = "gpio";
+
+               drive-strength = <2>;
+               bias-disable;
+       };
+
        tsp_en_default: tsp-en-default {
                pins = "gpio73";
                function = "gpio";