All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/2] musb: Rework USB and USB_GADGET config
@ 2013-12-26 12:24 Ezequiel Garcia
  2013-12-26 12:24 ` [PATCH 1/2] usb: musb: Remove usb_disable() check in module_init() Ezequiel Garcia
  2013-12-26 12:24 ` [PATCH 2/2] usb: musb: Rework USB and USB_GADGET dependency Ezequiel Garcia
  0 siblings, 2 replies; 4+ messages in thread
From: Ezequiel Garcia @ 2013-12-26 12:24 UTC (permalink / raw)
  To: linux-usb, linux-omap; +Cc: Felipe Balbi, Ezequiel Garcia

I'm resending this configuration rework to include one more patch in the
series, prior to the config change. The first patch removes the usb_disable()
usage, allowing the build the module for gadget-only mode usage.

Without the first patch, the build breaks when building for !USB && USB_GADGET.
Hope it looks better now.

Ezequiel Garcia (2):
  usb: musb: Remove usb_disable() check in module_init()
  usb: musb: Rework USB and USB_GADGET dependency

 drivers/usb/Kconfig          |  4 ++--
 drivers/usb/musb/Kconfig     |  8 ++++----
 drivers/usb/musb/musb_core.c | 17 +----------------
 3 files changed, 7 insertions(+), 22 deletions(-)

-- 
1.8.1.5


^ permalink raw reply	[flat|nested] 4+ messages in thread

* [PATCH 1/2] usb: musb: Remove usb_disable() check in module_init()
  2013-12-26 12:24 [PATCH 0/2] musb: Rework USB and USB_GADGET config Ezequiel Garcia
@ 2013-12-26 12:24 ` Ezequiel Garcia
  2013-12-26 12:24 ` [PATCH 2/2] usb: musb: Rework USB and USB_GADGET dependency Ezequiel Garcia
  1 sibling, 0 replies; 4+ messages in thread
From: Ezequiel Garcia @ 2013-12-26 12:24 UTC (permalink / raw)
  To: linux-usb, linux-omap; +Cc: Felipe Balbi, Ezequiel Garcia

Removing the check to usb_disable() before registering the platform
driver allows to build this driver when !USB && USB_GADGET, to be
used in gadget-only mode.

Also, use module_platform_driver() to register the platform driver.

Signed-off-by: Ezequiel Garcia <ezequiel.garcia@free-electrons.com>
---
 drivers/usb/musb/musb_core.c | 17 +----------------
 1 file changed, 1 insertion(+), 16 deletions(-)

diff --git a/drivers/usb/musb/musb_core.c b/drivers/usb/musb/musb_core.c
index 4d4499b..74d547a 100644
--- a/drivers/usb/musb/musb_core.c
+++ b/drivers/usb/musb/musb_core.c
@@ -2283,19 +2283,4 @@ static struct platform_driver musb_driver = {
 	.shutdown	= musb_shutdown,
 };
 
-/*-------------------------------------------------------------------------*/
-
-static int __init musb_init(void)
-{
-	if (usb_disabled())
-		return 0;
-
-	return platform_driver_register(&musb_driver);
-}
-module_init(musb_init);
-
-static void __exit musb_cleanup(void)
-{
-	platform_driver_unregister(&musb_driver);
-}
-module_exit(musb_cleanup);
+module_platform_driver(musb_driver);
-- 
1.8.1.5


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [PATCH 2/2] usb: musb: Rework USB and USB_GADGET dependency
  2013-12-26 12:24 [PATCH 0/2] musb: Rework USB and USB_GADGET config Ezequiel Garcia
  2013-12-26 12:24 ` [PATCH 1/2] usb: musb: Remove usb_disable() check in module_init() Ezequiel Garcia
@ 2013-12-26 12:24 ` Ezequiel Garcia
       [not found]   ` <1388060693-2716-3-git-send-email-ezequiel.garcia-wi1+55ScJUtKEb57/3fJTNBPR1lH4CV8@public.gmane.org>
  1 sibling, 1 reply; 4+ messages in thread
From: Ezequiel Garcia @ 2013-12-26 12:24 UTC (permalink / raw)
  To: linux-usb, linux-omap; +Cc: Felipe Balbi, Ezequiel Garcia

This USB controller can work in as host-only, gadget-only or dual-role
modes. Rework the dependency on the USB and USB_GADGET configs in order
to allow building the driver when !USB or !USG_GADGET.

Signed-off-by: Ezequiel Garcia <ezequiel.garcia@free-electrons.com>
---
This is just a resend of a recently sent, standalone patch.

 drivers/usb/Kconfig      | 4 ++--
 drivers/usb/musb/Kconfig | 8 ++++----
 2 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/drivers/usb/Kconfig b/drivers/usb/Kconfig
index 2642b8a..a34fb98 100644
--- a/drivers/usb/Kconfig
+++ b/drivers/usb/Kconfig
@@ -94,8 +94,6 @@ source "drivers/usb/wusbcore/Kconfig"
 
 source "drivers/usb/host/Kconfig"
 
-source "drivers/usb/musb/Kconfig"
-
 source "drivers/usb/renesas_usbhs/Kconfig"
 
 source "drivers/usb/class/Kconfig"
@@ -106,6 +104,8 @@ source "drivers/usb/image/Kconfig"
 
 endif
 
+source "drivers/usb/musb/Kconfig"
+
 source "drivers/usb/dwc3/Kconfig"
 
 source "drivers/usb/chipidea/Kconfig"
diff --git a/drivers/usb/musb/Kconfig b/drivers/usb/musb/Kconfig
index 57dfc0c..a1d805f 100644
--- a/drivers/usb/musb/Kconfig
+++ b/drivers/usb/musb/Kconfig
@@ -6,7 +6,7 @@
 # (M)HDRC = (Multipoint) Highspeed Dual-Role Controller
 config USB_MUSB_HDRC
 	tristate 'Inventra Highspeed Dual Role Controller (TI, ADI, ...)'
-	depends on USB_GADGET
+	depends on (USB || USB_GADGET)
 	help
 	  Say Y here if your system has a dual role high speed USB
 	  controller based on the Mentor Graphics silicon IP.  Then
@@ -35,21 +35,21 @@ choice
 
 config USB_MUSB_HOST
 	bool "Host only mode"
-	depends on USB
+	depends on USB=y || USB=USB_MUSB_HDRC
 	help
 	  Select this when you want to use MUSB in host mode only,
 	  thereby the gadget feature will be regressed.
 
 config USB_MUSB_GADGET
 	bool "Gadget only mode"
-	depends on USB_GADGET
+	depends on USB_GADGET=y || USB_GADGET=USB_MUSB_HDRC
 	help
 	  Select this when you want to use MUSB in gadget mode only,
 	  thereby the host feature will be regressed.
 
 config USB_MUSB_DUAL_ROLE
 	bool "Dual Role mode"
-	depends on (USB && USB_GADGET)
+	depends on ((USB=y || USB=USB_MUSB_HDRC) && (USB_GADGET=y || USB_GADGET=USB_MUSB_HDRC))
 	help
 	  This is the default mode of working of MUSB controller where
 	  both host and gadget features are enabled.
-- 
1.8.1.5


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH 2/2] usb: musb: Rework USB and USB_GADGET dependency
       [not found]   ` <1388060693-2716-3-git-send-email-ezequiel.garcia-wi1+55ScJUtKEb57/3fJTNBPR1lH4CV8@public.gmane.org>
@ 2013-12-26 12:40     ` Sergei Shtylyov
  0 siblings, 0 replies; 4+ messages in thread
From: Sergei Shtylyov @ 2013-12-26 12:40 UTC (permalink / raw)
  To: Ezequiel Garcia, linux-usb-u79uwXL29TY76Z2rM5mHXA,
	linux-omap-u79uwXL29TY76Z2rM5mHXA
  Cc: Felipe Balbi

Hello.

On 26-12-2013 16:24, Ezequiel Garcia wrote:

> This USB controller can work in as host-only, gadget-only or dual-role
> modes. Rework the dependency on the USB and USB_GADGET configs in order
> to allow building the driver when !USB or !USG_GADGET.

> Signed-off-by: Ezequiel Garcia <ezequiel.garcia-wi1+55ScJUtKEb57/3fJTNBPR1lH4CV8@public.gmane.org>
[...]

> diff --git a/drivers/usb/musb/Kconfig b/drivers/usb/musb/Kconfig
> index 57dfc0c..a1d805f 100644
> --- a/drivers/usb/musb/Kconfig
> +++ b/drivers/usb/musb/Kconfig
> @@ -6,7 +6,7 @@
>   # (M)HDRC = (Multipoint) Highspeed Dual-Role Controller
>   config USB_MUSB_HDRC
>   	tristate 'Inventra Highspeed Dual Role Controller (TI, ADI, ...)'
> -	depends on USB_GADGET
> +	depends on (USB || USB_GADGET)

    Parens are not needed here. Be consistent with other entries MUSB please.

>   	help
>   	  Say Y here if your system has a dual role high speed USB
>   	  controller based on the Mentor Graphics silicon IP.  Then
> @@ -35,21 +35,21 @@ choice
>
>   config USB_MUSB_HOST
>   	bool "Host only mode"
> -	depends on USB
> +	depends on USB=y || USB=USB_MUSB_HDRC
>   	help
>   	  Select this when you want to use MUSB in host mode only,
>   	  thereby the gadget feature will be regressed.
>
>   config USB_MUSB_GADGET
>   	bool "Gadget only mode"
> -	depends on USB_GADGET
> +	depends on USB_GADGET=y || USB_GADGET=USB_MUSB_HDRC
>   	help
>   	  Select this when you want to use MUSB in gadget mode only,
>   	  thereby the host feature will be regressed.
>
>   config USB_MUSB_DUAL_ROLE
>   	bool "Dual Role mode"
> -	depends on (USB && USB_GADGET)
> +	depends on ((USB=y || USB=USB_MUSB_HDRC) && (USB_GADGET=y || USB_GADGET=USB_MUSB_HDRC))

    Outer parens are not needed either...

WBR, Sergei

--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2013-12-26 12:40 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-12-26 12:24 [PATCH 0/2] musb: Rework USB and USB_GADGET config Ezequiel Garcia
2013-12-26 12:24 ` [PATCH 1/2] usb: musb: Remove usb_disable() check in module_init() Ezequiel Garcia
2013-12-26 12:24 ` [PATCH 2/2] usb: musb: Rework USB and USB_GADGET dependency Ezequiel Garcia
     [not found]   ` <1388060693-2716-3-git-send-email-ezequiel.garcia-wi1+55ScJUtKEb57/3fJTNBPR1lH4CV8@public.gmane.org>
2013-12-26 12:40     ` Sergei Shtylyov

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.