Sabrelite: New FT5x06 touch screen and swapped Y (input_set_abs_params)

cancel
Showing results for 
Search instead for 
Did you mean: 

Sabrelite: New FT5x06 touch screen and swapped Y (input_set_abs_params)

Jump to solution
4,009 Views
ThomasG1z
Contributor III

Trying to get a new display working on the Nitrogen6x/Sabrelite.

Boundarydevices have a touch driver for  the FT5x06 controller located in /drivers/input/touchscreen/ft5x06.c. The resolution of my display is 800x480 vs 1024x598 as defined in the driver, so I changed the init like so:

input_set_abs_params(idev, ABS_X, 0, 799, 0, 0);

input_set_abs_params(idev, ABS_Y, 0, 479, 0, 0);

input_set_abs_params(idev, ABS_PRESSURE, 0, 1, 0, 0);

Now the whole X and Y direction is used but Y is flipped, so I tried to swap the min and max for the Y orientation like so:

input_set_abs_params(idev, ABS_Y, 479, 0, 0, 0);

but no difference... Any idea what how to swap the Y coordinates?

Tried this using a modified kernel under the ubuntu rfs relase.

0 Kudos
1 Solution
483 Views
EricNelson
Senior Contributor II

The input_set_abs_params() call is used to inform userspace about the range of values and changing just those calls won't change the exact values.

The ft5x06 controllers we have were tuned to 1024/600 display, so these just happen to return pixel values on our screens.

Are you actually reading the same range on your 800x480 display or are you reading something more like the pixel values?

To swap the Y axis, you'll probably want to add code into the ts_evt_add() routine or use tslib to do the translation in userspace.

View solution in original post

0 Kudos
7 Replies
483 Views
karina_valencia
NXP Apps Support
NXP Apps Support

EricNelson can you help on this case?

0 Kudos
484 Views
EricNelson
Senior Contributor II

The input_set_abs_params() call is used to inform userspace about the range of values and changing just those calls won't change the exact values.

The ft5x06 controllers we have were tuned to 1024/600 display, so these just happen to return pixel values on our screens.

Are you actually reading the same range on your 800x480 display or are you reading something more like the pixel values?

To swap the Y axis, you'll probably want to add code into the ts_evt_add() routine or use tslib to do the translation in userspace.

View solution in original post

0 Kudos
483 Views
ThomasG1z
Contributor III

You're right. I just inverted the reporting of the y position by doing a "480 - Y" in the function and it's good..

0 Kudos
483 Views
vijayendraagraw
Contributor I

Can you pl send me the link to touch driver you have used. We have Nitrogen 6x board with higher resolution display so default touch screen driver from Boundary Devices should work.

0 Kudos
483 Views
ThomasG1z
Contributor III

It was the Boundary Devices driver I used in it's full form, but only swapped the Y orientation in the mentioned function, as our touch panel was flipped with regard to the lcd panel. Though, I see that BD has since updated the driver seemingly to better support various resolutions. Have you tried doing a calibration with the tslib tool? Or have you checked with 'evtest' what your touch screen is reporting?

Taken a look here?

https://github.com/boundarydevices/linux-imx6/blob/boundary-imx_3.0.35_4.1.0/drivers/input/touchscre...

0 Kudos
483 Views
EricNelson
Senior Contributor II

Hi Thomas and Vijayendra,

The recent changes to the driver allow a 'screenres' parameter of the form "1024,600" or "1280,800" for use with various displays.

In contrast to most multi-touch chip-sets, the displays we're receiving are calibrated to return pixel locations, so the driver needs to know the min/max for each direction.

0 Kudos
483 Views
ThomasG1z
Contributor III

I though perhaps the output from the ft5x06 was some kind of raw data, but actually changing the range as above to 800x480 I have perfect range from left to right and top down, only Y is swapped.

Thanks for your input, will take a look into that.

By the way do you know where I can find a protocol spec for this touch controller? Been looking all around and even asking FT but no response.

0 Kudos