static bool ffpl_replace_effect(const struct ff_effect *ac_eff, const struct ff_effect *la_eff);
+/* Destroy request - input device is being destroyed */
static void ffpl_destroy_rq(struct ff_device *ff)
{
struct klgd_plugin *self = ff->private;
ff->private = NULL;
}
+/* Erase request coming from userspace */
static int ffpl_erase_rq(struct input_dev *dev, int effect_id)
{
struct klgd_plugin *self = dev->ff->private;
return 0;
}
-
+
+/* Playback request coming from userspace */
static int ffpl_playback_rq(struct input_dev *dev, int effect_id, int value)
{
struct klgd_plugin *self = dev->ff->private;
return 0;
}
+/* Upload request coming from userspace */
static int ffpl_upload_rq(struct input_dev *dev, struct ff_effect *effect, struct ff_effect *old)
{
struct klgd_plugin *self = dev->ff->private;
/* State change flags */
enum ffpl_st_change {
- FFPL_DONT_TOUCH,
- FFPL_TO_UPLOAD,
- FFPL_TO_START,
- FFPL_TO_STOP,
- FFPL_TO_ERASE,
- FFPL_TO_UPDATE
+ FFPL_DONT_TOUCH, /* Effect has not been changed since last update */
+ FFPL_TO_UPLOAD, /* Effect shall be uploaded to device */
+ FFPL_TO_START, /* Effect shall be started */
+ FFPL_TO_STOP, /* Effect shall be stopped */
+ FFPL_TO_ERASE, /* Effect shall be removed from device */
+ FFPL_TO_UPDATE /* Effect paramaters shall be updated */
};
/* Status flags */
enum ffpl_state {
- FFPL_EMPTY,
- FFPL_UPLOADED,
- FFPL_STARTED,
+ FFPL_EMPTY, /* There is no effect in the slot */
+ FFPL_UPLOADED, /* Effect in the slot is uploaded to device */
+ FFPL_STARTED, /* Effect in the slot is started on device */
};
struct ffpl_effect {
- struct ff_effect *active;
- struct ff_effect *latest;
- enum ffpl_st_change change;
- enum ffpl_state state;
- bool replace;
+ struct ff_effect *active; /* Last effect submitted to device */
+ struct ff_effect *latest; /* Last effect submitted to us by userspace */
+ enum ffpl_st_change change; /* State to which the effect shall be put */
+ enum ffpl_state state; /* State of the active effect */
+ bool replace; /* Active effect has to be replaced => active effect shall be erased and latest uploaded */
};
struct klgd_plugin_private {