These changes are the raw update to linux-4.4.6-rt14. Kernel sources
[kvmfornfv.git] / kernel / drivers / usb / musb / musb_core.h
index 3877249..2337d7a 100644 (file)
@@ -67,7 +67,6 @@ struct musb_ep;
 #include "musb_dma.h"
 
 #include "musb_io.h"
-#include "musb_regs.h"
 
 #include "musb_gadget.h"
 #include <linux/usb/hcd.h>
@@ -157,6 +156,8 @@ struct musb_io;
  * @writel:    write 32 bits
  * @read_fifo: reads the fifo
  * @write_fifo:        writes to fifo
+ * @dma_init:  platform specific dma init function
+ * @dma_exit:  platform specific dma exit function
  * @init:      turns on clocks, sets up platform-specific registers, etc
  * @exit:      undoes @init
  * @set_mode:  forcefully changes operating mode
@@ -165,6 +166,8 @@ struct musb_io;
  * @vbus_status: returns vbus status if possible
  * @set_vbus:  forces vbus status
  * @adjust_channel_params: pre check for standard dma channel_program func
+ * @pre_root_reset_end: called before the root usb port reset flag gets cleared
+ * @post_root_reset_end: called after the root usb port reset flag gets cleared
  */
 struct musb_platform_ops {
 
@@ -187,6 +190,7 @@ struct musb_platform_ops {
        void    (*ep_select)(void __iomem *mbase, u8 epnum);
        u16     fifo_mode;
        u32     (*fifo_offset)(u8 epnum);
+       u32     (*busctl_offset)(u8 epnum, u16 offset);
        u8      (*readb)(const void __iomem *addr, unsigned offset);
        void    (*writeb)(void __iomem *addr, unsigned offset, u8 data);
        u16     (*readw)(const void __iomem *addr, unsigned offset);
@@ -195,6 +199,9 @@ struct musb_platform_ops {
        void    (*writel)(void __iomem *addr, unsigned offset, u32 data);
        void    (*read_fifo)(struct musb_hw_ep *hw_ep, u16 len, u8 *buf);
        void    (*write_fifo)(struct musb_hw_ep *hw_ep, u16 len, const u8 *buf);
+       struct dma_controller *
+               (*dma_init) (struct musb *musb, void __iomem *base);
+       void    (*dma_exit)(struct dma_controller *c);
        int     (*set_mode)(struct musb *musb, u8 mode);
        void    (*try_idle)(struct musb *musb, unsigned long timeout);
        int     (*recover)(struct musb *musb);
@@ -205,6 +212,8 @@ struct musb_platform_ops {
        int     (*adjust_channel_params)(struct dma_channel *channel,
                                u16 packet_sz, u8 *mode,
                                dma_addr_t *dma_addr, u32 *len);
+       void    (*pre_root_reset_end)(struct musb *musb);
+       void    (*post_root_reset_end)(struct musb *musb);
 };
 
 /*
@@ -241,8 +250,6 @@ struct musb_hw_ep {
        void __iomem            *fifo_sync_va;
 #endif
 
-       void __iomem            *target_regs;
-
        /* currently scheduled peripheral endpoint */
        struct musb_qh          *in_qh;
        struct musb_qh          *out_qh;
@@ -437,6 +444,9 @@ struct musb {
 #endif
 };
 
+/* This must be included after struct musb is defined */
+#include "musb_regs.h"
+
 static inline struct musb *gadget_to_musb(struct usb_gadget *g)
 {
        return container_of(g, struct musb, g);
@@ -569,7 +579,7 @@ static inline int  musb_platform_recover(struct musb *musb)
 static inline int musb_platform_get_vbus_status(struct musb *musb)
 {
        if (!musb->ops->vbus_status)
-               return 0;
+               return -EINVAL;
 
        return musb->ops->vbus_status(musb);
 }
@@ -590,4 +600,16 @@ static inline int musb_platform_exit(struct musb *musb)
        return musb->ops->exit(musb);
 }
 
+static inline void musb_platform_pre_root_reset_end(struct musb *musb)
+{
+       if (musb->ops->pre_root_reset_end)
+               musb->ops->pre_root_reset_end(musb);
+}
+
+static inline void musb_platform_post_root_reset_end(struct musb *musb)
+{
+       if (musb->ops->post_root_reset_end)
+               musb->ops->post_root_reset_end(musb);
+}
+
 #endif /* __MUSB_CORE_H__ */