]> git.karo-electronics.de Git - linux-beck.git/commitdiff
usb: gadget: renesas_usbhs: support otg pin control
authorKuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Tue, 11 Oct 2011 05:06:12 +0000 (22:06 -0700)
committerFelipe Balbi <balbi@ti.com>
Thu, 13 Oct 2011 17:41:47 +0000 (20:41 +0300)
some renesas_usbhs device is supporting OTG external device interface.
In that device, it is necessary to control PWEN/EXTLP on DVSTCTR.
This patch support it.
But renesas_usbhs driver doesn't have OTG support for now.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
arch/arm/mach-shmobile/board-mackerel.c
drivers/usb/renesas_usbhs/common.c
include/linux/usb/renesas_usbhs.h

index 0ea71f8d4b89dbd74f006ab047e2618c34da0f26..c20612ea5d0e939cafc554f594220faa6ed3a25c 100644 (file)
@@ -808,6 +808,7 @@ static struct usbhs_private usbhs1_private = {
                },
                .driver_param = {
                        .buswait_bwait  = 4,
+                       .has_otg        = 1,
                        .pipe_type      = usbhs1_pipe_cfg,
                        .pipe_size      = ARRAY_SIZE(usbhs1_pipe_cfg),
                },
index b327458f5cadfb2f4d58444c545f510c0eea2d8d..1161d78e16652b24efde37acabe417a1211ef8d4 100644 (file)
@@ -114,6 +114,10 @@ void usbhs_sys_host_ctrl(struct usbhs_priv *priv, int enable)
 {
        u16 mask = DCFM | DRPD | DPRPU;
        u16 val  = DCFM | DRPD;
+       int has_otg = usbhs_get_dparam(priv, has_otg);
+
+       if (has_otg)
+               usbhs_bset(priv, DVSTCTR, (EXTLP | PWEN), (EXTLP | PWEN));
 
        /*
         * if enable
index 040d8bb2b5a2c893303c3860b868728d5e78c4d5..e5a40c3185485e6f313640b409fb0ec8390498a7 100644 (file)
@@ -136,6 +136,11 @@ struct renesas_usbhs_driver_param {
         * pio <--> dma border.
         */
        int pio_dma_border; /* default is 64byte */
+
+       /*
+        * option:
+        */
+       u32 has_otg:1; /* for controlling PWEN/EXTLP */
 };
 
 /*