struct ff_device { int (* upload) (struct input_dev *dev, struct ff_effect *effect,struct ff_effect *old); int (* erase) (struct input_dev *dev, int effect_id); int (* playback) (struct input_dev *dev, int effect_id, int value); void (* set_gain) (struct input_dev *dev, u16 gain); void (* set_autocenter) (struct input_dev *dev, u16 magnitude); void (* destroy) (struct ff_device *); void * private; unsigned long ffbit[BITS_TO_LONGS(FF_CNT)]; struct mutex mutex; int max_effects; struct ff_effect * effects; struct file * effect_owners[]; };
upload
erase
playback
set_gain
set_autocenter
destroy
private
ffbit[BITS_TO_LONGS(FF_CNT)]
mutex
max_effects
effects
effect_owners[]
Every force-feedback device must implement upload and playback methods; erase is optional. set_gain and set_autocenter need only be implemented if driver sets up FF_GAIN and FF_AUTOCENTER bits.
Note that playback, set_gain and set_autocenter are called with dev->event_lock spinlock held and interrupts off and thus may not sleep.