ucb1x00 audio & zaurus touchscreen
Hi!
First, I'd like to ask: what is status of ucb1x00 audio in 2.6? I do have .c file here, but do not have corresponding header files...
Then, I'd like to announce that I finally got touchscreen to somehow work. Patch is very ugly and adds filtering into kernel (no-no), but does the trick, and can even coexist with battery reading code. [Don't bother commenting on style of this patch, it is for ilustration, I'd not be crazy enough to try to push it.]
Pavel
drivers/mfd/ucb1x00-ts.c +29 -4
@@ -55,20 +55,34 @@ struct ucb1x00_ts { };static int adcsync; +static int counter; +static int minx, miny, minpress;static inline void ucb1x00_ts_evt_add (struct ucb1x00_ts *ts,u16 pressure,u16 x,u16 y) {struct input_dev *idev = ts->idev; -input_report_abs (idev,ABS_X , x); -input_report_abs (idev,ABS_Y , y); -input_report_abs (idev,ABS_PRESSURE , pressure); +if (x < minx) minx = x; +if (y < miny) miny = y; +if (pressure < minpress) minpress = pressure; + +if (++counter <3 ) { +return ; + } + counter =0 ; + +input_report_abs (idev,ABS_X , minx); +input_report_abs (idev,ABS_Y , miny); +input_report_abs (idev,ABS_PRESSURE , minpress); +input_report_key (idev,BTN_TOUCH ,1 );input_sync (idev); + minx =1000 ; miny =1000 ; minpress =1000 ; }static inline void ucb1x00_ts_event_release (struct ucb1x00_ts *ts) {struct input_dev *idev = ts->idev;input_report_abs (idev,ABS_PRESSURE ,0 ); +input_report_key (idev,BTN_TOUCH ,0 );input_sync (idev); }
@@ -87,6 +101,7 @@ static inline void ucb1x00_ts_mode_int(s* Switch to pressure mode, and read pressure. We don't need to wait * here, since both plates are being driven. */ +/* set_read_pressure() in sharp code */ static inline unsigned int ucb1x00_ts_read_pressure (struct ucb1x00_ts *ts) {if (machine_is_collie ()) {
@@ -256,7 +271,9 @@ static int ucb1x00_thread(void *_ts) valid =0 ; } - timeout =MAX_SCHEDULE_TIMEOUT ; +/* With battery sensing on collie enabled, interrupts do not work quite well. +This works around it */ + timeout =HZ /10 ; }else {ucb1x00_disable (ts->ucb);
@@ -317,6 +334,10 @@ static int ucb1x00_ts_open(struct input_ ts->y_res =ucb1x00_ts_read_yres (ts);ucb1x00_adc_disable (ts->ucb); +if (machine_is_collie ()) { +ucb1x00_io_set_dir (ts->ucb,0 ,COLLIE_TC35143_GPIO_TBL_CHK ); + } + ts->rtask =kthread_run (ucb1x00_thread, ts,"ktsd" );if (!IS_ERR (ts->rtask)) { ret =0 ;
@@ -397,6 +418,10 @@ static int ucb1x00_ts_add(struct ucb1x00__set_bit (ABS_X , ts->idev->absbit);__set_bit (ABS_Y , ts->idev->absbit);__set_bit (ABS_PRESSURE , ts->idev->absbit); +input_set_abs_params (ts->idev,ABS_X ,0 ,450 ,0 ,0 ); +input_set_abs_params (ts->idev,ABS_Y ,200 ,800 ,0 ,0 ); +input_set_abs_params (ts->idev,ABS_PRESSURE ,400 ,800 ,0 ,0 ); +input_register_device (ts->idev);
Signature · 1 line
Picture of sleeping (Linux) penguin wanted...
Quoted 2 lines · Pavel Machek
First, I'd like to ask: what is status of ucb1x00 audio in 2.6? I do have .c file here, but do not have corresponding header files...
I never included the ucb1x00 audio patch into mainline because it depended on some obsolete SA11x0 OSS audio support, and I haven't had time to:
(a) finish my SA11x0 ALSA audio support (the stuff which is in mainline is under the guise of being generic, but is actually completely ipaq specific.)
(b) convert the ucb1x00 stuff to use this generic ALSA support.
Plus there's issues surrounding where it should live (as ever). It would be stretched between drivers/mfd and sound/arm and would be very ARM specific.
Signature · 3 lines
Russell King Linux kernel 2.6 ARM Linux - http://www.arm.linux.org.uk/ maintainer of: 2.6 Serial core
Quoted 7 lines · Russell King
Quoted 2 lines · Pavel Machek
First, I'd like to ask: what is status of ucb1x00 audio in 2.6? I do have .c file here, but do not have corresponding header files...
I never included the ucb1x00 audio patch into mainline because it depended on some obsolete SA11x0 OSS audio support, and I haven't had time to:
Do you still have copy, somewhere? I have something here, but it does not even compile due to missing headers.
Quoted 3 lines
(a) finish my SA11x0 ALSA audio support (the stuff which is in mainline is under the guise of being generic, but is actually completely ipaq specific.)
Do you mean ./sound/arm/sa11xx-uda1341.c here? Do you have any patches?
Quoted 5 lines
(b) convert the ucb1x00 stuff to use this generic ALSA support.
Plus there's issues surrounding where it should live (as ever). It would be stretched between
drivers/mfdandsound/armand would be very ARM specific.
Pavel
Signature · 1 line
Picture of sleeping (Linux) penguin wanted...
Quoted 8 lines · Russell King
Quoted 2 lines · Pavel Machek
First, I'd like to ask: what is status of ucb1x00 audio in 2.6? I do have .c file here, but do not have corresponding header files...
I never included the ucb1x00 audio patch into mainline because it depended on some obsolete SA11x0 OSS audio support, and I haven't had time to:
Quoted 8 lines
(a) finish my SA11x0 ALSA audio support (the stuff which is in mainline is under the guise of being generic, but is actually completely ipaq specific.)
(b) convert the ucb1x00 stuff to use this generic ALSA support.Plus there's issues surrounding where it should live (as ever). It would be stretched between
drivers/mfdandsound/armand would be very ARM specific.
I'd like to bring people's attention to the work done on ALSA ASoC.
Some information is available at:
http://www.rpsys.net/openzaurus/patches/alsa/info.html
(I think there are more supported codecs now.)
Patches are at:
http://www.rpsys.net/openzaurus/patches/alsa/
I've cc'd Liam in on this.
The PXA Zaurus machines are going down this route for audio support and its proving extremely functional and stable. Mainline inclusion is likely and there has been discussion about ASoC on the ALSA mailing lists.
Richard
Quoted 10 lines · Pavel Machek
Hi!
First, I'd like to ask: what is status of ucb1x00 audio in 2.6? I do have .c file here, but do not have corresponding header files...
Then, I'd like to announce that I finally got touchscreen to somehow work. Patch is very ugly and adds filtering into kernel (no-no), but does the trick, and can even coexist with battery reading code. [Don't bother commenting on style of this patch, it is for ilustration, I'd not be crazy enough to try to push it.]
I also have a brown-paper-bag hack to this driver that:
a) makes it work without interrupts
b) improves the interactive performance
c) makes it work on non-arm.
I'll post the patch tomorrow when I'm back at work.
David Vrabel
Quoted 10 lines · Pavel Machek
Hi!
First, I'd like to ask: what is status of ucb1x00 audio in 2.6? I do have .c file here, but do not have corresponding header files...
Then, I'd like to announce that I finally got touchscreen to somehow work. Patch is very ugly and adds filtering into kernel (no-no), but does the trick, and can even coexist with battery reading code. [Don't bother commenting on style of this patch, it is for ilustration, I'd not be crazy enough to try to push it.]
This is what I have lurking in an equally hacky state.
%description
This is a really nasty hack which I used simply to verify that the touchscreen hardware on the GX533 worked correctly. It came from a bit-rotted patch found on the L-K mailing list and war forcefully forward ported to the current tree. It needs some serious cleaning up before it gets used...
It hangs when you close the input device because semaphores and kthread_stop cannot play nice together.
%patch
drivers/mfd/Kconfig +3 -0
@@ -26,4 +26,7 @@ tristate "Touchscreen interface support" depends on MCP_UCB1200 && INPUT +config UCB1400_TS + tristate "UCB1400 Touchscreen support" + endmenu
drivers/mfd/Makefile +3 -0
@@ -11,3 +11,6 @@ ifeq ($(CONFIG_SA1100_ASSABET),y) obj-$(CONFIG_MCP_UCB1200) += ucb1x00-assabet.o endif + +ucb1400-core-y := ucb1x00-core.o +obj-$(CONFIG_UCB1400_TS) += ucb1400-core.o ucb1x00-ts.o
drivers/mfd/ucb1x00-core.c +54 -47
220 lines not on this page · raw message
drivers/mfd/ucb1x00-ts.c +54 -45
212 lines not on this page · raw message
drivers/mfd/ucb1x00.h +46 -16
122 lines not on this page · raw message
drivers/mfd/ucb1x00-core.c line 63
Quoted 8 lines · David Vrabel
drivers/mfd/ucb1x00-core.c +1
-1@@ -58,9 +65,9 @@spin_lock_irqsave (&ucb->io_lock, flags); ucb->io_dir |= out; ucb->io_dir &= ~in; +spin_unlock_irqrestore (&ucb->io_lock, flags);ucb1x00_reg_write (ucb,UCB_IO_DIR , ucb->io_dir); -spin_unlock_irqrestore (&ucb->io_lock, flags);
Racy.
drivers/mfd/ucb1x00-core.c line 91
Quoted 8 lines
drivers/mfd/ucb1x00-core.c +1
-1@@ -86,9 +93,9 @@spin_lock_irqsave (&ucb->io_lock, flags); ucb->io_out |= set; ucb->io_out &= ~clear; +spin_unlock_irqrestore (&ucb->io_lock, flags);ucb1x00_reg_write (ucb,UCB_IO_DATA , ucb->io_out); -spin_unlock_irqrestore (&ucb->io_lock, flags);
Racy.
Quoted 21 lines
drivers/mfd/ucb1x00-core.c +7
-8@@ -301,22 +305,23 @@*/ void ucb1x00_disable_irq (struct ucb1x00 *ucb,unsigned int idx,int edges) { -unsigned long flags; -if (idx <16 ) { -spin_lock_irqsave (&ucb->lock, flags); - -ucb1x00_enable (ucb); -if (edges &UCB_RISING ) { +down (&ucb->lock); +/* This can't be right. Can it? */ +if (edges &UCB_RISING ) + ucb->irq_ris_enbl |=1 << idx; +if (edges &UCB_FALLING ) + ucb->irq_fal_enbl |=1 << idx; +if (edges &UCB_RISING ) ucb->irq_ris_enbl &= ~(1 << idx); -ucb1x00_reg_write (ucb,UCB_IE_RIS , ucb->irq_ris_enbl); - }
drivers/mfd/ucb1x00-core.c line 323
Quoted 10 lines
drivers/mfd/ucb1x00-core.c +6
-3-if (edges &UCB_FALLING ) { +if (edges &UCB_FALLING ) ucb->irq_fal_enbl &= ~(1 << idx); -ucb1x00_reg_write (ucb,UCB_IE_FAL , ucb->irq_fal_enbl); - } +up (&ucb->lock); + +ucb1x00_enable (ucb); +ucb1x00_reg_write (ucb,UCB_IE_RIS , ucb->irq_ris_enbl); +ucb1x00_reg_write (ucb,UCB_IE_FAL , ucb->irq_fal_enbl);
Racy.
I'm very much of the opinion that while UCB1400 may appear to be vaguely register compatible with the UCB1200 and UCB1300 devices, it has sufficiently different requirements which make any attempt at merging drivers for both devices either racy or hard to read with additional unnecessary complexity for the 1200 and 1300 devices.
Hence why I've been very reluctant to consider putting the UCB1400 stuff in - because it changes the existing UCB1x00 code in ways I just don't like.
Signature · 3 lines
Russell King Linux kernel 2.6 ARM Linux - http://www.arm.linux.org.uk/ maintainer of: 2.6 Serial core