Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input
* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input: Input: fix locking in force-feedback core Input: add KEY_MEDIA_REPEAT definition
This commit is contained in:
commit
e1441b9a41
2 changed files with 13 additions and 8 deletions
|
@ -166,8 +166,10 @@ int input_ff_upload(struct input_dev *dev, struct ff_effect *effect,
|
||||||
if (ret)
|
if (ret)
|
||||||
goto out;
|
goto out;
|
||||||
|
|
||||||
|
spin_lock_irq(&dev->event_lock);
|
||||||
ff->effects[id] = *effect;
|
ff->effects[id] = *effect;
|
||||||
ff->effect_owners[id] = file;
|
ff->effect_owners[id] = file;
|
||||||
|
spin_unlock_irq(&dev->event_lock);
|
||||||
|
|
||||||
out:
|
out:
|
||||||
mutex_unlock(&ff->mutex);
|
mutex_unlock(&ff->mutex);
|
||||||
|
@ -189,15 +191,21 @@ static int erase_effect(struct input_dev *dev, int effect_id,
|
||||||
if (error)
|
if (error)
|
||||||
return error;
|
return error;
|
||||||
|
|
||||||
|
spin_lock_irq(&dev->event_lock);
|
||||||
ff->playback(dev, effect_id, 0);
|
ff->playback(dev, effect_id, 0);
|
||||||
|
ff->effect_owners[effect_id] = NULL;
|
||||||
|
spin_unlock_irq(&dev->event_lock);
|
||||||
|
|
||||||
if (ff->erase) {
|
if (ff->erase) {
|
||||||
error = ff->erase(dev, effect_id);
|
error = ff->erase(dev, effect_id);
|
||||||
if (error)
|
if (error) {
|
||||||
return error;
|
spin_lock_irq(&dev->event_lock);
|
||||||
}
|
ff->effect_owners[effect_id] = file;
|
||||||
|
spin_unlock_irq(&dev->event_lock);
|
||||||
|
|
||||||
ff->effect_owners[effect_id] = NULL;
|
return error;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
@ -263,8 +271,6 @@ int input_ff_event(struct input_dev *dev, unsigned int type,
|
||||||
if (type != EV_FF)
|
if (type != EV_FF)
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
mutex_lock(&ff->mutex);
|
|
||||||
|
|
||||||
switch (code) {
|
switch (code) {
|
||||||
case FF_GAIN:
|
case FF_GAIN:
|
||||||
if (!test_bit(FF_GAIN, dev->ffbit) || value > 0xffff)
|
if (!test_bit(FF_GAIN, dev->ffbit) || value > 0xffff)
|
||||||
|
@ -286,7 +292,6 @@ int input_ff_event(struct input_dev *dev, unsigned int type,
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
mutex_unlock(&ff->mutex);
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
EXPORT_SYMBOL_GPL(input_ff_event);
|
EXPORT_SYMBOL_GPL(input_ff_event);
|
||||||
|
|
|
@ -534,8 +534,8 @@ struct input_absinfo {
|
||||||
|
|
||||||
#define KEY_FRAMEBACK 0x1b4 /* Consumer - transport controls */
|
#define KEY_FRAMEBACK 0x1b4 /* Consumer - transport controls */
|
||||||
#define KEY_FRAMEFORWARD 0x1b5
|
#define KEY_FRAMEFORWARD 0x1b5
|
||||||
|
|
||||||
#define KEY_CONTEXT_MENU 0x1b6 /* GenDesc - system context menu */
|
#define KEY_CONTEXT_MENU 0x1b6 /* GenDesc - system context menu */
|
||||||
|
#define KEY_MEDIA_REPEAT 0x1b7 /* Consumer - transport control */
|
||||||
|
|
||||||
#define KEY_DEL_EOL 0x1c0
|
#define KEY_DEL_EOL 0x1c0
|
||||||
#define KEY_DEL_EOS 0x1c1
|
#define KEY_DEL_EOS 0x1c1
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue