summaryrefslogtreecommitdiff
path: root/drivers/input/keyboard/tca6416-keypad.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/input/keyboard/tca6416-keypad.c')
-rw-r--r--drivers/input/keyboard/tca6416-keypad.c31
1 files changed, 10 insertions, 21 deletions
diff --git a/drivers/input/keyboard/tca6416-keypad.c b/drivers/input/keyboard/tca6416-keypad.c
index 2a9755910065..508d84f6d00c 100644
--- a/drivers/input/keyboard/tca6416-keypad.c
+++ b/drivers/input/keyboard/tca6416-keypad.c
@@ -148,7 +148,7 @@ static int tca6416_keys_open(struct input_dev *dev)
if (chip->use_polling)
schedule_delayed_work(&chip->dwork, msecs_to_jiffies(100));
else
- enable_irq(chip->irqnum);
+ enable_irq(chip->client->irq);
return 0;
}
@@ -160,7 +160,7 @@ static void tca6416_keys_close(struct input_dev *dev)
if (chip->use_polling)
cancel_delayed_work_sync(&chip->dwork);
else
- disable_irq(chip->irqnum);
+ disable_irq(chip->client->irq);
}
static int tca6416_setup_registers(struct tca6416_keypad_chip *chip)
@@ -266,12 +266,7 @@ static int tca6416_keypad_probe(struct i2c_client *client,
goto fail1;
if (!chip->use_polling) {
- if (pdata->irq_is_gpio)
- chip->irqnum = gpio_to_irq(client->irq);
- else
- chip->irqnum = client->irq;
-
- error = request_threaded_irq(chip->irqnum, NULL,
+ error = request_threaded_irq(client->irq, NULL,
tca6416_keys_isr,
IRQF_TRIGGER_FALLING |
IRQF_ONESHOT | IRQF_NO_AUTOEN,
@@ -279,7 +274,7 @@ static int tca6416_keypad_probe(struct i2c_client *client,
if (error) {
dev_dbg(&client->dev,
"Unable to claim irq %d; error %d\n",
- chip->irqnum, error);
+ client->irq, error);
goto fail1;
}
}
@@ -297,10 +292,8 @@ static int tca6416_keypad_probe(struct i2c_client *client,
return 0;
fail2:
- if (!chip->use_polling) {
- free_irq(chip->irqnum, chip);
- enable_irq(chip->irqnum);
- }
+ if (!chip->use_polling)
+ free_irq(client->irq, chip);
fail1:
input_free_device(input);
kfree(chip);
@@ -311,10 +304,8 @@ static int tca6416_keypad_remove(struct i2c_client *client)
{
struct tca6416_keypad_chip *chip = i2c_get_clientdata(client);
- if (!chip->use_polling) {
- free_irq(chip->irqnum, chip);
- enable_irq(chip->irqnum);
- }
+ if (!chip->use_polling)
+ free_irq(client->irq, chip);
input_unregister_device(chip->input);
kfree(chip);
@@ -326,10 +317,9 @@ static int tca6416_keypad_remove(struct i2c_client *client)
static int tca6416_keypad_suspend(struct device *dev)
{
struct i2c_client *client = to_i2c_client(dev);
- struct tca6416_keypad_chip *chip = i2c_get_clientdata(client);
if (device_may_wakeup(dev))
- enable_irq_wake(chip->irqnum);
+ enable_irq_wake(client->irq);
return 0;
}
@@ -337,10 +327,9 @@ static int tca6416_keypad_suspend(struct device *dev)
static int tca6416_keypad_resume(struct device *dev)
{
struct i2c_client *client = to_i2c_client(dev);
- struct tca6416_keypad_chip *chip = i2c_get_clientdata(client);
if (device_may_wakeup(dev))
- disable_irq_wake(chip->irqnum);
+ disable_irq_wake(client->irq);
return 0;
}