Subject: RE: Absolute location pointing device
To: None <tech-kern@netbsd.org>
From: TAKEMURA, Shin <takemura@netbsd.org>
List: tech-kern
Date: 12/31/1999 14:22:06
Hello, Simon, Hubert and Chris.
Thank you for your comments.

I wrote starting point code pieces (attached). Please review that.

If there aren't any objection, I will change wsconsio.h, wsmousevar.h,
wsmouse.c and all codes from which we call wsmouse_input().

Takemura

-----Original Message-----
From: TAKEMURA, Shin <takemura@netbsd.org>
To: tech-kern@netbsd.org <tech-kern@netbsd.org>
Date: Monday, December 27, 1999 1:41 PM
Subject: Absolute location pointing device


>I'm working on a touch panel device driver, which is built in VR41xx CPU.
>I'd like to make it work as the wsmouse device. But it seems that the
>wsmouse does not support a device which handles absolute corrdinates.


Index: wsconsio.h
===================================================================
RCS file: /cvsroot/syssrc/sys/dev/wscons/wsconsio.h,v
retrieving revision 1.20
diff -c -r1.20 wsconsio.h
*** wsconsio.h  1999/09/20 06:29:07     1.20
--- wsconsio.h  1999/12/31 05:00:09
***************
*** 156,161 ****
--- 156,162 ----
  #define               WSMOUSE_TYPE_USB        3       /* USB mouse */
  #define               WSMOUSE_TYPE_LMS        4       /* Logitech busmouse
*/
  #define               WSMOUSE_TYPE_MMS        5       /* Microsoft InPort
mous
e */
+ #define               WSMOUSE_TYPE_TPANEL     6       /* Generic Touch
Panel *
/

  /* Set resolution.  Not applicable to all mouse types. */
  #define       WSMOUSEIO_SRES          _IOR('W', 33, u_int)
***************
*** 171,176 ****
--- 172,193 ----
  #define               WSMOUSE_RATE_MIN        0
  #define               WSMOUSE_RATE_DEFAULT    50
  #define               WSMOUSE_RATE_MAX        100
+
+ /* Set/get sample coordinates for calibration */
+ #define WSMOUSE_CALIBCOORDS_MAX               16
+ #define WSMOUSE_CALIBCOORDS_RESET     -1
+ struct wsmouse_calibcoords {
+       int minx, miny;         /* minimum value of X/Y */
+       int maxx, maxy;         /* maximum value of X/Y */
+       int samplelen;          /* number of samples available or
+                                  WSMOUSE_CALIBCOORDS_RESET for raw mode */
+       struct wsmouse_calibcoord {
+               int rawx, rawy; /* raw coordinate */
+               int x, y;       /* translated coordinate */
+       } samples[WSMOUSE_CALIBCOORDS_MAX];     /* sample coordinates */
+ };
+ #define       WSMOUSEIO_SCALIBCOORDS  _IOR('W', 36, struct
wsmouse_calibcoords
)
+ #define       WSMOUSEIO_GCALIBCOORDS  _IOR('R', 37, struct
wsmouse_calibcoords
)

  /*
   * Display ioctls (64 - 95)
Index: wsmousevar.h
===================================================================
RCS file: /cvsroot/syssrc/sys/dev/wscons/wsmousevar.h,v
retrieving revision 1.3
diff -c -r1.3 wsmousevar.h
*** wsmousevar.h        1999/07/29 18:20:03     1.3
--- wsmousevar.h        1999/12/31 05:00:09
***************
*** 68,72 ****
  /*
   * Callbacks from the mouse driver to the wsmouse interface driver.
   */
  void  wsmouse_input __P((struct device *kbddev, u_int btns,
!                          int dx, int dy, int dz));
--- 68,73 ----
  /*
   * Callbacks from the mouse driver to the wsmouse interface driver.
   */
+ #define WSMOUSE_INPUT_ABSOLUTE        (1<<0)
  void  wsmouse_input __P((struct device *kbddev, u_int btns,
!                          int x, int y, int z, u_int flags));

---- end of attachment