Re: [PATCH] power_supply: only register tosa_battery driver on tosa

Mark Brown
2008-11-03T17:41:39Z

On Mon, Nov 03, 2008 at 07:41:47PM +0300, Dmitry wrote:
> 2008/11/3 Anton Vorontsov <avorontsov@ru.mvista.com>:

> > Hmm.. So you can't rename the tosa driver, because then it won't
> > work, correct?

> * write better wm97xx interface. Dunno if that is feasible or possible.
> One of the possible solutions is to pass battery and ts device names
> and data from within board data via ac97 layer to wm97xx-core. This
> will provide several benefits (e.g. then we can drop lots of parameters
> from wm97xx-core, which are really board parameters).

There's only trivial writing required to do this in the WM97xx driver
itself - all that needs to be done is to allow the existing machine data
to be passed in as platform data and then add a couple of additional
hooks to that to allow instantation of things like the battery drivers
from machine code rather than doing it unconditionally as is done now.
The blocker currently is that it's not possible to pass any platform
data to an AC97 codec.

There was some work on doing that from Sebastian Siewior (CCed) but it
doesn't look like it ever made it to mainline. The last I saw of it[1]
it got stalled due to concerns about the difficulty in doing something
that is both type safe and general enough to cover complex cases like
the WM97xx parts that want to pass in lots of highly device and system
specific stuff. It did go into external ALSA for at least a while,
though.

It'd be really good to see some way of getting platform data to AC97
devices. It would make the WM97xx drivers a lot easier to use if we
could do it - I keep hoping to find the cycles to actively pursue this
myself but it's not happened yet.

[1] http://thread.gmane.org/gmane.linux.alsa.devel/52882