All of lore.kernel.org
 help / color / mirror / Atom feed
From: Chunfeng Yun <chunfeng.yun@mediatek.com>
To: Thinh Nguyen <Thinh.Nguyen@synopsys.com>
Cc: Felipe Balbi <balbi@kernel.org>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	<linux-usb@vger.kernel.org>, John Youn <John.Youn@synopsys.com>
Subject: Re: [PATCH v3 03/12] usb: gadget: Expose sublink speed attributes
Date: Sat, 25 Jul 2020 11:14:49 +0800	[thread overview]
Message-ID: <1595646889.23885.68.camel@mhfsdcap03> (raw)
In-Reply-To: <500284ccf0353ee17a6bee8fa55011f801e17630.1595631457.git.thinhn@synopsys.com>

On Fri, 2020-07-24 at 16:38 -0700, Thinh Nguyen wrote:
> The USB 3.2 specification supports dual-lane and different transfer
> rates for super-speed-plus. Devices operating in super-speed-plus can
> be gen2x1, gen1x2, or gen2x2.
> 
> A gadget driver may need to know the gadget's sublink speeds to properly
> setup its transfer requests and describe its capability in its
> descriptors. To describe the transfer rate in super-speed-plus fully,
> let's expose the lane count and sublink speed attributes when operating
> in super-speed-plus.
> 
> Signed-off-by: Thinh Nguyen <thinhn@synopsys.com>
> ---
>  Changes in v3:
>  - None
>  Changes in v2:
>  - None
> 
>  include/linux/usb/gadget.h | 20 ++++++++++++++++++++
>  1 file changed, 20 insertions(+)
> 
> diff --git a/include/linux/usb/gadget.h b/include/linux/usb/gadget.h
> index 52ce1f6b8f83..bd982669609c 100644
> --- a/include/linux/usb/gadget.h
> +++ b/include/linux/usb/gadget.h
> @@ -339,6 +339,15 @@ struct usb_gadget_ops {
>   * @speed: Speed of current connection to USB host.
>   * @max_speed: Maximal speed the UDC can handle.  UDC must support this
>   *      and all slower speeds.
> + * @num_lanes: Number of lanes in use.
> + * @max_num_lanes: Maximum number of lanes the UDC supports.
> + * @ssac: Sublink speed attribute count. The number of sublink speed
> + *	attributes is ssac + 1.
> + * @sublink_speed: Array of sublink speed attributes the UDC supports. Sublink
> + *	speed attributes are paired, and an RX followed by a TX attribute.
> + * @speed_ssid: Current sublink speed attribute ID in use.
> + * @min_speed_ssid: Sublink speed attribute ID with the minimum speed.
> + * @max_speed_ssid: Sublink speed attribute ID with the maximum speed.
>   * @state: the state we are now (attached, suspended, configured, etc)
>   * @name: Identifies the controller hardware type.  Used in diagnostics
>   *	and sometimes configuration.
> @@ -406,6 +415,17 @@ struct usb_gadget {
>  	struct list_head		ep_list;	/* of usb_ep */
>  	enum usb_device_speed		speed;
>  	enum usb_device_speed		max_speed;
> +
> +	/* SSP only */
> +	unsigned			num_lanes;
> +	unsigned			max_num_lanes;
> +	unsigned			ssac;
> +#define USB_GADGET_MAX_SSAC 3
> +	struct usb_sublink_speed	sublink_speed[USB_GADGET_MAX_SSAC + 1];
> +	unsigned			speed_ssid;
> +	unsigned			min_speed_ssid;
> +	unsigned			max_speed_ssid;
checkpatch warning:

WARNING:UNSPECIFIED_INT: Prefer 'unsigned int' to bare use of 'unsigned'

> +
>  	enum usb_device_state		state;
>  	const char			*name;
>  	struct device			dev;


  reply	other threads:[~2020-07-25  3:16 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-07-24 23:38 [PATCH v3 00/12] usb: Handle different sublink speeds Thinh Nguyen
2020-07-24 23:38 ` [PATCH v3 01/12] usb: ch9: Add sublink speed struct Thinh Nguyen
2020-07-24 23:38 ` [PATCH v3 02/12] usb: gadget: composite: Avoid using magic numbers Thinh Nguyen
2020-07-24 23:38 ` [PATCH v3 03/12] usb: gadget: Expose sublink speed attributes Thinh Nguyen
2020-07-25  3:14   ` Chunfeng Yun [this message]
2020-07-25  3:33     ` Thinh Nguyen
2020-07-25 10:13       ` Greg Kroah-Hartman
2020-07-25 10:52         ` Thinh Nguyen
2020-07-24 23:38 ` [PATCH v3 04/12] usb: gadget: Set max speed for SSP devices Thinh Nguyen
2020-07-24 23:38 ` [PATCH v3 05/12] usb: composite: Properly report sublink speed Thinh Nguyen
2020-07-24 23:39 ` [PATCH v3 06/12] usb: devicetree: Include USB SSP Gen X x Y Thinh Nguyen
2020-07-24 23:39 ` [PATCH v3 07/12] usb: common: Add function to get num_lanes and transfer rate Thinh Nguyen
2020-07-25  4:01   ` Chunfeng Yun
2020-07-25  4:10     ` Thinh Nguyen
2020-07-25 10:12   ` Greg Kroah-Hartman
2020-07-25 10:51     ` Thinh Nguyen
2020-07-25 11:06       ` Greg Kroah-Hartman
2020-07-25 11:18         ` Thinh Nguyen
2020-07-24 23:39 ` [PATCH v3 08/12] usb: dwc3: Initialize lane count and sublink speed Thinh Nguyen
2020-07-24 23:39 ` [PATCH v3 09/12] usb: dwc3: gadget: Report sublink speed capability Thinh Nguyen
2020-07-24 23:39 ` [PATCH v3 10/12] usb: dwc3: gadget: Implement setting of sublink speed Thinh Nguyen
2020-07-24 23:39 ` [PATCH v3 11/12] usb: dwc3: gadget: Track connected lane and " Thinh Nguyen
2020-07-24 23:39 ` [PATCH v3 12/12] usb: dwc3: gadget: Set speed only up to the max supported Thinh Nguyen

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=1595646889.23885.68.camel@mhfsdcap03 \
    --to=chunfeng.yun@mediatek.com \
    --cc=John.Youn@synopsys.com \
    --cc=Thinh.Nguyen@synopsys.com \
    --cc=balbi@kernel.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-usb@vger.kernel.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.