Monday, 12 August 2013

And fixes

lots of tiny fixes here n there

It turned into a chain of fixes. I'd fix one and then find another in the process.
Fixes would become bugs and then fixes for that lol ;)

Lets see.

HW preempt enabled.
Before, ADC was given priority. Not TSC. TSC event couldn't mess with ADC sampling. By enabling HW pre-emption, TSC event is given priority. This was done in an attempt to fix the TSC not registering a pen UP event even if the finger was lifted. (during ADC continuous mode sampling in the background)

There is a small delay in the TSC IRQ which lets the TSC sequencer settle before checking for pen UP events. Had to increase that delay slightly to allow a pen UP to be registered.

Locks in mfd.
One fix is already in the staging. And I forgot that the function comes in pairs. I sent a fix for the set function. But forgot the clr function lol. While fixing the continuous mode driver, i found the need for the clr function and realized that the fix is mising here..

TSC steps enable issue
TSC steps would disable if I mess with the ADC. Because the ADC would also play with the step enable register. the common mfd core locks for set/clr help. But not completely.
In some cases (during the reg_SE read, update, write, some bit would go bad), the TSC steps wouldn't be enabled properly. And that would caused the wrong configuration to hang. So had to add a mask to the mfd core.

TSCADC disable in ADC code.
The continuous mode code was littered in dozens of places with areas that would enable/disable the entire module. I think this was the real culprit causing the entire thing to hang. Put checks around to not disable the entire module if the TSC is alive.


Reg_SE written with 0x00 on ADC side.
Previously, channels for continuous sampling would enable and disable in iio_trigger_preenable. That would mess step enb register. There was even a write 0x00 for the SE register in there.
Now they update the SE register via the common mfd core.

I guess I was looking only at the ADC before and I didn't realize.
During the bug fix phase, I'm looking at both TSC and ADC and making sure they work.

Now I have a working continuous mode with TSC events that can occur simultaneously and TSC doesn't hang.

But I have a different issue lol. Asking greg about it.
Fix in mfd tree.
Fix in iio tree.
My patch series depends on both trees. lol.
and splitting them can be tricky.

lets see. greg said something about split. most of em can be split except for one fix which can go later.
lets see.

have to sort out the code and send it to the subsystems.

No comments:

Post a Comment