aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/input/misc
diff options
context:
space:
mode:
authorHeikki Krogerus <heikki.krogerus@linux.intel.com>2011-12-24 02:57:09 -0500
committerDmitry Torokhov <dmitry.torokhov@gmail.com>2011-12-24 04:06:13 -0500
commit3b5187248bd07e400af081ad777e9aa1e5519ad7 (patch)
treefc81409d6107ad7a9214c1f4693fe84556b00949 /drivers/input/misc
parente948981aa0c97b6fcaa8626eeddb0340e175e9d7 (diff)
Input: mpu3050 - ensure we enable interrupts
This also changes the devname parameter delivered to request_threaded_irq() from "mpu_int" to "mpu3050". Signed-off-by: Heikki Krogerus <heikki.krogerus@linux.intel.com> Signed-off-by: Kirill A. Shutemov <kirill.shutemov@linux.intel.com> Signed-off-by: Alan Cox <alan@linux.intel.com> Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
Diffstat (limited to 'drivers/input/misc')
-rw-r--r--drivers/input/misc/mpu3050.c13
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)
148static int mpu3050_input_open(struct input_dev *input) 148static 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);