input.h 20 KB

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