Wednesday, 26 June 2013

Working with a patchset upstreamed via mfd-next

Ok. So I started from scratch on the ADC drivers.

My current aims are to start from 0 ADC patches in the 3.8 tree we have.

Then go up to the patches in mfd-next which incorporate a number of changes.

But I couldn't just apply those patches directly could I. Tweaks and changes were needed.

List of changes.

Subject: [PATCH 05/21] input: ti_am33x_tsc: Add DT support
Guy missed out two steps to configure change to coordinate readout. But he removes the function later on so his tree doesn't break..
I wanted to keep that function later.

Did not apply number 6,8,11,14 which removes platfrom data support
Did not apply 15 and 16 which only renames DT bindings. But that would be unwise as it would mean changing DT patches.

Tweaked 9 as the patch changed the name to am3359 in places. Keeping it tsadc would be wise as that would keep DT unaffected.
Tweaked 20 a bit.

After a debugging session, I found out that IIO had improved from 3.8 to mfd-next. So those improvements had to be backported.
One was a bitmask. The other was interesting. While getting DT from childs a function would be called again in sub-functions. The data structure was tweaked to not require this. But I went back to calling the function twice instead.

IIO improvement backported. tscadc_dev->dev->of_node is being used in the 3.8 IIO. Not pdev->dev_of_node. which

Also. IIO was restructured a bit. A
node = of_get_child_by_name(pdev->dev.of_node, "adc"); was added in adc probe.

"EDIT. Dont make this mistake again. Be extra vigilant. Or you'll be debugging oops errors forever..

+        node = of_get_child_by_name(node, "adc");

And watch oops errors. They may have changed while you assume you are getting the same error.."

 Basically this function was called twice in 3.8. Till mfd-next (3.10 i think) the data structure had changed. Such that the nested call already had the ds and didn't need

12,17,18,19,20 caused hunk fix problems. git am wouldn't like them
So I used patch then diff to correct stuff.

Because of all my work in the ADC patches. There was one minor inconvenience in the other patches in the tree.
 the surrounding code had changed for a patch that was adding to the DT.
So I tweaked the DT stuff a bit as well.

was ti,adc-channels = <8>;
ti,adc-channels = <4 5 6 7>;

Channel access had changed. So I had to change DT stuff slightly to the above in our relevant BB patches too.

Now for debugging the ADC more and the arago improvements. which are much more in number! And much better for ADC!

But I guess if I layer patches on top of this I could easily re-base them for upstreaming. Yea :)


No comments:

Post a Comment