and power management into multiple files. This removes some dirty hacks
and improves the quality of the code.
- j720kbd.c - keyboard driver
* Converted to use the hpckbd(4) interface.
* Remove the old keymap file since it's no longer used.
- j720lcd.c - lcd brightness/control/power control
- j720pwr.c - power management
* Converted to use the hpcapm(4) interface.
* Fix the battery charge status. The values are non-linear so in order
to display a reasonable charge status we use a few charge points in
a table and interpolate between that.
- j720tp.c - touch-panel driver
- j720ssp.c - SSP port (on the SA-1110)
Many thanks to cube@ and uwe@ for providing useful feedback and reviewing
the changes.
- when moving the stylus, the cursor was updated only when the screen was
released
- when moving the stylus for too long, the kernel crashed
This was caused by improper delays in SSP read and write, and by interrupt
hammering while the screen is touched). Both led to the machine handling
interrupts all the time and been unable to schedule the X server, therefore
the lack of cursor refresh.
The problem is fixed by
- masking touchpanel interrupts as soon as we are already handling them
- creating a kernel thread (j720ssp) that takes care of keyboard and
touchpanel I/O, instead of doing it in a softintr.
- reducing delays in j720ssp_readwrite operations from 5ms to 0.1ms.
NB: If the delay in j720ssp_readwrite operation is lowered to 0.1, then
switching on the screen using the power key pushes brightness to maximum.
In order to avoid this, we introduce a wait argument to j720ssp_readwrite,
which specify how many microseconds we have to wait. j720ssp_readwrite is
called with wait = 100 everywhere except in j720lcdparam where it is called
with wait = 500. That way it works.
indicating an unhandled "command". ERESTART is -1, which can lead to
confusion. ERESTART has been moved to -3 and EPASSTHROUGH has been
placed at -4. No ioctl code should now return -1 anywhere. The
ioctl() system call is now properly restartable.