Input: s6sy761 - Add mode-switch support
Subsystems (5)
A message that is not in the archive (sent off-list or not yet received): [email protected]
PATCH 3/5 Input: s6sy761 - Add mode-switch support
On the Pixel 3 XL the touch I2C bus can be driven either by the AP or by the SLPI sensor DSP, selected by a GPIO. Take the optional "mode-switch-gpios" line and assert it at probe, before the first I2C access, so the AP owns the bus. Handing the bus back to the SLPI for low-power touch is not supported.
--- drivers/input/touchscreen/s6sy761.c | 11 +++++++++++ 1 file changed, 11 insertions(+)
drivers/input/touchscreen/s6sy761.c +11 -0
@@ -407,6 +407,7 @@ static void s6sy761_power_off(void *data)static int s6sy761_probe (struct i2c_client *client) {struct s6sy761_data *sdata; +struct gpio_desc *gpiod;unsigned int max_x, max_y;int err;
@@ -436,6 +437,16 @@ static int s6sy761_probe(struct i2c_client *client)return dev_err_probe (&client->dev,PTR_ERR (sdata->reset_gpio),"Failed to get reset GPIO\n" ); +/* +* Some boards share the touch I2C bus between the AP and the SLPI +* sensor DSP; make the AP the bus master before talking to the chip. +*/ + gpiod =devm_gpiod_get_optional (&client->dev,"mode-switch" , +GPIOD_OUT_HIGH ); +if (IS_ERR (gpiod)) +return dev_err_probe (&client->dev,PTR_ERR (gpiod), +"Failed to get mode-switch GPIO\n" ); + err =devm_add_action_or_reset (&client->dev, s6sy761_power_off, sdata);if (err)return err;
Signature · 1 line
2.53.0
PATCH 4/5 arm64: dts: qcom: sdm845-google: Group touchscreen pins, add mode-switch pin
In reply to a message not in the archivePixel 3 and Pixel 3 XL use different touchscreen controllers on the same
pins: reset on gpio99, interrupt on gpio125, and the AP/SLPI I2C bus switch on gpio136. Move the reset and interrupt pin configuration into a single touchscreen-default-state, add the switch pin to it, and use the grouped state on blueline.
--- .../arm64/boot/dts/qcom/sdm845-google-blueline.dts | 19 ++++++++++++- arch/arm64/boot/dts/qcom/sdm845-google-common.dtsi | 31 ++++++++++++++-------- 2 files changed, 38 insertions(+), 12 deletions(-)
arch/arm64/boot/dts/qcom/sdm845-google-blueline.dts +18 -1
@@ -26,7 +26,24 @@ &i2c2 { status = "okay"; - /* ST,FTS @ 49 */ + touchscreen@49 { + compatible = "st,stmfts5"; + reg = <0x49>; + + pinctrl-0 = <&touchscreen_default>; + pinctrl-names = "default"; + + interrupts-extended = <&tlmm 125 IRQ_TYPE_LEVEL_LOW>; + + mode-switch-gpios = <&tlmm 136 GPIO_ACTIVE_HIGH>; + reset-gpios = <&tlmm 99 GPIO_ACTIVE_LOW>; + + avdd-supply = <&vreg_l19a_3p3>; + vdd-supply = <&vreg_l14a_1p8>; + + touchscreen-size-x = <1080>; + touchscreen-size-y = <2160>; + }; }; &mdss_dsi0 {
arch/arm64/boot/dts/qcom/sdm845-google-common.dtsi +20 -11
@@ -523,18 +523,27 @@ firmware-pins { }; - touchscreen_reset: ts-reset-state { - pins = "gpio99"; - function = "gpio"; - drive-strength = <8>; - bias-pull-up; - }; + touchscreen_default: touchscreen-default-state { + reset-pins { + pins = "gpio99"; + function = "gpio"; + drive-strength = <8>; + bias-pull-up; + }; + + irq-pins { + pins = "gpio125"; + function = "gpio"; + drive-strength = <2>; + bias-disable; + }; - touchscreen_pins: ts-pins-gpio-state { - pins = "gpio125"; - function = "gpio"; - drive-strength = <2>; - bias-disable; + switch-pins { + pins = "gpio136"; + function = "gpio"; + drive-strength = <2>; + bias-disable; + }; }; };
Signature · 1 line
2.53.0