Re: [PATCH 9/9] i2c: move twl4030-madc to new registration style

Mikko Ylinen
2008-09-27T07:37:48Z

Hi,

Felipe Balbi wrote:
> On Fri, Sep 26, 2008 at 10:09:12AM -0700, David Brownell wrote:
>> Passing those registers in platform data seems bizarre.
>> Doesn't the MADC code know its own register offsets??
>
> there two of them. i[ms]r[12].

twl4030 has two interrupt lines. For INT1 and INT2
lines you should use I[MS]R1 and I[MS]R2, respectively.

This is board specific information. Beagleboard uses
INT1.

>> The platform data should probably say which ADC channels
>> are wired up...

Yeah, I thought about this at the time of writing the driver
but dropped the idea because of problems with twl4030-core.

I think this is a good idea and should be re-considered now.

>> And no ADC lines are even hooked up on Beagle, so the right
>> fix is just to not provide madc platform data on beagle.
>> Probably the same is true on some other boards.
>
> Yeah, i wasn't sure if beagle and overo were using them, so I put
> anyways.

Not completely true. MADC has 16 channels out of which only 6
are truly general purpose channels. Some channels are reserved
for battery charger interface (BCI) and some for chip's internal
purposes.

Boards having twl4030 should have at least VBAT (ch 12),
V backup battery (ch 9), and VBUS (ch 8) measurement available.

On Beagleboard you can measure these three channels.

>> Plus: MADC is just a set of ADC channels, right?
>> If so, the driver should have a comment saying that.
>
> Mikko should comment on that as he wrote the driver.

How detailed information would you like to have here?

--
Regards, Mikko