From: Pavel Machek <pavel@suse.cz>
To: rpurdie@rpsys.net, lenz@cs.wisc.edu,
kernel list <linux-kernel@vger.kernel.org>,
Russell King <rmk@arm.linux.org.uk>
Subject: ucb1x00 audio & zaurus touchscreen
Date: Wed, 22 Mar 2006 13:20:53 +0100 [thread overview]
Message-ID: <20060322122052.GN14075@elf.ucw.cz> (raw)
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
diff --git a/drivers/mfd/ucb1x00-ts.c b/drivers/mfd/ucb1x00-ts.c
index 79fd062..31d3258 100644
--- a/drivers/mfd/ucb1x00-ts.c
+++ b/drivers/mfd/ucb1x00-ts.c
@@ -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);
--
Picture of sleeping (Linux) penguin wanted...
next reply other threads:[~2006-03-22 12:21 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-03-22 12:20 Pavel Machek [this message]
2006-03-22 13:53 ` ucb1x00 audio & zaurus touchscreen Russell King
2006-03-22 14:11 ` Pavel Machek
2006-03-22 15:21 ` Richard Purdie
2006-03-22 20:10 ` David Vrabel
2006-03-23 14:40 ` David Vrabel
2006-03-23 15:44 ` Russell King
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20060322122052.GN14075@elf.ucw.cz \
--to=pavel@suse.cz \
--cc=lenz@cs.wisc.edu \
--cc=linux-kernel@vger.kernel.org \
--cc=rmk@arm.linux.org.uk \
--cc=rpurdie@rpsys.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox