Subject: [PATCH 02/10] support 88pm8606 in 860x driver

From: [email-masked] (Samuel Ortiz)
Date: Mon, 30 Nov 2009 11:19:44 +0100

Hi Haojian,

On Sun, Nov 29, 2009 at 08:43:45PM -0500, Haojian Zhuang wrote:
> > On the other hand if it is impossible from a HW point of view to have a
> > platform design where you'd have either a single 8806 or a single 8807, then 2
> > things:
> > - Your driver design would be ok.
> [Haojian]: Great Thanks :)
> > - Those chip designs are really bad as it should be one and only one single
> > (and in particular only use one single i2c address space and id)
> [Haojian]: I agree this opinion that the same functionality logic
> should be placed into one chip and using single i2c address. If same
> functionality logic can be in one chip, the driver could be simpler
> without glue logic.
> >
> > Cheers,
> > Samuel.
> >
> >
> Hi Samuel,
> 
> I tried to add some comments of the chip's background. Up to now, I
> can't find a better idea to handle this driver without mixed structure
> since usb charger linkes them tightly. If there's a better prototype
> to handle this, I'll adopt it.
Thanks for the explanations, I appreciate.
Only the board definition can describe what's the relationship between your
8806 and 8807, so here is what I propose: Add an i2c address to your 880x
platform data, and have only a 8806 definition on your board specific file.
Then from the 880x driver, you check for the platform data i2c address. If
it's a valid one, that means we are expecting a 8807 to be present on the
board and thus we can instantiate this i2c device by calling i2c_new_device().
That will give you a link to your 8807 i2c client from your 8806. The
advantage of that solution is to keep the 880x driver board and design
neutral while avoiding any static definitions.
Waiting for your feedback.

Cheers,
Samuel.
 
> Thanks
> Haojian

-- 
Intel Open Source Technology Centre
http://oss.intel.com/