Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input
authorLinus Torvalds <torvalds@linux-foundation.org>
Wed, 4 May 2016 23:07:50 +0000 (16:07 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Wed, 4 May 2016 23:07:50 +0000 (16:07 -0700)
Pull input fixes from Dmitry Torokhov.

* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input:
  Input: atmel_mxt_ts - use mxt_acquire_irq in mxt_soft_reset
  Input: zforce_ts - fix dual touch recognition
  Input: twl6040-vibra - fix atomic schedule panic

drivers/input/misc/twl6040-vibra.c
drivers/input/touchscreen/atmel_mxt_ts.c
drivers/input/touchscreen/zforce_ts.c

index 53e33fa..df3581f 100644 (file)
@@ -181,6 +181,14 @@ static void vibra_play_work(struct work_struct *work)
 {
        struct vibra_info *info = container_of(work,
                                struct vibra_info, play_work);
+       int ret;
+
+       /* Do not allow effect, while the routing is set to use audio */
+       ret = twl6040_get_vibralr_status(info->twl6040);
+       if (ret & TWL6040_VIBSEL) {
+               dev_info(info->dev, "Vibra is configured for audio\n");
+               return;
+       }
 
        mutex_lock(&info->mutex);
 
@@ -199,14 +207,6 @@ static int vibra_play(struct input_dev *input, void *data,
                      struct ff_effect *effect)
 {
        struct vibra_info *info = input_get_drvdata(input);
-       int ret;
-
-       /* Do not allow effect, while the routing is set to use audio */
-       ret = twl6040_get_vibralr_status(info->twl6040);
-       if (ret & TWL6040_VIBSEL) {
-               dev_info(&input->dev, "Vibra is configured for audio\n");
-               return -EBUSY;
-       }
 
        info->weak_speed = effect->u.rumble.weak_magnitude;
        info->strong_speed = effect->u.rumble.strong_magnitude;
index 2160512..5af7907 100644 (file)
@@ -1093,6 +1093,19 @@ static int mxt_t6_command(struct mxt_data *data, u16 cmd_offset,
        return 0;
 }
 
+static int mxt_acquire_irq(struct mxt_data *data)
+{
+       int error;
+
+       enable_irq(data->irq);
+
+       error = mxt_process_messages_until_invalid(data);
+       if (error)
+               return error;
+
+       return 0;
+}
+
 static int mxt_soft_reset(struct mxt_data *data)
 {
        struct device *dev = &data->client->dev;
@@ -1111,7 +1124,7 @@ static int mxt_soft_reset(struct mxt_data *data)
        /* Ignore CHG line for 100ms after reset */
        msleep(100);
 
-       enable_irq(data->irq);
+       mxt_acquire_irq(data);
 
        ret = mxt_wait_for_completion(data, &data->reset_completion,
                                      MXT_RESET_TIMEOUT);
@@ -1466,19 +1479,6 @@ release_mem:
        return ret;
 }
 
-static int mxt_acquire_irq(struct mxt_data *data)
-{
-       int error;
-
-       enable_irq(data->irq);
-
-       error = mxt_process_messages_until_invalid(data);
-       if (error)
-               return error;
-
-       return 0;
-}
-
 static int mxt_get_info(struct mxt_data *data)
 {
        struct i2c_client *client = data->client;
index 9bbadaa..7b3845a 100644 (file)
@@ -370,8 +370,8 @@ static int zforce_touch_event(struct zforce_ts *ts, u8 *payload)
                        point.coord_x = point.coord_y = 0;
                }
 
-               point.state = payload[9 * i + 5] & 0x03;
-               point.id = (payload[9 * i + 5] & 0xfc) >> 2;
+               point.state = payload[9 * i + 5] & 0x0f;
+               point.id = (payload[9 * i + 5] & 0xf0) >> 4;
 
                /* determine touch major, minor and orientation */
                point.area_major = max(payload[9 * i + 6],