From: Douglas Anderson Date: Fri, 22 Apr 2016 18:32:48 +0000 (-0700) Subject: ARM64: dts: rk3399: add trackpad for gru/kevin boards X-Git-Tag: firefly_0821_release~2718 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=b67caebc9470b9785a4ec28030fba7df7f85d99a;p=firefly-linux-kernel-4.4.55.git ARM64: dts: rk3399: add trackpad for gru/kevin boards The trackpad bits in the DTS needed some love. This adds some basic infrastructure support in the main gru dts file and then adds the specific trackpad used on kevin-r0 and kevin-r1. For now just duplicate between kevin-r0 and kevin-r1 and we'll decide if we want to share later (perhaps we want an "atmel" snippet?). Note that gpio-keymap here makes the driver appear as a trackpad rather than a touchscreen (driver assumes that anything with buttons is a trackpad). Input entry corresponding to the button on the trackpad was found by experimentation as suggested in the device tree bindings. BUG=chrome-os-partner:52637 TEST=With series, trackpad works in browser; button works. Change-Id: Ia62cff90449625778fd99054b914e22a55c13550 Signed-off-by: Douglas Anderson Reviewed-on: https://chrome-internal-review.googlesource.com/256510 Commit-Ready: Doug Anderson Tested-by: Doug Anderson Reviewed-by: Brian Norris Signed-off-by: Caesar Wang --- diff --git a/arch/arm64/boot/dts/rockchip/rk3399-gru-kevin-r0.dts b/arch/arm64/boot/dts/rockchip/rk3399-gru-kevin-r0.dts index 84d2c6990694..78fe59da7085 100644 --- a/arch/arm64/boot/dts/rockchip/rk3399-gru-kevin-r0.dts +++ b/arch/arm64/boot/dts/rockchip/rk3399-gru-kevin-r0.dts @@ -51,6 +51,21 @@ "google,kevin", "google,gru", "rockchip,rk3399"; }; +&ap_i2c_tp { + trackpad@4a { + compatible = "atmel,maxtouch"; + reg = <0x4a>; + pinctrl-names = "default"; + pinctrl-0 = <&trackpad_int_l>; + interrupt-parent = <&gpio1>; + interrupts = <4 IRQ_TYPE_LEVEL_LOW>; + linux,gpio-keymap = ; + }; +}; + /* GPIO overrides for -r0; in same order as parent */ &pp3000 { diff --git a/arch/arm64/boot/dts/rockchip/rk3399-gru-kevin-r1.dts b/arch/arm64/boot/dts/rockchip/rk3399-gru-kevin-r1.dts index 858e80397841..3ae059f34cb4 100644 --- a/arch/arm64/boot/dts/rockchip/rk3399-gru-kevin-r1.dts +++ b/arch/arm64/boot/dts/rockchip/rk3399-gru-kevin-r1.dts @@ -58,6 +58,21 @@ "google,gru", "rockchip,rk3399"; }; +&ap_i2c_tp { + trackpad@4a { + compatible = "atmel,maxtouch"; + reg = <0x4a>; + pinctrl-names = "default"; + pinctrl-0 = <&trackpad_int_l>; + interrupt-parent = <&gpio1>; + interrupts = <4 IRQ_TYPE_LEVEL_LOW>; + linux,gpio-keymap = ; + }; +}; + /* PINCTRL: always below everything else */ &pinctrl { diff --git a/arch/arm64/boot/dts/rockchip/rk3399-gru.dtsi b/arch/arm64/boot/dts/rockchip/rk3399-gru.dtsi index ba69a950c219..43d3fa8df8d8 100644 --- a/arch/arm64/boot/dts/rockchip/rk3399-gru.dtsi +++ b/arch/arm64/boot/dts/rockchip/rk3399-gru.dtsi @@ -42,6 +42,7 @@ * OTHER DEALINGS IN THE SOFTWARE. */ +#include #include #include "rk3399.dtsi" @@ -575,6 +576,8 @@ ap_i2c_ts: &i2c3 { }; ap_i2c_tp: &i2c5 { + status = "okay"; + /* * Note strange pullup enable. Apparently this avoids leakage but * still allows us to get nice 4.7K pullups for high speed i2c @@ -583,13 +586,11 @@ ap_i2c_tp: &i2c5 { */ pinctrl-0 = <&i2c5_xfer &ap_i2c_tp_pu_en>; - status = "okay"; + clock-frequency = <400000>; - // TODO: bus speed - // ...with no speed, it should just use 100kHz - // TODO: rise / fall times? - - // TODO: Add the proper touchpanel reference... + /* These are relatively safe rise/fall times; TODO: measure */ + i2c-scl-falling-time-ns = <50>; + i2c-scl-rising-time-ns = <300>; }; ap_i2c_audio: &i2c8 { @@ -1051,10 +1052,14 @@ ap_i2c_audio: &i2c8 { }; }; - touchpanel { + trackpad { ap_i2c_tp_pu_en: ap-i2c-tp-pu-en { rockchip,pins = <3 12 RK_FUNC_GPIO &pcfg_output_high>; }; + + trackpad_int_l: trackpad-int-l { + rockchip,pins = <1 4 RK_FUNC_GPIO &pcfg_pull_up>; + }; }; backlight-enable {