Lines Matching +full:locality +full:- +full:specific
1 /* SPDX-License-Identifier: GPL-2.0 */
6 * Copyright (C) 2005-2006 by Texas Instruments
7 * Copyright (C) 2006-2007 Nokia Corporation
32 /* Helper defines for struct musb->hwvers */
51 /* NOTE: otg and peripheral-only state machines start at B_IDLE.
52 * OTG or host-only go to A_IDLE when ID is sensed.
54 #define is_peripheral_active(m) (!(m)->is_host)
55 #define is_host_active(m) ((m)->is_host)
99 { (_musb)->is_host = true; }
101 { (_musb)->is_host = false; }
104 (musb_readb((_x)->mregs, MUSB_DEVCTL)&MUSB_DEVCTL_HM)
106 #define MUSB_MODE(musb) ((musb)->is_host ? "Host" : "Peripheral")
113 * struct musb_platform_ops - Operations passed to musb_core by HW glue layer
114 * @quirks: flags for platform specific quirks
123 * @clearb: could be clear-on-readb or W1C
126 * @clearw: could be clear-on-readw or W1C
129 * @get_toggle: platform specific get toggle function
130 * @set_toggle: platform specific set toggle function
131 * @dma_init: platform specific dma init function
132 * @dma_exit: platform specific dma exit function
133 * @init: turns on clocks, sets up platform-specific registers, etc
137 * @recover: platform-specific babble recovery
196 * struct musb_hw_ep - endpoint hardware (bidirectional)
198 * Ordered slightly for better cacheline locality.
209 /* index in musb->endpoints[] */
243 return next_request(&hw_ep->ep_in); in next_in_request()
248 return next_request(&hw_ep->ep_out); in next_out_request()
275 * struct musb - Driver instance data.
334 /* passed down from chip/board specific irq handlers */
379 (((type) == USB_ENDPOINT_XFER_BULK) && (musb)->bulk_split)
383 (((type) == USB_ENDPOINT_XFER_BULK) && (musb)->bulk_combine)
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()
462 return -ENODEV; in musb_read_fifosize()
464 musb->nr_endpoints++; in musb_read_fifosize()
465 musb->epmask |= (1 << epnum); in musb_read_fifosize()
467 hw_ep->max_packet_sz_tx = 1 << (reg & 0x0f); in musb_read_fifosize()
471 hw_ep->max_packet_sz_rx = hw_ep->max_packet_sz_tx; in musb_read_fifosize()
472 hw_ep->is_shared_fifo = true; in musb_read_fifosize()
475 hw_ep->max_packet_sz_rx = 1 << ((reg & 0xf0) >> 4); in musb_read_fifosize()
476 hw_ep->is_shared_fifo = false; in musb_read_fifosize()
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()
514 if (musb->ops->set_vbus) in musb_platform_set_vbus()
515 musb->ops->set_vbus(musb, is_on); in musb_platform_set_vbus()
520 if (musb->ops->enable) in musb_platform_enable()
521 musb->ops->enable(musb); in musb_platform_enable()
526 if (musb->ops->disable) in musb_platform_disable()
527 musb->ops->disable(musb); in musb_platform_disable()
532 if (!musb->ops->set_mode) in musb_platform_set_mode()
535 return musb->ops->set_mode(musb, mode); in musb_platform_set_mode()
541 if (musb->ops->try_idle) in musb_platform_try_idle()
542 musb->ops->try_idle(musb, timeout); in musb_platform_try_idle()
547 if (!musb->ops->recover) in musb_platform_recover()
550 return musb->ops->recover(musb); in musb_platform_recover()
555 if (!musb->ops->vbus_status) in musb_platform_get_vbus_status()
556 return -EINVAL; in musb_platform_get_vbus_status()
558 return musb->ops->vbus_status(musb); in musb_platform_get_vbus_status()
563 if (!musb->ops->init) in musb_platform_init()
564 return -EINVAL; in musb_platform_init()
566 return musb->ops->init(musb); in musb_platform_init()
571 if (!musb->ops->exit) in musb_platform_exit()
572 return -EINVAL; in musb_platform_exit()
574 return musb->ops->exit(musb); in musb_platform_exit()
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()
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()
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()
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()
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()