'\" t .\" Title: struct ff_device .\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] .\" Generator: DocBook XSL Stylesheets v1.78.1 .\" Date: January 2017 .\" Manual: Input Subsystem .\" Source: Kernel Hackers Manual 4.8.15 .\" Language: English .\" .TH "STRUCT FF_DEVICE" "9" "January 2017" "Kernel Hackers Manual 4\&.8\&." "Input Subsystem" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .\" http://bugs.debian.org/507673 .\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" ----------------------------------------------------------------- .\" * set default formatting .\" ----------------------------------------------------------------- .\" disable hyphenation .nh .\" disable justification (adjust text to left margin only) .ad l .\" ----------------------------------------------------------------- .\" * MAIN CONTENT STARTS HERE * .\" ----------------------------------------------------------------- .SH "NAME" struct_ff_device \- force\-feedback part of an input device .SH "SYNOPSIS" .sp .nf 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[]; }; .fi .SH "MEMBERS" .PP upload .RS 4 Called to upload an new effect into device .RE .PP erase .RS 4 Called to erase an effect from device .RE .PP playback .RS 4 Called to request device to start playing specified effect .RE .PP set_gain .RS 4 Called to set specified gain .RE .PP set_autocenter .RS 4 Called to auto\-center device .RE .PP destroy .RS 4 called by input core when parent input device is being destroyed .RE .PP private .RS 4 driver\-specific data, will be freed automatically .RE .PP ffbit[BITS_TO_LONGS(FF_CNT)] .RS 4 bitmap of force feedback capabilities truly supported by device (not emulated like ones in input_dev\->ffbit) .RE .PP mutex .RS 4 mutex for serializing access to the device .RE .PP max_effects .RS 4 maximum number of effects supported by device .RE .PP effects .RS 4 pointer to an array of effects currently loaded into device .RE .PP effect_owners[] .RS 4 array of effect owners; when file handle owning an effect gets closed the effect is automatically erased .RE .SH "DESCRIPTION" .PP Every force\-feedback device must implement \fBupload\fR and \fBplayback\fR methods; \fBerase\fR is optional\&. \fBset_gain\fR and \fBset_autocenter\fR need only be implemented if driver sets up FF_GAIN and FF_AUTOCENTER bits\&. .PP Note that \fBplayback\fR, \fBset_gain\fR and \fBset_autocenter\fR are called with dev\->event_lock spinlock held and interrupts off and thus may not sleep\&. .SH "COPYRIGHT" .br