Looking at QT's source (qevdevtouchhandler.cpp) the calibration values (min, max, pressure…) are obtained directly from the device ioctl.
There doesn't seem to be a way in Qt to change these values.
Looking at the kernel source for my controller (ADS7843 on Atmel spi) there doesn't seem to a way to change the values from user space (/proc, /sys).
The following snippet seems to do the job – reading and writing the calibration values:
// check the parameter count
if (argc != 3 && argc != 5) {
puts ("Get usage: evgetset device absnumber");
puts ("Set usage: evgetset device absnumber valname value");
return (1);
}
// the first parameter is the device file name
fd = open(argv[1], O_RDONLY);
if (fd < 0) {
puts ("Could not open device file - are you running as root");
return (1);
}
// the second parameter is the parameter number
absnumber = atoi (argv[2]);
if (absnumber < 0 || absnumber > ABS_MAX) {
puts ("absnumber out of range");
return (1);
}
// Read the ioctl and display the current values
ioctl(fd, EVIOCGABS(absnumber), &absval);
printf ("Properties for %d\n", absnumber);
printf ("Value : %d\n", absval.value);
printf ("Minimum : %d\n", absval.minimum);
printf ("Maximum : %d\n", absval.maximum);
printf ("Fuzz : %d\n", absval.fuzz);
printf ("Flat : %d\n", absval.flat);
// printf ("Resolution : %d\n", absval.resolution);
// check if a write is wanted - and do it
if (argc == 5) {
valvalue = atoi (argv[4]);
if (!strcmp ("Value", argv[3])) absval.value = valvalue;
if (!strcmp ("Minimum", argv[3])) absval.minimum = valvalue;
if (!strcmp ("Maximum", argv[3])) puts ("Got Maximum");
if (!strcmp ("Maximum", argv[3])) absval.maximum = valvalue;
if (!strcmp ("Fuzz", argv[3])) absval.fuzz = valvalue;
if (!strcmp ("Flat", argv[3])) absval.flat = valvalue;
// if (!strcmp ("Resolution", argv[2]) absval.resolution = valvalue;
ioctl(fd, EVIOCSABS(absnumber), &absval);
}
// all done
close(fd);