Commit 21a9703d authored by Linus Torvalds's avatar Linus Torvalds

Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input

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
parents 4810d968 eb43335c
...@@ -181,6 +181,14 @@ static void vibra_play_work(struct work_struct *work) ...@@ -181,6 +181,14 @@ static void vibra_play_work(struct work_struct *work)
{ {
struct vibra_info *info = container_of(work, struct vibra_info *info = container_of(work,
struct vibra_info, play_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); mutex_lock(&info->mutex);
...@@ -199,14 +207,6 @@ static int vibra_play(struct input_dev *input, void *data, ...@@ -199,14 +207,6 @@ static int vibra_play(struct input_dev *input, void *data,
struct ff_effect *effect) struct ff_effect *effect)
{ {
struct vibra_info *info = input_get_drvdata(input); 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->weak_speed = effect->u.rumble.weak_magnitude;
info->strong_speed = effect->u.rumble.strong_magnitude; info->strong_speed = effect->u.rumble.strong_magnitude;
......
...@@ -1093,6 +1093,19 @@ static int mxt_t6_command(struct mxt_data *data, u16 cmd_offset, ...@@ -1093,6 +1093,19 @@ static int mxt_t6_command(struct mxt_data *data, u16 cmd_offset,
return 0; 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) static int mxt_soft_reset(struct mxt_data *data)
{ {
struct device *dev = &data->client->dev; struct device *dev = &data->client->dev;
...@@ -1111,7 +1124,7 @@ static int mxt_soft_reset(struct mxt_data *data) ...@@ -1111,7 +1124,7 @@ static int mxt_soft_reset(struct mxt_data *data)
/* Ignore CHG line for 100ms after reset */ /* Ignore CHG line for 100ms after reset */
msleep(100); msleep(100);
enable_irq(data->irq); mxt_acquire_irq(data);
ret = mxt_wait_for_completion(data, &data->reset_completion, ret = mxt_wait_for_completion(data, &data->reset_completion,
MXT_RESET_TIMEOUT); MXT_RESET_TIMEOUT);
...@@ -1466,19 +1479,6 @@ static int mxt_update_cfg(struct mxt_data *data, const struct firmware *cfg) ...@@ -1466,19 +1479,6 @@ static int mxt_update_cfg(struct mxt_data *data, const struct firmware *cfg)
return ret; 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) static int mxt_get_info(struct mxt_data *data)
{ {
struct i2c_client *client = data->client; struct i2c_client *client = data->client;
......
...@@ -370,8 +370,8 @@ static int zforce_touch_event(struct zforce_ts *ts, u8 *payload) ...@@ -370,8 +370,8 @@ static int zforce_touch_event(struct zforce_ts *ts, u8 *payload)
point.coord_x = point.coord_y = 0; point.coord_x = point.coord_y = 0;
} }
point.state = payload[9 * i + 5] & 0x03; point.state = payload[9 * i + 5] & 0x0f;
point.id = (payload[9 * i + 5] & 0xfc) >> 2; point.id = (payload[9 * i + 5] & 0xf0) >> 4;
/* determine touch major, minor and orientation */ /* determine touch major, minor and orientation */
point.area_major = max(payload[9 * i + 6], point.area_major = max(payload[9 * i + 6],
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment