nanogui: touchscreen calibration


Previous by date: 13 Mar 2002 10:21:26 -0000 Re: LCD interface..., Greg Haerr
Next by date: 13 Mar 2002 10:21:26 -0000 Re: touchscreen calibration, Alex Holden
Previous in thread: 13 Mar 2002 10:21:26 -0000 Re: touchscreen calibration, Narasimha Reddy K
Next in thread: 13 Mar 2002 10:21:26 -0000 Re: touchscreen calibration, Alex Holden

Subject: RE: [nanogui] touchscreen calibration
From: Henry Chea ####@####.####
Date: 13 Mar 2002 10:21:26 -0000
Message-Id: <ED968F412990DE4080ADEC412897784907C6A9@gotz-fs1.semcon.se>

Hi Alex,

I am modifying mou_ads.c, and I have some questions for you.

In mou_ads.c I am editing PD_SetCalibration() because it seems there is no
SetCalibration() function in this file.

In PD_SetCalibration() I have added the following code:

	if(mousedev.mode == MWMOUSEMODE_RAW) {
                ioctl(pd_fd, SHOULD_KERNEL_SCALE_DATA, NO);
        } else { 
                ioctl(pd_fd, SHOULD_KERNEL_SCALE_DATA, YES);
                ioctl(pd_fd, 10, mousedev.xmin);                //sets min x
                ioctl(pd_fd, 3, mousedev.xmax);                 //sets max x
                ioctl(pd_fd, 11, mousedev.ymin);                //sets min y
                ioctl(pd_fd, 4, mousedev.ymax);                 //sets max y
                ioctl(pd_fd, SET_Z_THRESHOLD, mousedev.zthresh);
        }

As you can see, there are some values I still have to edit.  For reference,
here is what the ioctl arguments look like for the ADS Graphicsmaster
platform (this is taken from linux/drivers/char/ucb1200_ts.c which might be
specific to my platform):

      	case 3: 
           raw_max_x = arg; 
           break; 
        case 4: 
           raw_max_y = arg; 
           break; 
        case 5: 
           res_x = arg; 
           break; 
        case 6: 
           res_y = arg; 
           break; 
        case 10: 
           raw_min_x = arg; 
           break; 
        case 11: 
           raw_min_y = arg; 
           break; 
        case 12: 
  /* New attribute for portrait modes */ 
           xyswap = arg; 
  /* Allen Add */ 
        case 13:         /* 0 = Enable calibration ; 1 = Calibration OK */ 
           cal_ok = arg; 
        case 14:         /* Clear all buffer data */ 
           ts_clear(); 
           break; 
        case 15:         /* X axis reversed setting */ 
           x_rev = arg; 
           break; 
        case 16:         /* Y axis reversed setting */ 
           y_rev = arg; 
           break; 
        case 17:         /* Clear all buffer data */ 
           print_par(); 
           break;


Looking at this, I see no cases for "SHOULD_KERNEL_SCALE_DATA" and
"SET_Z_THRESHOLD".  Should I remove the ioctl lines from my code that deal
with these two?  Also, is "MWMOUSEMODE_RAW" something I have to edit?

Cheers,
//Henry Chea
Semcon Sweden AB

-----Original Message-----
From: Alex Holden
To: Henry Chea
Cc: ####@####.####
Sent: 3/11/2002 8:13 PM
Subject: Re: [nanogui] touchscreen calibration

Henry Chea wrote:
> I have no idea what needs to be done to fix the ADS platform for use
with
> the new calibration functionality.

If you want to have a go at this, apply the attached patch to a recent 
snapshot of my tree, and fill in the contents of the SetCalibration() 
function in src/drivers/mou_ads.c

What it should do is something like (in pseudocode):

if(mousedev.mode == MWMOUSEMODE_RAW) {
	ioctl(pd_fd, SHOULD_KERNEL_SCALE_DATA, NO);
} else {
	ioctl(pd_fd, SHOULD_KERNEL_SCALE_DATA, YES);
	ioctl(pd_fd, SET_MIN_X, mousedev.xmin);
	ioctl(pd_fd, SET_MAX_X, mousedev.xmax);
	ioctl(pd_fd, SET_MIN_Y, mousedev.ymin);
	ioctl(pd_fd, SET_MAX_Y, mousedev.ymax);
	ioctl(pd_fd, SET_Z_THRESHOLD, mousedev.zthresh);
}

-- 
------------ Alex Holden - http://www.linuxhacker.org ------------
If it doesn't work, you're not hitting it with a big enough hammer
 <<touchscreen.patch>> 

Previous by date: 13 Mar 2002 10:21:26 -0000 Re: LCD interface..., Greg Haerr
Next by date: 13 Mar 2002 10:21:26 -0000 Re: touchscreen calibration, Alex Holden
Previous in thread: 13 Mar 2002 10:21:26 -0000 Re: touchscreen calibration, Narasimha Reddy K
Next in thread: 13 Mar 2002 10:21:26 -0000 Re: touchscreen calibration, Alex Holden


Powered by ezmlm-browse 0.20.