usb: gadget: renesas_usbhs: make sure SOF packet sending-out control
authorKuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Tue, 11 Oct 2011 05:06:35 +0000 (22:06 -0700)
committerFelipe Balbi <balbi@ti.com>
Thu, 13 Oct 2011 17:41:48 +0000 (20:41 +0300)
It is enabled to set SOF packet output bit when USBRST bit was set.
And USBRST bit should be set 0 when SOF packet was output.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
drivers/usb/renesas_usbhs/common.c

index 1161d78e16652b24efde37acabe417a1211ef8d4..895eb44a1a518686513146dbb61cb237732cf8bd 100644 (file)
@@ -181,6 +181,13 @@ void usbhs_usbreq_set_val(struct usbhs_priv *priv, struct usb_ctrlrequest *req)
  */
 void usbhs_bus_send_sof_enable(struct usbhs_priv *priv)
 {
+       u16 status = usbhs_read(priv, DVSTCTR) & (USBRST | UACT);
+
+       if (status != USBRST) {
+               struct device *dev = usbhs_priv_to_dev(priv);
+               dev_err(dev, "usbhs should be reset\n");
+       }
+
        usbhs_bset(priv, DVSTCTR, (USBRST | UACT), UACT);
 }