All of lore.kernel.org
 help / color / mirror / Atom feed
From: Heikki Krogerus <heikki.krogerus@linux.intel.com>
To: Oliver Neukum <oneukum@suse.com>
Cc: Greg KH <gregkh@linuxfoundation.org>,
	Felipe Balbi <balbi@kernel.org>,
	Mathias Nyman <mathias.nyman@linux.intel.com>,
	linux-kernel@vger.kernel.org, linux-usb@vger.kernel.org
Subject: Re: [PATCH 1/3] usb: USB Type-C Connector Class
Date: Thu, 18 Feb 2016 10:47:24 +0200	[thread overview]
Message-ID: <20160218084724.GA1859@kuha.fi.intel.com> (raw)
In-Reply-To: <1455718047.7626.22.camel@suse.com>

[-- Attachment #1: Type: text/plain, Size: 1369 bytes --]

Hi Oliver,

On Wed, Feb 17, 2016 at 03:07:27PM +0100, Oliver Neukum wrote:
> On Tue, 2016-02-09 at 19:01 +0200, Heikki Krogerus wrote:
> > 1. connected - Connection status of the connector
> > 2. alternate_mode - The current Alternate Mode
> > 3. alternate_modes - Lists all Alternate Modes the connector supports
> > 4. partner_alt_modes - Lists partner's Alternate Modes when connected
> 
> Now that I think about it, there's a gap.
> Which SVIDs do we expose if we are UFP (slave)?

In the alternate_modes listing the connectors alt modes, we can not
have modes that the hardware can not support of course, and it is the
responsibility of the drivers registering the type-c ports with this
clss to make sure they are not part of the list.

In partner alternate modes, we will list all alternate modes the
partner supports, even the ones our connector doesn't.

The modes that can actually be selected have to be supported by both
the connector and the partner, and this is where I'm putting the ball
on the userspace at the moment. I'm not offering a list of
"possible_alternate_modes" where I list the combination, but instead
expect the userspace to be figure out that on it's own.

Do you think we should add "possible_alternate_modes" file?


P.S. That reminds me, here's my current draft for the
Documentation/ABI/. Could you take a look?


Thanks,

-- 
heikki

[-- Attachment #2: sysfs-class-type-c --]
[-- Type: text/plain, Size: 8523 bytes --]

What:		/sys/class/type-c/
Date:		February 2016
Contact:	Heikki Krogerus <heikki.krogerus@linux.intel.com>
Description:
		USB Type-C Connectors can be used for other purposes than just
		connecting USB peripherals to USB host. Devices with USB Type-C
		connector can be of one of the following types:

		1. USB - In normal USB use
		2. Accessory Mode - Audio or Debug. Special purpose modes for
				    the connector which are defined in the USB
				    Type-C specification. When an Accessory is
				    connected to the connector, it can not be
				    used for anything besides what the Accessory
				    Mode defines, including USB.
		3. Alternate Mode - Modes where the connector can be used also
				    for other purposes then just connecting USB
				    peripherals to USB hosts, and which are not
				    defined in USB Type-C Specification. The
				    Alternate Modes depend on USB Power Delivery
				    support as they are controlled with protocol
				    defined in USB Power Delivery specification.

		There is also only one type of USB Type-C Connector, so
		the connector will be the same for both host and peripheral. If
		two systems that are both dual-role capable (can act as both USB
		Host and USB Device) are connected together, the roles are
		selected randomly.

		This class gives the userspace the control over the USB role and
		the Alternate Mode with USB Type-C connectors.

What:		/sys/class/type-c/usbcN/
Date:		February 2016
Contact:	Heikki Krogerus <heikki.krogerus@linux.intel.com>
Description:
		A /sys/class/type-C/usbcN directory is created for each USB
		Type-C connector in the system. The N is the index of the
		connector.

What:		/sys/class/type-c/usbcN/connected
Date:		February 2016
Contact:	Heikki Krogerus <heikki.krogerus@linux.intel.com>
Description:
		Connection status of the USB Type-C connector usbcN. "yes" when
		connected, otherwise "no".

What:		/sys/class/type-c/usbcN/current_alternate_mode
Date:		February 2016
Contact:	Heikki Krogerus <heikki.krogerus@linux.intel.com>
Description:
		When connected to an Alternate Mode, displays the current Mode
		ID and the Standard of Vendor ID (SVID) of the Alternate Mode in
		form:

		<SVID>,<Mode>

		This file is writable and can be used to enter other modes both
		the connector usbcN and the partner support. The modes are
		Alternate Mode specific, and before they are to be changed with
		this file, the exact details of the modes under the given SVID
		should be known by the user.

What:		/sys/class/type-c/usbcN/current_data_role
Date:		February 2016
Contact:	Heikki Krogerus <heikki.krogerus@linux.intel.com>
Description:
		The current USB data role, host or device. This file can be used
		by the userspace to execute data role swap by writing the
		requested role to it.

		When the connector is not connected, the file is used to store
		the preselected role which the system will attempt to use next
		time when connected.

What:		/sys/class/type-c/usbcN/current_power_role
Date:		February 2016
Contact:	Heikki Krogerus <heikki.krogerus@linux.intel.com>
Description:
		The current power role of the connector, source or sink. This
		file can be used by the userspace to execute power role swap by
		writing the requested role to it. USB power role swap depends on
		USB Power Delivery support. When the connector usbcN, or the
		partner it's connected to, do not support USB Power Delivery,
		the power role is defined by the USB data role, i.e. host is
		source and device is sink, and can not be independently swapped
		with this file.

		When the connector is not connected, the file is used to store
		the preselected role which the system will attempt to use next
		time when connected.

What:		/sys/class/type-c/usbcN/partner_alternate_modes
Date:		February 2016
Contact:	Heikki Krogerus <heikki.krogerus@linux.intel.com>
Description:
		When connected, this file lists the Alternate Modes the partner
		connected to connector usbcN supports in the following form:

		<SVID 0>,<Mode 0>
		<SVID 0>,<Mode 1>
		...
		<SVID 0>,<Mode n>
		<SVID 1>,<Mode 0>
		...
		<SVID n>,<Mode n>

		Where the SVID is the 16 bit Standard of Vendor ID, and 32 bit
		Mode n is the ID of the Mode. The modes are Alternate Mode
		specific and are defined in the separate specifications for the
		Alternate Modes.

What:		/sys/class/type-c/usbcN/partner_type
Date:		February 2016
Contact:	Heikki Krogerus <heikki.krogerus@linux.intel.com>
Description:
		This read only file returns the type of partner when connected.
		The partner can be of type:

		- USB - When connected to normal USB host or device
		- Charger - When connected dedicated charger
		- Alternate Mode - when connected to Alternate Mode
		- Audio Accessory
		- Debug Accessory

What:		/sys/class/type-c/usbcN/power_operation_mode
Date:		February 2016
Contact:	Heikki Krogerus <heikki.krogerus@linux.intel.com>
Description:
		This file is read only, and it returns indication of the current
		power level of the connector when connected. It does not return
		the exact voltage and current in use except in case of 1.5A and
		3.0A modes which are defined in USB Type-C specification. The
		power operation mode can be one of the following:

		- USB - When normal power levels defined in USB specifications
			are in use
		- BC1.2 - When power levels defined in Battery Charging
			  Specification v1.2 are in use
		- USB Type-C 1.5A -  Higher 1.5A current compared to the
				     standard USB currents is possible, as
				     defined in USB Type-C specification
		- USB Type-C 3.0A -  Higher 3.0A current compared to the
				     standard USB currents is possible, as
				     defined in USB Type-C specification
		- USB Power Delivery - The voltages and currents defined in USB
				       Power Delivery specification are in use

		The exact power levels are outside the scope of this interface,
		and if needed by userspace, need to be extracted from an other
		source.

What:		/sys/class/type-c/usbcN/supported_alternate_modes
Date:		February 2016
Contact:	Heikki Krogerus <heikki.krogerus@linux.intel.com>
Description:
		This read only file lists the Alternate Modes the connector usbN
		supports in the following form:

		<SVID 0>,<Mode 0>
		<SVID 0>,<Mode 1>
		...
		<SVID 0>,<Mode n>
		<SVID 1>,<Mode 0>
		...
		<SVID n>,<Mode n>

		Where the SVID is the 16 bit Standard or Vendor ID, and 32 bit
		Mode n is the ID of the Mode. The modes are Alternate Mode
		specific and are defined in the separate specifications for the
		Alternate Modes.

What:		/sys/class/type-c/usbcN/supported_data_roles
Date:		February 2016
Contact:	Heikki Krogerus <heikki.krogerus@linux.intel.com>
Description:
		The USB data roles that the connector support.

		Valid values:
		- host
		- device

What:		/sys/class/type-c/usbcN/supported_power_roles
Date:		February 2016
Contact:	Heikki Krogerus <heikki.krogerus@linux.intel.com>
Description:
		The power roles that the connector usbcN support.

		Valid values:
		- source
		- sink

What:		/sys/class/type-c/usbcN/supports_audio_accessory
Date:		February 2016
Contact:	Heikki Krogerus <heikki.krogerus@linux.intel.com>
Description:
		Returns "yes" if the connector usbcN can be used in Audio
		Accessory Mode, otherwise "no". The file is read only.

		In Audio Accessory Mode the connector usbcN will be used as a
		replacement for 3.5mm audio plug, and the pins of the connector
		that the Audio Accessory Mode in USB Type-C specification defines
		are routed to the audio hardware on the system.

What:		/sys/class/type-c/usbcN/supports_debug_accessory
Date:		February 2016
Contact:	Heikki Krogerus <heikki.krogerus@linux.intel.com>
Description:
		Returns "yes" if the connector usbcN can be used in Debug
		Accessory Mode, otherwise "no". The file is read only.

		USB Type-C Specification does not define any details about Debug
		Accessory Mode, not even the pins on the connector. The Debug
		Accessory Mode will therefore be completely platform specific.
		Possible uses of the connector in this mode could be, serial
		port connected to 16550 compatible UART, or for example JTAG
		interface.

What:		/sys/class/type-c/usbcN/supports_usb_power_delivery
Date:		February 2016
Contact:	Heikki Krogerus <heikki.krogerus@linux.intel.com>
Description:
		Returns "yes" if the connector usbcN is USB Power Delivery
		capable, otherwise "no". The file is read only.

		USB Power Delivery support will define if the connector usbcN is
		able to use Alternate Modes and swap the power role
		independently of the USB data role.

  reply	other threads:[~2016-02-18  8:47 UTC|newest]

Thread overview: 90+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-02-09 17:01 [PATCH 0/3] usb: USB Type-C Class and driver for UCSI Heikki Krogerus
2016-02-09 17:01 ` [PATCH 1/3] usb: USB Type-C Connector Class Heikki Krogerus
2016-02-09 18:20   ` Greg KH
2016-02-10 10:38     ` Heikki Krogerus
2016-02-10 17:26       ` Greg KH
2016-02-11 14:07         ` Heikki Krogerus
2016-02-10 10:49   ` Oliver Neukum
2016-02-10 11:05     ` Andy Shevchenko
2016-02-10 11:11       ` Heikki Krogerus
2016-02-10 11:14         ` Andy Shevchenko
2016-02-10 11:23     ` Heikki Krogerus
2016-02-15 15:16       ` Oliver Neukum
2016-02-11  8:55     ` Felipe Balbi
2016-02-11  9:08       ` Oliver Neukum
2016-02-11 14:51         ` Heikki Krogerus
2016-02-11 14:36       ` Heikki Krogerus
2016-02-11 14:56         ` Oliver Neukum
2016-02-17 14:07   ` Oliver Neukum
2016-02-18  8:47     ` Heikki Krogerus [this message]
2016-02-18  9:21       ` Oliver Neukum
2016-02-18 13:09         ` Heikki Krogerus
2016-02-18  9:35       ` Oliver Neukum
2016-02-18 13:25         ` Heikki Krogerus
2016-02-18 13:44           ` Oliver Neukum
2016-02-18 15:13             ` Heikki Krogerus
2016-02-26 13:09             ` Heikki Krogerus
2016-02-09 17:01 ` [PATCH 2/3] usb: type-c: USB Type-C Connector System Software Interface Heikki Krogerus
2016-02-09 18:21   ` Greg KH
2016-02-10 10:30     ` Heikki Krogerus
2016-02-10 17:20       ` Greg KH
2016-02-11 13:50         ` Heikki Krogerus
2016-02-15 15:30           ` Oliver Neukum
2016-02-16  9:22             ` Heikki Krogerus
2016-02-16 13:39               ` Oliver Neukum
2016-02-17  7:58                 ` Heikki Krogerus
2016-02-17  9:03                   ` Oliver Neukum
2016-02-17 10:29                     ` Felipe Balbi
2016-02-17 10:36                       ` Oliver Neukum
2016-02-17 11:11                         ` Heikki Krogerus
2016-02-17 13:36                           ` Felipe Balbi
2016-02-17 14:28                             ` Heikki Krogerus
2016-02-18  9:07                               ` Peter Chen
2016-02-18 10:44                                 ` Heikki Krogerus
2016-02-18 10:37                               ` Rajaram R
2016-02-18 10:47                                 ` Heikki Krogerus
2016-02-18 11:06                                   ` Rajaram R
2016-02-17 13:34                         ` Felipe Balbi
2016-02-17 13:51                           ` Oliver Neukum
2016-02-18  7:08                             ` Felipe Balbi
2016-02-18 10:18                               ` Oliver Neukum
2016-02-18 10:30                                 ` Felipe Balbi
2016-02-18 10:40                                   ` Oliver Neukum
2016-02-18  9:29       ` Peter Chen
2016-02-18  9:44         ` Oliver Neukum
2016-02-10 11:19   ` Oliver Neukum
2016-02-10 12:04     ` Heikki Krogerus
2016-02-10 11:56   ` Andy Shevchenko
2016-02-10 13:21     ` Oliver Neukum
2016-02-10 14:02       ` Andy Shevchenko
2016-02-10 15:11         ` Bjørn Mork
2016-02-11  8:26           ` Andy Shevchenko
2016-02-11  8:59             ` Bjørn Mork
2016-02-10 14:15     ` Oliver Neukum
2016-02-10 14:24       ` Andy Shevchenko
2016-02-10 15:08         ` Oliver Neukum
     [not found]           ` <CAHp75VfmGsskf7Cmni3b4=tCbkPsR8d3jPYiv93Lm6DM9gq1-g@mail.gmail.com>
2016-02-11  8:13             ` Fwd: " Andy Shevchenko
2016-02-11 14:10               ` Heikki Krogerus
2016-02-10 13:04   ` Oliver Neukum
2016-02-11 14:08     ` Heikki Krogerus
2016-02-09 17:01 ` [PATCH 3/3] usb: type-c: UCSI ACPI driver Heikki Krogerus
2016-02-09 18:22   ` Greg KH
2016-02-10 10:23     ` Heikki Krogerus
2016-02-17 18:53 ` [PATCH 0/3] usb: USB Type-C Class and driver for UCSI Oliver Neukum
2016-02-18  9:21   ` Heikki Krogerus
2016-02-17 19:34 ` Rajaram R
2016-02-18 11:05   ` Heikki Krogerus
2016-02-18 11:15     ` Oliver Neukum
2016-05-05  3:05 ` Guenter Roeck
2016-05-06  6:50   ` Felipe Balbi
2016-05-06  8:05     ` Guenter Roeck
2016-05-06  8:29       ` Heikki Krogerus
2016-05-06 14:10         ` Guenter Roeck
2016-05-06  8:23     ` Heikki Krogerus
2016-05-06  8:08   ` Heikki Krogerus
2016-05-06 14:08     ` Guenter Roeck
2016-05-11  3:14     ` Guenter Roeck
2016-05-11  9:40       ` Heikki Krogerus
2016-05-11 14:47         ` Guenter Roeck
2016-05-13 14:23           ` Heikki Krogerus
2016-05-13 17:48             ` Guenter Roeck

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=20160218084724.GA1859@kuha.fi.intel.com \
    --to=heikki.krogerus@linux.intel.com \
    --cc=balbi@kernel.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=mathias.nyman@linux.intel.com \
    --cc=oneukum@suse.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.