From: Felipe Balbi <balbi-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
To: Baolin Wang <baolin.wang-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>
Cc: Greg KH
<gregkh-hQyY1W1yCW8ekmWlsbkhG0B+6BGkLq7r@public.gmane.org>,
Sebastian Reichel <sre-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>,
Dmitry Eremin-Solenikov
<dbaryshkov-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>,
David Woodhouse <dwmw2-wEGCiKHe2LqWVfeAwA7xHQ@public.gmane.org>,
Peter Chen <peter.chen-KZfg59tc24xl57MIdRCFDg@public.gmane.org>,
Alan Stern
<stern-nwvwT67g6+6dFdvTe/nMLpVzexx5G7lz@public.gmane.org>,
r.baldyga-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org,
Yoshihiro Shimoda
<yoshihiro.shimoda.uh-zM6kxYcvzFBBDgjK7y7TUQ@public.gmane.org>,
Lee Jones <lee.jones-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>,
Mark Brown <broonie-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>,
Charles Keepax
<ckeepax-yzvPICuk2AATkU/dhu1WVueM+bqZidxxQQ4Iyu8u01E@public.gmane.org>,
patches-yzvPICuk2AATkU/dhu1WVueM+bqZidxxQQ4Iyu8u01E@public.gmane.org,
Linux PM list <linux-pm-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>,
USB <linux-usb-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>,
device-mainlining-cunTk1MwBs98uUxBSJOaYoYkZiVZrdSR2LY78lusg7I@public.gmane.org,
LKML <linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>
Subject: Re: [PATCH v7 1/4] gadget: Introduce the usb charger framework
Date: Thu, 31 Mar 2016 11:18:06 +0300 [thread overview]
Message-ID: <87bn5vgiwx.fsf@intel.com> (raw)
In-Reply-To: <CAMz4kuJwfWPEndmVMoDBQQFZ2X8BAzDgej_9qMKQq0xU3tC=5w-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
[-- Attachment #1: Type: text/plain, Size: 1976 bytes --]
Hi,
Baolin Wang <baolin.wang-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org> writes:
>>>>> +#define DEFAULT_SDP_CUR_LIMIT (500 - DEFAULT_CUR_PROTECT)
>>>>
>>>> According to the spec we should always be talking about unit loads (1
>>>> unit load is 100mA for HS/FS/LS and 150mA for SS). Also, this will not
>>>> work for SS capable ports and SS gadgets (we have quite a few of them,
>>>> actually). You're missing the opportunity of charging at 900mA.
>>>
>>> I follow the DCP/SDP/CDP/ACA type's default current limitation and
>>> user can set them what they want.
>>
>> no, the user CANNOT set it to what they want. If you get enumerated
>> @100mA and the user just decides to set it to 2000mA, s/he could even
>> melt the USB connector. The kernel _must_ prevent such cases.
>>
>> In any case, DEFAULT_SDP_CUR_LIMIT shouldn't be a constant, it should be
>> variable because if you enumerate in SS, you _can_ get up to 900mA.
>
> Make sense. But these are just default values. They can be changed
> safely by power driver with 'usb_charger_set_cur_limit_by_type()'
> function to set 900mA.
oh okay. Still, the default value should be a function of gadget->speed,
IMO ;-)
>>>>> +
>>>>> +/* USB charger state */
>>>>> +enum usb_charger_state {
>>>>> + USB_CHARGER_DEFAULT,
>>>>> + USB_CHARGER_PRESENT,
>>>>> + USB_CHARGER_REMOVE,
>>>>> +};
>>>>
>>>> userland really doesn't need these two ?
>>>
>>> We've reported to userspace by kobject_uevent in
>>> 'usb_charger_notify_others()' function.
>>
>> I mean as a type ;-) So userspace doesn't have to redefine these for
>> their applications.
>
> Make sense. I can introduce some sysfs files for userspace. Thanks for
> your comments.
okay, my reply was a bit cryptic, but what I mean here is that enum
usb_charger_state could be moved your include/uapi header. My question
is, then, does userland need to have knowledge of enum
usb_charger_state ?
--
balbi
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 818 bytes --]
WARNING: multiple messages have this Message-ID (diff)
From: Felipe Balbi <balbi@kernel.org>
To: Baolin Wang <baolin.wang@linaro.org>
Cc: Greg KH <gregkh@linuxfoundation.org>,
Sebastian Reichel <sre@kernel.org>,
Dmitry Eremin-Solenikov <dbaryshkov@gmail.com>,
David Woodhouse <dwmw2@infradead.org>,
Peter Chen <peter.chen@freescale.com>,
Alan Stern <stern@rowland.harvard.edu>,
r.baldyga@samsung.com,
Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>,
Lee Jones <lee.jones@linaro.org>, Mark Brown <broonie@kernel.org>,
Charles Keepax <ckeepax@opensource.wolfsonmicro.com>,
patches@opensource.wolfsonmicro.com,
Linux PM list <linux-pm@vger.kernel.org>,
USB <linux-usb@vger.kernel.org>,
device-mainlining@lists.linuxfoundation.org,
LKML <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH v7 1/4] gadget: Introduce the usb charger framework
Date: Thu, 31 Mar 2016 11:18:06 +0300 [thread overview]
Message-ID: <87bn5vgiwx.fsf@intel.com> (raw)
In-Reply-To: <CAMz4kuJwfWPEndmVMoDBQQFZ2X8BAzDgej_9qMKQq0xU3tC=5w@mail.gmail.com>
[-- Attachment #1: Type: text/plain, Size: 1947 bytes --]
Hi,
Baolin Wang <baolin.wang@linaro.org> writes:
>>>>> +#define DEFAULT_SDP_CUR_LIMIT (500 - DEFAULT_CUR_PROTECT)
>>>>
>>>> According to the spec we should always be talking about unit loads (1
>>>> unit load is 100mA for HS/FS/LS and 150mA for SS). Also, this will not
>>>> work for SS capable ports and SS gadgets (we have quite a few of them,
>>>> actually). You're missing the opportunity of charging at 900mA.
>>>
>>> I follow the DCP/SDP/CDP/ACA type's default current limitation and
>>> user can set them what they want.
>>
>> no, the user CANNOT set it to what they want. If you get enumerated
>> @100mA and the user just decides to set it to 2000mA, s/he could even
>> melt the USB connector. The kernel _must_ prevent such cases.
>>
>> In any case, DEFAULT_SDP_CUR_LIMIT shouldn't be a constant, it should be
>> variable because if you enumerate in SS, you _can_ get up to 900mA.
>
> Make sense. But these are just default values. They can be changed
> safely by power driver with 'usb_charger_set_cur_limit_by_type()'
> function to set 900mA.
oh okay. Still, the default value should be a function of gadget->speed,
IMO ;-)
>>>>> +
>>>>> +/* USB charger state */
>>>>> +enum usb_charger_state {
>>>>> + USB_CHARGER_DEFAULT,
>>>>> + USB_CHARGER_PRESENT,
>>>>> + USB_CHARGER_REMOVE,
>>>>> +};
>>>>
>>>> userland really doesn't need these two ?
>>>
>>> We've reported to userspace by kobject_uevent in
>>> 'usb_charger_notify_others()' function.
>>
>> I mean as a type ;-) So userspace doesn't have to redefine these for
>> their applications.
>
> Make sense. I can introduce some sysfs files for userspace. Thanks for
> your comments.
okay, my reply was a bit cryptic, but what I mean here is that enum
usb_charger_state could be moved your include/uapi header. My question
is, then, does userland need to have knowledge of enum
usb_charger_state ?
--
balbi
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 818 bytes --]
next prev parent reply other threads:[~2016-03-31 8:18 UTC|newest]
Thread overview: 59+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-03-16 11:46 [PATCH v7 0/4] Introduce usb charger framework to deal with the usb gadget power negotation Baolin Wang
2016-03-16 11:46 ` [PATCH v7 1/4] gadget: Introduce the usb charger framework Baolin Wang
2016-03-16 12:09 ` Oliver Neukum
2016-03-17 1:58 ` Baolin Wang
2016-03-30 10:09 ` Felipe Balbi
2016-03-30 10:09 ` Felipe Balbi
[not found] ` <87h9foqnur.fsf-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
2016-03-30 17:44 ` Mark Brown
2016-03-30 17:44 ` Mark Brown
2016-03-31 6:21 ` Felipe Balbi
2016-03-31 6:28 ` Baolin Wang
2016-03-31 6:42 ` Felipe Balbi
2016-03-22 11:30 ` Pavel Machek
2016-04-18 8:12 ` Felipe Balbi
2016-04-18 10:23 ` Pavel Machek
2016-04-18 10:30 ` Felipe Balbi
[not found] ` <877ffvgqe9.fsf-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
2016-04-18 10:39 ` Pavel Machek
2016-04-18 10:39 ` Pavel Machek
2016-04-18 10:49 ` Felipe Balbi
2016-04-18 10:55 ` Felipe Balbi
2016-04-18 11:13 ` Pavel Machek
2016-04-18 11:42 ` Felipe Balbi
2016-04-18 12:58 ` Pavel Machek
2016-04-18 13:34 ` Felipe Balbi
2016-04-18 10:59 ` David Laight
2016-04-18 11:23 ` Pavel Machek
2016-03-31 8:03 ` Baolin Wang
2016-03-22 11:29 ` Pavel Machek
2016-04-18 8:18 ` Felipe Balbi
2016-04-18 10:33 ` Pavel Machek
2016-04-18 10:45 ` Felipe Balbi
2016-04-18 11:03 ` Pavel Machek
2016-04-18 11:51 ` Felipe Balbi
2016-04-18 11:51 ` Felipe Balbi
2016-04-18 13:16 ` Pavel Machek
2016-04-18 13:30 ` Felipe Balbi
[not found] ` <CAMz4kuJwfWPEndmVMoDBQQFZ2X8BAzDgej_9qMKQq0xU3tC=5w-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2016-03-31 8:18 ` Felipe Balbi [this message]
2016-03-31 8:18 ` Felipe Balbi
2016-03-31 8:35 ` Baolin Wang
2016-03-31 10:06 ` Felipe Balbi
2016-03-31 11:12 ` Baolin Wang
2016-03-31 17:06 ` Mark Brown
2016-04-01 5:43 ` Felipe Balbi
2016-04-01 14:16 ` Mark Brown
2016-04-04 10:47 ` Felipe Balbi
[not found] ` <877fgd7iqx.fsf-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
2016-04-04 16:04 ` Mark Brown
2016-04-04 16:04 ` Mark Brown
2016-04-04 18:44 ` Greg KH
2016-03-16 11:46 ` [PATCH v7 2/4] gadget: Support for " Baolin Wang
2016-03-16 12:50 ` kbuild test robot
2016-03-16 12:50 ` kbuild test robot
2016-03-16 20:19 ` kbuild test robot
2016-03-16 20:19 ` kbuild test robot
2016-03-16 11:46 ` [PATCH v7 3/4] gadget: Integrate with the usb gadget supporting for usb charger Baolin Wang
2016-03-16 11:46 ` [PATCH v7 4/4] power: wm831x_power: Support USB charger current limit management Baolin Wang
2016-03-16 11:48 ` [PATCH v7 0/4] Introduce usb charger framework to deal with the usb gadget power negotation Felipe Balbi
2016-03-16 11:48 ` Felipe Balbi
2016-03-16 11:56 ` Baolin Wang
-- strict thread matches above, loose matches on Subject: below --
2016-01-04 3:04 Baolin Wang
2016-01-04 3:04 ` [PATCH v7 1/4] gadget: Introduce the usb charger framework Baolin Wang
2015-12-08 8:36 [PATCH v7 0/4] Introduce usb charger framework to deal with the usb gadget power negotation Baolin Wang
2015-12-08 8:36 ` [PATCH v7 1/4] gadget: Introduce the usb charger framework Baolin Wang
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=87bn5vgiwx.fsf@intel.com \
--to=balbi-dgejt+ai2ygdnm+yrofe0a@public.gmane.org \
--cc=baolin.wang-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org \
--cc=broonie-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org \
--cc=ckeepax-yzvPICuk2AATkU/dhu1WVueM+bqZidxxQQ4Iyu8u01E@public.gmane.org \
--cc=dbaryshkov-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
--cc=device-mainlining-cunTk1MwBs98uUxBSJOaYoYkZiVZrdSR2LY78lusg7I@public.gmane.org \
--cc=dwmw2-wEGCiKHe2LqWVfeAwA7xHQ@public.gmane.org \
--cc=gregkh-hQyY1W1yCW8ekmWlsbkhG0B+6BGkLq7r@public.gmane.org \
--cc=lee.jones-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org \
--cc=linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=linux-pm-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=linux-usb-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=patches-yzvPICuk2AATkU/dhu1WVueM+bqZidxxQQ4Iyu8u01E@public.gmane.org \
--cc=peter.chen-KZfg59tc24xl57MIdRCFDg@public.gmane.org \
--cc=r.baldyga-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org \
--cc=sre-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org \
--cc=stern-nwvwT67g6+6dFdvTe/nMLpVzexx5G7lz@public.gmane.org \
--cc=yoshihiro.shimoda.uh-zM6kxYcvzFBBDgjK7y7TUQ@public.gmane.org \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.