Thanks a bunch. I will give it a try soon. From a quick look, i don't
understand as to what the Android dependency on the touchscreen is. If it is
going via the X-server which handles the touchscreen, what
specific things Android needs differently ?
mohan
On Mon, May 5, 2008 at 4:15 PM, Georges Toth <[EMAIL PROTECTED]> wrote:
> Hi Mohan,
> > Can you tell us what it takes to fix the touchscreen in N810 ? If the
> > explanation is equally large:--), then
> > perhaps ignore it and update your site when you have time.
> I was looking at the wrong file...the patch is actually rather small :-)
> Guiyong sent me that patch ... it fixes the touchscreen
>
> Apply the patch to a nokia+android patched 2.6.21 kernel and you should
> have a working touchscreen.
>
> --
> regards,
>
> Georges Toth
>
>
> >
>
> Index: drivers/input/touchscreen/tsc2005.c
> ===================================================================
> --- drivers/input/touchscreen/tsc2005.c (revision 1269)
> +++ drivers/input/touchscreen/tsc2005.c (revision 1273)
> @@ -181,6 +181,8 @@
> };
> #define NUM_READ_REGS
> (sizeof(tsc2005_read_reg)/sizeof(tsc2005_read_reg[0]))
>
> +extern struct input_dev * android_idev;
> +
> struct tsc2005 {
> struct spi_device *spi;
>
> @@ -262,6 +264,8 @@
> int x, int y, int pressure)
> {
> if (pressure) {
> + x = abs((x -260) * 800 / 3500);
> + y = abs((3550 - y) * 480 / 3000);
> input_report_abs(ts->idev, ABS_X, x);
> input_report_abs(ts->idev, ABS_Y, y);
> input_report_abs(ts->idev, ABS_PRESSURE, pressure);
> @@ -557,7 +561,8 @@
> ts->touch_pressure = pdata->ts_touch_pressure ? : ts->p_max;
> p_fudge = pdata->ts_pressure_fudge ? : 2;
>
> - idev = input_allocate_device();
> +// idev = input_allocate_device();
> + idev = android_idev;
> if (idev == NULL) {
> r = -ENOMEM;
> goto err2;
> @@ -567,10 +572,10 @@
> * TODO: should be "TSC2005 touchscreen", but X has hardcoded these
> * strings and doesn't accept TSC2005 yet...
> */
> - idev->name = "TSC2301 touchscreen";
> - snprintf(ts->phys, sizeof(ts->phys), "%s/input-ts",
> - ts->spi->dev.bus_id);
> - idev->phys = ts->phys;
> +// idev->name = "TSC2301 touchscreen";
> +// snprintf(ts->phys, sizeof(ts->phys), "%s/input-ts",
> +// ts->spi->dev.bus_id);
> +// idev->phys = ts->phys;
>
> idev->evbit[0] = BIT(EV_ABS) | BIT(EV_KEY);
> idev->absbit[0] = BIT(ABS_X) | BIT(ABS_Y) | BIT(ABS_PRESSURE);
> @@ -578,9 +583,14 @@
>
> tsc2005_ts_setup_spi_xfer(ts);
>
> + x_max = 800;
> + y_max = 480;
> +
> 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);
> + set_bit(BTN_TOUCH, idev->keybit);
> + bitmap_fill(idev->absbit, ABS_MAX);
>
> tsc2005_start_scan(ts);
>
> Index: drivers/video/omap/omapfb_main.c
> ===================================================================
> --- drivers/video/omap/omapfb_main.c (revision 1269)
> +++ drivers/video/omap/omapfb_main.c (revision 1273)
> @@ -698,6 +698,34 @@
> struct omapfb_device *fbdev = plane->fbdev;
> int r;
>
> + if((var->rotate & 1) != (fbi->var.rotate & 1)) {
> + if((var->xres != fbi->var.yres) ||
> + (var->yres != fbi->var.xres) ||
> + (var->xres_virtual != fbi->var.yres) ||
> + (var->yres_virtual > fbi->var.xres) ||
> + (var->yres_virtual < fbi->var.xres )) {
> + printk(KERN_INFO "omapfb_check_var: failed 1\n");
> + return -EINVAL;
> + }
> + }
> + else {
> + if((var->xres != fbi->var.xres) ||
> + (var->yres != fbi->var.yres) ||
> + (var->xres_virtual != fbi->var.xres) ||
> + (var->yres_virtual > fbi->var.yres) ||
> + (var->yres_virtual < fbi->var.yres )) {
> + printk(KERN_INFO "omapfb_check_var: failed 2\n");
> + return -EINVAL;
> + }
> + }
> + if((var->xoffset != fbi->var.xoffset) ||
> + (var->bits_per_pixel != fbi->var.bits_per_pixel) ||
> + (var->grayscale != fbi->var.grayscale)) {
> +
> + printk(KERN_INFO "omapfb_check_var: failed 3\n");
> + return -EINVAL;
> + }
> +
> omapfb_rqueue_lock(fbdev);
> if (fbdev->ctrl->sync != NULL)
> fbdev->ctrl->sync();
> Index: drivers/i2c/chips/menelaus.c
> ===================================================================
> --- drivers/i2c/chips/menelaus.c (revision 1269)
> +++ drivers/i2c/chips/menelaus.c (revision 1273)
> @@ -48,6 +48,7 @@
> #include <asm/arch/menelaus.h>
>
> /*#define DEBUG*/
> +#define dev_info(dev, format, arg...) do { (void)(dev); } while (0)
>
> #define DRIVER_NAME "menelaus"
>
> Index: drivers/i2c/chips/lm8323.c
> ===================================================================
> --- drivers/i2c/chips/lm8323.c (revision 1269)
> +++ drivers/i2c/chips/lm8323.c (revision 1273)
> @@ -174,6 +174,9 @@
> struct lm8323_pwm pwm3;
> };
>
> +struct input_dev * android_idev;
> +EXPORT_SYMBOL(android_idev);
> +
> #define client_to_lm8323(c) container_of(c, struct lm8323_chip,
> client)
> #define dev_to_lm8323(d) container_of(d, struct lm8323_chip,
> client.dev)
> #define work_to_lm8323(w) container_of(w, struct lm8323_chip, work)
> @@ -801,6 +804,7 @@
> err = -ENOMEM;
> goto fail8;
> }
> + android_idev = idev;
>
> if (lm8323_pdata->name)
> idev->name = lm8323_pdata->name;
> @@ -822,7 +826,7 @@
> set_bit(EV_REP, idev->evbit);
>
> lm->idev = idev;
> - input_register_device(idev);
> +// input_register_device(idev);
>
> return 0;
>
>
>
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---