Skip to content

Commit

Permalink
arm64: dts: qcom: msm8916-samsung-serranove: Add touch key
Browse files Browse the repository at this point in the history
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 <[email protected]>
Signed-off-by: Bjorn Andersson <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
  • Loading branch information
stephan-gh authored and andersson committed Oct 24, 2021
1 parent c6b4ddc commit 3fb7605
Showing 1 changed file with 87 additions and 0 deletions.
87 changes: 87 additions & 0 deletions arch/arm64/boot/dts/qcom/msm8916-samsung-serranove.dts
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,32 @@
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)>;
Expand All @@ -113,6 +139,35 @@
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 {
Expand Down Expand Up @@ -333,6 +388,38 @@
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";
Expand Down

0 comments on commit 3fb7605

Please sign in to comment.