linux-usb.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Paul Cercueil <paul@crapouillou.net>
To: Chunfeng Yun <chunfeng.yun@mediatek.com>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	od@zcrc.me, linux-usb@vger.kernel.org, linux-pm@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] usb: common: usb-conn-gpio: Register charger
Date: Tue, 14 Jan 2020 12:15:48 -0300	[thread overview]
Message-ID: <1579014948.3.0@crapouillou.net> (raw)
In-Reply-To: <1578536872.21256.25.camel@mhfsdcap03>

Hi Chunfeng,

Le jeu., janv. 9, 2020 at 10:27, Chunfeng Yun 
<chunfeng.yun@mediatek.com> a écrit :
> Hi Paul,
> 
> On Wed, 2020-01-08 at 14:26 -0300, Paul Cercueil wrote:
>>  Hi Greg,
>> 
>> 
>>  Le mer., janv. 8, 2020 at 17:53, Greg Kroah-Hartman
>>  <gregkh@linuxfoundation.org> a écrit :
>>  > On Tue, Jan 07, 2020 at 01:29:01AM +0100, Paul Cercueil wrote:
>>  >>  Register a power supply charger, whose online state depends on
>>  >> whether
>>  >>  the USB role is set to device or not.
>>  >
>>  > That says _what_ you are doing, but I have no idea _why_ you want 
>> to
>>  > do
>>  > this.
>>  >
>>  > What is this going to cause to have happen?  What new userspace 
>> api is
>>  > going to result?  What will a user do with this?
>> 
>>  This is useful when the USB role is the only way to know if the 
>> device
>>  is charging from USB.
> There is no charger IC on your platform?

Correct.

> 
>> 
>>  The API is the standard power supply charger API, you get a
>>  /sys/class/power_supply/xxx/online node which tells you the state of
>>  the charger.
>> 
>>  The sole purpose of this is to give userspace applications a way to
>>  know whether or not the charger is plugged.
>> 
>>  > Is this going to always show up, no matter if the role is not even
>>  > relevant for a power supply?
>> 
>>  I guess it'd always show up, yes. In which case would the role not 
>> be
>>  relevant for a power supply?
> Do you also need it if the platform don't have battery?

I guess not. Would you prefer it to be disabled by default? If so, what 
would be the way to have it enabled? A flag in devicetree?

> 
>>  Is gpio-b-connector not always used for
>>  OTG connectors?
> It also supports device only mode, usually uses vBus pin to
> enable/disable controller

Yes, that would work too. The problem would be a host-only 
gpio-b-connector.

-Paul



      reply	other threads:[~2020-01-14 15:16 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-01-07  0:29 [PATCH] usb: common: usb-conn-gpio: Register charger Paul Cercueil
2020-01-08 16:53 ` Greg Kroah-Hartman
2020-01-08 17:26   ` Paul Cercueil
2020-01-08 17:58     ` Greg Kroah-Hartman
2020-01-09  2:27     ` Chunfeng Yun
2020-01-14 15:15       ` Paul Cercueil [this message]

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=1579014948.3.0@crapouillou.net \
    --to=paul@crapouillou.net \
    --cc=chunfeng.yun@mediatek.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=od@zcrc.me \
    /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;
as well as URLs for NNTP newsgroup(s).