Re: [PATCH v2 05/22] doc: dt-binding: usb: add otg related properties

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 




On Fri, Jun 12, 2015 at 11:41:40AM +0300, Roger Quadros wrote:
> 
> 
> On Fri, 12 Jun 2015 16:23:59 +0800
> Li Jun <b47624@xxxxxxxxxxxxx> wrote:
> 
> > On Fri, Jun 12, 2015 at 11:02:13AM +0300, Roger Quadros wrote:
> > > 
> > > On Fri, 12 Jun 2015 09:42:04 +0800
> > > Li Jun <b47624@xxxxxxxxxxxxx> wrote:
> > > 
> > > > On Thu, Jun 11, 2015 at 05:55:57PM +0300, Roger Quadros wrote:
> > > > > > > drivers/usb/core/hub.c
> > > > > > > 
> > > > > > > static int usb_enumerate_device_otg(struct usb_device *udev)
> > > > > > > {
> > > > > > > 	int err = 0;
> > > > > > > 
> > > > > > > #ifdef	CONFIG_USB_OTG

> > > 
> > > Not necessarily. Many systems don't have any OTG port so that request cannot
> > > be sent even if CONFIG_USB_OTG is enabled.
> > > 
> > That's the fact, but we are talking the code only for those systems which
> > have OTG port. If you think we need not cover the support for OTG 1.x host,
> > we can simply remove it.
> 
> We should not remove it but need to add the following check.
> 
> Send that request only if the system has at least one OTG (v1.x) port that is
> capable of HNP _and_ this port is not that HNP capable port _and_
> the connected device is OTG (v1.x)
> 
Agreed.

> > 
> > > > > So it should not send any OTG specific request to device. Right?
> > > > Non-otg port(in OTG 1.x protocol) + OTG 1.x device, should send,
> > > > otherwise, should not send.
> > > 
> > > What did you mean by Non-OTG port (in OTG 1.x protocol)?
> > 
> > Means host only port without HNP.
> > 
> > > If it is Non-OTG port it doesn't understand any OTG protocol.
> > 
> > With common sense, yes, but there is one exception.
> > 
> > > So Non-OTG port should not send any OTG request.
> > > 
> > see below from OTG 1.3:
> > 
> > 6.5.3 a_alt_hnp_support
> > Setting this feature indicates to the B-device that it is connected to
> > an A-device port that is not capable of HNP, but that the A-device does
> > have an alternate port that is capable of HNP.
> > The A-device is required to set this feature under the following conditions:
> > • the A-device has multiple receptacles
> > • the A-device port that connects to the B-device does not support HNP
> > • the A-device has another port that does support HNP
> > ... ...
> 
> Thanks for this info. I can't seem to find the OTG v1.3 spec.
> 
You can download from:
http://www.usb.org/developers/docs/USB_OTG_1-3.pdf

> cheers,
> -roger
> 
> > 
> > > > 
> > > > So the code you pasted here was right only for OTG 1.x, I assume
> > > > OTG 2.0 has not been released when it was designed. But now it's
> > > > out of date, it's wrong if you connect a OTG 2.0 device. 
> > > > 
> > > 
> > > The code is wrong for non-OTG ports when CONFIG_USB_OTG is set.
> > > 
> > > Peter/Felipe, any comments on this?
> > > 
> > > cheers,
> > > -roger
> > > 
> > > > > 
> > > > > > 
> > > > > > > 
> > > > > > > 				if (err < 0) {
> > > > > > > 					/* OTG MESSAGE: report errors here,
> > > > > > > 					 * customize to match your product.
> > > > > > > 					 */
> > > > > > > 					dev_info(&udev->dev,
> > > > > > > 						"can't set HNP mode: %d\n",
> > > > > > > 						err);
> > > > > > > 					bus->b_hnp_enable = 0;
> > > > > > > 				}
> > > > > > > 
> > > > > > > Instead it should be moved inside the if (port1 == bus->otg_port) condition.
> > > > > > 
> > > > > > Nope, as I explained above, this is really too detailed OTG protocol:)
> > > > > > > 
> > > > > > > 			}
> > > > > > > 		}
> > > > > > > 	}
> > > > > > > #endif
> > > > > > > 	return err;
> > > > > > > }
> > > > > > > 
> > > 
> 
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Device Tree Compilter]     [Device Tree Spec]     [Linux Driver Backports]     [Video for Linux]     [Linux USB Devel]     [Linux PCI Devel]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Yosemite Backpacking]
  Powered by Linux