Re: [PATCH 3/6] twl4030_charger: allow charging whenever VBUS is present.

From: Grazvydas Ignotas
Date: Wed Apr 25 2012 - 07:33:22 EST


On Wed, Apr 25, 2012 at 10:33 AM, NeilBrown <neilb@xxxxxxx> wrote:
> We currently refuse to charge if the USB ID pin is grounded, even
> though VBUS might be present.
> However some chargers do pull the ID pin low through a resistor which
> might be as low as 47Kohm (openmoko charger).
>
> The documentation is unclear but some experimental evidence suggests
> that when the charge pump provides VBUS that doesn't get reflected in
> HW_CONDITIONS, so we should be safe to ignore the ID pin.

On pandora I see the opposite, STS_VBUS is set regardless of who
drives it, so this will break pandora..

>
> Signed-off-by: NeilBrown <neilb@xxxxxxx>
> ---
>
> Âdrivers/power/twl4030_charger.c | Â Â6 +-----
> Â1 file changed, 1 insertion(+), 5 deletions(-)
>
> diff --git a/drivers/power/twl4030_charger.c b/drivers/power/twl4030_charger.c
> index 0511610..684662a 100644
> --- a/drivers/power/twl4030_charger.c
> +++ b/drivers/power/twl4030_charger.c
> @@ -155,11 +155,7 @@ static int twl4030_bci_have_vbus(struct twl4030_bci *bci)
>
> Â Â Â Âdev_dbg(bci->dev, "check_vbus: HW_CONDITIONS %02x\n", hwsts);
>
> - Â Â Â /* in case we also have STS_USB_ID, VBUS is driven by TWL itself */
> - Â Â Â if ((hwsts & TWL4030_STS_VBUS) && !(hwsts & TWL4030_STS_USB_ID))
> - Â Â Â Â Â Â Â return 1;
> -
> - Â Â Â return 0;
> + Â Â Â return (hwsts & TWL4030_STS_VBUS);
> Â}
>
> Â/*
>
>


--
GraÅvydas
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/