Thursday, 27 June 2013

Working with arago patchset

This time I will try to document things properly as I go .

I'm going to forward port the improvements in the arago tree.

After going through all the commits I have to say. Thats a lot of work..

I could just ignore the mfd-next patch and take these changes for BBB 3.8 tree.

However that would defeat the purpose later on. Upstreaming patches and making our tree closer to the mainline. mfd-next is what will be the ADC driver later on. Because those patches have been upstreamed. Like it or not.

So I'll have to layer all these changes on top of that. And then upstream them hopefully..;a=commitdiff;h=98260cf92c52e7e4eef3b64b7dcf43d3f14ea969
Registers children TSC and ADC only if available. This change is already incorporated.;a=commitdiff;h=2c67698139cceee19d2205ad34d11c74e758b307
AFE Pen Ctrl and TouchScreen transistors enabling is not

required when only ADC mode is being used, so check for availability of

TSC driver before accessing control register.

Update: Have applied this patch on my 3.8 tree.;a=commitdiff;h=2ce225a521671644ddc4d7b472fac139bb64f9c4
Tries to number channels from 1 instead of 0. Not a particularly useful change.
Also. Driver format has changed quite a bit compared to what I have..

Update: Ignored this one.;a=commitdiff;h=663aa2e74f36a5a8000224b37a74c11ee729550d
Important Patch.
Message "Previously we tried to read data form ADC even before ADC sequencer finished sampling. This led to wrong samples.  We now wait on ADC status register idle bit to be set."

Update: have applied this patch to the 3.8 tree. Led to the correction of the first sample.;a=commitdiff;h=09597d7a244a8e6f5ea79da3c5dced3a5ea620c4
Important. Sets the ground for interrupt handling on the TSC side.
At the moment IRQ is taken only by TSC. This starts changes to shared structure.

"Touchscreen and ADC share the same IRQ line from parent MFD core. Previously only Touchscreen was interrupt based. With continuous mode support added in ADC driver, now driver requires interrupt to process the ADC samples, so enable shared IRQ flag bit for touchscreen."

Update: Have applied this patch to the 3.8 tree.

Update: We(Me, Koen, Greg KH) decided to freeze development on the 3.8 tree and move to 3.11.

I have added another fix which removes the need for bone-helper. The 3.8 tree had the bone-helper driver to help with ADC detection and scale values to 1.8v.
There were bugs in the underlying driver as well which caused erroneous values and the need to sample twice.

The ADC driver for the 3.8 tree will hopefully be replaced by this new patchset I have soon. I am still testing and refining the patchset.
But I have successfully scaled the voltage values within the IIO subsystem model. And fixed the need for sampling twice. The tests I have run yet are simple connecting the adc to ground or 1.8v or 1.5v. And checking via sysfs.
The more thorough test for /dev/iio via a userspace application is needed.
And the interaction between the touchscreen and ADC drivers is to be tested and seen if it works.

The patches below and the ones above will be applied to the 3.11 tree after re-basing the ones from mfd-next by Sebastian as well.;a=commitdiff;h=b332370651a7d64d3c6ed8780d939fc18163e141
Most important patch I guess. Adds continuous mode and IRQ.;a=commitdiff;h=478af139295b451c59eeba8f851654964321cbfe
Imp "ADC reports few wrong/erroneous data on read in continuous mode. Providing an appropriate delay so that ADC has sufficient time to sequence data present on the input channel. ";a=commitdiff;h=585b034972eb667cce3bf9f3bc5bb46f1f21bced
Imp. "The ADC driver did not check for FIFO1 underflow and overrun conditions. Add support to handle these conditions. TSC/ADC module does not recover from this state by itself, a module reset is required."

The driver has diverged a lot from what is in mfd-next. Poll handler. Irq. continuous mode.;a=commitdiff;h=b9a063a1654653348161de8d3d411d8ce2f56856
not implemented.;a=commitdiff;h=adb9fa13a403f0f6f4e0d57a0bfcfd1a91e0edea
not implemented;a=commitdiff;h=1be244a840f9a162e3c832d7c1686100a6096a7c
not implemented;a=commitdiff;h=333f3460f855abd02c7e7eefcb692740ecd9c662
Simple one. Can be applied easily. Clock 3MHz check.;a=commitdiff;h=a62dbd7027667d99254f0f38f9364e4edcd56ddc
Seems similar to what is there. But error handling corrections.;a=commitdiff;h=0f2a3e7288e91d42f9a527f193b1df61d5afff5c
FIFO 0 for tsc only. not implemented. quite different structure..;a=commitdiff;h=2e8d35ab98789ee8b0d0d56c2a5d72940ffb2670
Not implemented. Quite different.;a=commitdiff;h=2ab9b41a1ac235c81f20bfebec69d4eb7021b275
Very different structure. Some TSC fifo issue.;a=commitdiff;h=931e7f0032c5113f82f7b59b29406d2e9eab1c48
Step enable bits etc. Not implemented for continuous mode.

Russ dills bugfixes from now onwards. These are small bug fixes.;a=commitdiff;h=7ce1a9f88aea036034e5e7dc65480694e7e0913d
IRQ stuff again.;a=commitdiff;h=8607406b53cc6bd65cd48ed17d34ae2455271aa2
IRQ stuff;a=commitdiff;h=7fb9db4270711a434a8dd322ad1e3a6e7f798b91
IRQ stuff;a=commitdiff;h=bd967ca8af48bd56076fad77ac77a010f3efd21c
IRQ Stuff;a=commitdiff;h=da42b4c279d6241cab87bff5ea6d83c02651ef7e
IRQ Stuff;a=commitdiff;h=7295475758e73aa72a92cdc720186698cec8d033
FIFO clear on next work.;a=commitdiff;h=de871da92081b17d6f286b5774ce24a938065f0b
Some error handling;a=commitdiff;h=2404a847db796cd17a9189d7ac2b73fe22446ebf
Some fifo check.;a=commitdiff;h=337c3895437961b85bf507cfe2e2847a7851b4f2
tiny Fix;a=commitdiff;h=a819c4feafe9eac8d2e756954ab4e111c5b83732
Reverses a previous commit for delay that is not needed.;a=commitdiff;h=18ce4a630452348b8308b922491130e8ce1e9134
Some power stuff. small.

No comments:

Post a Comment