public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Hans de Goede <hdegoede@redhat.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH] sunxi: axp221: Use vbus-available rather then vbus-usable for vbus-detect
Date: Mon, 23 Mar 2015 17:38:19 +0100	[thread overview]
Message-ID: <5510417B.5070608@redhat.com> (raw)
In-Reply-To: <1427128438.2507.8.camel@collins>

Hi,

On 23-03-15 17:33, Paul Kocialkowski wrote:
> Le lundi 23 mars 2015 ? 17:28 +0100, Hans de Goede a ?crit :
>> vbus-usable does not get set if power is provided through the power barrel
>> connector, even if external 5v is also present on the otg connector.
>>
>> vbus-available correctly always reflects if there is 5v present on the otg
>> connector.
>
> You (or I) could submit the very same change for the AXP209. It's the
> same bit for available (1 << 5).

Yes I was about to mail you about that when I noticed that this seems to
break actual host mode support on the otg connector, it seems that
plugging in a micro-b to usb-a receptacle (aka host) convertor + a device
plugged into the usb-a receptacle also causes bit 5 to get set :|

So my patch is no good, but powering the otg port while external 5v is present
also is not good (one side effect is that the tablet will power up immediately
after sending a power-off command to the axp221).

If you've some time to tinker with this I would appreciate any ideas
you may have (assuming the same problem exists on the axp209)
simply plug in 5v power into the power barrel, as well as 5v power
(e.g. simply from your pc) and boot up the tablet,@least in my
case then it does not properly give the charger plugged in error.

Regards,

Hans



>
>> Signed-off-by: Hans de Goede <hdegoede@redhat.com>
>> ---
>>   drivers/power/axp221.c | 2 +-
>>   1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/drivers/power/axp221.c b/drivers/power/axp221.c
>> index f758a75..dc3a7f1 100644
>> --- a/drivers/power/axp221.c
>> +++ b/drivers/power/axp221.c
>> @@ -424,7 +424,7 @@ int axp_gpio_get_value(unsigned int pin)
>>   		if (ret)
>>   			return ret;
>>
>> -		return !!(val & AXP221_POWER_STATUS_VBUS_USABLE);
>> +		return !!(val & AXP221_POWER_STATUS_VBUS_AVAIL);
>>   	default:
>>   		return -EINVAL;
>>   	}
>

  reply	other threads:[~2015-03-23 16:38 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-03-23 16:28 [U-Boot] [PATCH] sunxi: axp221: Use vbus-available rather then vbus-usable for vbus-detect Hans de Goede
2015-03-23 16:33 ` Paul Kocialkowski
2015-03-23 16:38   ` Hans de Goede [this message]
2015-03-23 22:44     ` Paul Kocialkowski
2015-03-27 20:37     ` Hans de Goede
2015-03-28  8:27       ` Paul Kocialkowski
2015-03-23 16:34 ` Hans de Goede
2015-03-23 16:46   ` Chen-Yu Tsai

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=5510417B.5070608@redhat.com \
    --to=hdegoede@redhat.com \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox