gpio_mouse.c (4e73e0eb633f8a1b5cbf20e7f42c6dbfec1d1ca7) | gpio_mouse.c (eeafa5ef6de5acf678624a21f7dba7d43ba73845) |
---|---|
1/* 2 * Driver for simulating a mouse on GPIO lines. 3 * 4 * Copyright (C) 2007 Atmel Corporation 5 * 6 * This program is free software; you can redistribute it and/or modify 7 * it under the terms of the GNU General Public License version 2 as 8 * published by the Free Software Foundation. --- 32 unchanged lines hidden (view full) --- 41 y = (gpio_get_value(gpio->down) ^ gpio->polarity) 42 - (gpio_get_value(gpio->up) ^ gpio->polarity); 43 44 input_report_rel(input, REL_X, x); 45 input_report_rel(input, REL_Y, y); 46 input_sync(input); 47} 48 | 1/* 2 * Driver for simulating a mouse on GPIO lines. 3 * 4 * Copyright (C) 2007 Atmel Corporation 5 * 6 * This program is free software; you can redistribute it and/or modify 7 * it under the terms of the GNU General Public License version 2 as 8 * published by the Free Software Foundation. --- 32 unchanged lines hidden (view full) --- 41 y = (gpio_get_value(gpio->down) ^ gpio->polarity) 42 - (gpio_get_value(gpio->up) ^ gpio->polarity); 43 44 input_report_rel(input, REL_X, x); 45 input_report_rel(input, REL_Y, y); 46 input_sync(input); 47} 48 |
49static int __init gpio_mouse_probe(struct platform_device *pdev) | 49static int __devinit gpio_mouse_probe(struct platform_device *pdev) |
50{ 51 struct gpio_mouse_platform_data *pdata = pdev->dev.platform_data; 52 struct input_polled_dev *input_poll; 53 struct input_dev *input; 54 int pin, i; 55 int error; 56 57 if (!pdata) { --- 107 unchanged lines hidden (view full) --- 165 gpio_free(pin); 166 } 167 168 platform_set_drvdata(pdev, NULL); 169 170 return 0; 171} 172 | 50{ 51 struct gpio_mouse_platform_data *pdata = pdev->dev.platform_data; 52 struct input_polled_dev *input_poll; 53 struct input_dev *input; 54 int pin, i; 55 int error; 56 57 if (!pdata) { --- 107 unchanged lines hidden (view full) --- 165 gpio_free(pin); 166 } 167 168 platform_set_drvdata(pdev, NULL); 169 170 return 0; 171} 172 |
173/* work with hotplug and coldplug */ 174MODULE_ALIAS("platform:gpio_mouse"); 175 | |
176static struct platform_driver gpio_mouse_device_driver = { | 173static struct platform_driver gpio_mouse_device_driver = { |
174 .probe = gpio_mouse_probe, |
|
177 .remove = __devexit_p(gpio_mouse_remove), 178 .driver = { 179 .name = "gpio_mouse", 180 .owner = THIS_MODULE, 181 } 182}; 183 184static int __init gpio_mouse_init(void) 185{ | 175 .remove = __devexit_p(gpio_mouse_remove), 176 .driver = { 177 .name = "gpio_mouse", 178 .owner = THIS_MODULE, 179 } 180}; 181 182static int __init gpio_mouse_init(void) 183{ |
186 return platform_driver_probe(&gpio_mouse_device_driver, 187 gpio_mouse_probe); | 184 return platform_driver_register(&gpio_mouse_device_driver); |
188} 189module_init(gpio_mouse_init); 190 191static void __exit gpio_mouse_exit(void) 192{ 193 platform_driver_unregister(&gpio_mouse_device_driver); 194} 195module_exit(gpio_mouse_exit); 196 197MODULE_AUTHOR("Hans-Christian Egtvedt <hcegtvedt@atmel.com>"); 198MODULE_DESCRIPTION("GPIO mouse driver"); 199MODULE_LICENSE("GPL"); | 185} 186module_init(gpio_mouse_init); 187 188static void __exit gpio_mouse_exit(void) 189{ 190 platform_driver_unregister(&gpio_mouse_device_driver); 191} 192module_exit(gpio_mouse_exit); 193 194MODULE_AUTHOR("Hans-Christian Egtvedt <hcegtvedt@atmel.com>"); 195MODULE_DESCRIPTION("GPIO mouse driver"); 196MODULE_LICENSE("GPL"); |
197MODULE_ALIAS("platform:gpio_mouse"); /* work with hotplug and coldplug */ 198 |
|