diff options
author | Heikki Krogerus <heikki.krogerus@linux.intel.com> | 2011-12-24 08:57:09 +0100 |
---|---|---|
committer | Dmitry Torokhov <dmitry.torokhov@gmail.com> | 2011-12-24 10:06:13 +0100 |
commit | 3b5187248bd07e400af081ad777e9aa1e5519ad7 (patch) | |
tree | fc81409d6107ad7a9214c1f4693fe84556b00949 /drivers/input | |
parent | Input: mpu3050 - add of_match table for device-tree probing (diff) | |
download | linux-3b5187248bd07e400af081ad777e9aa1e5519ad7.tar.xz linux-3b5187248bd07e400af081ad777e9aa1e5519ad7.zip |
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')
-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) static int mpu3050_input_open(struct input_dev *input) { struct mpu3050_sensor *sensor = input_get_drvdata(input); + int error; pm_runtime_get(sensor->dev); + /* Enable interrupts */ + error = i2c_smbus_write_byte_data(sensor->client, MPU3050_INT_CFG, + MPU3050_LATCH_INT_EN | + MPU3050_RAW_RDY_EN | + MPU3050_MPU_RDY_EN); + if (error < 0) { + pm_runtime_put(sensor->dev); + return error; + } + return 0; } @@ -259,7 +270,7 @@ static int __devinit mpu3050_probe(struct i2c_client *client, error = request_threaded_irq(client->irq, NULL, mpu3050_interrupt_thread, IRQF_TRIGGER_RISING, - "mpu_int", sensor); + "mpu3050", sensor); if (error) { dev_err(&client->dev, "can't get IRQ %d, error %d\n", client->irq, error); |