From 3b9e2a2520082ebf64ad4607bace057ac8fb0076 Mon Sep 17 00:00:00 2001
From: Adam Ford <aford173@gmail.com>
Date: Tue, 2 Jan 2018 10:38:36 -0600
Subject: [PATCH] Convert CONFIG_TWL4030_USB to Kconfig

This converts the following to Kconfig:
   CONFIG_TWL4030_USB

Signed-off-by: Adam Ford <aford173@gmail.com>
---
 configs/cm_t35_defconfig         |  1 +
 configs/igep0032_defconfig       |  1 +
 configs/igep00x0_defconfig       |  1 +
 configs/nokia_rx51_defconfig     |  1 +
 configs/omap3_beagle_defconfig   |  1 +
 configs/omap3_logic_defconfig    |  1 +
 configs/omap3_zoom1_defconfig    |  1 +
 configs/sniper_defconfig         |  1 +
 drivers/usb/Kconfig              |  2 ++
 drivers/usb/phy/Kconfig          | 12 ++++++++++++
 include/configs/cm_t35.h         |  3 ---
 include/configs/nokia_rx51.h     |  3 ---
 include/configs/omap3_beagle.h   |  1 -
 include/configs/omap3_igep00x0.h |  3 ---
 include/configs/omap3_logic.h    |  5 -----
 include/configs/omap3_zoom1.h    |  3 ---
 include/configs/sniper.h         |  6 ------
 scripts/config_whitelist.txt     |  1 -
 18 files changed, 22 insertions(+), 25 deletions(-)
 create mode 100644 drivers/usb/phy/Kconfig

diff --git a/configs/cm_t35_defconfig b/configs/cm_t35_defconfig
index cfb68b1cd2..0cb6e7277d 100644
--- a/configs/cm_t35_defconfig
+++ b/configs/cm_t35_defconfig
@@ -52,6 +52,7 @@ CONFIG_USB=y
 CONFIG_USB_EHCI_HCD=y
 CONFIG_USB_MUSB_UDC=y
 CONFIG_USB_OMAP3=y
+CONFIG_TWL4030_USB=y
 CONFIG_USB_STORAGE=y
 CONFIG_LCD=y
 CONFIG_OF_LIBFDT=y
diff --git a/configs/igep0032_defconfig b/configs/igep0032_defconfig
index 60cce779cd..b0daee1a61 100644
--- a/configs/igep0032_defconfig
+++ b/configs/igep0032_defconfig
@@ -42,6 +42,7 @@ CONFIG_OMAP3_SPI=y
 CONFIG_USB=y
 CONFIG_USB_MUSB_UDC=y
 CONFIG_USB_OMAP3=y
+CONFIG_TWL4030_USB=y
 CONFIG_FAT_WRITE=y
 CONFIG_BCH=y
 CONFIG_OF_LIBFDT=y
diff --git a/configs/igep00x0_defconfig b/configs/igep00x0_defconfig
index d8ece6bbee..22dbc70615 100644
--- a/configs/igep00x0_defconfig
+++ b/configs/igep00x0_defconfig
@@ -43,6 +43,7 @@ CONFIG_OMAP3_SPI=y
 CONFIG_USB=y
 CONFIG_USB_MUSB_UDC=y
 CONFIG_USB_OMAP3=y
+CONFIG_TWL4030_USB=y
 CONFIG_FAT_WRITE=y
 CONFIG_BCH=y
 CONFIG_OF_LIBFDT=y
diff --git a/configs/nokia_rx51_defconfig b/configs/nokia_rx51_defconfig
index 570bb3f7ac..e93042e76a 100644
--- a/configs/nokia_rx51_defconfig
+++ b/configs/nokia_rx51_defconfig
@@ -30,6 +30,7 @@ CONFIG_USB=y
 CONFIG_USB_MUSB_HCD=y
 CONFIG_USB_MUSB_UDC=y
 CONFIG_USB_OMAP3=y
+CONFIG_TWL4030_USB=y
 CONFIG_VIDEO=y
 CONFIG_CFB_CONSOLE_ANSI=y
 # CONFIG_VGA_AS_SINGLE_DEVICE is not set
diff --git a/configs/omap3_beagle_defconfig b/configs/omap3_beagle_defconfig
index 33fd1462c4..318c1f9346 100644
--- a/configs/omap3_beagle_defconfig
+++ b/configs/omap3_beagle_defconfig
@@ -53,6 +53,7 @@ CONFIG_USB=y
 CONFIG_USB_EHCI_HCD=y
 CONFIG_USB_MUSB_GADGET=y
 CONFIG_USB_MUSB_OMAP2PLUS=y
+CONFIG_TWL4030_USB=y
 CONFIG_USB_STORAGE=y
 CONFIG_USB_GADGET=y
 CONFIG_USB_GADGET_MANUFACTURER="TI"
diff --git a/configs/omap3_logic_defconfig b/configs/omap3_logic_defconfig
index 3abe8885f0..3482538d78 100644
--- a/configs/omap3_logic_defconfig
+++ b/configs/omap3_logic_defconfig
@@ -53,6 +53,7 @@ CONFIG_USB_EHCI_HCD=y
 CONFIG_USB_OMAP3=y
 CONFIG_USB_MUSB_GADGET=y
 CONFIG_USB_MUSB_OMAP2PLUS=y
+CONFIG_TWL4030_USB=y
 CONFIG_USB_STORAGE=y
 CONFIG_USB_GADGET=y
 CONFIG_USB_GADGET_MANUFACTURER="TI"
diff --git a/configs/omap3_zoom1_defconfig b/configs/omap3_zoom1_defconfig
index db867b1f2c..1a915c5128 100644
--- a/configs/omap3_zoom1_defconfig
+++ b/configs/omap3_zoom1_defconfig
@@ -44,5 +44,6 @@ CONFIG_OMAP3_SPI=y
 CONFIG_USB=y
 CONFIG_USB_MUSB_UDC=y
 CONFIG_USB_OMAP3=y
+CONFIG_TWL4030_USB=y
 CONFIG_FAT_WRITE=y
 CONFIG_OF_LIBFDT=y
diff --git a/configs/sniper_defconfig b/configs/sniper_defconfig
index c75b1ba4ef..a3bae56cda 100644
--- a/configs/sniper_defconfig
+++ b/configs/sniper_defconfig
@@ -40,6 +40,7 @@ CONFIG_SYS_NS16550=y
 CONFIG_USB=y
 CONFIG_USB_MUSB_GADGET=y
 CONFIG_USB_MUSB_OMAP2PLUS=y
+CONFIG_TWL4030_USB=y
 CONFIG_USB_GADGET=y
 CONFIG_USB_GADGET_MANUFACTURER="Texas Instruments"
 CONFIG_USB_GADGET_VENDOR_NUM=0x0451
diff --git a/drivers/usb/Kconfig b/drivers/usb/Kconfig
index 13e9e49b22..7de41057ca 100644
--- a/drivers/usb/Kconfig
+++ b/drivers/usb/Kconfig
@@ -57,6 +57,8 @@ source "drivers/usb/musb-new/Kconfig"
 
 source "drivers/usb/emul/Kconfig"
 
+source "drivers/usb/phy/Kconfig"
+
 source "drivers/usb/ulpi/Kconfig"
 
 comment "USB peripherals"
diff --git a/drivers/usb/phy/Kconfig b/drivers/usb/phy/Kconfig
new file mode 100644
index 0000000000..943a966a90
--- /dev/null
+++ b/drivers/usb/phy/Kconfig
@@ -0,0 +1,12 @@
+#
+# (C) Copyright 2017
+# Adam Ford, Logic PD, aford173@gmail.com
+#
+# SPDX-License-Identifier:	GPL-2.0+
+#
+
+comment "USB Phy"
+
+config TWL4030_USB
+	bool "TWL4030 PHY"
+
diff --git a/include/configs/cm_t35.h b/include/configs/cm_t35.h
index 8abe870e9f..3c64cb575c 100644
--- a/include/configs/cm_t35.h
+++ b/include/configs/cm_t35.h
@@ -71,9 +71,6 @@
 #define CONFIG_SYS_BAUDRATE_TABLE	{4800, 9600, 19200, 38400, 57600,\
 					115200}
 
-/* USB */
-#define CONFIG_TWL4030_USB
-
 /* USB device configuration */
 #define CONFIG_USB_DEVICE
 #define CONFIG_USB_TTY
diff --git a/include/configs/nokia_rx51.h b/include/configs/nokia_rx51.h
index 1c02a8ca31..00509e8508 100644
--- a/include/configs/nokia_rx51.h
+++ b/include/configs/nokia_rx51.h
@@ -82,9 +82,6 @@
 #define CONFIG_ENV_OVERWRITE
 #define CONFIG_SYS_BAUDRATE_TABLE { 4800, 9600, 19200, 38400, 57600, 115200 }
 
-/* USB */
-#define CONFIG_TWL4030_USB
-
 /* USB device configuration */
 #define CONFIG_USB_DEVICE
 #define CONFIG_USBD_VENDORID		0x0421
diff --git a/include/configs/omap3_beagle.h b/include/configs/omap3_beagle.h
index 7d109a43dc..d3dfe60bb0 100644
--- a/include/configs/omap3_beagle.h
+++ b/include/configs/omap3_beagle.h
@@ -62,7 +62,6 @@
 
 /* MUSB */
 #define CONFIG_USB_OMAP3
-#define CONFIG_TWL4030_USB
 
 /* USB EHCI */
 #define CONFIG_OMAP_EHCI_PHY1_RESET_GPIO	147
diff --git a/include/configs/omap3_igep00x0.h b/include/configs/omap3_igep00x0.h
index 9b815e03f7..76d8e13d52 100644
--- a/include/configs/omap3_igep00x0.h
+++ b/include/configs/omap3_igep00x0.h
@@ -41,9 +41,6 @@
 #define GPIO_IGEP00X0_BOARD_DETECTION		28
 #define GPIO_IGEP00X0_REVISION_DETECTION	129
 
-/* USB */
-#define CONFIG_TWL4030_USB		1
-
 /* USB device configuration */
 #define CONFIG_USB_DEVICE		1
 #define CONFIG_USB_TTY			1
diff --git a/include/configs/omap3_logic.h b/include/configs/omap3_logic.h
index a4b29f1812..70745a882c 100644
--- a/include/configs/omap3_logic.h
+++ b/include/configs/omap3_logic.h
@@ -52,11 +52,6 @@
 /* I2C */
 #define CONFIG_SYS_I2C_EEPROM_ADDR	0x50	/* EEPROM AT24C64      */
 
-/* USB */
-
-/* TWL4030 */
-#define CONFIG_TWL4030_USB
-
 /* Board NAND Info. */
 #ifdef CONFIG_NAND
 #define CONFIG_SYS_NAND_ADDR		NAND_BASE /* physical address */
diff --git a/include/configs/omap3_zoom1.h b/include/configs/omap3_zoom1.h
index e5e4bc4c8e..cc7c2fdf04 100644
--- a/include/configs/omap3_zoom1.h
+++ b/include/configs/omap3_zoom1.h
@@ -34,9 +34,6 @@
  * Hardware drivers
  */
 
-/* USB */
-#define CONFIG_TWL4030_USB		1
-
 /* USB device configuration */
 #define CONFIG_USB_DEVICE		1
 #define CONFIG_USB_TTY			1
diff --git a/include/configs/sniper.h b/include/configs/sniper.h
index 09b5a73ec0..0ed72cf901 100644
--- a/include/configs/sniper.h
+++ b/include/configs/sniper.h
@@ -109,12 +109,6 @@
 #define CONFIG_SYS_BAUDRATE_TABLE	{ 4800, 9600, 19200, 38400, 57600, \
 					  115200 }
 
-/*
- * USB gadget
- */
-
-#define CONFIG_TWL4030_USB
-
 /*
  * Environment
  */
diff --git a/scripts/config_whitelist.txt b/scripts/config_whitelist.txt
index 2fea7aefac..20d5fbec31 100644
--- a/scripts/config_whitelist.txt
+++ b/scripts/config_whitelist.txt
@@ -4747,7 +4747,6 @@ CONFIG_TUXX1
 CONFIG_TWL4030_INPUT
 CONFIG_TWL4030_KEYPAD
 CONFIG_TWL4030_LED
-CONFIG_TWL4030_USB
 CONFIG_TWL6030_INPUT
 CONFIG_TWL6030_POWER
 CONFIG_TWR
-- 
2.39.5