usb: host: add Kconfig option for EHSET
authorJack Pham <jackp@codeaurora.org>
Tue, 13 Aug 2013 20:40:13 +0000 (13:40 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 14 Aug 2013 19:18:26 +0000 (12:18 -0700)
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>
drivers/usb/host/Kconfig
drivers/usb/host/ehci-hub.c
drivers/usb/host/ehci-q.c

index e3ea970fe42441380d6e336be1579b9863e1964e..c41005a47802c986170d44f712fe6b5b29c8261e 100644 (file)
@@ -699,3 +699,20 @@ config USB_HCD_SSB
          for ehci and ohci.
 
          If unsure, say N.
+
+config USB_HCD_TEST_MODE
+       bool "HCD test mode support"
+       ---help---
+         Say 'Y' to enable additional software test modes that may be
+         supported by the host controller drivers.
+
+         One such test mode is the Embedded High-speed Host Electrical Test
+         (EHSET) for EHCI host controller hardware, specifically the "Single
+         Step Set Feature" test.  Typically this will be enabled for On-the-Go
+         or embedded hosts that need to undergo USB-IF compliance testing with
+         the aid of special testing hardware.  In the future, this may expand
+         to include other tests that require support from a HCD driver.
+
+         This option is of interest only to developers who need to validate
+         their USB hardware designs.  It is not needed for normal use.  If
+         unsure, say N.
index f8b215fa0d936e3d7b7f04dc43330c7d7c5c4441..3bf9f482710c1574999b3ad340c9a2e21ed19d32 100644 (file)
@@ -712,6 +712,8 @@ ehci_hub_descriptor (
 }
 
 /*-------------------------------------------------------------------------*/
+#ifdef CONFIG_USB_HCD_TEST_MODE
+
 #define EHSET_TEST_SINGLE_STEP_SET_FEATURE 0x06
 
 static void usb_ehset_completion(struct urb *urb)
@@ -847,6 +849,7 @@ cleanup:
        kfree(buf);
        return retval;
 }
+#endif /* CONFIG_USB_HCD_TEST_MODE */
 /*-------------------------------------------------------------------------*/
 
 static int ehci_hub_control (
@@ -1222,13 +1225,16 @@ static int ehci_hub_control (
                 * about the EHCI-specific stuff.
                 */
                case USB_PORT_FEAT_TEST:
+#ifdef CONFIG_USB_HCD_TEST_MODE
                        if (selector == EHSET_TEST_SINGLE_STEP_SET_FEATURE) {
                                spin_unlock_irqrestore(&ehci->lock, flags);
                                retval = ehset_single_step_set_feature(hcd,
                                                                        wIndex);
                                spin_lock_irqsave(&ehci->lock, flags);
                                break;
-                       } else if (!selector || selector > 5)
+                       }
+#endif
+                       if (!selector || selector > 5)
                                goto error;
                        spin_unlock_irqrestore(&ehci->lock, flags);
                        ehci_quiesce(ehci);
index 903d00dd66832c8cd22ab3253530869739b6261f..33336874c47bc023792a89ce224d3a7a6bb37209 100644 (file)
@@ -1139,6 +1139,7 @@ submit_async (
 }
 
 /*-------------------------------------------------------------------------*/
+#ifdef CONFIG_USB_HCD_TEST_MODE
 /*
  * This function creates the qtds and submits them for the
  * SINGLE_STEP_SET_FEATURE Test.
@@ -1238,6 +1239,7 @@ cleanup:
        qtd_list_free(ehci, urb, head);
        return -1;
 }
+#endif /* CONFIG_USB_HCD_TEST_MODE */
 
 /*-------------------------------------------------------------------------*/