mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Lanslott Gish" <lanslott.gish@gmail.com>
To: "Daniel Ritz" <daniel.ritz-ml@swissonline.ch>
Cc: "Greg KH" <greg@kroah.com>,
	"Dmitry Torokhov" <dmitry.torokhov@gmail.com>,
	linux-kernel <linux-kernel@vger.kernel.org>,
	linux-usb <linux-usb-devel@lists.sourceforge.net>,
	tejohnson@yahoo.com, hc@mivu.no, vojtech@suse.cz
Subject: Re: [RFC][PATCH] USB touch screen driver, all-in-one
Date: Tue, 21 Mar 2006 14:39:08 +0800	[thread overview]
Message-ID: <38c09b90603202239l66e1d4bds33c2023f85587299@mail.gmail.com> (raw)
In-Reply-To: <38c09b90603161846n47b5d47fnc6b4d4b9ff2d078b@mail.gmail.com>

On 3/17/06, Lanslott Gish <lanslott.gish@gmail.com> wrote:
> On 3/16/06, Daniel Ritz <daniel.ritz-ml@swissonline.ch> wrote:
> that just can't be right. you probably mean
> +       *y = pkt[3] | ((pkt[4] & 0x0F) << 8);
>
> otherwise you mask out bits 4-7. but you want to limit it to 12 bits...
> (btw. no need for the & 0xFF mask since *pkt is char)
>
>
> you are right, sorry for my fault. the truely way is
>
> +       *x = (pkt[1] & 0xFF) | ((pkt[2] & 0x0F) << 8);
> +       *y = (pkt[3] & 0xFF) | ((pkt[4] & 0x0F) << 8);
>
> still need 12 bits( 0x0FFF) and the masks to avoid get negative.
>


OK, Here we go~
i try your patch:

+	printk("pkg_dbg,%x,%x,%x,%x\n",pkt[1],pkt[2],pkt[3],pkt[4]);
+       *x = pkt[1] | ((pkt[2] & 0x0F) << 8);
+       *y = pkt[3] | ((pkt[4] & 0x0F) << 8);
+       printk("touchset_dbg,%x,%x,%d,%d\n",*x,*y,*x,*y);

and here is parts of the /var/log/message (raw data from 4 corners of
the panel):

---------------------------------------------------------------------------
Mar 21 14:33:52 localhost kernel: input: PANJIT TouchSet USB Touch
Panel as /class/input/input12
Mar 21 14:33:55 localhost input.agent[10300]:      joydev: already loaded
Mar 21 14:34:38 localhost kernel: pkg_dbg,fffffff9,1,2d,e
Mar 21 14:34:38 localhost kernel: touchset_dbg,fffffff9,e2d,-7,3629
Mar 21 14:34:38 localhost kernel: pkg_dbg,fffffff8,1,2c,e
Mar 21 14:34:38 localhost kernel: touchset_dbg,fffffff8,e2c,-8,3628
Mar 21 14:34:38 localhost kernel: pkg_dbg,fffffff4,1,2d,e
Mar 21 14:34:38 localhost kernel: touchset_dbg,fffffff4,e2d,-12,3629
Mar 21 14:34:38 localhost kernel: pkg_dbg,fffffff2,1,2d,e
Mar 21 14:34:38 localhost kernel: touchset_dbg,fffffff2,e2d,-14,3629
Mar 21 14:34:38 localhost kernel: pkg_dbg,fffffff1,1,2e,e
Mar 21 14:34:38 localhost kernel: touchset_dbg,fffffff1,e2e,-15,3630
Mar 21 14:34:39 localhost kernel: pkg_dbg,20,3,ffffffae,2
Mar 21 14:34:39 localhost kernel: touchset_dbg,320,ffffffae,800,-82
Mar 21 14:34:39 localhost kernel: pkg_dbg,20,3,ffffffae,2
Mar 21 14:34:39 localhost kernel: touchset_dbg,320,ffffffae,800,-82
Mar 21 14:34:39 localhost kernel: pkg_dbg,1d,3,ffffffb2,2
Mar 21 14:34:39 localhost kernel: touchset_dbg,31d,ffffffb2,797,-78
Mar 21 14:34:39 localhost kernel: pkg_dbg,1b,3,ffffffb4,2
Mar 21 14:34:39 localhost kernel: touchset_dbg,31b,ffffffb4,795,-76
Mar 21 14:34:41 localhost kernel: pkg_dbg,ffffffa4,c,75,d
Mar 21 14:34:41 localhost kernel: touchset_dbg,ffffffa4,d75,-92,3445
Mar 21 14:34:41 localhost kernel: pkg_dbg,ffffffa4,c,7a,d
Mar 21 14:34:41 localhost kernel: touchset_dbg,ffffffa4,d7a,-92,3450
Mar 21 14:34:41 localhost kernel: pkg_dbg,ffffffa2,c,ffffff81,d
Mar 21 14:34:41 localhost kernel: touchset_dbg,ffffffa2,ffffff81,-94,-127
Mar 21 14:34:41 localhost kernel: pkg_dbg,ffffff9d,c,ffffff87,d
Mar 21 14:34:41 localhost kernel: touchset_dbg,ffffff9d,ffffff87,-99,-121
Mar 21 14:34:42 localhost kernel: pkg_dbg,ffffff86,d,ffffffcf,1
Mar 21 14:34:42 localhost kernel: touchset_dbg,ffffff86,ffffffcf,-122,-49
Mar 21 14:34:42 localhost kernel: pkg_dbg,74,d,ffffffd7,1
Mar 21 14:34:42 localhost kernel: touchset_dbg,d74,ffffffd7,3444,-41
Mar 21 14:34:42 localhost kernel: pkg_dbg,58,d,ffffffe0,1
Mar 21 14:34:42 localhost kernel: touchset_dbg,d58,ffffffe0,3416,-32
----------------------------------------------------------------------


is anything weird?
and i try my codes:

+	printk("pkg_dbg,%x,%x,%x,%x\n",pkt[1],pkt[2],pkt[3],pkt[4]);
+       *x = (pkt[1] & 0xFF) | ((pkt[2] & 0x0F) << 8);
+       *y = (pkt[3] & 0xFF) | ((pkt[4] & 0x0F) << 8);
+	printk("touchset_dbg,%x,%x,%d,%d\n",*x,*y,*x,*y);

and here is the /var/log/message (the same, 4 coners):

---------------------------------------------------------------------
Mar 21 14:38:14 localhost kernel: usbcore: deregistering driver usbtouchscreen
Mar 21 14:38:14 localhost kernel: input: PANJIT TouchSet USB Touch
Panel as /class/input/input14
Mar 21 14:38:14 localhost kernel: usbcore: registered new driver usbtouchscreen
Mar 21 14:38:17 localhost input.agent[10688]:      joydev: already loaded
Mar 21 14:38:38 localhost kernel: pkg_dbg,5,2,6,e
Mar 21 14:38:38 localhost kernel: touchset_dbg,205,e06,517,3590
Mar 21 14:38:38 localhost kernel: pkg_dbg,fffffffe,1,13,e
Mar 21 14:38:38 localhost kernel: touchset_dbg,1fe,e13,510,3603
Mar 21 14:38:38 localhost kernel: pkg_dbg,fffffff0,1,22,e
Mar 21 14:38:38 localhost kernel: touchset_dbg,1f0,e22,496,3618
Mar 21 14:38:39 localhost kernel: pkg_dbg,ffffffd5,2,ffffff99,2
Mar 21 14:38:39 localhost kernel: touchset_dbg,2d5,299,725,665
Mar 21 14:38:39 localhost kernel: pkg_dbg,ffffffd2,2,ffffff9a,2
Mar 21 14:38:39 localhost kernel: touchset_dbg,2d2,29a,722,666
Mar 21 14:38:39 localhost kernel: pkg_dbg,ffffffce,2,ffffff9c,2
Mar 21 14:38:39 localhost kernel: touchset_dbg,2ce,29c,718,668
Mar 21 14:38:39 localhost kernel: pkg_dbg,ffffffc9,2,ffffff9e,2
Mar 21 14:38:39 localhost kernel: touchset_dbg,2c9,29e,713,670
Mar 21 14:38:41 localhost kernel: pkg_dbg,6e,d,ffffffec,d
Mar 21 14:38:41 localhost kernel: touchset_dbg,d6e,dec,3438,3564
Mar 21 14:38:41 localhost kernel: pkg_dbg,71,d,ffffffed,d
Mar 21 14:38:41 localhost kernel: touchset_dbg,d71,ded,3441,3565
Mar 21 14:38:41 localhost kernel: pkg_dbg,72,d,ffffffed,d
Mar 21 14:38:41 localhost kernel: touchset_dbg,d72,ded,3442,3565
Mar 21 14:38:41 localhost kernel: pkg_dbg,71,d,ffffffed,d
Mar 21 14:38:41 localhost kernel: touchset_dbg,d71,ded,3441,3565
Mar 21 14:38:41 localhost kernel: pkg_dbg,5f,d,ffffffec,d
Mar 21 14:38:41 localhost kernel: touchset_dbg,d5f,dec,3423,3564
Mar 21 14:38:42 localhost kernel: pkg_dbg,ffffffac,d,ffffffd0,1
Mar 21 14:38:42 localhost kernel: touchset_dbg,dac,1d0,3500,464
Mar 21 14:38:42 localhost kernel: pkg_dbg,ffffffae,d,ffffffd0,1
Mar 21 14:38:42 localhost kernel: touchset_dbg,dae,1d0,3502,464
Mar 21 14:38:42 localhost kernel: pkg_dbg,ffffffa3,d,ffffffdb,1
Mar 21 14:38:42 localhost kernel: touchset_dbg,da3,1db,3491,475
Mar 21 14:38:42 localhost kernel: pkg_dbg,ffffff92,d,ffffffe6,1
Mar 21 14:38:42 localhost kernel: touchset_dbg,d92,1e6,3474,486
---------------------------------------------------------------------
i think my codes is correct.

so, make sure that your device differ with mine. :)


regards,

Lanslott Gish
--
L.G, Life's Good~

  parent reply	other threads:[~2006-03-21  6:39 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-03-10  9:24 [PATCH] Try to add support for universal USB touchscreen device, and WISH for help~ Lanslott Gish
2006-03-11 20:55 ` [RFC][PATCH] USB touch screen driver, all-in-one Daniel Ritz
2006-03-12  1:31   ` Dmitry Torokhov
2006-03-13  1:01   ` Lanslott Gish
2006-03-14  1:10     ` Lanslott Gish
2006-03-14 10:38       ` Jan-Benedict Glaw
2006-03-15  4:30         ` Lanslott Gish
2006-03-15 14:08           ` Jan-Benedict Glaw
2006-03-16  6:46             ` Lanslott Gish
2006-03-15 21:53           ` Daniel Ritz
2006-03-17  2:46             ` Lanslott Gish
2006-03-17 21:50               ` Daniel Ritz
2006-03-21  4:23                 ` Lanslott Gish
2006-03-21 20:22                   ` Daniel Ritz
2006-03-21 22:48                     ` Todd E. Johnson
2006-03-21  6:39               ` Lanslott Gish [this message]
2006-03-21 20:21                 ` Daniel Ritz
2006-03-15 21:54   ` Daniel Ritz
2006-03-15 22:13     ` Greg KH

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=38c09b90603202239l66e1d4bds33c2023f85587299@mail.gmail.com \
    --to=lanslott.gish@gmail.com \
    --cc=daniel.ritz-ml@swissonline.ch \
    --cc=dmitry.torokhov@gmail.com \
    --cc=greg@kroah.com \
    --cc=hc@mivu.no \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-usb-devel@lists.sourceforge.net \
    --cc=tejohnson@yahoo.com \
    --cc=vojtech@suse.cz \
    /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

all inboxes | Powered by JetHome®