Touchscreen support for sharp sl-5500
Subsystems (3)
PATCH 1/2 Touchscreen support for sharp sl-5500
This adds support for reading ADCs (etc), neccessary to operate touch screen on Sharp Zaurus sl-5500.
Please apply,
Pavel
drivers/misc/Kconfig +17 -0
@@ -30,3 +30,20 @@ config IBM_ASM endmenu +menu "Multimedia Capabilities Port drivers" + +config MCP + tristate + +# Interface drivers +config MCP_SA1100 + tristate "Support SA1100 MCP interface" + depends on ARCH_SA1100 + select MCP + +# Chip drivers +config MCP_UCB1200 + tristate "Support for UCB1200 / UCB1300" + depends on MCP + +endmenu
drivers/misc/Makefile +8 -0
@@ -5,3 +5,11 @@ obj- := misc.o # Dummy rule to force bui obj-$(CONFIG_IBM_ASM) += ibmasm/ obj-$(CONFIG_HDPU_FEATURES) += hdpuftrs/ + +obj-$(CONFIG_MCP) += mcp-core.o +obj-$(CONFIG_MCP_UCB1200) += ucb1x00-core.o + +obj-$(CONFIG_MCP_SA1100) += mcp-sa1100.o + +ucb1400-core-y := ucb1x00-core.o mcp-ac97.o +obj-$(CONFIG_UCB1400_TS) += ucb1400-core.o ucb1x00-ts.o
drivers/misc/mcp-core.c new file +257 -0
257 lines not on this page · raw message
drivers/misc/mcp-sa1100.c new file +287 -0
287 lines not on this page · raw message
drivers/misc/ucb1x00-core.c new file +638 -0
638 lines not on this page · raw message
drivers/pcmcia/sa1100_generic.h +1 -0
@@ -8,6 +8,7 @@ extern int pcmcia_adsbitsy_init(struct dextern int pcmcia_assabet_init (struct device *);extern int pcmcia_badge4_init (struct device *);extern int pcmcia_cerf_init (struct device *); +extern int pcmcia_collie_init (struct device *);extern int pcmcia_flexanet_init (struct device *);extern int pcmcia_freebird_init (struct device *);extern int pcmcia_gcplus_init (struct device *);
include/asm-arm/arch-sa1100/mcp.h new file +65 -0
65 lines not on this page · raw message
include/asm-arm/arch-sa1100/ucb1x00.h new file +270 -0
270 lines not on this page · raw message
Quoted 2 lines · Pavel Machek
This adds support for reading ADCs (etc), neccessary to operate touch screen on Sharp Zaurus sl-5500.
I would like to know what the diffs are between my version (attached) and this version before they get applied.
The only reason my version has not been submitted is because it lives in the drivers/misc directory, and mainline kernel folk don't like drivers which clutter up that directory. In fact, I had been told that drivers/misc should remain completely empty - which makes this set of miscellaneous drivers homeless.
Signature · 3 lines
Russell King Linux kernel 2.6 ARM Linux - http://www.arm.linux.org.uk/ maintainer of: 2.6 Serial core
Quoted 4 lines · Russell King
Quoted 2 lines · Pavel Machek
This adds support for reading ADCs (etc), neccessary to operate touch screen on Sharp Zaurus sl-5500.
Quoted 8 lines
I would like to know what the diffs are between my version (attached) and this version before they get applied.
The only reason my version has not been submitted is because it lives in the
drivers/miscdirectory, and mainline kernel folk don't like drivers which clutter up that directory. In fact, I had been told thatdrivers/miscshould remain completely empty - which makes this set of miscellaneous drivers homeless.
I've been wondering about suggesting the creation of a drivers/soc directory. The idea would be for it to contain "system on chip" type support code. I use that description loosely to fit any code which needs to support drivers in multiple driver subsections.
An example use in my Zaurus tree is the TSC2101 which contains a touchscreen, battery monitoring and sound. Handhelds.org has devices such as the ASIC2/ASIC3 in the ipaqs (and other handhelds) which cover many different drivers subsections.
Where practical, the sub drivers such as the touchscreen could be placed into the specific driver areas such as drivers/input/touchscreen/ but the core chip specific support would be in drivers/soc and the files would be connected.
Would that be acceptable in mainline?
Richard
Quoted 4 lines · On Sun, 24 Jul 2005 17:47:56 +0100 Russell King wrote:
Quoted 2 lines · Pavel Machek
This adds support for reading ADCs (etc), neccessary to operate touch screen on Sharp Zaurus sl-5500.
Quoted 8 lines
I would like to know what the diffs are between my version (attached) and this version before they get applied.
The only reason my version has not been submitted is because it lives in the
drivers/miscdirectory, and mainline kernel folk don't like drivers which clutter up that directory. In fact, I had been told thatdrivers/miscshould remain completely empty - which makes this set of miscellaneous drivers homeless.
but clearly drivers/misc/ is not empty, unless you mean at its top level.
The IBM ASM service processor driver is there (added in 2.6.x) as well as some hdpuftrs/ driver, which is not in any Kconfig file or defconfig file. :(
---
~Randy
Hi!
Quoted 5 lines
Quoted 2 lines
This adds support for reading ADCs (etc), neccessary to operate touch screen on Sharp Zaurus sl-5500.
I would like to know what the diffs are between my version (attached) and this version before they get applied.
Hmm, diff looks quite big (attached), and I got it from lenz for 99% part.
I have made quite a lot of cleanups to touchscreen part, and it seems to be acceptable by input people. I think it should go into drivers/input/touchscreen/collie_ts.c... Also it looks to me like mcp.h should go into asm/arch-sa1100, so that other drivers can use it...
Quoted 5 lines
The only reason my version has not been submitted is because it lives in the
drivers/miscdirectory, and mainline kernel folk don't like drivers which clutter up that directory. In fact, I had been told thatdrivers/miscshould remain completely empty - which makes this set of miscellaneous drivers homeless.
Could they simply live in arch/arm/mach-sa1100? Or is arch/arm/soc better place?
Pavel
drivers/input/touchscreen/Kconfig +9 -0
@@ -36,6 +36,15 @@ To compile this driver as a module, choose M here: the module will be called ads7846_ts. +config TOUCHSCREEN_COLLIE + tristate "Collie touchscreen (for Sharp SL-5500)" + depends on MCP_UCB1200 + help + Say Y here to enable the driver for the touchscreen on the + Sharp SL-5500 series of PDAs. + + If unsure, say N. + config TOUCHSCREEN_GUNZE tristate "Gunze AHL-51S touchscreen" select SERIO
drivers/input/touchscreen/Makefile +1 -0
@@ -6,6 +6,7 @@ obj-$(CONFIG_TOUCHSCREEN_BITSY) += h3600_ts_input.o obj-$(CONFIG_TOUCHSCREEN_CORGI) += corgi_ts.o +obj-$(CONFIG_TOUCHSCREEN_COLLIE)+= collie_ts.o obj-$(CONFIG_TOUCHSCREEN_GUNZE) += gunze.o obj-$(CONFIG_TOUCHSCREEN_ELO) += elo.o obj-$(CONFIG_TOUCHSCREEN_MTOUCH) += mtouch.o
drivers/misc/Makefile +9 -6
@@ -6,12 +6,15 @@ obj-$(CONFIG_IBM_ASM) += ibmasm/ obj-$(CONFIG_HDPU_FEATURES) += hdpuftrs/ -obj-$(CONFIG_MCP) += mcp-core.o -obj-$(CONFIG_MCP_SA1100) += mcp-sa1100.o -obj-$(CONFIG_MCP_UCB1200) += ucb1x00-core.o -obj-$(CONFIG_MCP_UCB1200_AUDIO) += ucb1x00-audio.o -obj-$(CONFIG_MCP_UCB1200_TS) += ucb1x00-ts.o +obj-$(CONFIG_MCP) += mcp-core.o +obj-$(CONFIG_MCP_UCB1200) += ucb1x00-core.o +obj-$(CONFIG_MCP_UCB1200_AUDIO) += ucb1x00-audio.o ifeq ($(CONFIG_SA1100_ASSABET),y) -obj-$(CONFIG_MCP_UCB1200) += ucb1x00-assabet.o +obj-$(CONFIG_MCP_UCB1200) += ucb1x00-assabet.o endif + +obj-$(CONFIG_MCP_SA1100) += mcp-sa1100.o + +ucb1400-core-y := ucb1x00-core.o mcp-ac97.o +obj-$(CONFIG_UCB1400_TS) += ucb1400-core.o ucb1x00-ts.o
Only in linux-z/drivers/misc: mcp-ac97.c
drivers/misc/mcp-core.c +29 -15
71 lines not on this page · raw message
drivers/misc/mcp-sa1100.c +21 -19
@@ -27,7 +27,8 @@#include <asm/arch/assabet.h> -#include "mcp.h" +#include <asm/arch-sa1100/mcp.h> +static void mcp_sa1100_set_telecom_divisor (struct mcp *mcp,unsigned int divisor)
@@ -140,7 +141,7 @@static int mcp_sa1100_probe (struct device *dev) {struct platform_device *pdev =to_platform_device (dev); -struct mcp *mcp; +struct mcp *mcp = &mcp_sa1100;int ret; if (!machine_is_adsbitsy() && !machine_is_assabet() &&
@@ -149,20 +150,16 @@ !machine_is_graphicsmaster() && !machine_is_lart() && !machine_is_omnimeter() && !machine_is_pfs168() && !machine_is_shannon() && !machine_is_simpad() && - !machine_is_yopy()) + !machine_is_yopy() && !machine_is_collie()) { +printk (KERN_WARNING "MCP-sa1100: machine is not supported\n" );return -ENODEV ; + } -if (!request_mem_region (0x80060000 ,0x60 ,"sa11x0-mcp" )) +if (!request_mem_region (0x80060000 ,0x60 ,"sa11x0-mcp" )) { +printk (KERN_ERR "MCP-sa1100: Unable to request memory region\n" );return -EBUSY ; - - mcp =kmalloc (sizeof (struct mcp ),GFP_KERNEL ); -if (!mcp) { - ret = -ENOMEM ; - goto release; } - *mcp = mcp_sa1100; - mcp->me = dev;dev_set_drvdata (dev, mcp);
@@ -170,6 +167,12 @@ASSABET_BCR_set (ASSABET_BCR_CODEC_RST ); } +if (machine_is_collie ()) { +GAFR &= ~(GPIO_GPIO (16 )); +GPDR |=GPIO_GPIO (16 ); +GPSR |=GPIO_GPIO (16 ); + } +/* * Setup the PPC unit correctly. */
@@ -181,7 +184,8 @@ Ser4MCSR =-1 ; Ser4MCCR1 =0 ; - Ser4MCCR0 =0x00007f7f |MCCR0_ADM ; +//Ser4MCCR0 = 0x00007f7f | MCCR0_ADM; + Ser4MCCR0 =MCCR0_ADM | MCCR0_ExtClk;/* * Calculate the read/write timeout (us) from the bit clock
@@ -192,14 +196,11 @@ mcp->sclk_rate; ret =mcp_host_register (mcp, &pdev->dev); -if (ret ==0 ) - goto out; - - release: -release_mem_region (0x80060000 ,0x60 ); -dev_set_drvdata (dev,NULL ); +if (ret !=0 ) { +release_mem_region (0x80060000 ,0x60 ); +dev_set_drvdata (dev,NULL ); + } - out:return ret; }
@@ -208,6 +209,7 @@struct mcp *mcp =dev_get_drvdata (dev);dev_set_drvdata (dev,NULL ); +mcp_host_unregister (mcp);release_mem_region (0x80060000 ,0x60 );
Only in linux-rmk/drivers/misc: mcp.h
drivers/misc/ucb1x00-assabet.c +11 -11
@@ -35,34 +35,34 @@UCB1X00_ATTR (vcharger,UCB_ADC_INP_AD0 );UCB1X00_ATTR (batt_temp,UCB_ADC_INP_AD2 ); -static int ucb1x00_assabet_add (struct ucb1x00_dev *dev) +static int ucb1x00_assabet_add (struct class_device *dev) { -class_device_create_file (&dev->ucb->cdev, &class_device_attr_vbatt); -class_device_create_file (&dev->ucb->cdev, &class_device_attr_vcharger); -class_device_create_file (&dev->ucb->cdev, &class_device_attr_batt_temp); +class_device_create_file (dev, &class_device_attr_vbatt); +class_device_create_file (dev, &class_device_attr_vcharger); +class_device_create_file (dev, &class_device_attr_batt_temp);return 0 ; } -static void ucb1x00_assabet_remove (struct ucb1x00_dev *dev) +static void ucb1x00_assabet_remove (struct class_device *dev) { -class_device_remove_file (&dev->ucb->cdev, &class_device_attr_batt_temp); -class_device_remove_file (&dev->ucb->cdev, &class_device_attr_vcharger); -class_device_remove_file (&dev->ucb->cdev, &class_device_attr_vbatt); +class_device_remove_file (dev, &class_device_attr_batt_temp); +class_device_remove_file (dev, &class_device_attr_vcharger); +class_device_remove_file (dev, &class_device_attr_vbatt); } -static struct ucb1x00_driver ucb1x00_assabet_driver = { +static struct class_interface ucb1x00_assabet_interface = { .add = ucb1x00_assabet_add, .remove = ucb1x00_assabet_remove, };static int __init ucb1x00_assabet_init (void ) { -return ucb1x00_register_driver (&ucb1x00_assabet_driver); +return ucb1x00_register_interface (&ucb1x00_assabet_interface); } static void __exit ucb1x00_assabet_exit(void) { -ucb1x00_unregister_driver (&ucb1x00_assabet_driver); +ucb1x00_unregister_interface (&ucb1x00_assabet_interface); }module_init (ucb1x00_assabet_init);
drivers/misc/ucb1x00-audio.c +93 -88
247 lines not on this page · raw message
drivers/misc/ucb1x00-core.c +115 -142
402 lines not on this page · raw message
Only in linux-rmk/drivers/misc: ucb1x00-ts.c
Only in linux-rmk/drivers/misc: ucb1x00.h
drivers/input/touchscreen/collie_ts.c new file +367 -0
367 lines not on this page · raw message
Signature · 1 line
teflon -- maybe it is a trademark, but it should not be.
Dmitry Torokhov
maintainerHi Pavel,
Quoted 5 lines · Pavel Machek
I have made quite a lot of cleanups to touchscreen part, and it seems to be acceptable by input people. I think it should go into
drivers/input/touchscreen/collie_ts.c... Also it looks to me likemcp.hshould go into asm/arch-sa1100, so that other drivers can use it...
I have couple of nitpicks (below) and one bigger concern - I am surprised that a driver for a physical device is implemented as an interface to a class device. This precludes implementing any kind of power management in the driver and pushes it into the parent and is generally speaking is a wrong thing to do (IMHO).
If the problem is that you have a single piece of hardware you need to bind several drivers to - I guess you will have to create a new sub-device bus for that. Or just register sub-devices on the same bus the parent device is registered on - I am not sure what is best in this particular case - I am not familiar with the arch. It is my understanding that the purpose of interfaces to to present different "views" to userspace and therefore they are not quie suited for what you are trying to do...
drivers/input/touchscreen/collie_ts.c line 161
Quoted 7 lines
drivers/input/touchscreen/collie_ts.c new file +7
-0+static int ucb1x00_thread (void *_ts) +{ +struct ucb1x00_ts *ts = _ts; +struct task_struct *tsk = current; +int valid; + + ts->rtask = tsk;
Just move that assignment into ucb1x00_input_open and kill all this "current" stuff.
drivers/input/touchscreen/collie_ts.c line 171
Quoted 10 lines
drivers/input/touchscreen/collie_ts.c new file +10
-0+ +/* +* We run as a real-time thread. However, thus far +* this doesn't seem to be necessary. +*/ + tsk->policy =SCHED_FIFO ; + tsk->rt_priority =1 ; + + valid =0 ; +for (;;) {
Can we change this to "while (!kthread_should_stop())" to make me completely happy?
Thanks!
Signature · 1 line
Dmitry
Quoted 5 lines · Dmitry Torokhov
If the problem is that you have a single piece of hardware you need to bind several drivers to - I guess you will have to create a new sub-device bus for that. Or just register sub-devices on the same bus the parent device is registered on - I am not sure what is best in this particular case - I am not familiar with the arch.
That is exactly the problem - these kinds of devices do _not_ fit well into the device model. A struct device for every different possible sub-unit is completely overkill.
For instance, you may logically use one ADC and some GPIO lines on the device for X and something else for Y and they logically end up in different drivers.
The problem is that the parent doesn't actually know how many devices to create nor what to call them, and they're logically indistinguishable from each other so there's no logical naming system.
Quoted 2 lines
Can we change this to "while (!kthread_should_stop())" to make me completely happy?
I still ask, and I'll keep repeating this. What is the difference between this and the reference implementation which is known to work on other hardware.
Let's not go all out on one implementation for one set of hardware, but try to work out what we need to do to the generic reference implementation to make it work on this hardware.
IOW, you're working on the wrong version.
Signature · 3 lines
Russell King Linux kernel 2.6 ARM Linux - http://www.arm.linux.org.uk/ maintainer of: 2.6 Serial core
Dmitry Torokhov
maintainerQuoted 11 lines · Russell King
Quoted 5 lines · Dmitry Torokhov
If the problem is that you have a single piece of hardware you need to bind several drivers to - I guess you will have to create a new sub-device bus for that. Or just register sub-devices on the same bus the parent device is registered on - I am not sure what is best in this particular case - I am not familiar with the arch.
That is exactly the problem - these kinds of devices do _not_ fit well into the device model. A struct device for every different possible sub-unit is completely overkill.
Quoted 9 lines
For instance, you may logically use one ADC and some GPIO lines on the device for X and something else for Y and they logically end up in different drivers.
The problem is that the parent doesn't actually know how many devices to create nor what to call them, and they're logically indistinguishable from each other so there's no logical naming system.
Then we should probably not try to force them into driver model. Have parent device register struct device and when sub-drivers register they could attach class devices (like input devices) directly to the "main" device thus hiding presence of sub-sections of the chip from sysfs completely. My point is that we should not be using class_interface here - its purpose is diferent.
Signature · 1 line
Dmitry
Quoted 22 lines · Dmitry Torokhov
Quoted 11 lines · Russell King
Quoted 5 lines · Dmitry Torokhov
If the problem is that you have a single piece of hardware you need to bind several drivers to - I guess you will have to create a new sub-device bus for that. Or just register sub-devices on the same bus the parent device is registered on - I am not sure what is best in this particular case - I am not familiar with the arch.
That is exactly the problem - these kinds of devices do _not_ fit well into the device model. A struct device for every different possible sub-unit is completely overkill.
Quoted 9 lines
For instance, you may logically use one ADC and some GPIO lines on the device for X and something else for Y and they logically end up in different drivers.
The problem is that the parent doesn't actually know how many devices to create nor what to call them, and they're logically indistinguishable from each other so there's no logical naming system.
Quoted 6 lines
Then we should probably not try to force them into driver model. Have parent device register struct device and when sub-drivers register they could attach class devices (like input devices) directly to the "main" device thus hiding presence of sub-sections of the chip from sysfs completely. My point is that we should not be using
class_interfacehere - its purpose is diferent.
If you look at _my_ version, you'll notice that it doesn't use the class interface stuff. A previous version of it did, and this seems to be what the collie stuff is based upon.
What I suggest is that the collie folk need to update their driver to my version so that we don't have two different forks of the same driver in existance. Then we can start discussing whether things should be using kthreads or not.
Signature · 3 lines
Russell King Linux kernel 2.6 ARM Linux - http://www.arm.linux.org.uk/ maintainer of: 2.6 Serial core
Dmitry Torokhov
maintainerQuoted 30 lines · Russell King
Quoted 22 lines · Dmitry Torokhov
Quoted 11 lines · Russell King
Quoted 5 lines · Dmitry Torokhov
If the problem is that you have a single piece of hardware you need to bind several drivers to - I guess you will have to create a new sub-device bus for that. Or just register sub-devices on the same bus the parent device is registered on - I am not sure what is best in this particular case - I am not familiar with the arch.
That is exactly the problem - these kinds of devices do _not_ fit well into the device model. A struct device for every different possible sub-unit is completely overkill.
Quoted 9 lines
For instance, you may logically use one ADC and some GPIO lines on the device for X and something else for Y and they logically end up in different drivers.
The problem is that the parent doesn't actually know how many devices to create nor what to call them, and they're logically indistinguishable from each other so there's no logical naming system.
Quoted 6 lines
Then we should probably not try to force them into driver model. Have parent device register struct device and when sub-drivers register they could attach class devices (like input devices) directly to the "main" device thus hiding presence of sub-sections of the chip from sysfs completely. My point is that we should not be using
class_interfacehere - its purpose is diferent.
Quoted 4 lines
If you look at _my_ version, you'll notice that it doesn't use the class interface stuff. A previous version of it did, and this seems to be what the collie stuff is based upon.
I was only commenting on something that was posted on LKML for inclusion into input subtree that I am interested in. I don't track ARM development that closely. Where can we see your version, please?
Quoted 4 lines
What I suggest is that the collie folk need to update their driver to my version so that we don't have two different forks of the same driver in existance. Then we can start discussing whether things should be using kthreads or not.
Do you have any reason why, generally speaking, threads should not be used? They seem to clean up code in drivers quite a bit.
Signature · 1 line
Dmitry
Quoted 8 lines · Dmitry Torokhov
Quoted 3 lines · Russell King
If you look at _my_ version, you'll notice that it doesn't use the class interface stuff. A previous version of it did, and this seems to be what the collie stuff is based upon.
I was only commenting on something that was posted on LKML for inclusion into input subtree that I am interested in. I don't track ARM development that closely. Where can we see your version, please?
See earlier in this thread, 24th July.
Quoted 7 lines
Quoted 4 lines
What I suggest is that the collie folk need to update their driver to my version so that we don't have two different forks of the same driver in existance. Then we can start discussing whether things should be using kthreads or not.
Do you have any reason why, generally speaking, threads should not be used? They seem to clean up code in drivers quite a bit.
It depends what the reasoning is behind them. The touchscreen driver is threaded because it wants to collect touschreen samples independently of the availability of a user thread. Moreover, obtaining ADC samples needs a sleeping context since it may take a while to complete.
However, putting all UCB interrupts into a thread does not make sense to me - if we allow UCB interrupts to sleep, it allows one UCB interrupt to be processed at the exclusion of the others.
Signature · 3 lines
Russell King Linux kernel 2.6 ARM Linux - http://www.arm.linux.org.uk/ maintainer of: 2.6 Serial core
Hi!
Quoted 12 lines
Quoted 11 lines
Quoted 4 lines
The problem is that the parent doesn't actually know how many devices to create nor what to call them, and they're logically indistinguishable from each other so there's no logical naming system.
Then we should probably not try to force them into driver model. Have parent device register struct device and when sub-drivers register they could attach class devices (like input devices) directly to the "main" device thus hiding presence of sub-sections of the chip from sysfs completely. My point is that we should not be using
class_interfacehere - its purpose is diferent.
Quoted 6 lines
If you look at _my_ version, you'll notice that it doesn't use the class interface stuff. A previous version of it did, and this seems to be what the collie stuff is based upon.
What I suggest is that the collie folk need to update their driver to my version so that we don't have two different forks of the same
Yep, will do, and sorry for the confusion.
Pavel
Signature · 1 line
teflon -- maybe it is a trademark, but it should not be.
Hi!
Quoted 6 lines
Quoted 2 lines
Can we change this to "while (!kthread_should_stop())" to make me completely happy?
I still ask, and I'll keep repeating this. What is the difference between this and the reference implementation which is known to work on other hardware.
I think I posted diffs already, but they were rather big and against wrong version. I'll try to get better diffs.
Quoted 3 lines
Let's not go all out on one implementation for one set of hardware, but try to work out what we need to do to the generic reference implementation to make it work on this hardware.
I did not know it is supposed to work on other devices, too. My fault.
Pavel
Signature · 1 line
teflon -- maybe it is a trademark, but it should not be.
Hi!
Quoted 10 lines
Quoted 4 lines
I have made quite a lot of cleanups to touchscreen part, and it seems to be acceptable by input people. I think it should go into
drivers/input/touchscreen/collie_ts.c... Also it looks to me likemcp.hshould go into asm/arch-sa1100, so that other drivers can use it...I have couple of nitpicks (below) and one bigger concern - I am surprised that a driver for a physical device is implemented as an interface to a class device. This precludes implementing any kind of power management in the driver and pushes it into the parent and is generally speaking is a wrong thing to do (IMHO).
I'll port my changes to newer version of rmk's tree, that should solve it.
Quoted 10 lines
Review
Quoted 7 lines
(quoted diff) +7
-0+static int ucb1x00_thread(void *_ts) +{ + struct ucb1x00_ts *ts = _ts; + struct task_struct *tsk = current; + int valid; + + ts->rtask = tsk;Just move that assignment into
ucb1x00_input_openand kill all this "current" stuff.
It will still want to set the priority, but yes, it cleaned it.
Quoted 10 lines
Review
Quoted 9 lines
(quoted diff) +9
-0+ /* + * We run as a real-time thread. However, thus far + * this doesn't seem to be necessary. + */ + tsk->policy = SCHED_FIFO; + tsk->rt_priority = 1; + + valid = 0; + for (;;) {
Quoted 2 lines
Can we change this to "while (!kthread_should_stop())" to make me completely happy?
:-) Ok.
[Just FYI, I'll post agregated patch when I solve file placement and port to newer version.]
Cleanups suggested by Dmitri.
---
commit 60814924ed695d863fa226c24b3d4e96054c8b66 tree 0e88e8272c23926c5654ae10bfe14d4cb2af84ab parent ff30d8505b88064a5f6e6e70bd42028150a864e2 author <pavel@amd.(none)> Mon, 25 Jul 2005 23:35:21 +0200 committer <pavel@amd.(none)> Mon, 25 Jul 2005 23:35:21 +0200
drivers/input/touchscreen/collie_ts.c | 12 ++++-------- 1 files changed, 4 insertions(+), 8 deletions(-)
drivers/input/touchscreen/collie_ts.c +4 -8
@@ -158,8 +158,6 @@ static int ucb1x00_thread(void *_ts)struct task_struct *tsk = current;int valid; - ts->rtask = tsk; -/* * We run as a real-time thread. However, thus far * this doesn't seem to be necessary.
@@ -168,7 +166,7 @@ static int ucb1x00_thread(void *_ts) tsk->rt_priority =1 ; valid =0 ; -for (;;) { +while (!kthread_should_stop ()) {unsigned int x, y, p, val; ts->restart =0 ;
@@ -231,9 +229,6 @@ static int ucb1x00_thread(void *_ts)msleep_interruptible (10 ); } - -if (kthread_should_stop ()) -break ; } ts->rtask =NULL ;
@@ -273,11 +268,12 @@ static int ucb1x00_ts_open(struct input_ ts->y_res =ucb1x00_ts_read_yres (ts);ucb1x00_adc_disable (ts->ucb); - task =kthread_run (ucb1x00_thread, ts,"ktsd" ); -if (!IS_ERR (task)) { + ts->rtask =kthread_run (ucb1x00_thread, ts,"ktsd" ); +if (!IS_ERR (ts->task)) { ret =0 ; }else {ucb1x00_free_irq (ts->ucb,UCB_IRQ_TSPX , ts); + ts->rtask =NULL ; ret = -EFAULT ; }
Signature · 1 line
teflon -- maybe it is a trademark, but it should not be.
Quoted 10 lines · Pavel Machek
Hi!
Quoted 5 lines
Quoted 2 lines
This adds support for reading ADCs (etc), neccessary to operate touch screen on Sharp Zaurus sl-5500.
I would like to know what the diffs are between my version (attached) and this version before they get applied.
Hmm, diff looks quite big (attached), and I got it from lenz for 99% part.
It looks like John's version is actually based on a previous revision of this driver. 8/
Quoted 3 lines
I have made quite a lot of cleanups to touchscreen part, and it seems to be acceptable by input people. I think it should go into
drivers/input/touchscreen/collie_ts.c...
Err, why should my assabet touchscreen be called "collie_ts" ? collie is just a platform which happens to use it - it's got no relevance to the driver naming at all.
Quoted 2 lines
Also it looks to me like
mcp.hshould go into asm/arch-sa1100, so that other drivers can use it...
That doesn't make sense when you have other non-SA1100 devices using mcp-core.c. Whether that happens or not I've no idea - I can't see what everyone's using out there (just like I've absolutely zero idea what collie folk are doing or not doing.)
Quoted 8 lines
Quoted 5 lines
The only reason my version has not been submitted is because it lives in the
drivers/miscdirectory, and mainline kernel folk don't like drivers which clutter up that directory. In fact, I had been told thatdrivers/miscshould remain completely empty - which makes this set of miscellaneous drivers homeless.Could they simply live in
arch/arm/mach-sa1100? Or isarch/arm/socbetter place?
arch/arm/soc? That means that (a) we end up with another directory to accumulate crap, (b) it's not a SoC so doesn't belong in a directory named as such, (c) it means that the MCP and UCB drivers get their individual files scattered throughout the kernel tree, one in this directory, one in that directory, one in another random directory. That's far from ideal.
Anyway, summarising this, the results are that what we have here is a complete and utter mess. ;(
So, if the collie folk would like to clean their changes up and send them to me as the driver author, I'll see about integrating them into my version and we'll take it from there.
Signature · 3 lines
Russell King Linux kernel 2.6 ARM Linux - http://www.arm.linux.org.uk/ maintainer of: 2.6 Serial core
Hi!
Quoted 11 lines
Quoted 8 lines
Quoted 5 lines
Quoted 2 lines
This adds support for reading ADCs (etc), neccessary to operate touch screen on Sharp Zaurus sl-5500.
I would like to know what the diffs are between my version (attached) and this version before they get applied.
Hmm, diff looks quite big (attached), and I got it from lenz for 99% part.
It looks like John's version is actually based on a previous revision of this driver. 8/
Oops.
Quoted 7 lines
Quoted 3 lines
I have made quite a lot of cleanups to touchscreen part, and it seems to be acceptable by input people. I think it should go into
drivers/input/touchscreen/collie_ts.c...Err, why should my assabet touchscreen be called "
collie_ts" ? collie is just a platform which happens to use it - it's got no relevance to the driver naming at all.
Okay, I did not quite realized it was shared.
Quoted 7 lines
Quoted 2 lines
Also it looks to me like
mcp.hshould go into asm/arch-sa1100, so that other drivers can use it...That doesn't make sense when you have other non-SA1100 devices using
mcp-core.c. Whether that happens or not I've no idea - I can't see what everyone's using out there (just like I've absolutely zero idea what collie folk are doing or not doing.)
set_telecom_divisor relies on CONFIG_SA1100 being set (otherwise it breaks compilation, because struct members will not be available; at least in this version), so I doubt it has many non-SA1100 users...
Quoted 9 lines
Quoted 8 lines
Quoted 5 lines
The only reason my version has not been submitted is because it lives in the
drivers/miscdirectory, and mainline kernel folk don't like drivers which clutter up that directory. In fact, I had been told thatdrivers/miscshould remain completely empty - which makes this set of miscellaneous drivers homeless.Could they simply live in
arch/arm/mach-sa1100? Or isarch/arm/socbetter place?
Quoted 6 lines
arch/arm/soc? That means that (a) we end up with another directory to accumulate crap, (b) it's not a SoC so doesn't belong in a directory named as such, (c) it means that the MCP and UCB drivers get their individual files scattered throughout the kernel tree, one in this directory, one in that directory, one in another random directory. That's far from ideal.
Well, I believe that UCB layer is quite well define and it looks quite okay for touchscreen driver to be near other touchscreens... ucb-core still needs to go somewhere, if drivers/misc was vetoed, perhaps arch/arm/misc would be okay?
Quoted 2 lines
Anyway, summarising this, the results are that what we have here is a complete and utter mess. ;(
Yep :-(.
Quoted 3 lines
So, if the collie folk would like to clean their changes up and send them to me as the driver author, I'll see about integrating them into my version and we'll take it from there.
Okay, will do. [Is there chance to pull your tree using git? It would help a bit...]
Pavel
Signature · 1 line
teflon -- maybe it is a trademark, but it should not be.
Quoted 11 lines · Pavel Machek
Quoted 7 lines
Quoted 2 lines
Also it looks to me like
mcp.hshould go into asm/arch-sa1100, so that other drivers can use it...That doesn't make sense when you have other non-SA1100 devices using
mcp-core.c. Whether that happens or not I've no idea - I can't see what everyone's using out there (just like I've absolutely zero idea what collie folk are doing or not doing.)
set_telecom_divisorrelies onCONFIG_SA1100being set (otherwise it breaks compilation, because struct members will not be available; at least in this version), so I doubt it has many non-SA1100 users...
That's not conclusive in itself - if it's only usable on SA1100 platforms, why was that ifdef added?
Quoted 6 lines
Quoted 3 lines
So, if the collie folk would like to clean their changes up and send them to me as the driver author, I'll see about integrating them into my version and we'll take it from there.
Okay, will do. [Is there chance to pull your tree using git? It would help a bit...]
My git usage is limited to the final stage of my development - iow providing an integration and test bed for merging upstream. My work prior to that is all patch based (as per the tarball of patches I posted previously) with scripts to manage them - I like the power to re-order, split, merge, insert and remove patches at random, which includes whole series of patches vs individual patches themselves.
Consequently, if I were to publish my git trees, what you'll find is that they're indentical copies of Linus' tree except for maybe when Linus is away, or hasn't pulled that night, or...
What you're actually seeing with the UCB stuff is the effect of me stopping maintaining the -rmk trees - code effectively got "dropped" from public view at that point, and I'm not going to start publishing such a tree any time soon. It completely detracts from the task of ensuring mainline kernels work for ARM - since the -rmk tree is/was seen as the tree for everything ARM to be merged into, and hence upstream merging became my problem. No, never again will I make a fool of myself like that. Hence, I'll never again publish a kernel tree myself, except maybe for very limited purposes.
However, if the UCB stuff is going to get worked on, I don't mind setting up, maintaining and publishing a git tree for that that, provided it then vanishes once merged into mainline. That falls within the "very limited purposes" clause above.
Signature · 3 lines
Russell King Linux kernel 2.6 ARM Linux - http://www.arm.linux.org.uk/ maintainer of: 2.6 Serial core
Hi!
Quoted 6 lines
Quoted 6 lines
Quoted 3 lines
So, if the collie folk would like to clean their changes up and send them to me as the driver author, I'll see about integrating them into my version and we'll take it from there.
Okay, will do. [Is there chance to pull your tree using git? It would help a bit...]
...
Quoted 4 lines
However, if the UCB stuff is going to get worked on, I don't mind setting up, maintaining and publishing a git tree for that that, provided it then vanishes once merged into mainline. That falls within the "very limited purposes" clause above.
Yes, that would help a lot, because I'd have a tree to diff against.
Pavel
Signature · 1 line
teflon -- maybe it is a trademark, but it should not be.