|
| 1 | +/* |
| 2 | + This is a skeleton of joypad with 2 sticks and FN (MODE) button. |
| 3 | + Fits devices with 1 stick and 2 extra face buttons too. |
| 4 | + By including this ans setting I/O properties only, |
| 5 | + devices should get consistent controller id and mapping |
| 6 | + thus reusing non-game configs: |
| 7 | + * SDL gamecontrollerdb.txt |
| 8 | + * ES es_input.cfg |
| 9 | + * Retroarch gamepad |
| 10 | +*/ |
| 11 | + |
| 12 | +/ { |
| 13 | + joypad: retrogame_joypad_s2_f1 { |
| 14 | + /* These drivers emit the same button set which makes this skeleton ADC-agnostic */ |
| 15 | + /* compatible = "rocknix-joypad"; */ |
| 16 | + /* compatible = "rocknix-singleadc-joypad"; */ |
| 17 | + |
| 18 | + /* These are constants making Joystick Guid the same */ |
| 19 | + joypad-name = "retrogame_joypad_s2_f1"; |
| 20 | + joypad-vendor = <0x484B>; |
| 21 | + joypad-product = <0x1121>; /* 11 inherited, 2 for number of sticks, 1 for number of FN */ |
| 22 | + joypad-revision = <0x0100>; |
| 23 | + |
| 24 | + /* require explicit status = "okay"; */ |
| 25 | + status = "disabled"; |
| 26 | + |
| 27 | + /* adc calculate scale */ |
| 28 | + button-adc-scale = <2>; |
| 29 | + |
| 30 | + /* adc deadzone range */ |
| 31 | + button-adc-deadzone = <64>; |
| 32 | + |
| 33 | + /* |
| 34 | + specifies fuzz value that is used to filter noise from |
| 35 | + the event stream. |
| 36 | + */ |
| 37 | + button-adc-fuzz = <32>; |
| 38 | + button-adc-flat = <32>; |
| 39 | + |
| 40 | + /* poll device interval (ms), adc read interval */ |
| 41 | + poll-interval = <10>; |
| 42 | + |
| 43 | + /* gpio button auto repeat set value : default disable */ |
| 44 | + /* |
| 45 | + autorepeat; |
| 46 | + */ |
| 47 | + |
| 48 | + /* meaningful node names for easier use */ |
| 49 | + up { |
| 50 | + label = "GPIO DPAD-UP"; |
| 51 | + linux,code = <BTN_DPAD_UP>; |
| 52 | + }; |
| 53 | + down { |
| 54 | + label = "GPIO DPAD-DOWN"; |
| 55 | + linux,code = <BTN_DPAD_DOWN>; |
| 56 | + }; |
| 57 | + left { |
| 58 | + label = "GPIO DPAD-LEFT"; |
| 59 | + linux,code = <BTN_DPAD_LEFT>; |
| 60 | + }; |
| 61 | + right { |
| 62 | + label = "GPIO DPAD-RIGHT"; |
| 63 | + linux,code = <BTN_DPAD_RIGHT>; |
| 64 | + }; |
| 65 | + |
| 66 | + a { |
| 67 | + label = "GPIO BTN-A"; |
| 68 | + linux,code = <BTN_EAST>; |
| 69 | + }; |
| 70 | + b { |
| 71 | + label = "GPIO BTN-B"; |
| 72 | + linux,code = <BTN_SOUTH>; |
| 73 | + }; |
| 74 | + x { |
| 75 | + label = "GPIO BTN-X"; |
| 76 | + linux,code = <BTN_NORTH>; |
| 77 | + }; |
| 78 | + y { |
| 79 | + label = "GPIO BTN-Y"; |
| 80 | + linux,code = <BTN_WEST>; |
| 81 | + }; |
| 82 | + |
| 83 | + select { |
| 84 | + label = "GPIO BTN_SELECT"; |
| 85 | + linux,code = <BTN_SELECT>; |
| 86 | + }; |
| 87 | + start { |
| 88 | + label = "GPIO BTN_START"; |
| 89 | + linux,code = <BTN_START>; |
| 90 | + }; |
| 91 | + mode { |
| 92 | + label = "GPIO BTN_F"; |
| 93 | + linux,code = <BTN_MODE>; |
| 94 | + }; |
| 95 | + |
| 96 | + tl { |
| 97 | + label = "GPIO BTN_TL"; |
| 98 | + linux,code = <BTN_TL>; |
| 99 | + }; |
| 100 | + tr { |
| 101 | + label = "GPIO BTN_TR"; |
| 102 | + linux,code = <BTN_TR>; |
| 103 | + }; |
| 104 | + tl2 { |
| 105 | + label = "GPIO BTN_TL2"; |
| 106 | + linux,code = <BTN_TL2>; |
| 107 | + }; |
| 108 | + tr2 { |
| 109 | + label = "GPIO BTN_TR2"; |
| 110 | + linux,code = <BTN_TR2>; |
| 111 | + }; |
| 112 | + |
| 113 | + thumbl { |
| 114 | + label = "GPIO BTN_THUMBL"; |
| 115 | + linux,code = <BTN_THUMBL>; |
| 116 | + }; |
| 117 | + thumbr { |
| 118 | + label = "GPIO BTN_THUMBR"; |
| 119 | + linux,code = <BTN_THUMBR>; |
| 120 | + }; |
| 121 | + }; |
| 122 | +}; |
0 commit comments