From 3db98e2fedd5601e869b59750648e7c8ba583a33 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Michal=20Mal=C3=BD?= Date: Sun, 2 Aug 2015 02:00:19 +0200 Subject: [PATCH] Handle gain adjustment correctly for ticking effects or effects with an envelope when the device does not support gain natively --- klgd_ff_plugin.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/klgd_ff_plugin.c b/klgd_ff_plugin.c index 9e01c91..d797529 100644 --- a/klgd_ff_plugin.c +++ b/klgd_ff_plugin.c @@ -338,7 +338,7 @@ static void ffpl_recalc_combined(struct klgd_plugin_private *priv, const unsigne ffpl_ramp_to_x_y(eff, &_x, &_y, now); break; default: - printk(KERN_ERR "KLGDFF: Combinable effect handler tried to process an unccombinable effect! This should not happen!\n"); + printk(KERN_ERR "KLGDFF: Combinable effect handler tried to process an uncombinable effect! This should not happen!\n"); break; } @@ -629,8 +629,10 @@ static void ffpl_set_gain_rq(struct input_dev *dev, u16 gain) if (eff->state != FFPL_STARTED) continue; - eff->change = FFPL_TO_UPDATE; - eff->trigger = FFPL_TRIG_NOW; + if (eff->change == FFPL_DONT_TOUCH && eff->trigger != FFPL_TRIG_RECALC) { + eff->change = FFPL_TO_UPDATE; + eff->trigger = FFPL_TRIG_NOW; + } } out: -- 2.43.5