sunxi: usb: USB_MUSB_SUNXI move to musb-new Kconfig

Now that the musb-new driver has a Kconfig, we can move Kconfig options to
enable controllers to it, so that it's easier in e.g. menuconfig.

In addition, this allows declaring support for USB_MUSB_HOST/GADGET in
defconfigs instead of the USB_MUSB_SUNXI controller, that will get selected
automatically when needed.

Signed-off-by: Paul Kocialkowski <contact@paulk.fr>
diff --git a/board/sunxi/Kconfig b/board/sunxi/Kconfig
index 441c880..e1c5e1d 100644
--- a/board/sunxi/Kconfig
+++ b/board/sunxi/Kconfig
@@ -539,15 +539,6 @@
 endchoice
 
 
-config USB_MUSB_SUNXI
-	bool "Enable sunxi OTG / DRC USB controller in host mode"
-	default n
-	---help---
-	Say y here to enable support for the sunxi OTG / DRC USB controller
-	used on almost all sunxi boards. Note currently u-boot can only have
-	one usb host controller enabled at a time, so enabling this on boards
-	which also use the ehci host controller will result in build errors.
-
 config USB_KEYBOARD
 	boolean "Enable USB keyboard support"
 	default y
diff --git a/configs/Ainol_AW1_defconfig b/configs/Ainol_AW1_defconfig
index e1262e6..ff7abfa 100644
--- a/configs/Ainol_AW1_defconfig
+++ b/configs/Ainol_AW1_defconfig
@@ -11,7 +11,7 @@
 CONFIG_VIDEO_LCD_POWER="PH8"
 CONFIG_VIDEO_LCD_BL_EN="PH7"
 CONFIG_VIDEO_LCD_BL_PWM="PB2"
-CONFIG_USB_MUSB_SUNXI=y
+CONFIG_USB_MUSB_HOST=y
 CONFIG_DEFAULT_DEVICE_TREE="sun7i-a20-ainol-aw1"
 # CONFIG_SYS_MALLOC_CLEAR_ON_INIT is not set
 CONFIG_SPL=y
diff --git a/configs/Ampe_A76_defconfig b/configs/Ampe_A76_defconfig
index 2ee0307..1d36919 100644
--- a/configs/Ampe_A76_defconfig
+++ b/configs/Ampe_A76_defconfig
@@ -10,7 +10,7 @@
 CONFIG_VIDEO_LCD_POWER="AXP0-0"
 CONFIG_VIDEO_LCD_BL_EN="AXP0-1"
 CONFIG_VIDEO_LCD_BL_PWM="PB2"
-CONFIG_USB_MUSB_SUNXI=y
+CONFIG_USB_MUSB_HOST=y
 CONFIG_DEFAULT_DEVICE_TREE="sun5i-a13-ampe-a76"
 # CONFIG_SYS_MALLOC_CLEAR_ON_INIT is not set
 CONFIG_SPL=y
diff --git a/configs/CSQ_CS908_defconfig b/configs/CSQ_CS908_defconfig
index fe88a7b..7c8eca8 100644
--- a/configs/CSQ_CS908_defconfig
+++ b/configs/CSQ_CS908_defconfig
@@ -15,4 +15,4 @@
 CONFIG_AXP221_DLDO1_VOLT=3300
 CONFIG_AXP221_ALDO1_VOLT=3300
 CONFIG_USB_EHCI_HCD=y
-CONFIG_USB_MUSB_SUNXI=y
+CONFIG_USB_MUSB_HOST=y
diff --git a/configs/Chuwi_V7_CW0825_defconfig b/configs/Chuwi_V7_CW0825_defconfig
index cb659c9..4011351 100644
--- a/configs/Chuwi_V7_CW0825_defconfig
+++ b/configs/Chuwi_V7_CW0825_defconfig
@@ -10,7 +10,7 @@
 CONFIG_VIDEO_LCD_BL_EN="PH7"
 CONFIG_VIDEO_LCD_BL_PWM="PB2"
 CONFIG_VIDEO_LCD_PANEL_HITACHI_TX18D42VM=y
-CONFIG_USB_MUSB_SUNXI=y
+CONFIG_USB_MUSB_HOST=y
 CONFIG_DEFAULT_DEVICE_TREE="sun4i-a10-chuwi-v7-cw0825"
 # CONFIG_SYS_MALLOC_CLEAR_ON_INIT is not set
 CONFIG_SPL=y
diff --git a/configs/Et_q8_v1_6_defconfig b/configs/Et_q8_v1_6_defconfig
index 2783347..ca8db19 100644
--- a/configs/Et_q8_v1_6_defconfig
+++ b/configs/Et_q8_v1_6_defconfig
@@ -11,7 +11,7 @@
 CONFIG_VIDEO_LCD_POWER="PH7"
 CONFIG_VIDEO_LCD_BL_EN="PH6"
 CONFIG_VIDEO_LCD_BL_PWM="PH0"
-CONFIG_USB_MUSB_SUNXI=y
+CONFIG_USB_MUSB_HOST=y
 CONFIG_DEFAULT_DEVICE_TREE="sun8i-a33-et-q8-v1.6"
 # CONFIG_SYS_MALLOC_CLEAR_ON_INIT is not set
 CONFIG_SPL=y
diff --git a/configs/Hyundai_A7HD_defconfig b/configs/Hyundai_A7HD_defconfig
index 06fdd2a..065a3f9 100644
--- a/configs/Hyundai_A7HD_defconfig
+++ b/configs/Hyundai_A7HD_defconfig
@@ -12,7 +12,7 @@
 CONFIG_VIDEO_LCD_BL_PWM="PB2"
 # CONFIG_VIDEO_LCD_BL_PWM_ACTIVE_LOW is not set
 CONFIG_VIDEO_LCD_PANEL_LVDS=y
-CONFIG_USB_MUSB_SUNXI=y
+CONFIG_USB_MUSB_HOST=y
 CONFIG_DEFAULT_DEVICE_TREE="sun4i-a10-hyundai-a7hd"
 # CONFIG_SYS_MALLOC_CLEAR_ON_INIT is not set
 CONFIG_SPL=y
diff --git a/configs/Ippo_q8h_v1_2_a33_1024x600_defconfig b/configs/Ippo_q8h_v1_2_a33_1024x600_defconfig
index fda7683..213de5a 100644
--- a/configs/Ippo_q8h_v1_2_a33_1024x600_defconfig
+++ b/configs/Ippo_q8h_v1_2_a33_1024x600_defconfig
@@ -12,7 +12,7 @@
 CONFIG_VIDEO_LCD_POWER="PH7"
 CONFIG_VIDEO_LCD_BL_EN="PH6"
 CONFIG_VIDEO_LCD_BL_PWM="PH0"
-CONFIG_USB_MUSB_SUNXI=y
+CONFIG_USB_MUSB_HOST=y
 CONFIG_DEFAULT_DEVICE_TREE="sun8i-a33-ippo-q8h-v1.2"
 # CONFIG_SYS_MALLOC_CLEAR_ON_INIT is not set
 CONFIG_SPL=y
diff --git a/configs/Ippo_q8h_v1_2_defconfig b/configs/Ippo_q8h_v1_2_defconfig
index 490cbe2..ff5ec30 100644
--- a/configs/Ippo_q8h_v1_2_defconfig
+++ b/configs/Ippo_q8h_v1_2_defconfig
@@ -12,7 +12,7 @@
 CONFIG_VIDEO_LCD_POWER="PH7"
 CONFIG_VIDEO_LCD_BL_EN="PH6"
 CONFIG_VIDEO_LCD_BL_PWM="PH0"
-CONFIG_USB_MUSB_SUNXI=y
+CONFIG_USB_MUSB_HOST=y
 CONFIG_DEFAULT_DEVICE_TREE="sun8i-a23-ippo-q8h-v1.2"
 # CONFIG_SYS_MALLOC_CLEAR_ON_INIT is not set
 CONFIG_SPL=y
diff --git a/configs/Ippo_q8h_v5_defconfig b/configs/Ippo_q8h_v5_defconfig
index aa1eb69..b67206c 100644
--- a/configs/Ippo_q8h_v5_defconfig
+++ b/configs/Ippo_q8h_v5_defconfig
@@ -12,7 +12,7 @@
 CONFIG_VIDEO_LCD_POWER="PH7"
 CONFIG_VIDEO_LCD_BL_EN="PH6"
 CONFIG_VIDEO_LCD_BL_PWM="PH0"
-CONFIG_USB_MUSB_SUNXI=y
+CONFIG_USB_MUSB_HOST=y
 CONFIG_DEFAULT_DEVICE_TREE="sun8i-a23-ippo-q8h-v5"
 # CONFIG_SYS_MALLOC_CLEAR_ON_INIT is not set
 CONFIG_SPL=y
diff --git a/configs/MSI_Primo81_defconfig b/configs/MSI_Primo81_defconfig
index b3b21cb..b089e97 100644
--- a/configs/MSI_Primo81_defconfig
+++ b/configs/MSI_Primo81_defconfig
@@ -10,7 +10,7 @@
 CONFIG_VIDEO_LCD_BL_EN="PA25"
 CONFIG_VIDEO_LCD_BL_PWM="PH13"
 CONFIG_VIDEO_LCD_PANEL_MIPI_4_LANE_513_MBPS_VIA_SSD2828=y
-CONFIG_USB_MUSB_SUNXI=y
+CONFIG_USB_MUSB_HOST=y
 # CONFIG_USB_KEYBOARD is not set
 CONFIG_DEFAULT_DEVICE_TREE="sun6i-a31s-primo81"
 # CONFIG_SYS_MALLOC_CLEAR_ON_INIT is not set
diff --git a/configs/Mele_A1000G_quad_defconfig b/configs/Mele_A1000G_quad_defconfig
index ffc8d9b..5e31ef6 100644
--- a/configs/Mele_A1000G_quad_defconfig
+++ b/configs/Mele_A1000G_quad_defconfig
@@ -17,4 +17,4 @@
 CONFIG_AXP221_DLDO4_VOLT=3300
 CONFIG_AXP221_ALDO1_VOLT=3300
 CONFIG_USB_EHCI_HCD=y
-CONFIG_USB_MUSB_SUNXI=y
+CONFIG_USB_MUSB_HOST=y
diff --git a/configs/Mini-X_defconfig b/configs/Mini-X_defconfig
index c721c87..00b6c63 100644
--- a/configs/Mini-X_defconfig
+++ b/configs/Mini-X_defconfig
@@ -9,5 +9,5 @@
 # CONFIG_CMD_FLASH is not set
 # CONFIG_CMD_FPGA is not set
 CONFIG_USB_EHCI_HCD=y
-CONFIG_USB_MUSB_SUNXI=y
+CONFIG_USB_MUSB_HOST=y
 CONFIG_USB0_VBUS_PIN="PB9"
diff --git a/configs/TZX-Q8-713B7_defconfig b/configs/TZX-Q8-713B7_defconfig
index 6a716bd..3508834 100644
--- a/configs/TZX-Q8-713B7_defconfig
+++ b/configs/TZX-Q8-713B7_defconfig
@@ -10,7 +10,7 @@
 CONFIG_VIDEO_LCD_POWER="AXP0-0"
 CONFIG_VIDEO_LCD_BL_EN="AXP0-1"
 CONFIG_VIDEO_LCD_BL_PWM="PB2"
-CONFIG_USB_MUSB_SUNXI=y
+CONFIG_USB_MUSB_HOST=y
 CONFIG_DEFAULT_DEVICE_TREE="sun5i-a13-tzx-q8-713b7"
 # CONFIG_SYS_MALLOC_CLEAR_ON_INIT is not set
 CONFIG_SPL=y
diff --git a/configs/UTOO_P66_defconfig b/configs/UTOO_P66_defconfig
index d59a044..0266299 100644
--- a/configs/UTOO_P66_defconfig
+++ b/configs/UTOO_P66_defconfig
@@ -15,7 +15,7 @@
 CONFIG_VIDEO_LCD_BL_EN="AXP0-1"
 CONFIG_VIDEO_LCD_BL_PWM="PB2"
 CONFIG_VIDEO_LCD_TL059WV5C0=y
-CONFIG_USB_MUSB_SUNXI=y
+CONFIG_USB_MUSB_HOST=y
 CONFIG_DEFAULT_DEVICE_TREE="sun5i-a13-utoo-p66"
 # CONFIG_SYS_MALLOC_CLEAR_ON_INIT is not set
 CONFIG_SPL=y
diff --git a/configs/Yones_Toptech_BD1078_defconfig b/configs/Yones_Toptech_BD1078_defconfig
index 22b51a2..27f2e2b 100644
--- a/configs/Yones_Toptech_BD1078_defconfig
+++ b/configs/Yones_Toptech_BD1078_defconfig
@@ -16,7 +16,7 @@
 CONFIG_VIDEO_LCD_BL_PWM="PB2"
 # CONFIG_VIDEO_LCD_BL_PWM_ACTIVE_LOW is not set
 CONFIG_VIDEO_LCD_PANEL_LVDS=y
-CONFIG_USB_MUSB_SUNXI=y
+CONFIG_USB_MUSB_HOST=y
 CONFIG_DEFAULT_DEVICE_TREE="sun7i-a20-yones-toptech-bd1078"
 # CONFIG_SYS_MALLOC_CLEAR_ON_INIT is not set
 CONFIG_SPL=y
diff --git a/configs/ba10_tv_box_defconfig b/configs/ba10_tv_box_defconfig
index ae302c5..5b5fc12 100644
--- a/configs/ba10_tv_box_defconfig
+++ b/configs/ba10_tv_box_defconfig
@@ -12,5 +12,5 @@
 # CONFIG_CMD_FLASH is not set
 # CONFIG_CMD_FPGA is not set
 CONFIG_USB_EHCI_HCD=y
-CONFIG_USB_MUSB_SUNXI=y
+CONFIG_USB_MUSB_HOST=y
 CONFIG_USB0_VBUS_PIN="PB9"
diff --git a/configs/forfun_q88db_defconfig b/configs/forfun_q88db_defconfig
index 8f10c25..6fff725 100644
--- a/configs/forfun_q88db_defconfig
+++ b/configs/forfun_q88db_defconfig
@@ -9,7 +9,7 @@
 CONFIG_VIDEO_LCD_POWER="AXP0-0"
 CONFIG_VIDEO_LCD_BL_EN="AXP0-1"
 CONFIG_VIDEO_LCD_BL_PWM="PB2"
-CONFIG_USB_MUSB_SUNXI=y
+CONFIG_USB_MUSB_HOST=y
 CONFIG_DEFAULT_DEVICE_TREE="sun5i-a13-forfun-q88db"
 # CONFIG_SYS_MALLOC_CLEAR_ON_INIT is not set
 CONFIG_SPL=y
diff --git a/configs/ga10h_v1_1_defconfig b/configs/ga10h_v1_1_defconfig
index e766db4..098284d 100644
--- a/configs/ga10h_v1_1_defconfig
+++ b/configs/ga10h_v1_1_defconfig
@@ -14,7 +14,7 @@
 CONFIG_VIDEO_LCD_BL_EN="PH6"
 CONFIG_VIDEO_LCD_BL_PWM="PH0"
 CONFIG_VIDEO_LCD_PANEL_LVDS=y
-CONFIG_USB_MUSB_SUNXI=y
+CONFIG_USB_MUSB_HOST=y
 CONFIG_DEFAULT_DEVICE_TREE="sun8i-a33-ga10h-v1.1"
 # CONFIG_SYS_MALLOC_CLEAR_ON_INIT is not set
 CONFIG_SPL=y
diff --git a/configs/iNet_3F_defconfig b/configs/iNet_3F_defconfig
index c4611cf..22d0caf 100644
--- a/configs/iNet_3F_defconfig
+++ b/configs/iNet_3F_defconfig
@@ -11,7 +11,7 @@
 CONFIG_VIDEO_LCD_BL_EN="PH7"
 CONFIG_VIDEO_LCD_BL_PWM="PB2"
 CONFIG_VIDEO_LCD_PANEL_LVDS=y
-CONFIG_USB_MUSB_SUNXI=y
+CONFIG_USB_MUSB_HOST=y
 CONFIG_DEFAULT_DEVICE_TREE="sun4i-a10-inet-3f"
 # CONFIG_SYS_MALLOC_CLEAR_ON_INIT is not set
 CONFIG_SPL=y
diff --git a/configs/iNet_3W_defconfig b/configs/iNet_3W_defconfig
index d75eb21..c296c0c 100644
--- a/configs/iNet_3W_defconfig
+++ b/configs/iNet_3W_defconfig
@@ -11,7 +11,7 @@
 CONFIG_VIDEO_LCD_POWER="PH8"
 CONFIG_VIDEO_LCD_BL_EN="PH7"
 CONFIG_VIDEO_LCD_BL_PWM="PB2"
-CONFIG_USB_MUSB_SUNXI=y
+CONFIG_USB_MUSB_HOST=y
 CONFIG_DEFAULT_DEVICE_TREE="sun4i-a10-inet-3w"
 # CONFIG_SYS_MALLOC_CLEAR_ON_INIT is not set
 CONFIG_SPL=y
diff --git a/configs/iNet_86VS_defconfig b/configs/iNet_86VS_defconfig
index b9f2066..33162d1 100644
--- a/configs/iNet_86VS_defconfig
+++ b/configs/iNet_86VS_defconfig
@@ -9,7 +9,7 @@
 CONFIG_VIDEO_LCD_POWER="AXP0-0"
 CONFIG_VIDEO_LCD_BL_EN="AXP0-1"
 CONFIG_VIDEO_LCD_BL_PWM="PB2"
-CONFIG_USB_MUSB_SUNXI=y
+CONFIG_USB_MUSB_HOST=y
 CONFIG_DEFAULT_DEVICE_TREE="sun5i-a13-inet-86vs"
 # CONFIG_SYS_MALLOC_CLEAR_ON_INIT is not set
 CONFIG_SPL=y
diff --git a/drivers/usb/musb-new/Kconfig b/drivers/usb/musb-new/Kconfig
index 34a8474..0082ff8 100644
--- a/drivers/usb/musb-new/Kconfig
+++ b/drivers/usb/musb-new/Kconfig
@@ -12,3 +12,17 @@
 	bool "MUSB gadget mode support"
 	help
 	  Enables the MUSB USB dual-role controller in gadget mode.
+
+if USB_MUSB_HOST || USB_MUSB_GADGET
+
+config USB_MUSB_SUNXI
+	bool "Enable sunxi OTG / DRC USB controller"
+	depends on ARCH_SUNXI
+	default y
+	---help---
+	Say y here to enable support for the sunxi OTG / DRC USB controller
+	used on almost all sunxi boards. Note currently u-boot can only have
+	one usb host controller enabled at a time, so enabling this on boards
+	which also use the ehci host controller will result in build errors.
+
+endif