Lines Matching refs:musb

27 struct musb;
106 #define MUSB_MODE(musb) ((musb)->is_host ? "Host" : "Peripheral") argument
158 int (*init)(struct musb *musb);
159 int (*exit)(struct musb *musb);
161 void (*enable)(struct musb *musb);
162 void (*disable)(struct musb *musb);
180 (*dma_init) (struct musb *musb, void __iomem *base);
182 int (*set_mode)(struct musb *musb, u8 mode);
183 void (*try_idle)(struct musb *musb, unsigned long timeout);
184 int (*recover)(struct musb *musb);
186 int (*vbus_status)(struct musb *musb);
187 void (*set_vbus)(struct musb *musb, int on);
189 void (*pre_root_reset_end)(struct musb *musb);
190 void (*post_root_reset_end)(struct musb *musb);
192 void (*clear_ep_rxintr)(struct musb *musb, int epnum);
201 struct musb *musb; member
277 struct musb { struct
378 #define can_bulk_split(musb, type) \ argument
379 (((type) == USB_ENDPOINT_XFER_BULK) && (musb)->bulk_split)
382 #define can_bulk_combine(musb, type) \ argument
383 (((type) == USB_ENDPOINT_XFER_BULK) && (musb)->bulk_combine)
423 static inline struct musb *gadget_to_musb(struct usb_gadget *g) in gadget_to_musb()
425 return container_of(g, struct musb, g); in gadget_to_musb()
452 static inline int musb_read_fifosize(struct musb *musb, in musb_read_fifosize() argument
455 void __iomem *mbase = musb->mregs; in musb_read_fifosize()
459 reg = musb_readb(mbase, musb->io.ep_offset(epnum, MUSB_FIFOSIZE)); in musb_read_fifosize()
464 musb->nr_endpoints++; in musb_read_fifosize()
465 musb->epmask |= (1 << epnum); in musb_read_fifosize()
482 static inline void musb_configure_ep0(struct musb *musb) in musb_configure_ep0() argument
484 musb->endpoints[0].max_packet_sz_tx = MUSB_EP0_FIFOSIZE; in musb_configure_ep0()
485 musb->endpoints[0].max_packet_sz_rx = MUSB_EP0_FIFOSIZE; in musb_configure_ep0()
486 musb->endpoints[0].is_shared_fifo = true; in musb_configure_ep0()
493 extern void musb_stop(struct musb *musb);
494 extern void musb_start(struct musb *musb);
499 extern int musb_set_host(struct musb *musb);
500 extern int musb_set_peripheral(struct musb *musb);
502 extern void musb_load_testpacket(struct musb *);
504 extern irqreturn_t musb_interrupt(struct musb *);
506 extern void musb_hnp_stop(struct musb *musb);
508 int musb_queue_resume_work(struct musb *musb,
509 int (*callback)(struct musb *musb, void *data),
512 static inline void musb_platform_set_vbus(struct musb *musb, int is_on) in musb_platform_set_vbus() argument
514 if (musb->ops->set_vbus) in musb_platform_set_vbus()
515 musb->ops->set_vbus(musb, is_on); in musb_platform_set_vbus()
518 static inline void musb_platform_enable(struct musb *musb) in musb_platform_enable() argument
520 if (musb->ops->enable) in musb_platform_enable()
521 musb->ops->enable(musb); in musb_platform_enable()
524 static inline void musb_platform_disable(struct musb *musb) in musb_platform_disable() argument
526 if (musb->ops->disable) in musb_platform_disable()
527 musb->ops->disable(musb); in musb_platform_disable()
530 static inline int musb_platform_set_mode(struct musb *musb, u8 mode) in musb_platform_set_mode() argument
532 if (!musb->ops->set_mode) in musb_platform_set_mode()
535 return musb->ops->set_mode(musb, mode); in musb_platform_set_mode()
538 static inline void musb_platform_try_idle(struct musb *musb, in musb_platform_try_idle() argument
541 if (musb->ops->try_idle) in musb_platform_try_idle()
542 musb->ops->try_idle(musb, timeout); in musb_platform_try_idle()
545 static inline int musb_platform_recover(struct musb *musb) in musb_platform_recover() argument
547 if (!musb->ops->recover) in musb_platform_recover()
550 return musb->ops->recover(musb); in musb_platform_recover()
553 static inline int musb_platform_get_vbus_status(struct musb *musb) in musb_platform_get_vbus_status() argument
555 if (!musb->ops->vbus_status) in musb_platform_get_vbus_status()
558 return musb->ops->vbus_status(musb); in musb_platform_get_vbus_status()
561 static inline int musb_platform_init(struct musb *musb) in musb_platform_init() argument
563 if (!musb->ops->init) in musb_platform_init()
566 return musb->ops->init(musb); in musb_platform_init()
569 static inline int musb_platform_exit(struct musb *musb) in musb_platform_exit() argument
571 if (!musb->ops->exit) in musb_platform_exit()
574 return musb->ops->exit(musb); in musb_platform_exit()
577 static inline void musb_platform_pre_root_reset_end(struct musb *musb) in musb_platform_pre_root_reset_end() argument
579 if (musb->ops->pre_root_reset_end) in musb_platform_pre_root_reset_end()
580 musb->ops->pre_root_reset_end(musb); in musb_platform_pre_root_reset_end()
583 static inline void musb_platform_post_root_reset_end(struct musb *musb) in musb_platform_post_root_reset_end() argument
585 if (musb->ops->post_root_reset_end) in musb_platform_post_root_reset_end()
586 musb->ops->post_root_reset_end(musb); in musb_platform_post_root_reset_end()
589 static inline void musb_platform_clear_ep_rxintr(struct musb *musb, int epnum) in musb_platform_clear_ep_rxintr() argument
591 if (musb->ops->clear_ep_rxintr) in musb_platform_clear_ep_rxintr()
592 musb->ops->clear_ep_rxintr(musb, epnum); in musb_platform_clear_ep_rxintr()
595 static inline void musb_set_state(struct musb *musb, in musb_set_state() argument
598 if (musb->xceiv) in musb_set_state()
599 musb->xceiv->otg->state = otg_state; in musb_set_state()
601 musb->otg_state = otg_state; in musb_set_state()
604 static inline enum usb_otg_state musb_get_state(struct musb *musb) in musb_get_state() argument
606 if (musb->xceiv) in musb_get_state()
607 return musb->xceiv->otg->state; in musb_get_state()
609 return musb->otg_state; in musb_get_state()
612 static inline const char *musb_otg_state_string(struct musb *musb) in musb_otg_state_string() argument
614 return usb_otg_state_string(musb_get_state(musb)); in musb_otg_state_string()