]> Devoid-pointer.net GitWeb - KLGD_FF_plugin.git/commitdiff
Set state change to TO_UPLOAD when effect is to be replaced
authorMichal Malý <madcatxster@devoid-pointer.net>
Wed, 1 Oct 2014 13:14:23 +0000 (15:14 +0200)
committerMichal Malý <madcatxster@devoid-pointer.net>
Wed, 1 Oct 2014 13:14:23 +0000 (15:14 +0200)
klgd_ff_plugin.c
klgdff.c

index b12b9e440ea374885d4d87cb785b9dc8feae33d9..9ad78a40c7577bf94bf9b5684266190898f62d0c 100644 (file)
@@ -201,9 +201,10 @@ static int ffpl_upload_rq(struct input_dev *dev, struct ff_effect *effect, struc
        eff->latest = *effect;
 
        if (eff->state != FFPL_EMPTY) {
-               if (ffpl_needs_replacing(&eff->active, &eff->latest))
+               if (ffpl_needs_replacing(&eff->active, &eff->latest)) {
                        eff->replace = true;
-               else {
+                       eff->change = FFPL_TO_UPLOAD;
+               } else {
                        eff->replace = false;
                        eff->change = FFPL_TO_UPDATE;
                }
@@ -322,6 +323,7 @@ static struct klgd_command_stream * ffpl_get_commands(struct klgd_plugin *self,
                                        ret = ffpl_start_effect(priv, s, eff);
                                        break;
                                }
+                               break;
                        case FFPL_DONT_TOUCH:
                                printk(KERN_WARNING "Got FFPL_DONT_TOUCH change for effect that should be replaced - this should not happen!\n");
                                break;
index 90719ecba15485ccd2ea09e0bebff8b823bf6107..63e0b337334b8d13532b71f89b26341695398fdd 100644 (file)
--- a/klgdff.c
+++ b/klgdff.c
@@ -248,7 +248,7 @@ static int __init klgdff_init(void)
        input_set_abs_params(dev, ABS_Y, -0x7fff, 0x7fff, 0, 0);
 
        ret = ffpl_init_plugin(&ff_plugin, dev, EFFECT_COUNT, ffbits,
-                              FFPL_UPLOAD_WHEN_STARTED | FFPL_REPLACE_STARTED,
+                              FFPL_HAS_EMP_TO_SRT | FFPL_REPLACE_STARTED,
                               klgdff_control);
        if (ret) {
                printk(KERN_ERR "KLGDFF: Cannot init plugin\n");