[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20090126001354.GA18543@zarina>
Date: Mon, 26 Jan 2009 03:13:54 +0300
From: Anton Vorontsov <cbouatmailru@...il.com>
To: Philipp Zabel <philipp.zabel@...il.com>
Cc: linux-kernel@...r.kernel.org, Anton Vorontsov <cbou@...l.ru>,
David Brownell <dbrownell@...rs.sourceforge.net>
Subject: Re: [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@...il.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@...il.com
irc://irc.freenode.net/bd2
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists