usb: chipidea: otg: add a_alt_hnp_support response for B device
authorLi Jun <B47624@freescale.com>
Sun, 8 Mar 2015 08:05:01 +0000 (16:05 +0800)
committerSasha Levin <sasha.levin@oracle.com>
Fri, 17 Apr 2015 00:11:40 +0000 (20:11 -0400)
commitefbf141e9c246f27392137c8735419db1db2c8fd
tree3f98f315047de595c5bb50aa1d30cfb9e08cb508
parentde4b9c41c2518137d51b765b270317dd0f16367a
usb: chipidea: otg: add a_alt_hnp_support response for B device

[ Upstream commit d20f7807996c69537e07443ef8dec4e01a28b099 ]

This patch adds response to a_alt_hnp_support set feature request from legacy
A device, that is, B-device can provide a message to the user indicating that
the user needs to connect the B-device to an alternate port on the A-device.
A device sets 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.

[Peter]
Without this patch, the OTG B device can't be enumerated on
non-HNP port at A device, see below log:
[    2.287464] usb 1-1: Dual-Role OTG device on non-HNP port
[    2.293105] usb 1-1: can't set HNP mode: -32
[    2.417422] usb 1-1: new high-speed USB device number 4 using ci_hdrc
[    2.460635] usb 1-1: Dual-Role OTG device on non-HNP port
[    2.466424] usb 1-1: can't set HNP mode: -32
[    2.587464] usb 1-1: new high-speed USB device number 5 using ci_hdrc
[    2.630649] usb 1-1: Dual-Role OTG device on non-HNP port
[    2.636436] usb 1-1: can't set HNP mode: -32
[    2.641003] usb usb1-port1: unable to enumerate USB device

Cc: stable <stable@vger.kernel.org>
Acked-by: Peter Chen <peter.chen@freescale.com>
Signed-off-by: Li Jun <b47624@freescale.com>
Signed-off-by: Peter Chen <peter.chen@freescale.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Sasha Levin <sasha.levin@oracle.com>
drivers/usb/chipidea/udc.c