linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: hzpeterchen@gmail.com (Peter Chen)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH v2 0/3] USB: add generic onboard USB HUB driver
Date: Wed, 24 Feb 2016 17:22:52 +0800	[thread overview]
Message-ID: <20160224092252.GA9297@shlinux2.ap.freescale.net> (raw)
In-Reply-To: <CAL_Jsq+rqv1NBSUToX5BsbnBp_goUWhdczU7ETSxOrJ5D4D1rw@mail.gmail.com>

On Thu, Jan 07, 2016 at 08:18:02AM -0600, Rob Herring wrote:
> On Tue, Jan 5, 2016 at 9:20 PM, Peter Chen <hzpeterchen@gmail.com> wrote:
> > On Tue, Jan 05, 2016 at 08:36:31AM -0600, Rob Herring wrote:
> >> > 2. There are MFD USB devices, which includes several interfaces under
> >> > USB device,
> >> > like i2c, gpios, etc. Due to lack of device tree support, USB
> >> > class/device driver doesn't know
> >> > which kinds of interfaces are needed for this board.
> >>
> >> Are you talking about a device hard wired on the same board or
> >> something like GPIOs on FTDI chip which could be hot-plugged in any
> >> host (including non-DT based)?
> >
> > I talked about the case that the device hard wired on the board.
> > Hot-plug device's bus topology is unknown, we can't describe it
> > statically at dts.
> 
> Correct, upstream (the USB side) can't be described, but it is the
> downstream side we care about describing.
> 
> >> For the hotplug case, we will need a way to associate a DT overlay
> >> with the USB device and there may not even be a base DT to map the
> >> overlay into. In this case, the USB device's driver will need to load
> >> the overlay and trigger enumerating the child devices. Anyway, this is
> >> a separate issue from your problem.
> >>
> >
> > Since both you and Alan agree with my problem should be fixed at
> > bootloader, I give the kernel solution up.
> 
> Surprising, no one ever seems to agree with that solution... There
> will be people with this problem and unable to update their
> bootloader.
> 

Hi Rob, I noticed there are still some platform needs to this solution,
I would like to see if I can move this on, please review below dts
solution. In below case, there are two ports on the root hub, one is
USB HUB, the another is a USB wifi. Both of these devices need to have
power control before they can work.

At USB hcd driver, it will try to look-up all USB devices on this
controller, if the usb-pwr-ops is existed, it will try to get its
phandle, and do gpio and clock operations.

Optional properties:
- usb-pwr-ops: the power operations which need to do before this USB device
  can work.

Example:

/ {
	...

	hub_genesys_1_pwr_ops: hub_genesys_1_pwr_ops {
		compatible = "usb-pwrseq-simple";
		reset-gpios = <&gpio4 5 GPIO_ACTIVE_LOW>; /* hub reset pin */
		reset-duration-us = <10>;
		clocks = <&clks IMX6QDL_CLK_CKO>;
	};

	wifi_nxp_2_pwr_ops: wifi_nxp_2_pwr_ops {
		compatible = "usb-pwrseq-simple";
		reset-gpios = <&gpio4 6 GPIO_ACTIVE_LOW>, /* wifi_rst */
				<&gpio4 7 GPIO_ACTIVE_LOW>; /* wifi_en */
		reset-duration-us = <10>;
		clocks = <&clks IMX6QDL_CLK_CKO1>;
	};

	...
};

&usb1 {
	status = "okay";

	#address-cells = <1>;
	#size-cells = <0>;

	hub: genesys at 1 {
		compatible = "usb5e3,608";
		reg = <1>;
		usb-pwr-ops = <&hub_genesys_1_pwr_ops>
	};

	wifi: nxp at 2 {
		compatible = "usb5e3,608";
		reg = <2>;
		usb-pwr-ops = <&wifi_nxp_2_pwr_ops>
	};
}

-- 

Best Regards,
Peter Chen

  parent reply	other threads:[~2016-02-24  9:22 UTC|newest]

Thread overview: 33+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-12-14  7:26 [PATCH v2 0/3] USB: add generic onboard USB HUB driver Peter Chen
2015-12-14  7:26 ` [PATCH v2 1/3] usb: misc: generic_onboard_hub: " Peter Chen
2015-12-14  7:26 ` [PATCH v2 2/3] doc: dt-binding: generic onboard USB HUB Peter Chen
2015-12-14  7:26 ` [PATCH v2 3/3] ARM: dts: imx6qdl-udoo.dtsi: fix onboard USB HUB property Peter Chen
2015-12-14  9:35 ` [PATCH v2 0/3] USB: add generic onboard USB HUB driver Arnd Bergmann
2015-12-15  8:33   ` Peter Chen
2015-12-16 22:59   ` Rob Herring
2015-12-16 23:13     ` Arnd Bergmann
2015-12-17  2:31       ` Peter Chen
2015-12-17 13:49         ` Rob Herring
2015-12-18  7:38           ` Peter Chen
2015-12-17 16:13     ` Alan Stern
2015-12-18  7:42       ` Peter Chen
2015-12-18 15:38         ` Alan Stern
2015-12-21  8:33           ` Peter Chen
2015-12-21 19:40             ` Alan Stern
2015-12-22  3:32               ` Peter Chen
2015-12-22 15:48                 ` Alan Stern
2016-01-05 14:36             ` Rob Herring
2016-01-05 15:59               ` Alan Stern
2016-01-06  3:20               ` Peter Chen
2016-01-07 14:18                 ` Rob Herring
2016-01-08  3:33                   ` Peter Chen
2016-02-24  9:22                   ` Peter Chen [this message]
2015-12-14 11:26 ` Fabio Estevam
2015-12-15  6:28   ` Peter Chen
2015-12-15 11:32     ` Fabio Estevam
2015-12-16  4:11       ` Peter Chen
2015-12-16 10:11         ` Fabio Estevam
2015-12-16 20:05           ` Maciej S. Szmigiero
2015-12-17  6:57             ` Peter Chen
2015-12-18 23:48               ` Maciej S. Szmigiero
2015-12-21  8:44                 ` Peter Chen

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=20160224092252.GA9297@shlinux2.ap.freescale.net \
    --to=hzpeterchen@gmail.com \
    --cc=linux-arm-kernel@lists.infradead.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 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).