Thanks at all, I have Android on N800 with touchscreen.
I've used the attached patch obtained from NuuNeol patch, modified to work
on TSC2301  driver present on N800 driver instead of TSC2005 present on N810
and applied after patchv1 of android-on-n8xx.

To change between maemo and android coordinate you should insert the
following line in the start_android.sh script:

echo z > /media/mmc1/proc/sysrq-trigger

before the following line:

umask 000
chroot /media/mmc1 /a.sh

Now a question. Since the n800 has not a keyboard, for you is possible and
simple use a bluetooth keyboard to write in Android?

Best regards
Andrea Bernardi

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Android Internals" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/android-internals?hl=en
-~----------~----~----~----~------~----~------~--~---

diff -uprN linux-2.6.21/.config linux-2.6.21-patch1/.config
--- linux-2.6.21/.config	2008-05-20 16:11:56.000000000 +0200
+++ linux-2.6.21-patch1/.config	2008-05-20 12:12:15.000000000 +0200
@@ -1,7 +1,7 @@
 #
 # Automatically generated make config: don't edit
 # Linux kernel version: 2.6.21-omap1
-# Sat Apr  5 10:50:01 2008
+# Tue May 20 12:12:15 2008
 #
 CONFIG_ARM=y
 CONFIG_SYS_SUPPORTS_APM_EMULATION=y
@@ -778,7 +778,7 @@ CONFIG_INPUT_TOUCHSCREEN=y
 # CONFIG_TOUCHSCREEN_TOUCHRIGHT is not set
 # CONFIG_TOUCHSCREEN_TOUCHWIN is not set
 # CONFIG_TOUCHSCREEN_UCB1400 is not set
-CONFIG_TOUCHSCREEN_TSC2005=y
+# CONFIG_TOUCHSCREEN_TSC2005 is not set
 CONFIG_TOUCHSCREEN_TSC2301=y
 # CONFIG_TOUCHSCREEN_TSC2046 is not set
 # CONFIG_INPUT_MISC is not set
diff -uprN linux-2.6.21/drivers/char/sysrq.c linux-2.6.21-patch1/drivers/char/sysrq.c
--- linux-2.6.21/drivers/char/sysrq.c	2007-04-26 05:08:32.000000000 +0200
+++ linux-2.6.21-patch1/drivers/char/sysrq.c	2008-05-20 16:24:13.000000000 +0200
@@ -310,6 +310,21 @@ static struct sysrq_key_op sysrq_unrt_op
 	.enable_mask	= SYSRQ_ENABLE_RTNICE,
 };
 
+/* android-start */
+extern bool tsc_androidmode;
+
+static void sysrq_handle_tscandroid(int key, struct tty_struct *tty)
+{
+	tsc_androidmode = !tsc_androidmode;
+}
+static struct sysrq_key_op sysrq_tscandroid_op = {
+	.handler	= sysrq_handle_tscandroid,
+	.help_msg	= "Touch Screen Mode Change",
+	.action_msg	= "Changing",
+	.enable_mask	= SYSRQ_ENABLE_TSCANDROID,
+};
+/* android-end */
+
 /* Key Operations table and lock */
 static DEFINE_SPINLOCK(sysrq_key_table_lock);
 
@@ -358,7 +373,9 @@ static struct sysrq_key_op *sysrq_key_ta
 	/* x: May be registered on ppc/powerpc for xmon */
 	NULL,				/* x */
 	NULL,				/* y */
-	NULL				/* z */
+	/* android-start */
+	&sysrq_tscandroid_op /* z */
+	/* android-end */
 };
 
 /* key2index calculation, -1 on invalid index */
diff -uprN linux-2.6.21/drivers/input/touchscreen/tsc2301_ts.c linux-2.6.21-patch1/drivers/input/touchscreen/tsc2301_ts.c
--- linux-2.6.21/drivers/input/touchscreen/tsc2301_ts.c	2008-05-20 16:11:57.000000000 +0200
+++ linux-2.6.21-patch1/drivers/input/touchscreen/tsc2301_ts.c	2008-05-20 16:29:52.000000000 +0200
@@ -275,9 +275,21 @@ static void tsc2301_ts_stop_scan(struct 
 	tsc2301_kp_restart(tsc);
 }
 
+/* android-start */
+bool tsc_androidmode;
+EXPORT_SYMBOL(tsc_androidmode);
+/* android-end */
+
 static void update_pen_state(struct tsc2301_ts *ts, int x, int y, int pressure)
 {
 	if (pressure) {
+        /* android-start */
+		if (tsc_androidmode)
+		{
+			x = abs((x - 250) * 800 / 3600);
+			y = abs((3600 - y) * 480 / 3200);
+		}
+		/* android-end */
 		input_report_abs(ts->idev, ABS_X, x);
 		input_report_abs(ts->idev, ABS_Y, y);
 		input_report_abs(ts->idev, ABS_PRESSURE, pressure);
@@ -591,10 +603,13 @@ int __devinit tsc2301_ts_init(struct tsc
 		r = -ENOMEM;
 		goto err2;
 	}
-	idev->name = "TSC2301 touchscreen";
-	snprintf(ts->phys, sizeof(ts->phys),
-		 "%s/input-ts", tsc->spi->dev.bus_id);
-	idev->phys = ts->phys;
+	
+	/* android-start */
+	//idev->name = "TSC2301 touchscreen";
+	//snprintf(ts->phys, sizeof(ts->phys),
+	//	 "%s/input-ts", tsc->spi->dev.bus_id);
+	//idev->phys = ts->phys;
+	/* android-end */
 
 	idev->evbit[0] = BIT(EV_ABS) | BIT(EV_KEY);
 	idev->absbit[0] = BIT(ABS_X) | BIT(ABS_Y) | BIT(ABS_PRESSURE);
@@ -602,11 +617,21 @@ int __devinit tsc2301_ts_init(struct tsc
 
 	tsc2301_ts_setup_spi_xfer(tsc);
 
+	/* android-start */
+	x_max = 800;
+	y_max = 480;
+	/* android-end */
+
 	/* These parameters should perhaps be configurable? */
 	input_set_abs_params(idev, ABS_X, 0, x_max, x_fudge, 0);
 	input_set_abs_params(idev, ABS_Y, 0, y_max, y_fudge, 0);
 	input_set_abs_params(idev, ABS_PRESSURE, 0, ts->p_max, p_fudge, 0);
 
+	/* android-start */
+	set_bit(BTN_TOUCH, idev->keybit);
+	bitmap_fill(idev->absbit, ABS_MAX);
+	/* android-end */
+
 	tsc2301_ts_start_scan(tsc);
 
 	r = request_irq(ts->irq, tsc2301_ts_irq_handler,
diff -uprN linux-2.6.21/include/linux/sysrq.h linux-2.6.21-patch1/include/linux/sysrq.h
--- linux-2.6.21/include/linux/sysrq.h	2007-04-26 05:08:32.000000000 +0200
+++ linux-2.6.21-patch1/include/linux/sysrq.h	2008-05-20 12:32:20.000000000 +0200
@@ -27,6 +27,9 @@ struct tty_struct;
 #define SYSRQ_ENABLE_SIGNAL	0x0040
 #define SYSRQ_ENABLE_BOOT	0x0080
 #define SYSRQ_ENABLE_RTNICE	0x0100
+/* andrea-start */
+#define SYSRQ_ENABLE_TSCANDROID	0x0200
+/* andrea-end */
 
 struct sysrq_key_op {
 	void (*handler)(int, struct tty_struct *);

Reply via email to