hid-uclogic-params.h (f25df3532832c93b7857a61266e48fa0ab87bca7) hid-uclogic-params.h (2112b49eaa5c5cffc22ddd8b3b09f7d20bf13819)
1/* SPDX-License-Identifier: GPL-2.0+ */
2/*
3 * HID driver for UC-Logic devices not fully compliant with HID standard
4 * - tablet initialization and parameter retrieval
5 *
6 * Copyright (c) 2018 Nikolai Kondrashov
7 */
8

--- 139 unchanged lines hidden (view full) ---

148 __s8 touch_ring_max;
149
150 /*
151 * The value to anchor the reversed reports at.
152 * I.e. one, if the reports should be flipped without offset.
153 * Zero if no reversal should be done.
154 */
155 __s8 touch_ring_flip_at;
1/* SPDX-License-Identifier: GPL-2.0+ */
2/*
3 * HID driver for UC-Logic devices not fully compliant with HID standard
4 * - tablet initialization and parameter retrieval
5 *
6 * Copyright (c) 2018 Nikolai Kondrashov
7 */
8

--- 139 unchanged lines hidden (view full) ---

148 __s8 touch_ring_max;
149
150 /*
151 * The value to anchor the reversed reports at.
152 * I.e. one, if the reports should be flipped without offset.
153 * Zero if no reversal should be done.
154 */
155 __s8 touch_ring_flip_at;
156 /*
157 * Offset of the bitmap dial byte, in the report. Zero if not present.
158 * Only valid if "id" is not zero. A bitmap dial sends reports with a
159 * dedicated bit per direction: 1 means clockwise rotation, 2 means
160 * counterclockwise, as opposed to the normal 1 and -1.
161 */
162 unsigned int bitmap_dial_byte;
156};
157
158/*
159 * Tablet interface report parameters.
160 *
161 * Must use declarative (descriptive) language, not imperative, to simplify
162 * understanding and maintain consistency.
163 *

--- 61 unchanged lines hidden (view full) ---

225 "\t\t.desc_size = %u\n" \
226 "\t\t.id = %u\n" \
227 "\t\t.suffix = %s\n" \
228 "\t\t.re_lsb = %u\n" \
229 "\t\t.dev_id_byte = %u\n" \
230 "\t\t.touch_ring_byte = %u\n" \
231 "\t\t.touch_ring_max = %hhd\n" \
232 "\t\t.touch_ring_flip_at = %hhd\n" \
163};
164
165/*
166 * Tablet interface report parameters.
167 *
168 * Must use declarative (descriptive) language, not imperative, to simplify
169 * understanding and maintain consistency.
170 *

--- 61 unchanged lines hidden (view full) ---

232 "\t\t.desc_size = %u\n" \
233 "\t\t.id = %u\n" \
234 "\t\t.suffix = %s\n" \
235 "\t\t.re_lsb = %u\n" \
236 "\t\t.dev_id_byte = %u\n" \
237 "\t\t.touch_ring_byte = %u\n" \
238 "\t\t.touch_ring_max = %hhd\n" \
239 "\t\t.touch_ring_flip_at = %hhd\n" \
240 "\t\t.bitmap_dial_byte = %u\n" \
233 "\t},\n" \
234 "\t{\n" \
235 "\t\t.desc_ptr = %p\n" \
236 "\t\t.desc_size = %u\n" \
237 "\t\t.id = %u\n" \
238 "\t\t.suffix = %s\n" \
239 "\t\t.re_lsb = %u\n" \
240 "\t\t.dev_id_byte = %u\n" \
241 "\t\t.touch_ring_byte = %u\n" \
242 "\t\t.touch_ring_max = %hhd\n" \
243 "\t\t.touch_ring_flip_at = %hhd\n" \
241 "\t},\n" \
242 "\t{\n" \
243 "\t\t.desc_ptr = %p\n" \
244 "\t\t.desc_size = %u\n" \
245 "\t\t.id = %u\n" \
246 "\t\t.suffix = %s\n" \
247 "\t\t.re_lsb = %u\n" \
248 "\t\t.dev_id_byte = %u\n" \
249 "\t\t.touch_ring_byte = %u\n" \
250 "\t\t.touch_ring_max = %hhd\n" \
251 "\t\t.touch_ring_flip_at = %hhd\n" \
252 "\t\t.bitmap_dial_byte = %u\n" \
244 "\t},\n" \
245 "\t{\n" \
246 "\t\t.desc_ptr = %p\n" \
247 "\t\t.desc_size = %u\n" \
248 "\t\t.id = %u\n" \
249 "\t\t.suffix = %s\n" \
250 "\t\t.re_lsb = %u\n" \
251 "\t\t.dev_id_byte = %u\n" \
252 "\t\t.touch_ring_byte = %u\n" \
253 "\t\t.touch_ring_max = %hhd\n" \
254 "\t\t.touch_ring_flip_at = %hhd\n" \
253 "\t},\n" \
254 "\t{\n" \
255 "\t\t.desc_ptr = %p\n" \
256 "\t\t.desc_size = %u\n" \
257 "\t\t.id = %u\n" \
258 "\t\t.suffix = %s\n" \
259 "\t\t.re_lsb = %u\n" \
260 "\t\t.dev_id_byte = %u\n" \
261 "\t\t.touch_ring_byte = %u\n" \
262 "\t\t.touch_ring_max = %hhd\n" \
263 "\t\t.touch_ring_flip_at = %hhd\n" \
264 "\t\t.bitmap_dial_byte = %u\n" \
255 "\t},\n" \
256 "}\n"
257
258/* Tablet interface parameters *printf format arguments */
259#define UCLOGIC_PARAMS_FMT_ARGS(_params) \
260 ((_params)->invalid ? "true" : "false"), \
261 (_params)->desc_ptr, \
262 (_params)->desc_size, \

--- 13 unchanged lines hidden (view full) ---

276 (_params)->frame_list[0].desc_size, \
277 (_params)->frame_list[0].id, \
278 (_params)->frame_list[0].suffix, \
279 (_params)->frame_list[0].re_lsb, \
280 (_params)->frame_list[0].dev_id_byte, \
281 (_params)->frame_list[0].touch_ring_byte, \
282 (_params)->frame_list[0].touch_ring_max, \
283 (_params)->frame_list[0].touch_ring_flip_at, \
265 "\t},\n" \
266 "}\n"
267
268/* Tablet interface parameters *printf format arguments */
269#define UCLOGIC_PARAMS_FMT_ARGS(_params) \
270 ((_params)->invalid ? "true" : "false"), \
271 (_params)->desc_ptr, \
272 (_params)->desc_size, \

--- 13 unchanged lines hidden (view full) ---

286 (_params)->frame_list[0].desc_size, \
287 (_params)->frame_list[0].id, \
288 (_params)->frame_list[0].suffix, \
289 (_params)->frame_list[0].re_lsb, \
290 (_params)->frame_list[0].dev_id_byte, \
291 (_params)->frame_list[0].touch_ring_byte, \
292 (_params)->frame_list[0].touch_ring_max, \
293 (_params)->frame_list[0].touch_ring_flip_at, \
294 (_params)->frame_list[0].bitmap_dial_byte, \
284 (_params)->frame_list[1].desc_ptr, \
285 (_params)->frame_list[1].desc_size, \
286 (_params)->frame_list[1].id, \
287 (_params)->frame_list[1].suffix, \
288 (_params)->frame_list[1].re_lsb, \
289 (_params)->frame_list[1].dev_id_byte, \
290 (_params)->frame_list[1].touch_ring_byte, \
291 (_params)->frame_list[1].touch_ring_max, \
292 (_params)->frame_list[1].touch_ring_flip_at, \
295 (_params)->frame_list[1].desc_ptr, \
296 (_params)->frame_list[1].desc_size, \
297 (_params)->frame_list[1].id, \
298 (_params)->frame_list[1].suffix, \
299 (_params)->frame_list[1].re_lsb, \
300 (_params)->frame_list[1].dev_id_byte, \
301 (_params)->frame_list[1].touch_ring_byte, \
302 (_params)->frame_list[1].touch_ring_max, \
303 (_params)->frame_list[1].touch_ring_flip_at, \
304 (_params)->frame_list[1].bitmap_dial_byte, \
293 (_params)->frame_list[2].desc_ptr, \
294 (_params)->frame_list[2].desc_size, \
295 (_params)->frame_list[2].id, \
296 (_params)->frame_list[2].suffix, \
297 (_params)->frame_list[2].re_lsb, \
298 (_params)->frame_list[2].dev_id_byte, \
299 (_params)->frame_list[2].touch_ring_byte, \
300 (_params)->frame_list[2].touch_ring_max, \
305 (_params)->frame_list[2].desc_ptr, \
306 (_params)->frame_list[2].desc_size, \
307 (_params)->frame_list[2].id, \
308 (_params)->frame_list[2].suffix, \
309 (_params)->frame_list[2].re_lsb, \
310 (_params)->frame_list[2].dev_id_byte, \
311 (_params)->frame_list[2].touch_ring_byte, \
312 (_params)->frame_list[2].touch_ring_max, \
301 (_params)->frame_list[2].touch_ring_flip_at
313 (_params)->frame_list[2].touch_ring_flip_at, \
314 (_params)->frame_list[2].bitmap_dial_byte
302
303/* Get a replacement report descriptor for a tablet's interface. */
304extern int uclogic_params_get_desc(const struct uclogic_params *params,
305 __u8 **pdesc,
306 unsigned int *psize);
307
308/* Free resources used by tablet interface's parameters */
309extern void uclogic_params_cleanup(struct uclogic_params *params);
310
311#endif /* _HID_UCLOGIC_PARAMS_H */
315
316/* Get a replacement report descriptor for a tablet's interface. */
317extern int uclogic_params_get_desc(const struct uclogic_params *params,
318 __u8 **pdesc,
319 unsigned int *psize);
320
321/* Free resources used by tablet interface's parameters */
322extern void uclogic_params_cleanup(struct uclogic_params *params);
323
324#endif /* _HID_UCLOGIC_PARAMS_H */