[UPSTREAM - RFC] pcf50633_use_regulator_api.patch

Andy Green andy at openmoko.com
Thu Oct 9 10:17:59 CEST 2008

Hash: SHA1

Balaji Rao wrote:
> On Thu, 9 Oct 2008 00:15:07 +0200
> Harald Welte <laforge at openmoko.org> wrote:
>> Dear Balaji,
>> first of all thanks for all your work.
> Hi Harald,
> You are welcome.
>> However:
>> On Wed, Oct 08, 2008 at 07:38:45PM +0530, Balaji Rao wrote:
>>> pcf50633_use_regulator_api.patch
>> I don't really like the split betwee the i2c-pcf5633 part and the
>> regulator part.  It means that you need to publicly expose/export a
>> number of low level register read/write/set/clearbit functions, plus
>> put the entire register definitions into the public linux/pcf50633.h
>> file.
>> It is usually not a good idea to expose that many internal details to
>> the kernel.  Either you just put the two files into one driver by
>> directly linking multiple .c/.o files into one .ko, or you find some
>> other way how to find a high-level API between the two drivers.
>> I personally think putting the i2c and the regulator bits together is
>> a good idea.
> We had discussed it a bit on which approach to take. Apparently, both
> have their own advantages.
> Mark had expressed his feeling that as a subsystem maintainer he would
> prefer that things are separated. The counter argument to this would
> be that say, the pcf50633 regulator wouldn't be used by anyone other
> than us and there's no point in separating it. Both seem right :)

I guess it comes down to the number of "customers" for the exports, if
it is just two then binding them in one file and making them static
makes sense.

But there is generally regulator stuff, rtc, backlight.  Glamo is mfd
and it doesn't export its access functions, but then since it's memory
mapped it's more lightweight to reimplement them in the broken out drivers.

So it seems the question is keeping them all in one file like they are
now versus breaking them out.  Maybe we are making too much of a
mountain of it and we could just leave it in pcf50633.c without getting
thrown out of town.

- -Andy
Version: GnuPG v1.4.9 (GNU/Linux)
Comment: Using GnuPG with Fedora - http://enigmail.mozdev.org


More information about the openmoko-kernel mailing list