提交 034d7c13 编写于 作者: K Kuninori Morimoto 提交者: Felipe Balbi

usb: gadget: renesas_usbhs: add mod_host support

This is mod_host prototype support for renesas_usbhs driver.
It doesn't support USB-Hub, and USB-DMAC for now.
Signed-off-by: NKuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: NFelipe Balbi <balbi@ti.com>
上级 e2eddc61
...@@ -515,6 +515,19 @@ config USB_R8A66597_HCD ...@@ -515,6 +515,19 @@ config USB_R8A66597_HCD
To compile this driver as a module, choose M here: the To compile this driver as a module, choose M here: the
module will be called r8a66597-hcd. module will be called r8a66597-hcd.
config USB_RENESAS_USBHS_HCD
tristate "Renesas USBHS HCD support"
depends on USB
depends on USB_RENESAS_USBHS
help
The Renesas USBHS is a USB 2.0 host and peripheral controller.
Enable this option if your board has this chip, and you want
to use it as a host controller. If unsure, say N.
To compile this driver as a module, choose M here: the
module will be called renesas-usbhs.
config USB_WHCI_HCD config USB_WHCI_HCD
tristate "Wireless USB Host Controller Interface (WHCI) driver (EXPERIMENTAL)" tristate "Wireless USB Host Controller Interface (WHCI) driver (EXPERIMENTAL)"
depends on EXPERIMENTAL depends on EXPERIMENTAL
......
...@@ -6,4 +6,5 @@ obj-$(CONFIG_USB_RENESAS_USBHS) += renesas_usbhs.o ...@@ -6,4 +6,5 @@ obj-$(CONFIG_USB_RENESAS_USBHS) += renesas_usbhs.o
renesas_usbhs-y := common.o mod.o pipe.o fifo.o renesas_usbhs-y := common.o mod.o pipe.o fifo.o
renesas_usbhs-$(CONFIG_USB_RENESAS_USBHS_HCD) += mod_host.o
renesas_usbhs-$(CONFIG_USB_RENESAS_USBHS_UDC) += mod_gadget.o renesas_usbhs-$(CONFIG_USB_RENESAS_USBHS_UDC) += mod_gadget.o
...@@ -140,10 +140,14 @@ int usbhs_mod_probe(struct usbhs_priv *priv) ...@@ -140,10 +140,14 @@ int usbhs_mod_probe(struct usbhs_priv *priv)
/* /*
* install host/gadget driver * install host/gadget driver
*/ */
ret = usbhs_mod_gadget_probe(priv); ret = usbhs_mod_host_probe(priv);
if (ret < 0) if (ret < 0)
return ret; return ret;
ret = usbhs_mod_gadget_probe(priv);
if (ret < 0)
goto mod_init_host_err;
/* irq settings */ /* irq settings */
ret = request_irq(priv->irq, usbhs_interrupt, ret = request_irq(priv->irq, usbhs_interrupt,
0, dev_name(dev), priv); 0, dev_name(dev), priv);
...@@ -156,12 +160,15 @@ int usbhs_mod_probe(struct usbhs_priv *priv) ...@@ -156,12 +160,15 @@ int usbhs_mod_probe(struct usbhs_priv *priv)
mod_init_gadget_err: mod_init_gadget_err:
usbhs_mod_gadget_remove(priv); usbhs_mod_gadget_remove(priv);
mod_init_host_err:
usbhs_mod_host_remove(priv);
return ret; return ret;
} }
void usbhs_mod_remove(struct usbhs_priv *priv) void usbhs_mod_remove(struct usbhs_priv *priv)
{ {
usbhs_mod_host_remove(priv);
usbhs_mod_gadget_remove(priv); usbhs_mod_gadget_remove(priv);
free_irq(priv->irq, priv); free_irq(priv->irq, priv);
} }
......
...@@ -139,8 +139,21 @@ void usbhs_irq_callback_update(struct usbhs_priv *priv, struct usbhs_mod *mod); ...@@ -139,8 +139,21 @@ void usbhs_irq_callback_update(struct usbhs_priv *priv, struct usbhs_mod *mod);
}) })
/* /*
* gadget control * host / gadget control
*/ */
#ifdef CONFIG_USB_RENESAS_USBHS_HCD
extern int __devinit usbhs_mod_host_probe(struct usbhs_priv *priv);
extern int __devexit usbhs_mod_host_remove(struct usbhs_priv *priv);
#else
static inline int usbhs_mod_host_probe(struct usbhs_priv *priv)
{
return 0;
}
static inline void usbhs_mod_host_remove(struct usbhs_priv *priv)
{
}
#endif
#ifdef CONFIG_USB_RENESAS_USBHS_UDC #ifdef CONFIG_USB_RENESAS_USBHS_UDC
extern int __devinit usbhs_mod_gadget_probe(struct usbhs_priv *priv); extern int __devinit usbhs_mod_gadget_probe(struct usbhs_priv *priv);
extern void __devexit usbhs_mod_gadget_remove(struct usbhs_priv *priv); extern void __devexit usbhs_mod_gadget_remove(struct usbhs_priv *priv);
......
此差异已折叠。
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册