diff options
author | Li Jun <B47624@freescale.com> | 2015-03-08 04:05:01 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2015-03-15 05:27:20 -0400 |
commit | d20f7807996c69537e07443ef8dec4e01a28b099 (patch) | |
tree | 8abe4838fa65372922477f9dafd92da3bd303464 /drivers/usb | |
parent | c526c216fef0022611b0b7cd0f68d103e3378b49 (diff) |
usb: chipidea: otg: add a_alt_hnp_support response for B device
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>
Diffstat (limited to 'drivers/usb')
-rw-r--r-- | drivers/usb/chipidea/udc.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/drivers/usb/chipidea/udc.c b/drivers/usb/chipidea/udc.c index ff451048c1ac..4bfb7ac0239f 100644 --- a/drivers/usb/chipidea/udc.c +++ b/drivers/usb/chipidea/udc.c | |||
@@ -929,6 +929,13 @@ __acquires(hwep->lock) | |||
929 | return retval; | 929 | return retval; |
930 | } | 930 | } |
931 | 931 | ||
932 | static int otg_a_alt_hnp_support(struct ci_hdrc *ci) | ||
933 | { | ||
934 | dev_warn(&ci->gadget.dev, | ||
935 | "connect the device to an alternate port if you want HNP\n"); | ||
936 | return isr_setup_status_phase(ci); | ||
937 | } | ||
938 | |||
932 | /** | 939 | /** |
933 | * isr_setup_packet_handler: setup packet handler | 940 | * isr_setup_packet_handler: setup packet handler |
934 | * @ci: UDC descriptor | 941 | * @ci: UDC descriptor |
@@ -1061,6 +1068,10 @@ __acquires(ci->lock) | |||
1061 | ci); | 1068 | ci); |
1062 | } | 1069 | } |
1063 | break; | 1070 | break; |
1071 | case USB_DEVICE_A_ALT_HNP_SUPPORT: | ||
1072 | if (ci_otg_is_fsm_mode(ci)) | ||
1073 | err = otg_a_alt_hnp_support(ci); | ||
1074 | break; | ||
1064 | default: | 1075 | default: |
1065 | goto delegate; | 1076 | goto delegate; |
1066 | } | 1077 | } |