input.h 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581
  1. /* SPDX-License-Identifier: GPL-2.0-only */
  2. /*
  3. * Copyright (c) 1999-2002 Vojtech Pavlik
  4. */
  5. #ifndef _INPUT_H
  6. #define _INPUT_H
  7. #include <linux/time.h>
  8. #include <linux/list.h>
  9. #include <linux/android_kabi.h>
  10. #include <uapi/linux/input.h>
  11. /* Implementation details, userspace should not care about these */
  12. #define ABS_MT_FIRST ABS_MT_TOUCH_MAJOR
  13. #define ABS_MT_LAST ABS_MT_TOOL_Y
  14. /*
  15. * In-kernel definitions.
  16. */
  17. #include <linux/device.h>
  18. #include <linux/fs.h>
  19. #include <linux/timer.h>
  20. #include <linux/mod_devicetable.h>
  21. struct input_dev_poller;
  22. /**
  23. * struct input_value - input value representation
  24. * @type: type of value (EV_KEY, EV_ABS, etc)
  25. * @code: the value code
  26. * @value: the value
  27. */
  28. struct input_value {
  29. __u16 type;
  30. __u16 code;
  31. __s32 value;
  32. };
  33. enum input_clock_type {
  34. INPUT_CLK_REAL = 0,
  35. INPUT_CLK_MONO,
  36. INPUT_CLK_BOOT,
  37. INPUT_CLK_MAX
  38. };
  39. /**
  40. * struct input_dev - represents an input device
  41. * @name: name of the device
  42. * @phys: physical path to the device in the system hierarchy
  43. * @uniq: unique identification code for the device (if device has it)
  44. * @id: id of the device (struct input_id)
  45. * @propbit: bitmap of device properties and quirks
  46. * @evbit: bitmap of types of events supported by the device (EV_KEY,
  47. * EV_REL, etc.)
  48. * @keybit: bitmap of keys/buttons this device has
  49. * @relbit: bitmap of relative axes for the device
  50. * @absbit: bitmap of absolute axes for the device
  51. * @mscbit: bitmap of miscellaneous events supported by the device
  52. * @ledbit: bitmap of leds present on the device
  53. * @sndbit: bitmap of sound effects supported by the device
  54. * @ffbit: bitmap of force feedback effects supported by the device
  55. * @swbit: bitmap of switches present on the device
  56. * @hint_events_per_packet: average number of events generated by the
  57. * device in a packet (between EV_SYN/SYN_REPORT events). Used by
  58. * event handlers to estimate size of the buffer needed to hold
  59. * events.
  60. * @keycodemax: size of keycode table
  61. * @keycodesize: size of elements in keycode table
  62. * @keycode: map of scancodes to keycodes for this device
  63. * @getkeycode: optional legacy method to retrieve current keymap.
  64. * @setkeycode: optional method to alter current keymap, used to implement
  65. * sparse keymaps. If not supplied default mechanism will be used.
  66. * The method is being called while holding event_lock and thus must
  67. * not sleep
  68. * @ff: force feedback structure associated with the device if device
  69. * supports force feedback effects
  70. * @poller: poller structure associated with the device if device is
  71. * set up to use polling mode
  72. * @repeat_key: stores key code of the last key pressed; used to implement
  73. * software autorepeat
  74. * @timer: timer for software autorepeat
  75. * @rep: current values for autorepeat parameters (delay, rate)
  76. * @mt: pointer to multitouch state
  77. * @absinfo: array of &struct input_absinfo elements holding information
  78. * about absolute axes (current value, min, max, flat, fuzz,
  79. * resolution)
  80. * @key: reflects current state of device's keys/buttons
  81. * @led: reflects current state of device's LEDs
  82. * @snd: reflects current state of sound effects
  83. * @sw: reflects current state of device's switches
  84. * @open: this method is called when the very first user calls
  85. * input_open_device(). The driver must prepare the device
  86. * to start generating events (start polling thread,
  87. * request an IRQ, submit URB, etc.)
  88. * @close: this method is called when the very last user calls
  89. * input_close_device().
  90. * @flush: purges the device. Most commonly used to get rid of force
  91. * feedback effects loaded into the device when disconnecting
  92. * from it
  93. * @event: event handler for events sent _to_ the device, like EV_LED
  94. * or EV_SND. The device is expected to carry out the requested
  95. * action (turn on a LED, play sound, etc.) The call is protected
  96. * by @event_lock and must not sleep
  97. * @grab: input handle that currently has the device grabbed (via
  98. * EVIOCGRAB ioctl). When a handle grabs a device it becomes sole
  99. * recipient for all input events coming from the device
  100. * @event_lock: this spinlock is taken when input core receives
  101. * and processes a new event for the device (in input_event()).
  102. * Code that accesses and/or modifies parameters of a device
  103. * (such as keymap or absmin, absmax, absfuzz, etc.) after device
  104. * has been registered with input core must take this lock.
  105. * @mutex: serializes calls to open(), close() and flush() methods
  106. * @users: stores number of users (input handlers) that opened this
  107. * device. It is used by input_open_device() and input_close_device()
  108. * to make sure that dev->open() is only called when the first
  109. * user opens device and dev->close() is called when the very
  110. * last user closes the device
  111. * @going_away: marks devices that are in a middle of unregistering and
  112. * causes input_open_device*() fail with -ENODEV.
  113. * @dev: driver model's view of this device
  114. * @h_list: list of input handles associated with the device. When
  115. * accessing the list dev->mutex must be held
  116. * @node: used to place the device onto input_dev_list
  117. * @num_vals: number of values queued in the current frame
  118. * @max_vals: maximum number of values queued in a frame
  119. * @vals: array of values queued in the current frame
  120. * @devres_managed: indicates that devices is managed with devres framework
  121. * and needs not be explicitly unregistered or freed.
  122. * @timestamp: storage for a timestamp set by input_set_timestamp called
  123. * by a driver
  124. */
  125. struct input_dev {
  126. const char *name;
  127. const char *phys;
  128. const char *uniq;
  129. struct input_id id;
  130. unsigned long propbit[BITS_TO_LONGS(INPUT_PROP_CNT)];
  131. unsigned long evbit[BITS_TO_LONGS(EV_CNT)];
  132. unsigned long keybit[BITS_TO_LONGS(KEY_CNT)];
  133. unsigned long relbit[BITS_TO_LONGS(REL_CNT)];
  134. unsigned long absbit[BITS_TO_LONGS(ABS_CNT)];
  135. unsigned long mscbit[BITS_TO_LONGS(MSC_CNT)];
  136. unsigned long ledbit[BITS_TO_LONGS(LED_CNT)];
  137. unsigned long sndbit[BITS_TO_LONGS(SND_CNT)];
  138. unsigned long ffbit[BITS_TO_LONGS(FF_CNT)];
  139. unsigned long swbit[BITS_TO_LONGS(SW_CNT)];
  140. unsigned int hint_events_per_packet;
  141. unsigned int keycodemax;
  142. unsigned int keycodesize;
  143. void *keycode;
  144. int (*setkeycode)(struct input_dev *dev,
  145. const struct input_keymap_entry *ke,
  146. unsigned int *old_keycode);
  147. int (*getkeycode)(struct input_dev *dev,
  148. struct input_keymap_entry *ke);
  149. struct ff_device *ff;
  150. struct input_dev_poller *poller;
  151. unsigned int repeat_key;
  152. struct timer_list timer;
  153. int rep[REP_CNT];
  154. struct input_mt *mt;
  155. struct input_absinfo *absinfo;
  156. unsigned long key[BITS_TO_LONGS(KEY_CNT)];
  157. unsigned long led[BITS_TO_LONGS(LED_CNT)];
  158. unsigned long snd[BITS_TO_LONGS(SND_CNT)];
  159. unsigned long sw[BITS_TO_LONGS(SW_CNT)];
  160. int (*open)(struct input_dev *dev);
  161. void (*close)(struct input_dev *dev);
  162. int (*flush)(struct input_dev *dev, struct file *file);
  163. int (*event)(struct input_dev *dev, unsigned int type, unsigned int code, int value);
  164. struct input_handle __rcu *grab;
  165. spinlock_t event_lock;
  166. struct mutex mutex;
  167. unsigned int users;
  168. bool going_away;
  169. struct device dev;
  170. struct list_head h_list;
  171. struct list_head node;
  172. unsigned int num_vals;
  173. unsigned int max_vals;
  174. struct input_value *vals;
  175. bool devres_managed;
  176. ktime_t timestamp[INPUT_CLK_MAX];
  177. ANDROID_KABI_RESERVE(1);
  178. ANDROID_KABI_RESERVE(2);
  179. ANDROID_KABI_RESERVE(3);
  180. ANDROID_KABI_RESERVE(4);
  181. };
  182. #define to_input_dev(d) container_of(d, struct input_dev, dev)
  183. /*
  184. * Verify that we are in sync with input_device_id mod_devicetable.h #defines
  185. */
  186. #if EV_MAX != INPUT_DEVICE_ID_EV_MAX
  187. #error "EV_MAX and INPUT_DEVICE_ID_EV_MAX do not match"
  188. #endif
  189. #if KEY_MIN_INTERESTING != INPUT_DEVICE_ID_KEY_MIN_INTERESTING
  190. #error "KEY_MIN_INTERESTING and INPUT_DEVICE_ID_KEY_MIN_INTERESTING do not match"
  191. #endif
  192. #if KEY_MAX != INPUT_DEVICE_ID_KEY_MAX
  193. #error "KEY_MAX and INPUT_DEVICE_ID_KEY_MAX do not match"
  194. #endif
  195. #if REL_MAX != INPUT_DEVICE_ID_REL_MAX
  196. #error "REL_MAX and INPUT_DEVICE_ID_REL_MAX do not match"
  197. #endif
  198. #if ABS_MAX != INPUT_DEVICE_ID_ABS_MAX
  199. #error "ABS_MAX and INPUT_DEVICE_ID_ABS_MAX do not match"
  200. #endif
  201. #if MSC_MAX != INPUT_DEVICE_ID_MSC_MAX
  202. #error "MSC_MAX and INPUT_DEVICE_ID_MSC_MAX do not match"
  203. #endif
  204. #if LED_MAX != INPUT_DEVICE_ID_LED_MAX
  205. #error "LED_MAX and INPUT_DEVICE_ID_LED_MAX do not match"
  206. #endif
  207. #if SND_MAX != INPUT_DEVICE_ID_SND_MAX
  208. #error "SND_MAX and INPUT_DEVICE_ID_SND_MAX do not match"
  209. #endif
  210. #if FF_MAX != INPUT_DEVICE_ID_FF_MAX
  211. #error "FF_MAX and INPUT_DEVICE_ID_FF_MAX do not match"
  212. #endif
  213. #if SW_MAX != INPUT_DEVICE_ID_SW_MAX
  214. #error "SW_MAX and INPUT_DEVICE_ID_SW_MAX do not match"
  215. #endif
  216. #if INPUT_PROP_MAX != INPUT_DEVICE_ID_PROP_MAX
  217. #error "INPUT_PROP_MAX and INPUT_DEVICE_ID_PROP_MAX do not match"
  218. #endif
  219. #define INPUT_DEVICE_ID_MATCH_DEVICE \
  220. (INPUT_DEVICE_ID_MATCH_BUS | INPUT_DEVICE_ID_MATCH_VENDOR | INPUT_DEVICE_ID_MATCH_PRODUCT)
  221. #define INPUT_DEVICE_ID_MATCH_DEVICE_AND_VERSION \
  222. (INPUT_DEVICE_ID_MATCH_DEVICE | INPUT_DEVICE_ID_MATCH_VERSION)
  223. struct input_handle;
  224. /**
  225. * struct input_handler - implements one of interfaces for input devices
  226. * @private: driver-specific data
  227. * @event: event handler. This method is being called by input core with
  228. * interrupts disabled and dev->event_lock spinlock held and so
  229. * it may not sleep
  230. * @events: event sequence handler. This method is being called by
  231. * input core with interrupts disabled and dev->event_lock
  232. * spinlock held and so it may not sleep
  233. * @filter: similar to @event; separates normal event handlers from
  234. * "filters".
  235. * @match: called after comparing device's id with handler's id_table
  236. * to perform fine-grained matching between device and handler
  237. * @connect: called when attaching a handler to an input device
  238. * @disconnect: disconnects a handler from input device
  239. * @start: starts handler for given handle. This function is called by
  240. * input core right after connect() method and also when a process
  241. * that "grabbed" a device releases it
  242. * @legacy_minors: set to %true by drivers using legacy minor ranges
  243. * @minor: beginning of range of 32 legacy minors for devices this driver
  244. * can provide
  245. * @name: name of the handler, to be shown in /proc/bus/input/handlers
  246. * @id_table: pointer to a table of input_device_ids this driver can
  247. * handle
  248. * @h_list: list of input handles associated with the handler
  249. * @node: for placing the driver onto input_handler_list
  250. *
  251. * Input handlers attach to input devices and create input handles. There
  252. * are likely several handlers attached to any given input device at the
  253. * same time. All of them will get their copy of input event generated by
  254. * the device.
  255. *
  256. * The very same structure is used to implement input filters. Input core
  257. * allows filters to run first and will not pass event to regular handlers
  258. * if any of the filters indicate that the event should be filtered (by
  259. * returning %true from their filter() method).
  260. *
  261. * Note that input core serializes calls to connect() and disconnect()
  262. * methods.
  263. */
  264. struct input_handler {
  265. void *private;
  266. void (*event)(struct input_handle *handle, unsigned int type, unsigned int code, int value);
  267. void (*events)(struct input_handle *handle,
  268. const struct input_value *vals, unsigned int count);
  269. bool (*filter)(struct input_handle *handle, unsigned int type, unsigned int code, int value);
  270. bool (*match)(struct input_handler *handler, struct input_dev *dev);
  271. int (*connect)(struct input_handler *handler, struct input_dev *dev, const struct input_device_id *id);
  272. void (*disconnect)(struct input_handle *handle);
  273. void (*start)(struct input_handle *handle);
  274. bool legacy_minors;
  275. int minor;
  276. const char *name;
  277. const struct input_device_id *id_table;
  278. struct list_head h_list;
  279. struct list_head node;
  280. ANDROID_KABI_RESERVE(1);
  281. };
  282. /**
  283. * struct input_handle - links input device with an input handler
  284. * @private: handler-specific data
  285. * @open: counter showing whether the handle is 'open', i.e. should deliver
  286. * events from its device
  287. * @name: name given to the handle by handler that created it
  288. * @dev: input device the handle is attached to
  289. * @handler: handler that works with the device through this handle
  290. * @d_node: used to put the handle on device's list of attached handles
  291. * @h_node: used to put the handle on handler's list of handles from which
  292. * it gets events
  293. */
  294. struct input_handle {
  295. void *private;
  296. int open;
  297. const char *name;
  298. struct input_dev *dev;
  299. struct input_handler *handler;
  300. struct list_head d_node;
  301. struct list_head h_node;
  302. ANDROID_KABI_RESERVE(1);
  303. };
  304. struct input_dev __must_check *input_allocate_device(void);
  305. struct input_dev __must_check *devm_input_allocate_device(struct device *);
  306. void input_free_device(struct input_dev *dev);
  307. static inline struct input_dev *input_get_device(struct input_dev *dev)
  308. {
  309. return dev ? to_input_dev(get_device(&dev->dev)) : NULL;
  310. }
  311. static inline void input_put_device(struct input_dev *dev)
  312. {
  313. if (dev)
  314. put_device(&dev->dev);
  315. }
  316. static inline void *input_get_drvdata(struct input_dev *dev)
  317. {
  318. return dev_get_drvdata(&dev->dev);
  319. }
  320. static inline void input_set_drvdata(struct input_dev *dev, void *data)
  321. {
  322. dev_set_drvdata(&dev->dev, data);
  323. }
  324. int __must_check input_register_device(struct input_dev *);
  325. void input_unregister_device(struct input_dev *);
  326. void input_reset_device(struct input_dev *);
  327. int input_setup_polling(struct input_dev *dev,
  328. void (*poll_fn)(struct input_dev *dev));
  329. void input_set_poll_interval(struct input_dev *dev, unsigned int interval);
  330. void input_set_min_poll_interval(struct input_dev *dev, unsigned int interval);
  331. void input_set_max_poll_interval(struct input_dev *dev, unsigned int interval);
  332. int input_get_poll_interval(struct input_dev *dev);
  333. int __must_check input_register_handler(struct input_handler *);
  334. void input_unregister_handler(struct input_handler *);
  335. int __must_check input_get_new_minor(int legacy_base, unsigned int legacy_num,
  336. bool allow_dynamic);
  337. void input_free_minor(unsigned int minor);
  338. int input_handler_for_each_handle(struct input_handler *, void *data,
  339. int (*fn)(struct input_handle *, void *));
  340. int input_register_handle(struct input_handle *);
  341. void input_unregister_handle(struct input_handle *);
  342. int input_grab_device(struct input_handle *);
  343. void input_release_device(struct input_handle *);
  344. int input_open_device(struct input_handle *);
  345. void input_close_device(struct input_handle *);
  346. int input_flush_device(struct input_handle *handle, struct file *file);
  347. void input_set_timestamp(struct input_dev *dev, ktime_t timestamp);
  348. ktime_t *input_get_timestamp(struct input_dev *dev);
  349. void input_event(struct input_dev *dev, unsigned int type, unsigned int code, int value);
  350. void input_inject_event(struct input_handle *handle, unsigned int type, unsigned int code, int value);
  351. static inline void input_report_key(struct input_dev *dev, unsigned int code, int value)
  352. {
  353. input_event(dev, EV_KEY, code, !!value);
  354. }
  355. static inline void input_report_rel(struct input_dev *dev, unsigned int code, int value)
  356. {
  357. input_event(dev, EV_REL, code, value);
  358. }
  359. static inline void input_report_abs(struct input_dev *dev, unsigned int code, int value)
  360. {
  361. input_event(dev, EV_ABS, code, value);
  362. }
  363. static inline void input_report_ff_status(struct input_dev *dev, unsigned int code, int value)
  364. {
  365. input_event(dev, EV_FF_STATUS, code, value);
  366. }
  367. static inline void input_report_switch(struct input_dev *dev, unsigned int code, int value)
  368. {
  369. input_event(dev, EV_SW, code, !!value);
  370. }
  371. static inline void input_sync(struct input_dev *dev)
  372. {
  373. input_event(dev, EV_SYN, SYN_REPORT, 0);
  374. }
  375. static inline void input_mt_sync(struct input_dev *dev)
  376. {
  377. input_event(dev, EV_SYN, SYN_MT_REPORT, 0);
  378. }
  379. void input_set_capability(struct input_dev *dev, unsigned int type, unsigned int code);
  380. /**
  381. * input_set_events_per_packet - tell handlers about the driver event rate
  382. * @dev: the input device used by the driver
  383. * @n_events: the average number of events between calls to input_sync()
  384. *
  385. * If the event rate sent from a device is unusually large, use this
  386. * function to set the expected event rate. This will allow handlers
  387. * to set up an appropriate buffer size for the event stream, in order
  388. * to minimize information loss.
  389. */
  390. static inline void input_set_events_per_packet(struct input_dev *dev, int n_events)
  391. {
  392. dev->hint_events_per_packet = n_events;
  393. }
  394. void input_alloc_absinfo(struct input_dev *dev);
  395. void input_set_abs_params(struct input_dev *dev, unsigned int axis,
  396. int min, int max, int fuzz, int flat);
  397. #define INPUT_GENERATE_ABS_ACCESSORS(_suffix, _item) \
  398. static inline int input_abs_get_##_suffix(struct input_dev *dev, \
  399. unsigned int axis) \
  400. { \
  401. return dev->absinfo ? dev->absinfo[axis]._item : 0; \
  402. } \
  403. \
  404. static inline void input_abs_set_##_suffix(struct input_dev *dev, \
  405. unsigned int axis, int val) \
  406. { \
  407. input_alloc_absinfo(dev); \
  408. if (dev->absinfo) \
  409. dev->absinfo[axis]._item = val; \
  410. }
  411. INPUT_GENERATE_ABS_ACCESSORS(val, value)
  412. INPUT_GENERATE_ABS_ACCESSORS(min, minimum)
  413. INPUT_GENERATE_ABS_ACCESSORS(max, maximum)
  414. INPUT_GENERATE_ABS_ACCESSORS(fuzz, fuzz)
  415. INPUT_GENERATE_ABS_ACCESSORS(flat, flat)
  416. INPUT_GENERATE_ABS_ACCESSORS(res, resolution)
  417. int input_scancode_to_scalar(const struct input_keymap_entry *ke,
  418. unsigned int *scancode);
  419. int input_get_keycode(struct input_dev *dev, struct input_keymap_entry *ke);
  420. int input_set_keycode(struct input_dev *dev,
  421. const struct input_keymap_entry *ke);
  422. bool input_match_device_id(const struct input_dev *dev,
  423. const struct input_device_id *id);
  424. void input_enable_softrepeat(struct input_dev *dev, int delay, int period);
  425. extern struct class input_class;
  426. /**
  427. * struct ff_device - force-feedback part of an input device
  428. * @upload: Called to upload an new effect into device
  429. * @erase: Called to erase an effect from device
  430. * @playback: Called to request device to start playing specified effect
  431. * @set_gain: Called to set specified gain
  432. * @set_autocenter: Called to auto-center device
  433. * @destroy: called by input core when parent input device is being
  434. * destroyed
  435. * @private: driver-specific data, will be freed automatically
  436. * @ffbit: bitmap of force feedback capabilities truly supported by
  437. * device (not emulated like ones in input_dev->ffbit)
  438. * @mutex: mutex for serializing access to the device
  439. * @max_effects: maximum number of effects supported by device
  440. * @effects: pointer to an array of effects currently loaded into device
  441. * @effect_owners: array of effect owners; when file handle owning
  442. * an effect gets closed the effect is automatically erased
  443. *
  444. * Every force-feedback device must implement upload() and playback()
  445. * methods; erase() is optional. set_gain() and set_autocenter() need
  446. * only be implemented if driver sets up FF_GAIN and FF_AUTOCENTER
  447. * bits.
  448. *
  449. * Note that playback(), set_gain() and set_autocenter() are called with
  450. * dev->event_lock spinlock held and interrupts off and thus may not
  451. * sleep.
  452. */
  453. struct ff_device {
  454. int (*upload)(struct input_dev *dev, struct ff_effect *effect,
  455. struct ff_effect *old);
  456. int (*erase)(struct input_dev *dev, int effect_id);
  457. int (*playback)(struct input_dev *dev, int effect_id, int value);
  458. void (*set_gain)(struct input_dev *dev, u16 gain);
  459. void (*set_autocenter)(struct input_dev *dev, u16 magnitude);
  460. void (*destroy)(struct ff_device *);
  461. void *private;
  462. unsigned long ffbit[BITS_TO_LONGS(FF_CNT)];
  463. struct mutex mutex;
  464. int max_effects;
  465. struct ff_effect *effects;
  466. ANDROID_KABI_RESERVE(1);
  467. struct file *effect_owners[];
  468. };
  469. int input_ff_create(struct input_dev *dev, unsigned int max_effects);
  470. void input_ff_destroy(struct input_dev *dev);
  471. int input_ff_event(struct input_dev *dev, unsigned int type, unsigned int code, int value);
  472. int input_ff_upload(struct input_dev *dev, struct ff_effect *effect, struct file *file);
  473. int input_ff_erase(struct input_dev *dev, int effect_id, struct file *file);
  474. int input_ff_flush(struct input_dev *dev, struct file *file);
  475. int input_ff_create_memless(struct input_dev *dev, void *data,
  476. int (*play_effect)(struct input_dev *, void *, struct ff_effect *));
  477. #endif