twl4030-pwrbutton.c (6e9041c6ddd6cbdc61d87bcaca8ca7bb17c28377) twl4030-pwrbutton.c (c81e592696bbe1224506087eae8b4e02cd7186c3)
1/**
2 * twl4030-pwrbutton.c - TWL4030 Power Button Input Driver
3 *
4 * Copyright (C) 2008-2009 Nokia Corporation
5 *
6 * Written by Peter De Schrijver <peter.de-schrijver@nokia.com>
7 * Several fixes by Felipe Balbi <felipe.balbi@nokia.com>
8 *

--- 38 unchanged lines hidden (view full) ---

47 } else {
48 dev_err(pwr->dev.parent, "twl4030: i2c error %d while reading"
49 " TWL4030 PM_MASTER STS_HW_CONDITIONS register\n", err);
50 }
51
52 return IRQ_HANDLED;
53}
54
1/**
2 * twl4030-pwrbutton.c - TWL4030 Power Button Input Driver
3 *
4 * Copyright (C) 2008-2009 Nokia Corporation
5 *
6 * Written by Peter De Schrijver <peter.de-schrijver@nokia.com>
7 * Several fixes by Felipe Balbi <felipe.balbi@nokia.com>
8 *

--- 38 unchanged lines hidden (view full) ---

47 } else {
48 dev_err(pwr->dev.parent, "twl4030: i2c error %d while reading"
49 " TWL4030 PM_MASTER STS_HW_CONDITIONS register\n", err);
50 }
51
52 return IRQ_HANDLED;
53}
54
55static int __init twl4030_pwrbutton_probe(struct platform_device *pdev)
55static int twl4030_pwrbutton_probe(struct platform_device *pdev)
56{
57 struct input_dev *pwr;
58 int irq = platform_get_irq(pdev, 0);
59 int err;
60
61 pwr = input_allocate_device();
62 if (!pwr) {
63 dev_dbg(&pdev->dev, "Can't allocate power button\n");

--- 37 unchanged lines hidden (view full) ---

101 int irq = platform_get_irq(pdev, 0);
102
103 free_irq(irq, pwr);
104 input_unregister_device(pwr);
105
106 return 0;
107}
108
56{
57 struct input_dev *pwr;
58 int irq = platform_get_irq(pdev, 0);
59 int err;
60
61 pwr = input_allocate_device();
62 if (!pwr) {
63 dev_dbg(&pdev->dev, "Can't allocate power button\n");

--- 37 unchanged lines hidden (view full) ---

101 int irq = platform_get_irq(pdev, 0);
102
103 free_irq(irq, pwr);
104 input_unregister_device(pwr);
105
106 return 0;
107}
108
109#ifdef CONFIG_OF
110static const struct of_device_id twl4030_pwrbutton_dt_match_table[] = {
111 { .compatible = "ti,twl4030-pwrbutton" },
112 {},
113};
114MODULE_DEVICE_TABLE(of, twl4030_pwrbutton_dt_match_table);
115#endif
116
109static struct platform_driver twl4030_pwrbutton_driver = {
117static struct platform_driver twl4030_pwrbutton_driver = {
118 .probe = twl4030_pwrbutton_probe,
110 .remove = __exit_p(twl4030_pwrbutton_remove),
111 .driver = {
112 .name = "twl4030_pwrbutton",
113 .owner = THIS_MODULE,
119 .remove = __exit_p(twl4030_pwrbutton_remove),
120 .driver = {
121 .name = "twl4030_pwrbutton",
122 .owner = THIS_MODULE,
123 .of_match_table = of_match_ptr(twl4030_pwrbutton_dt_match_table),
114 },
115};
124 },
125};
126module_platform_driver(twl4030_pwrbutton_driver);
116
127
117module_platform_driver_probe(twl4030_pwrbutton_driver,
118 twl4030_pwrbutton_probe);
119
120MODULE_ALIAS("platform:twl4030_pwrbutton");
121MODULE_DESCRIPTION("Triton2 Power Button");
122MODULE_LICENSE("GPL");
123MODULE_AUTHOR("Peter De Schrijver <peter.de-schrijver@nokia.com>");
124MODULE_AUTHOR("Felipe Balbi <felipe.balbi@nokia.com>");
125
128MODULE_ALIAS("platform:twl4030_pwrbutton");
129MODULE_DESCRIPTION("Triton2 Power Button");
130MODULE_LICENSE("GPL");
131MODULE_AUTHOR("Peter De Schrijver <peter.de-schrijver@nokia.com>");
132MODULE_AUTHOR("Felipe Balbi <felipe.balbi@nokia.com>");
133