aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJack Pham <jackp@codeaurora.org>2013-08-13 16:40:13 -0400
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2013-08-14 15:18:26 -0400
commit726a85caa30201eaadb993397a3e8ec23949c608 (patch)
tree94b1332a3df2540c251fdcf04d3ebabc227a854b
parent034d1527adebd302115c87ef343497a889638275 (diff)
usb: host: add Kconfig option for EHSET
commit 9841f37a1c ("usb: ehci: Add support for SINGLE_STEP_SET_FEATURE test of EHSET") added additional code to the EHCI hub driver but it is anticipated to only have a limited audience (e.g. embedded silicon vendors and integrators). Avoid subjecting all EHCI (and in the future maybe xHCI/OHCI, etc.) HCD users to code bloat by conditionally compiling the EHSET-specific additions with a new Kconfig option, CONFIG_USB_HCD_TEST_MODE. Signed-off-by: Jack Pham <jackp@codeaurora.org> Acked-by: Alan Stern <stern@rowland.harvard.edu> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r--drivers/usb/host/Kconfig17
-rw-r--r--drivers/usb/host/ehci-hub.c8
-rw-r--r--drivers/usb/host/ehci-q.c2
3 files changed, 26 insertions, 1 deletions
diff --git a/drivers/usb/host/Kconfig b/drivers/usb/host/Kconfig
index e3ea970fe424..c41005a47802 100644
--- a/drivers/usb/host/Kconfig
+++ b/drivers/usb/host/Kconfig
@@ -699,3 +699,20 @@ config USB_HCD_SSB
699 for ehci and ohci. 699 for ehci and ohci.
700 700
701 If unsure, say N. 701 If unsure, say N.
702
703config USB_HCD_TEST_MODE
704 bool "HCD test mode support"
705 ---help---
706 Say 'Y' to enable additional software test modes that may be
707 supported by the host controller drivers.
708
709 One such test mode is the Embedded High-speed Host Electrical Test
710 (EHSET) for EHCI host controller hardware, specifically the "Single
711 Step Set Feature" test. Typically this will be enabled for On-the-Go
712 or embedded hosts that need to undergo USB-IF compliance testing with
713 the aid of special testing hardware. In the future, this may expand
714 to include other tests that require support from a HCD driver.
715
716 This option is of interest only to developers who need to validate
717 their USB hardware designs. It is not needed for normal use. If
718 unsure, say N.
diff --git a/drivers/usb/host/ehci-hub.c b/drivers/usb/host/ehci-hub.c
index f8b215fa0d93..3bf9f482710c 100644
--- a/drivers/usb/host/ehci-hub.c
+++ b/drivers/usb/host/ehci-hub.c
@@ -712,6 +712,8 @@ ehci_hub_descriptor (
712} 712}
713 713
714/*-------------------------------------------------------------------------*/ 714/*-------------------------------------------------------------------------*/
715#ifdef CONFIG_USB_HCD_TEST_MODE
716
715#define EHSET_TEST_SINGLE_STEP_SET_FEATURE 0x06 717#define EHSET_TEST_SINGLE_STEP_SET_FEATURE 0x06
716 718
717static void usb_ehset_completion(struct urb *urb) 719static void usb_ehset_completion(struct urb *urb)
@@ -847,6 +849,7 @@ cleanup:
847 kfree(buf); 849 kfree(buf);
848 return retval; 850 return retval;
849} 851}
852#endif /* CONFIG_USB_HCD_TEST_MODE */
850/*-------------------------------------------------------------------------*/ 853/*-------------------------------------------------------------------------*/
851 854
852static int ehci_hub_control ( 855static int ehci_hub_control (
@@ -1222,13 +1225,16 @@ static int ehci_hub_control (
1222 * about the EHCI-specific stuff. 1225 * about the EHCI-specific stuff.
1223 */ 1226 */
1224 case USB_PORT_FEAT_TEST: 1227 case USB_PORT_FEAT_TEST:
1228#ifdef CONFIG_USB_HCD_TEST_MODE
1225 if (selector == EHSET_TEST_SINGLE_STEP_SET_FEATURE) { 1229 if (selector == EHSET_TEST_SINGLE_STEP_SET_FEATURE) {
1226 spin_unlock_irqrestore(&ehci->lock, flags); 1230 spin_unlock_irqrestore(&ehci->lock, flags);
1227 retval = ehset_single_step_set_feature(hcd, 1231 retval = ehset_single_step_set_feature(hcd,
1228 wIndex); 1232 wIndex);
1229 spin_lock_irqsave(&ehci->lock, flags); 1233 spin_lock_irqsave(&ehci->lock, flags);
1230 break; 1234 break;
1231 } else if (!selector || selector > 5) 1235 }
1236#endif
1237 if (!selector || selector > 5)
1232 goto error; 1238 goto error;
1233 spin_unlock_irqrestore(&ehci->lock, flags); 1239 spin_unlock_irqrestore(&ehci->lock, flags);
1234 ehci_quiesce(ehci); 1240 ehci_quiesce(ehci);
diff --git a/drivers/usb/host/ehci-q.c b/drivers/usb/host/ehci-q.c
index 903d00dd6683..33336874c47b 100644
--- a/drivers/usb/host/ehci-q.c
+++ b/drivers/usb/host/ehci-q.c
@@ -1139,6 +1139,7 @@ submit_async (
1139} 1139}
1140 1140
1141/*-------------------------------------------------------------------------*/ 1141/*-------------------------------------------------------------------------*/
1142#ifdef CONFIG_USB_HCD_TEST_MODE
1142/* 1143/*
1143 * This function creates the qtds and submits them for the 1144 * This function creates the qtds and submits them for the
1144 * SINGLE_STEP_SET_FEATURE Test. 1145 * SINGLE_STEP_SET_FEATURE Test.
@@ -1238,6 +1239,7 @@ cleanup:
1238 qtd_list_free(ehci, urb, head); 1239 qtd_list_free(ehci, urb, head);
1239 return -1; 1240 return -1;
1240} 1241}
1242#endif /* CONFIG_USB_HCD_TEST_MODE */
1241 1243
1242/*-------------------------------------------------------------------------*/ 1244/*-------------------------------------------------------------------------*/
1243 1245