mirror of
https://mirrors.bfsu.edu.cn/git/linux.git
synced 2024-11-17 09:14:19 +08:00
Input: da9052_onkey.c: Convert to the new da9052 interrupt functions.
Use the new da9052 irq functions and allow the driver to probe successfully. Cc: Dmitry Torokhov <dmitry.torokhov@gmail.com> Cc: <linux-input@vger.kernel.org> Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com> Reviewed-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
This commit is contained in:
parent
8f520803d2
commit
21eed07d12
@ -24,7 +24,6 @@ struct da9052_onkey {
|
|||||||
struct da9052 *da9052;
|
struct da9052 *da9052;
|
||||||
struct input_dev *input;
|
struct input_dev *input;
|
||||||
struct delayed_work work;
|
struct delayed_work work;
|
||||||
unsigned int irq;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
static void da9052_onkey_query(struct da9052_onkey *onkey)
|
static void da9052_onkey_query(struct da9052_onkey *onkey)
|
||||||
@ -76,7 +75,6 @@ static int __devinit da9052_onkey_probe(struct platform_device *pdev)
|
|||||||
struct da9052 *da9052 = dev_get_drvdata(pdev->dev.parent);
|
struct da9052 *da9052 = dev_get_drvdata(pdev->dev.parent);
|
||||||
struct da9052_onkey *onkey;
|
struct da9052_onkey *onkey;
|
||||||
struct input_dev *input_dev;
|
struct input_dev *input_dev;
|
||||||
int irq;
|
|
||||||
int error;
|
int error;
|
||||||
|
|
||||||
if (!da9052) {
|
if (!da9052) {
|
||||||
@ -84,13 +82,6 @@ static int __devinit da9052_onkey_probe(struct platform_device *pdev)
|
|||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
}
|
}
|
||||||
|
|
||||||
irq = platform_get_irq_byname(pdev, "ONKEY");
|
|
||||||
if (irq < 0) {
|
|
||||||
dev_err(&pdev->dev,
|
|
||||||
"Failed to get an IRQ for input device, %d\n", irq);
|
|
||||||
return -EINVAL;
|
|
||||||
}
|
|
||||||
|
|
||||||
onkey = kzalloc(sizeof(*onkey), GFP_KERNEL);
|
onkey = kzalloc(sizeof(*onkey), GFP_KERNEL);
|
||||||
input_dev = input_allocate_device();
|
input_dev = input_allocate_device();
|
||||||
if (!onkey || !input_dev) {
|
if (!onkey || !input_dev) {
|
||||||
@ -101,7 +92,6 @@ static int __devinit da9052_onkey_probe(struct platform_device *pdev)
|
|||||||
|
|
||||||
onkey->input = input_dev;
|
onkey->input = input_dev;
|
||||||
onkey->da9052 = da9052;
|
onkey->da9052 = da9052;
|
||||||
onkey->irq = irq;
|
|
||||||
INIT_DELAYED_WORK(&onkey->work, da9052_onkey_work);
|
INIT_DELAYED_WORK(&onkey->work, da9052_onkey_work);
|
||||||
|
|
||||||
input_dev->name = "da9052-onkey";
|
input_dev->name = "da9052-onkey";
|
||||||
@ -111,13 +101,11 @@ static int __devinit da9052_onkey_probe(struct platform_device *pdev)
|
|||||||
input_dev->evbit[0] = BIT_MASK(EV_KEY);
|
input_dev->evbit[0] = BIT_MASK(EV_KEY);
|
||||||
__set_bit(KEY_POWER, input_dev->keybit);
|
__set_bit(KEY_POWER, input_dev->keybit);
|
||||||
|
|
||||||
error = request_threaded_irq(onkey->irq, NULL, da9052_onkey_irq,
|
error = da9052_request_irq(onkey->da9052, DA9052_IRQ_NONKEY, "ONKEY",
|
||||||
IRQF_TRIGGER_LOW | IRQF_ONESHOT,
|
da9052_onkey_irq, onkey);
|
||||||
"ONKEY", onkey);
|
|
||||||
if (error < 0) {
|
if (error < 0) {
|
||||||
dev_err(onkey->da9052->dev,
|
dev_err(onkey->da9052->dev,
|
||||||
"Failed to register ONKEY IRQ %d, error = %d\n",
|
"Failed to register ONKEY IRQ: %d\n", error);
|
||||||
onkey->irq, error);
|
|
||||||
goto err_free_mem;
|
goto err_free_mem;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -132,7 +120,7 @@ static int __devinit da9052_onkey_probe(struct platform_device *pdev)
|
|||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
err_free_irq:
|
err_free_irq:
|
||||||
free_irq(onkey->irq, onkey);
|
da9052_free_irq(onkey->da9052, DA9052_IRQ_NONKEY, onkey);
|
||||||
cancel_delayed_work_sync(&onkey->work);
|
cancel_delayed_work_sync(&onkey->work);
|
||||||
err_free_mem:
|
err_free_mem:
|
||||||
input_free_device(input_dev);
|
input_free_device(input_dev);
|
||||||
@ -145,7 +133,7 @@ static int __devexit da9052_onkey_remove(struct platform_device *pdev)
|
|||||||
{
|
{
|
||||||
struct da9052_onkey *onkey = platform_get_drvdata(pdev);
|
struct da9052_onkey *onkey = platform_get_drvdata(pdev);
|
||||||
|
|
||||||
free_irq(onkey->irq, onkey);
|
da9052_free_irq(onkey->da9052, DA9052_IRQ_NONKEY, onkey);
|
||||||
cancel_delayed_work_sync(&onkey->work);
|
cancel_delayed_work_sync(&onkey->work);
|
||||||
|
|
||||||
input_unregister_device(onkey->input);
|
input_unregister_device(onkey->input);
|
||||||
|
Loading…
Reference in New Issue
Block a user