diff options
author | Ping Cheng <pinglinux@gmail.com> | 2015-01-27 16:29:36 -0500 |
---|---|---|
committer | Jiri Kosina <jkosina@suse.cz> | 2015-01-29 08:05:04 -0500 |
commit | a2f71c6c878e664cce4591fc1de36dce2bf44d8d (patch) | |
tree | 944c60b38bfc049cff1610747051a389c4d2c4d8 /drivers/hid | |
parent | 9b61aa864ab6c2e12e463559eb83cf83cbd06889 (diff) |
HID: wacom: consolidate input capability settings for pen and touch
After PAD moved to its own interface, there were duplicated statements in
wacom_setup_pentouch_input_capabilities. Merge them together to reduce future
maintenance effort.
Signed-off-by: Ping Cheng <pingc@wacom.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
Diffstat (limited to 'drivers/hid')
-rw-r--r-- | drivers/hid/wacom_wac.c | 67 |
1 files changed, 10 insertions, 57 deletions
diff --git a/drivers/hid/wacom_wac.c b/drivers/hid/wacom_wac.c index 6d490f602cfd..d239d82a1f90 100644 --- a/drivers/hid/wacom_wac.c +++ b/drivers/hid/wacom_wac.c | |||
@@ -2089,32 +2089,17 @@ int wacom_setup_pentouch_input_capabilities(struct input_dev *input_dev, | |||
2089 | wacom_abs_set_axis(input_dev, wacom_wac); | 2089 | wacom_abs_set_axis(input_dev, wacom_wac); |
2090 | 2090 | ||
2091 | switch (features->type) { | 2091 | switch (features->type) { |
2092 | case WACOM_MO: | ||
2093 | case WACOM_G4: | ||
2094 | /* fall through */ | ||
2095 | |||
2096 | case GRAPHIRE: | ||
2097 | input_set_capability(input_dev, EV_REL, REL_WHEEL); | ||
2098 | |||
2099 | __set_bit(BTN_LEFT, input_dev->keybit); | ||
2100 | __set_bit(BTN_RIGHT, input_dev->keybit); | ||
2101 | __set_bit(BTN_MIDDLE, input_dev->keybit); | ||
2102 | |||
2103 | __set_bit(BTN_TOOL_RUBBER, input_dev->keybit); | ||
2104 | __set_bit(BTN_TOOL_PEN, input_dev->keybit); | ||
2105 | __set_bit(BTN_TOOL_MOUSE, input_dev->keybit); | ||
2106 | __set_bit(BTN_STYLUS, input_dev->keybit); | ||
2107 | __set_bit(BTN_STYLUS2, input_dev->keybit); | ||
2108 | |||
2109 | __set_bit(INPUT_PROP_POINTER, input_dev->propbit); | ||
2110 | break; | ||
2111 | |||
2112 | case GRAPHIRE_BT: | 2092 | case GRAPHIRE_BT: |
2113 | __clear_bit(ABS_MISC, input_dev->absbit); | 2093 | __clear_bit(ABS_MISC, input_dev->absbit); |
2094 | |||
2095 | case WACOM_MO: | ||
2096 | case WACOM_G4: | ||
2114 | input_set_abs_params(input_dev, ABS_DISTANCE, 0, | 2097 | input_set_abs_params(input_dev, ABS_DISTANCE, 0, |
2115 | features->distance_max, | 2098 | features->distance_max, |
2116 | 0, 0); | 2099 | 0, 0); |
2100 | /* fall through */ | ||
2117 | 2101 | ||
2102 | case GRAPHIRE: | ||
2118 | input_set_capability(input_dev, EV_REL, REL_WHEEL); | 2103 | input_set_capability(input_dev, EV_REL, REL_WHEEL); |
2119 | 2104 | ||
2120 | __set_bit(BTN_LEFT, input_dev->keybit); | 2105 | __set_bit(BTN_LEFT, input_dev->keybit); |
@@ -2131,30 +2116,13 @@ int wacom_setup_pentouch_input_capabilities(struct input_dev *input_dev, | |||
2131 | break; | 2116 | break; |
2132 | 2117 | ||
2133 | case WACOM_24HD: | 2118 | case WACOM_24HD: |
2134 | input_set_abs_params(input_dev, ABS_Z, -900, 899, 0, 0); | ||
2135 | input_abs_set_res(input_dev, ABS_Z, 287); | ||
2136 | input_set_abs_params(input_dev, ABS_THROTTLE, 0, 71, 0, 0); | ||
2137 | /* fall through */ | ||
2138 | |||
2139 | case DTK: | 2119 | case DTK: |
2140 | __set_bit(INPUT_PROP_DIRECT, input_dev->propbit); | ||
2141 | |||
2142 | wacom_setup_cintiq(wacom_wac); | ||
2143 | break; | ||
2144 | |||
2145 | case WACOM_22HD: | 2120 | case WACOM_22HD: |
2146 | case WACOM_21UX2: | 2121 | case WACOM_21UX2: |
2147 | case WACOM_BEE: | 2122 | case WACOM_BEE: |
2148 | case CINTIQ: | 2123 | case CINTIQ: |
2149 | input_set_abs_params(input_dev, ABS_Z, -900, 899, 0, 0); | ||
2150 | input_abs_set_res(input_dev, ABS_Z, 287); | ||
2151 | |||
2152 | __set_bit(INPUT_PROP_DIRECT, input_dev->propbit); | ||
2153 | |||
2154 | wacom_setup_cintiq(wacom_wac); | ||
2155 | break; | ||
2156 | |||
2157 | case WACOM_13HD: | 2124 | case WACOM_13HD: |
2125 | case CINTIQ_HYBRID: | ||
2158 | input_set_abs_params(input_dev, ABS_Z, -900, 899, 0, 0); | 2126 | input_set_abs_params(input_dev, ABS_Z, -900, 899, 0, 0); |
2159 | input_abs_set_res(input_dev, ABS_Z, 287); | 2127 | input_abs_set_res(input_dev, ABS_Z, 287); |
2160 | __set_bit(INPUT_PROP_DIRECT, input_dev->propbit); | 2128 | __set_bit(INPUT_PROP_DIRECT, input_dev->propbit); |
@@ -2164,6 +2132,10 @@ int wacom_setup_pentouch_input_capabilities(struct input_dev *input_dev, | |||
2164 | case INTUOS3: | 2132 | case INTUOS3: |
2165 | case INTUOS3L: | 2133 | case INTUOS3L: |
2166 | case INTUOS3S: | 2134 | case INTUOS3S: |
2135 | case INTUOS4: | ||
2136 | case INTUOS4WL: | ||
2137 | case INTUOS4L: | ||
2138 | case INTUOS4S: | ||
2167 | input_set_abs_params(input_dev, ABS_Z, -900, 899, 0, 0); | 2139 | input_set_abs_params(input_dev, ABS_Z, -900, 899, 0, 0); |
2168 | input_abs_set_res(input_dev, ABS_Z, 287); | 2140 | input_abs_set_res(input_dev, ABS_Z, 287); |
2169 | /* fall through */ | 2141 | /* fall through */ |
@@ -2202,17 +2174,6 @@ int wacom_setup_pentouch_input_capabilities(struct input_dev *input_dev, | |||
2202 | } | 2174 | } |
2203 | break; | 2175 | break; |
2204 | 2176 | ||
2205 | case INTUOS4: | ||
2206 | case INTUOS4WL: | ||
2207 | case INTUOS4L: | ||
2208 | case INTUOS4S: | ||
2209 | input_set_abs_params(input_dev, ABS_Z, -900, 899, 0, 0); | ||
2210 | input_abs_set_res(input_dev, ABS_Z, 287); | ||
2211 | wacom_setup_intuos(wacom_wac); | ||
2212 | |||
2213 | __set_bit(INPUT_PROP_POINTER, input_dev->propbit); | ||
2214 | break; | ||
2215 | |||
2216 | case WACOM_24HDT: | 2177 | case WACOM_24HDT: |
2217 | if (features->device_type == BTN_TOOL_FINGER) { | 2178 | if (features->device_type == BTN_TOOL_FINGER) { |
2218 | input_set_abs_params(input_dev, ABS_MT_TOUCH_MAJOR, 0, features->x_max, 0, 0); | 2179 | input_set_abs_params(input_dev, ABS_MT_TOUCH_MAJOR, 0, features->x_max, 0, 0); |
@@ -2308,14 +2269,6 @@ int wacom_setup_pentouch_input_capabilities(struct input_dev *input_dev, | |||
2308 | 0, 0); | 2269 | 0, 0); |
2309 | } | 2270 | } |
2310 | break; | 2271 | break; |
2311 | |||
2312 | case CINTIQ_HYBRID: | ||
2313 | input_set_abs_params(input_dev, ABS_Z, -900, 899, 0, 0); | ||
2314 | input_abs_set_res(input_dev, ABS_Z, 287); | ||
2315 | __set_bit(INPUT_PROP_DIRECT, input_dev->propbit); | ||
2316 | |||
2317 | wacom_setup_cintiq(wacom_wac); | ||
2318 | break; | ||
2319 | } | 2272 | } |
2320 | return 0; | 2273 | return 0; |
2321 | } | 2274 | } |