All of lore.kernel.org
 help / color / mirror / Atom feed
From: Angus Ainslie <angus@akkea.ca>
To: Chanwoo Choi <cw00.choi@samsung.com>
Cc: kernel@puri.sm, MyungJoo Ham <myungjoo.ham@samsung.com>,
	Heikki Krogerus <heikki.krogerus@linux.intel.com>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	linux-kernel@vger.kernel.org, linux-usb@vger.kernel.org,
	bryan.odonoghue@linaro.org
Subject: Re: [PATCH 1/4] extcon: Add USB VBUS properties
Date: Tue, 15 Sep 2020 06:31:19 -0700	[thread overview]
Message-ID: <23ce56387f39fa097b36380dbe9661a0@akkea.ca> (raw)
In-Reply-To: <bfa20bf2-e13b-1cd4-52d9-c8fa922d5aac@samsung.com>

Hi,

On 2020-09-14 18:40, Chanwoo Choi wrote:
> Hi,
> 
> On 9/15/20 1:46 AM, Angus Ainslie wrote:
>> USB type C, USB BC1.2 and USB power delivery allow different voltages
>> and currents for VBUS so we need these additional properties.
>> 
>> Also USB type C allows separate device and power roles so add a VBUS 
>> SRC
>> property.
>> 
>> Signed-off-by: Angus Ainslie <angus@akkea.ca>
>> ---
>>  include/linux/extcon.h | 17 ++++++++++++++++-
>>  1 file changed, 16 insertions(+), 1 deletion(-)
>> 
>> diff --git a/include/linux/extcon.h b/include/linux/extcon.h
>> index fd183fb9c20f..c4d48f4f74c4 100644
>> --- a/include/linux/extcon.h
>> +++ b/include/linux/extcon.h
>> @@ -117,14 +117,29 @@
>>   * @type:       integer (intval)
>>   * @value:      0 (USB/USB2) or 1 (USB3)
>>   * @default:    0 (USB/USB2)
>> + * - EXTCON_PROP_USB_VBUS_SRC
> 
> Could you explain more correct meaning of both sink and source?
> 

Sure I can add some comments.

>> + * @type:	integer (intval)
>> + * @value:	0 (sink) or 1 (source)
>> + * @default:	0 (sink)
>> + * - EXTCON_PROP_USB_VBUS_VOLTAGE
>> + * @type:	integer (intval)
>> + * @value:	negotiated vbus voltage in mV
>> + * @default:	5000
> 
> Could you suggest the data why do you set default value as 5000?
> 

The lowest USB VBUS is 5V so I can add that to the comments.

>> + * - EXTCON_PROP_USB_VBUS_CURRENT
>> + * @type:	integer (intval)
>> + * @value:	negotiated vbus current in mA
>> + * @default:	100
> 
> ditto. Why default value is 100?
> 

USB spec says that until the current is negotiated the max that anything 
can draw is 100mA. I can add a comment to that effect.

Thanks
Angus

>>   *
>>   */
>>  #define EXTCON_PROP_USB_VBUS		0
>>  #define EXTCON_PROP_USB_TYPEC_POLARITY	1
>>  #define EXTCON_PROP_USB_SS		2
>> +#define EXTCON_PROP_USB_VBUS_SRC	3
>> +#define EXTCON_PROP_USB_VBUS_VOLTAGE	4
>> +#define EXTCON_PROP_USB_VBUS_CURRENT	5
>> 
>>  #define EXTCON_PROP_USB_MIN		0
>> -#define EXTCON_PROP_USB_MAX		2
>> +#define EXTCON_PROP_USB_MAX		5
>>  #define EXTCON_PROP_USB_CNT	(EXTCON_PROP_USB_MAX - 
>> EXTCON_PROP_USB_MIN + 1)
>> 
>>  /* Properties of EXTCON_TYPE_CHG. */
>> 

  reply	other threads:[~2020-09-15 13:38 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-09-14 16:46 [PATCH 0/4] RFC: USB C extcon patchset for the tps6598x Angus Ainslie
2020-09-14 16:46 ` [PATCH 1/4] extcon: Add USB VBUS properties Angus Ainslie
2020-09-15  1:40   ` Chanwoo Choi
2020-09-15 13:31     ` Angus Ainslie [this message]
2020-09-14 16:46 ` [PATCH 2/4] usb: typec: tps6589x: register as an extcon provider Angus Ainslie
2020-09-15  1:19   ` Chanwoo Choi
2020-09-15 13:32     ` Angus Ainslie
2020-09-14 16:46 ` [PATCH 3/4] usb: typec: tps6598x: Add the extcon USB chargers Angus Ainslie
2020-09-14 16:46 ` [PATCH 4/4] usb: typec: tps6598x: Add the power delivery irq Angus Ainslie
2020-09-24 14:42   ` kernel test robot
2020-09-21 14:37 ` [PATCH 0/4] RFC: USB C extcon patchset for the tps6598x Heikki Krogerus
2020-09-22 21:15   ` Angus Ainslie

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=23ce56387f39fa097b36380dbe9661a0@akkea.ca \
    --to=angus@akkea.ca \
    --cc=bryan.odonoghue@linaro.org \
    --cc=cw00.choi@samsung.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=heikki.krogerus@linux.intel.com \
    --cc=kernel@puri.sm \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=myungjoo.ham@samsung.com \
    /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.