diff --git a/arch/arm64/boot/dts/amlogic/meson-g12b-odroid-go-ultra.dts b/arch/arm64/boot/dts/amlogic/meson-g12b-odroid-go-ultra.dts index 01d433769da8..f04ecf9e8771 100644 --- a/arch/arm64/boot/dts/amlogic/meson-g12b-odroid-go-ultra.dts +++ b/arch/arm64/boot/dts/amlogic/meson-g12b-odroid-go-ultra.dts @@ -48,95 +48,126 @@ linux,code = ; gpios = <&gpio GPIOX_9 GPIO_ACTIVE_LOW>; }; - dpad-up-button { - label = "DPAD-UP"; - linux,code = ; + }; + + joypad: gou_joypad { + compatible = "odroidgou-joypad"; + poll-interval = <10>; + pinctrl-0 = <&keypad_gpio_pins>; + pinctrl-names = "default"; + status = "okay"; + + joypad-name = "GO-Ultra Gamepad"; + //joypad-vendor = <0x045e>; + joypad-product = <0x1000>; + joypad-revision = <0x0100>; + + /* Analog sticks */ + io-channels = <&saradc 0>, <&saradc 1>, <&saradc 2>, <&saradc 3>; + io-channel-names = "key-RY", "key-RX", "key-LY", "key-LX"; + button-adc-scale = <4>; + button-adc-deadzone = <64>; + button-adc-fuzz = <32>; + button-adc-flat = <32>; + abs_x-p-tuning = <350>; + abs_x-n-tuning = <350>; + abs_y-p-tuning = <350>; + abs_y-n-tuning = <350>; + abs_rx-p-tuning = <350>; + abs_rx-n-tuning = <350>; + abs_ry-p-tuning = <350>; + abs_ry-n-tuning = <350>; + + /* Buttons */ + sw1 { gpios = <&gpio GPIOX_0 GPIO_ACTIVE_LOW>; + label = "GPIO DPAD-UP"; + linux,code = ; // 0x220 }; - dpad-down-button { - label = "DPAD-DOWN"; - linux,code = ; + sw2 { gpios = <&gpio GPIOX_1 GPIO_ACTIVE_LOW>; + label = "GPIO DPAD-DOWN"; + linux,code = ; // 0x221 }; - dpad-left-button { - label = "DPAD-LEFT"; - linux,code = ; + sw3 { gpios = <&gpio GPIOX_2 GPIO_ACTIVE_LOW>; + label = "GPIO DPAD-LEFT"; + linux,code = ; // 0x222 }; - dpad-right-button { - label = "DPAD-RIGHT"; - linux,code = ; + sw4 { gpios = <&gpio GPIOX_3 GPIO_ACTIVE_LOW>; + label = "GPIO DPAD-RIGHT"; + linux,code = ; // 0x223 }; - a-button { - label = "A"; - linux,code = ; + sw5 { gpios = <&gpio GPIOX_4 GPIO_ACTIVE_LOW>; + label = "GPIO BTN-A"; + linux,code = ; // 0x131 }; - b-button { - label = "B"; - linux,code = ; + sw6 { gpios = <&gpio GPIOX_5 GPIO_ACTIVE_LOW>; + label = "GPIO BTN-B"; + linux,code = ; // 0x130 }; - y-button { - label = "Y"; - linux,code = ; + sw7 { gpios = <&gpio GPIOX_6 GPIO_ACTIVE_LOW>; + label = "GPIO BTN-Y"; + linux,code = ; // 0x134 }; - x-button { - label = "X"; - linux,code = ; + sw8 { gpios = <&gpio GPIOX_7 GPIO_ACTIVE_LOW>; + label = "GPIO BTN-X"; + linux,code = ; // 0x133 }; - f1-button { - label = "F1"; - linux,code = ; - gpios = <&gpio GPIOX_17 GPIO_ACTIVE_LOW>; - }; - f2-button { - label = "F2"; - linux,code = ; + sw11 { gpios = <&gpio GPIOX_10 GPIO_ACTIVE_LOW>; + label = "GPIO F2"; + linux,code = ; // 0x2c2 }; - f3-button { - label = "F3"; - linux,code = ; + sw12 { gpios = <&gpio GPIOX_11 GPIO_ACTIVE_LOW>; + label = "GPIO F3"; + linux,code = ; // 0x2c3 }; - f4-button { - label = "F4"; - linux,code = ; + sw13 { gpios = <&gpio GPIOX_12 GPIO_ACTIVE_LOW>; + label = "GPIO F4"; + linux,code = ; // 0x2c4 }; - f5-button { - label = "F5"; - linux,code = ; + sw14 { gpios = <&gpio GPIOX_13 GPIO_ACTIVE_LOW>; + label = "GPIO F5"; + linux,code = ; // 0x13c }; - f6-button { - label = "F6"; - linux,code = ; - gpios = <&gpio GPIOX_16 GPIO_ACTIVE_LOW>; - }; - top-left-button { - label = "TOP Left"; - linux,code = ; + sw15 { gpios = <&gpio GPIOX_14 GPIO_ACTIVE_LOW>; + label = "GPIO TOP-LEFT"; + linux,code = ; // 0x02 }; - top-left2-button { - label = "TOP Left 2"; - linux,code = ; - gpios = <&gpio GPIOX_19 GPIO_ACTIVE_LOW>; - }; - top-right-button { - label = "TOP Right"; - linux,code = ; + sw16 { gpios = <&gpio GPIOX_15 GPIO_ACTIVE_LOW>; + label = "GPIO TOP-RIGHT"; + linux,code = ; // 0x05 }; - top-right2-button { - label = "TOP Right 2"; - linux,code = ; + sw17 { + gpios = <&gpio GPIOX_16 GPIO_ACTIVE_LOW>; + label = "GPIO F6"; + linux,code = ; + }; + sw18 { + gpios = <&gpio GPIOX_17 GPIO_ACTIVE_LOW>; + label = "GPIO F1"; + linux,code = ; + }; + sw19 { gpios = <&gpio GPIOX_18 GPIO_ACTIVE_LOW>; + label = "GPIO TOP-RIGHT2"; + linux,code = ; + }; + sw20 { + gpios = <&gpio GPIOX_19 GPIO_ACTIVE_LOW>; + label = "GPIO TOP-LEFT2"; + linux,code = ; }; };