diff options
Diffstat (limited to 'drivers/input')
-rw-r--r-- | drivers/input/misc/mpu3050.c | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/drivers/input/misc/mpu3050.c b/drivers/input/misc/mpu3050.c index e9a57e3dba08..ebec0baa1e36 100644 --- a/drivers/input/misc/mpu3050.c +++ b/drivers/input/misc/mpu3050.c | |||
@@ -148,9 +148,20 @@ static void mpu3050_set_power_mode(struct i2c_client *client, u8 val) | |||
148 | static int mpu3050_input_open(struct input_dev *input) | 148 | static int mpu3050_input_open(struct input_dev *input) |
149 | { | 149 | { |
150 | struct mpu3050_sensor *sensor = input_get_drvdata(input); | 150 | struct mpu3050_sensor *sensor = input_get_drvdata(input); |
151 | int error; | ||
151 | 152 | ||
152 | pm_runtime_get(sensor->dev); | 153 | pm_runtime_get(sensor->dev); |
153 | 154 | ||
155 | /* Enable interrupts */ | ||
156 | error = i2c_smbus_write_byte_data(sensor->client, MPU3050_INT_CFG, | ||
157 | MPU3050_LATCH_INT_EN | | ||
158 | MPU3050_RAW_RDY_EN | | ||
159 | MPU3050_MPU_RDY_EN); | ||
160 | if (error < 0) { | ||
161 | pm_runtime_put(sensor->dev); | ||
162 | return error; | ||
163 | } | ||
164 | |||
154 | return 0; | 165 | return 0; |
155 | } | 166 | } |
156 | 167 | ||
@@ -259,7 +270,7 @@ static int __devinit mpu3050_probe(struct i2c_client *client, | |||
259 | error = request_threaded_irq(client->irq, | 270 | error = request_threaded_irq(client->irq, |
260 | NULL, mpu3050_interrupt_thread, | 271 | NULL, mpu3050_interrupt_thread, |
261 | IRQF_TRIGGER_RISING, | 272 | IRQF_TRIGGER_RISING, |
262 | "mpu_int", sensor); | 273 | "mpu3050", sensor); |
263 | if (error) { | 274 | if (error) { |
264 | dev_err(&client->dev, | 275 | dev_err(&client->dev, |
265 | "can't get IRQ %d, error %d\n", client->irq, error); | 276 | "can't get IRQ %d, error %d\n", client->irq, error); |