From: <sle...@us...> - 2007-06-22 20:03:26
|
Revision: 1045 http://svn.sourceforge.net/hackndev/?rev=1045&view=rev Author: sleep_walker Date: 2007-06-22 13:03:14 -0700 (Fri, 22 Jun 2007) Log Message: ----------- l4p: 'platform_device'ed tsc2101, SUSPEND/RESUME works on T|T3! Modified Paths: -------------- linux4palm/linux/trunk/drivers/input/touchscreen/tsc2101_ts.c linux4palm/linux/trunk/drivers/mfd/tsc2101.c Modified: linux4palm/linux/trunk/drivers/input/touchscreen/tsc2101_ts.c =================================================================== --- linux4palm/linux/trunk/drivers/input/touchscreen/tsc2101_ts.c 2007-06-22 19:19:08 UTC (rev 1044) +++ linux4palm/linux/trunk/drivers/input/touchscreen/tsc2101_ts.c 2007-06-22 20:03:14 UTC (rev 1045) @@ -17,6 +17,7 @@ #include <linux/input.h> #include <linux/module.h> #include <linux/soc/tsc2101.h> +#include <linux/platform_device.h> #ifdef CONFIG_TOUCHSCREEN_TSC2101 #define X_AXIS_MAX 3800 @@ -45,9 +46,9 @@ return; } -void tsc2101_ts_setup(struct device *dev) +void tsc2101_ts_setup(struct platform_device *dev) { - struct tsc2101_data *tsc2101_ts = dev_get_drvdata(dev); + struct tsc2101_data *tsc2101_ts = platform_get_drvdata(dev); struct input_dev *input_dev; //init_input_dev(&(tsc2101_ts->inputdevice)); Modified: linux4palm/linux/trunk/drivers/mfd/tsc2101.c =================================================================== --- linux4palm/linux/trunk/drivers/mfd/tsc2101.c 2007-06-22 19:19:08 UTC (rev 1044) +++ linux4palm/linux/trunk/drivers/mfd/tsc2101.c 2007-06-22 20:03:14 UTC (rev 1045) @@ -23,7 +23,7 @@ #include <linux/platform_device.h> #include "tsc2101.h" -extern void tsc2101_ts_setup(struct device *dev); +extern void tsc2101_ts_setup(struct platform_device *dev); extern void tsc2101_ts_report(struct tsc2101_data *devdata, int x, int y, int p, int pendown); static int tsc2101_regread(struct tsc2101_data *devdata, int regnum) @@ -227,9 +227,9 @@ mod_timer(&(devdata->misc_timer), jiffies + HZ); } -void tsc2101_print_miscdata(struct device *dev) +void tsc2101_print_miscdata(struct platform_device *dev) { - struct tsc2101_data *devdata = dev_get_drvdata(dev); + struct tsc2101_data *devdata = platform_get_drvdata(dev); printk(KERN_ERR "TSC2101 Bat: %04x\n",devdata->miscdata.bat); printk(KERN_ERR "TSC2101 Aux1: %04x\n",devdata->miscdata.aux1); @@ -238,9 +238,9 @@ printk(KERN_ERR "TSC2101 Temp2: %04x\n",devdata->miscdata.temp2); } -static int tsc2101_suspend(struct device *dev, pm_message_t state) +static int tsc2101_suspend(struct platform_device *dev, pm_message_t state) { - struct tsc2101_data *devdata = dev_get_drvdata(dev); + struct tsc2101_data *devdata = platform_get_drvdata(dev); /* comment this out like in old driver, it's sick though */ /* if (level == SUSPEND_POWER_DOWN) { */ @@ -251,9 +251,9 @@ return 0; } -static int tsc2101_resume(struct device *dev) +static int tsc2101_resume(struct platform_device *dev) { - struct tsc2101_data *devdata = dev_get_drvdata(dev); + struct tsc2101_data *devdata = platform_get_drvdata(dev); /* comment this out like in old driver, it's sick though */ /* if (level == RESUME_POWER_ON) { */ @@ -265,7 +265,7 @@ } -static int __init tsc2101_probe(struct device *dev) +static int tsc2101_probe(struct platform_device *dev) { struct tsc2101_data *devdata; struct tsc2101_ts_event ts_data; @@ -273,9 +273,9 @@ if (!(devdata = kcalloc(1, sizeof(struct tsc2101_data), GFP_KERNEL))) return -ENOMEM; - dev_set_drvdata(dev,devdata); + platform_set_drvdata(dev,devdata); spin_lock_init(&devdata->lock); - devdata->platform = dev->platform_data; + devdata->platform = dev->dev.platform_data; init_timer(&devdata->ts_timer); devdata->ts_timer.data = (unsigned long) devdata; @@ -305,9 +305,9 @@ } -static int __exit tsc2101_remove(struct device *dev) +static int tsc2101_remove(struct platform_device *dev) { - struct tsc2101_data *devdata = dev_get_drvdata(dev); + struct tsc2101_data *devdata = platform_get_drvdata(dev); free_irq(devdata->platform->irq, devdata); del_timer_sync(&devdata->ts_timer); @@ -318,23 +318,26 @@ return 0; } -static struct device_driver tsc2101_driver = { +static struct platform_driver tsc2101_driver = { + .driver = { .name = "tsc2101", - .bus = &platform_bus_type, + .owner = THIS_MODULE, + }, +/* .bus = &platform_bus_type, */ .probe = tsc2101_probe, - .remove = __exit_p(tsc2101_remove), + .remove = tsc2101_remove, .suspend = tsc2101_suspend, .resume = tsc2101_resume, }; static int __init tsc2101_init(void) { - return driver_register(&tsc2101_driver); + return platform_driver_register(&tsc2101_driver); } static void __exit tsc2101_exit(void) { - driver_unregister(&tsc2101_driver); + platform_driver_unregister(&tsc2101_driver); } module_init(tsc2101_init); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |