diff options
Diffstat (limited to 'drivers/input/touchscreen/lpc32xx_ts.c')
| -rw-r--r-- | drivers/input/touchscreen/lpc32xx_ts.c | 32 |
1 files changed, 15 insertions, 17 deletions
diff --git a/drivers/input/touchscreen/lpc32xx_ts.c b/drivers/input/touchscreen/lpc32xx_ts.c index dcf803f5a1f..bb47d3442a3 100644 --- a/drivers/input/touchscreen/lpc32xx_ts.c +++ b/drivers/input/touchscreen/lpc32xx_ts.c @@ -15,13 +15,13 @@ */ #include <linux/platform_device.h> -#include <linux/init.h> #include <linux/input.h> #include <linux/interrupt.h> #include <linux/module.h> #include <linux/clk.h> #include <linux/io.h> #include <linux/slab.h> +#include <linux/of.h> /* * Touchscreen controller register offsets @@ -202,7 +202,7 @@ static void lpc32xx_ts_close(struct input_dev *dev) lpc32xx_stop_tsc(tsc); } -static int __devinit lpc32xx_ts_probe(struct platform_device *pdev) +static int lpc32xx_ts_probe(struct platform_device *pdev) { struct lpc32xx_tsc *tsc; struct input_dev *input; @@ -276,7 +276,7 @@ static int __devinit lpc32xx_ts_probe(struct platform_device *pdev) input_set_drvdata(input, tsc); error = request_irq(tsc->irq, lpc32xx_ts_interrupt, - IRQF_DISABLED, pdev->name, tsc); + 0, pdev->name, tsc); if (error) { dev_err(&pdev->dev, "failed requesting interrupt\n"); goto err_put_clock; @@ -308,7 +308,7 @@ err_free_mem: return error; } -static int __devexit lpc32xx_ts_remove(struct platform_device *pdev) +static int lpc32xx_ts_remove(struct platform_device *pdev) { struct lpc32xx_tsc *tsc = platform_get_drvdata(pdev); struct resource *res; @@ -383,27 +383,25 @@ static const struct dev_pm_ops lpc32xx_ts_pm_ops = { #define LPC32XX_TS_PM_OPS NULL #endif +#ifdef CONFIG_OF +static const struct of_device_id lpc32xx_tsc_of_match[] = { + { .compatible = "nxp,lpc3220-tsc", }, + { }, +}; +MODULE_DEVICE_TABLE(of, lpc32xx_tsc_of_match); +#endif + static struct platform_driver lpc32xx_ts_driver = { .probe = lpc32xx_ts_probe, - .remove = __devexit_p(lpc32xx_ts_remove), + .remove = lpc32xx_ts_remove, .driver = { .name = MOD_NAME, .owner = THIS_MODULE, .pm = LPC32XX_TS_PM_OPS, + .of_match_table = of_match_ptr(lpc32xx_tsc_of_match), }, }; - -static int __init lpc32xx_ts_init(void) -{ - return platform_driver_register(&lpc32xx_ts_driver); -} -module_init(lpc32xx_ts_init); - -static void __exit lpc32xx_ts_exit(void) -{ - platform_driver_unregister(&lpc32xx_ts_driver); -} -module_exit(lpc32xx_ts_exit); +module_platform_driver(lpc32xx_ts_driver); MODULE_AUTHOR("Kevin Wells <kevin.wells@nxp.com"); MODULE_DESCRIPTION("LPC32XX TSC Driver"); |
