lkml.org 
[lkml]   [2009]   [Jan]   [25]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [RFC] power: add optional OTG transceiver and voltage regulator support to pda_power
On Sun, Jan 18, 2009 at 05:40:27PM +0100, Philipp Zabel wrote:
> This patch allows machines to use an OTG transceiver driver instead of
> supplying a custom is_usb_online callback to check USB power.
> Also, in the case that the OTG transceiver handles charger control when
> connected to USB, a regulator named "ac_draw" can be supplied instead of
> the custom set_charge callback to control the charger when connected to AC.
>
> The check for (transceiver->state == OTG_STATE_B_PERIPHERAL) in
> otg_is_usb_online is probably too simple, I'm just using this with a peripheral
> only device and gpio_vbus + bq24022. I'm not sure which other OTG states
> can supply power.
>
> Signed-off-by: Philipp Zabel <philipp.zabel@gmail.com>
> ---

I'm not USB OTG expert, but from the power supply point of view the
patch looks OK. If there are no objections, I'll queue it for 2.6.30.

Thanks Philipp. ;-)

[...]
> +#ifdef CONFIG_USB_OTG_UTILS
> + transceiver = otg_get_transceiver();
> + if (transceiver && !pdata->is_usb_online) {
> + pdata->is_usb_online = otg_is_usb_online;
> + }
> +#endif

On a general note, I'd prefer linux/usb/otg.h provide stubs for
!USB_OTG_UTILS case.. I.e.

#ifdef CONFIG_USB_OTG_UTILS
extern struct otg_transceiver *otg_get_transceiver(void);
extern void otg_put_transceiver(struct otg_transceiver *);
#else
static inline struct otg_transceiver *otg_get_transceiver(void)
{ return NULL; }
static inline void otg_put_transceiver(struct otg_transceiver *) {}
#endif

That way we could avoid #ifdefs in drivers.

--
Anton Vorontsov
email: cbouatmailru@gmail.com
irc://irc.freenode.net/bd2


\
 
 \ /
  Last update: 2009-01-26 01:17    [W:0.036 / U:0.068 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site