espi              247 drivers/net/ethernet/chelsio/cxgb/common.h 	struct peespi *espi;
espi              522 drivers/net/ethernet/chelsio/cxgb/cxgb2.c 	if (adapter->espi) {
espi              525 drivers/net/ethernet/chelsio/cxgb/cxgb2.c 		e = t1_espi_get_intr_counts(adapter->espi);
espi              117 drivers/net/ethernet/chelsio/cxgb/espi.c void t1_espi_intr_enable(struct peespi *espi)
espi              119 drivers/net/ethernet/chelsio/cxgb/espi.c 	u32 enable, pl_intr = readl(espi->adapter->regs + A_PL_ENABLE);
espi              128 drivers/net/ethernet/chelsio/cxgb/espi.c 	enable = t1_is_T1B(espi->adapter) ? 0 : ESPI_INTR_MASK;
espi              129 drivers/net/ethernet/chelsio/cxgb/espi.c 	writel(enable, espi->adapter->regs + A_ESPI_INTR_ENABLE);
espi              130 drivers/net/ethernet/chelsio/cxgb/espi.c 	writel(pl_intr | F_PL_INTR_ESPI, espi->adapter->regs + A_PL_ENABLE);
espi              133 drivers/net/ethernet/chelsio/cxgb/espi.c void t1_espi_intr_clear(struct peespi *espi)
espi              135 drivers/net/ethernet/chelsio/cxgb/espi.c 	readl(espi->adapter->regs + A_ESPI_DIP2_ERR_COUNT);
espi              136 drivers/net/ethernet/chelsio/cxgb/espi.c 	writel(0xffffffff, espi->adapter->regs + A_ESPI_INTR_STATUS);
espi              137 drivers/net/ethernet/chelsio/cxgb/espi.c 	writel(F_PL_INTR_ESPI, espi->adapter->regs + A_PL_CAUSE);
espi              140 drivers/net/ethernet/chelsio/cxgb/espi.c void t1_espi_intr_disable(struct peespi *espi)
espi              142 drivers/net/ethernet/chelsio/cxgb/espi.c 	u32 pl_intr = readl(espi->adapter->regs + A_PL_ENABLE);
espi              144 drivers/net/ethernet/chelsio/cxgb/espi.c 	writel(0, espi->adapter->regs + A_ESPI_INTR_ENABLE);
espi              145 drivers/net/ethernet/chelsio/cxgb/espi.c 	writel(pl_intr & ~F_PL_INTR_ESPI, espi->adapter->regs + A_PL_ENABLE);
espi              148 drivers/net/ethernet/chelsio/cxgb/espi.c int t1_espi_intr_handler(struct peespi *espi)
espi              150 drivers/net/ethernet/chelsio/cxgb/espi.c 	u32 status = readl(espi->adapter->regs + A_ESPI_INTR_STATUS);
espi              153 drivers/net/ethernet/chelsio/cxgb/espi.c 		espi->intr_cnt.DIP4_err++;
espi              155 drivers/net/ethernet/chelsio/cxgb/espi.c 		espi->intr_cnt.rx_drops++;
espi              157 drivers/net/ethernet/chelsio/cxgb/espi.c 		espi->intr_cnt.tx_drops++;
espi              159 drivers/net/ethernet/chelsio/cxgb/espi.c 		espi->intr_cnt.rx_ovflw++;
espi              161 drivers/net/ethernet/chelsio/cxgb/espi.c 		espi->intr_cnt.parity_err++;
espi              163 drivers/net/ethernet/chelsio/cxgb/espi.c 		espi->intr_cnt.DIP2_parity_err++;
espi              169 drivers/net/ethernet/chelsio/cxgb/espi.c 		readl(espi->adapter->regs + A_ESPI_DIP2_ERR_COUNT);
espi              176 drivers/net/ethernet/chelsio/cxgb/espi.c 	if (status && t1_is_T1B(espi->adapter))
espi              178 drivers/net/ethernet/chelsio/cxgb/espi.c 	writel(status, espi->adapter->regs + A_ESPI_INTR_STATUS);
espi              182 drivers/net/ethernet/chelsio/cxgb/espi.c const struct espi_intr_counts *t1_espi_get_intr_counts(struct peespi *espi)
espi              184 drivers/net/ethernet/chelsio/cxgb/espi.c 	return &espi->intr_cnt;
espi              237 drivers/net/ethernet/chelsio/cxgb/espi.c int t1_espi_init(struct peespi *espi, int mac_type, int nports)
espi              240 drivers/net/ethernet/chelsio/cxgb/espi.c 	adapter_t *adapter = espi->adapter;
espi              273 drivers/net/ethernet/chelsio/cxgb/espi.c 		espi->misc_ctrl = readl(adapter->regs + A_ESPI_MISC_CONTROL);
espi              274 drivers/net/ethernet/chelsio/cxgb/espi.c 		espi->misc_ctrl &= ~MON_MASK;
espi              275 drivers/net/ethernet/chelsio/cxgb/espi.c 		espi->misc_ctrl |= F_MONITORED_DIRECTION;
espi              277 drivers/net/ethernet/chelsio/cxgb/espi.c 			espi->misc_ctrl |= F_MONITORED_INTERFACE;
espi              278 drivers/net/ethernet/chelsio/cxgb/espi.c 		writel(espi->misc_ctrl, adapter->regs + A_ESPI_MISC_CONTROL);
espi              279 drivers/net/ethernet/chelsio/cxgb/espi.c 		spin_lock_init(&espi->lock);
espi              285 drivers/net/ethernet/chelsio/cxgb/espi.c void t1_espi_destroy(struct peespi *espi)
espi              287 drivers/net/ethernet/chelsio/cxgb/espi.c 	kfree(espi);
espi              292 drivers/net/ethernet/chelsio/cxgb/espi.c 	struct peespi *espi = kzalloc(sizeof(*espi), GFP_KERNEL);
espi              294 drivers/net/ethernet/chelsio/cxgb/espi.c 	if (espi)
espi              295 drivers/net/ethernet/chelsio/cxgb/espi.c 		espi->adapter = adapter;
espi              296 drivers/net/ethernet/chelsio/cxgb/espi.c 	return espi;
espi              302 drivers/net/ethernet/chelsio/cxgb/espi.c 	struct peespi *espi = adapter->espi;
espi              306 drivers/net/ethernet/chelsio/cxgb/espi.c 	spin_lock(&espi->lock);
espi              307 drivers/net/ethernet/chelsio/cxgb/espi.c 	espi->misc_ctrl = (val & ~MON_MASK) |
espi              308 drivers/net/ethernet/chelsio/cxgb/espi.c 			  (espi->misc_ctrl & MON_MASK);
espi              309 drivers/net/ethernet/chelsio/cxgb/espi.c 	writel(espi->misc_ctrl, adapter->regs + A_ESPI_MISC_CONTROL);
espi              310 drivers/net/ethernet/chelsio/cxgb/espi.c 	spin_unlock(&espi->lock);
espi              316 drivers/net/ethernet/chelsio/cxgb/espi.c 	struct peespi *espi = adapter->espi;
espi              324 drivers/net/ethernet/chelsio/cxgb/espi.c 		if (!spin_trylock(&espi->lock))
espi              327 drivers/net/ethernet/chelsio/cxgb/espi.c 		spin_lock(&espi->lock);
espi              329 drivers/net/ethernet/chelsio/cxgb/espi.c 	if ((sel != (espi->misc_ctrl & MON_MASK))) {
espi              330 drivers/net/ethernet/chelsio/cxgb/espi.c 		writel(((espi->misc_ctrl & ~MON_MASK) | sel),
espi              333 drivers/net/ethernet/chelsio/cxgb/espi.c 		writel(espi->misc_ctrl, adapter->regs + A_ESPI_MISC_CONTROL);
espi              336 drivers/net/ethernet/chelsio/cxgb/espi.c 	spin_unlock(&espi->lock);
espi              347 drivers/net/ethernet/chelsio/cxgb/espi.c 	struct peespi *espi = adapter->espi;
espi              351 drivers/net/ethernet/chelsio/cxgb/espi.c 		if (!spin_trylock(&espi->lock))
espi              354 drivers/net/ethernet/chelsio/cxgb/espi.c 		spin_lock(&espi->lock);
espi              356 drivers/net/ethernet/chelsio/cxgb/espi.c 	if ((espi->misc_ctrl & MON_MASK) != F_MONITORED_DIRECTION) {
espi              357 drivers/net/ethernet/chelsio/cxgb/espi.c 		espi->misc_ctrl = (espi->misc_ctrl & ~MON_MASK) |
espi              359 drivers/net/ethernet/chelsio/cxgb/espi.c 		writel(espi->misc_ctrl, adapter->regs + A_ESPI_MISC_CONTROL);
espi              363 drivers/net/ethernet/chelsio/cxgb/espi.c 			writel(espi->misc_ctrl | V_MONITORED_PORT_NUM(i),
espi              369 drivers/net/ethernet/chelsio/cxgb/espi.c 	writel(espi->misc_ctrl, adapter->regs + A_ESPI_MISC_CONTROL);
espi              370 drivers/net/ethernet/chelsio/cxgb/espi.c 	spin_unlock(&espi->lock);
espi               55 drivers/net/ethernet/chelsio/cxgb/espi.h void t1_espi_destroy(struct peespi *espi);
espi               56 drivers/net/ethernet/chelsio/cxgb/espi.h int t1_espi_init(struct peespi *espi, int mac_type, int nports);
espi               62 drivers/net/ethernet/chelsio/cxgb/espi.h const struct espi_intr_counts *t1_espi_get_intr_counts(struct peespi *espi);
espi              763 drivers/net/ethernet/chelsio/cxgb/subr.c 	if (adapter->espi) {
espi              765 drivers/net/ethernet/chelsio/cxgb/subr.c 		t1_espi_intr_enable(adapter->espi);
espi              795 drivers/net/ethernet/chelsio/cxgb/subr.c 	if (adapter->espi)
espi              796 drivers/net/ethernet/chelsio/cxgb/subr.c 		t1_espi_intr_disable(adapter->espi);
espi              821 drivers/net/ethernet/chelsio/cxgb/subr.c 	if (adapter->espi)
espi              822 drivers/net/ethernet/chelsio/cxgb/subr.c 		t1_espi_intr_clear(adapter->espi);
espi              857 drivers/net/ethernet/chelsio/cxgb/subr.c 		t1_espi_intr_handler(adapter->espi);
espi              975 drivers/net/ethernet/chelsio/cxgb/subr.c 	if (adapter->espi && t1_espi_init(adapter->espi, bi->chip_mac,
espi             1026 drivers/net/ethernet/chelsio/cxgb/subr.c 	if (adapter->espi)
espi             1027 drivers/net/ethernet/chelsio/cxgb/subr.c 		t1_espi_destroy(adapter->espi);
espi             1066 drivers/net/ethernet/chelsio/cxgb/subr.c 	if (bi->espi_nports && !(adapter->espi = t1_espi_create(adapter))) {
espi              629 drivers/pinctrl/nuvoton/pinctrl-npcm7xx.c 	NPCM7XX_GRP(espi), \
espi              772 drivers/pinctrl/nuvoton/pinctrl-npcm7xx.c NPCM7XX_SFUNC(espi);
espi              890 drivers/pinctrl/nuvoton/pinctrl-npcm7xx.c 	NPCM7XX_MKFUNC(espi),
espi             1022 drivers/pinctrl/nuvoton/pinctrl-npcm7xx.c 	NPCM7XX_PINCFG(95,	  lpc, NONE, 0,		  espi, MFSEL4, 8,      gpio, MFSEL1, 26,    0),
espi             1091 drivers/pinctrl/nuvoton/pinctrl-npcm7xx.c 	NPCM7XX_PINCFG(161,	  lpc, NONE, 0,		  espi, MFSEL4, 8,      gpio, MFSEL1, 26,    DS(8, 12)),
espi             1093 drivers/pinctrl/nuvoton/pinctrl-npcm7xx.c 	NPCM7XX_PINCFG(163,	  lpc, NONE, 0,		  espi, MFSEL4, 8,      gpio, MFSEL1, 26,    0),
espi             1094 drivers/pinctrl/nuvoton/pinctrl-npcm7xx.c 	NPCM7XX_PINCFG(164,	  lpc, NONE, 0,		  espi, MFSEL4, 8,      gpio, MFSEL1, 26,    SLEWLPC),
espi             1095 drivers/pinctrl/nuvoton/pinctrl-npcm7xx.c 	NPCM7XX_PINCFG(165,	  lpc, NONE, 0,		  espi, MFSEL4, 8,      gpio, MFSEL1, 26,    SLEWLPC),
espi             1096 drivers/pinctrl/nuvoton/pinctrl-npcm7xx.c 	NPCM7XX_PINCFG(166,	  lpc, NONE, 0,		  espi, MFSEL4, 8,      gpio, MFSEL1, 26,    SLEWLPC),
espi             1097 drivers/pinctrl/nuvoton/pinctrl-npcm7xx.c 	NPCM7XX_PINCFG(167,	  lpc, NONE, 0,		  espi, MFSEL4, 8,      gpio, MFSEL1, 26,    SLEWLPC),
espi             1098 drivers/pinctrl/nuvoton/pinctrl-npcm7xx.c 	NPCM7XX_PINCFG(168,    lpcclk, NONE, 0,           espi, MFSEL4, 8,      gpio, MFSEL3, 16,    0),
espi              114 drivers/spi/spi-ep93xx.c 	struct ep93xx_spi *espi = spi_master_get_devdata(master);
espi              115 drivers/spi/spi-ep93xx.c 	unsigned long spi_clk_rate = clk_get_rate(espi->clk);
espi              149 drivers/spi/spi-ep93xx.c 	struct ep93xx_spi *espi = spi_master_get_devdata(master);
espi              169 drivers/spi/spi-ep93xx.c 	writel(div_cpsr, espi->mmio + SSPCPSR);
espi              170 drivers/spi/spi-ep93xx.c 	writel(cr0, espi->mmio + SSPCR0);
espi              177 drivers/spi/spi-ep93xx.c 	struct ep93xx_spi *espi = spi_master_get_devdata(master);
espi              183 drivers/spi/spi-ep93xx.c 			val = ((u16 *)xfer->tx_buf)[espi->tx];
espi              184 drivers/spi/spi-ep93xx.c 		espi->tx += 2;
espi              187 drivers/spi/spi-ep93xx.c 			val = ((u8 *)xfer->tx_buf)[espi->tx];
espi              188 drivers/spi/spi-ep93xx.c 		espi->tx += 1;
espi              190 drivers/spi/spi-ep93xx.c 	writel(val, espi->mmio + SSPDR);
espi              195 drivers/spi/spi-ep93xx.c 	struct ep93xx_spi *espi = spi_master_get_devdata(master);
espi              199 drivers/spi/spi-ep93xx.c 	val = readl(espi->mmio + SSPDR);
espi              202 drivers/spi/spi-ep93xx.c 			((u16 *)xfer->rx_buf)[espi->rx] = val;
espi              203 drivers/spi/spi-ep93xx.c 		espi->rx += 2;
espi              206 drivers/spi/spi-ep93xx.c 			((u8 *)xfer->rx_buf)[espi->rx] = val;
espi              207 drivers/spi/spi-ep93xx.c 		espi->rx += 1;
espi              224 drivers/spi/spi-ep93xx.c 	struct ep93xx_spi *espi = spi_master_get_devdata(master);
espi              228 drivers/spi/spi-ep93xx.c 	while ((readl(espi->mmio + SSPSR) & SSPSR_RNE)) {
espi              230 drivers/spi/spi-ep93xx.c 		espi->fifo_level--;
espi              234 drivers/spi/spi-ep93xx.c 	while (espi->fifo_level < SPI_FIFO_SIZE && espi->tx < xfer->len) {
espi              236 drivers/spi/spi-ep93xx.c 		espi->fifo_level++;
espi              239 drivers/spi/spi-ep93xx.c 	if (espi->rx == xfer->len)
espi              271 drivers/spi/spi-ep93xx.c 	struct ep93xx_spi *espi = spi_master_get_devdata(master);
espi              292 drivers/spi/spi-ep93xx.c 		chan = espi->dma_rx;
espi              294 drivers/spi/spi-ep93xx.c 		sgt = &espi->rx_sgt;
espi              296 drivers/spi/spi-ep93xx.c 		conf.src_addr = espi->sspdr_phys;
espi              299 drivers/spi/spi-ep93xx.c 		chan = espi->dma_tx;
espi              301 drivers/spi/spi-ep93xx.c 		sgt = &espi->tx_sgt;
espi              303 drivers/spi/spi-ep93xx.c 		conf.dst_addr = espi->sspdr_phys;
espi              338 drivers/spi/spi-ep93xx.c 			sg_set_page(sg, virt_to_page(espi->zeropage),
espi              375 drivers/spi/spi-ep93xx.c 	struct ep93xx_spi *espi = spi_master_get_devdata(master);
espi              380 drivers/spi/spi-ep93xx.c 		chan = espi->dma_rx;
espi              381 drivers/spi/spi-ep93xx.c 		sgt = &espi->rx_sgt;
espi              383 drivers/spi/spi-ep93xx.c 		chan = espi->dma_tx;
espi              384 drivers/spi/spi-ep93xx.c 		sgt = &espi->tx_sgt;
espi              402 drivers/spi/spi-ep93xx.c 	struct ep93xx_spi *espi = spi_master_get_devdata(master);
espi              426 drivers/spi/spi-ep93xx.c 	dma_async_issue_pending(espi->dma_rx);
espi              427 drivers/spi/spi-ep93xx.c 	dma_async_issue_pending(espi->dma_tx);
espi              436 drivers/spi/spi-ep93xx.c 	struct ep93xx_spi *espi = spi_master_get_devdata(master);
espi              443 drivers/spi/spi-ep93xx.c 	if (readl(espi->mmio + SSPIIR) & SSPIIR_RORIS) {
espi              445 drivers/spi/spi-ep93xx.c 		writel(0, espi->mmio + SSPICR);
espi              469 drivers/spi/spi-ep93xx.c 	val = readl(espi->mmio + SSPCR1);
espi              471 drivers/spi/spi-ep93xx.c 	writel(val, espi->mmio + SSPCR1);
espi              482 drivers/spi/spi-ep93xx.c 	struct ep93xx_spi *espi = spi_master_get_devdata(master);
espi              493 drivers/spi/spi-ep93xx.c 	espi->rx = 0;
espi              494 drivers/spi/spi-ep93xx.c 	espi->tx = 0;
espi              501 drivers/spi/spi-ep93xx.c 	if (espi->dma_rx && xfer->len > SPI_FIFO_SIZE)
espi              507 drivers/spi/spi-ep93xx.c 	val = readl(espi->mmio + SSPCR1);
espi              509 drivers/spi/spi-ep93xx.c 	writel(val, espi->mmio + SSPCR1);
espi              518 drivers/spi/spi-ep93xx.c 	struct ep93xx_spi *espi = spi_master_get_devdata(master);
espi              525 drivers/spi/spi-ep93xx.c 	while (readl(espi->mmio + SSPSR) & SSPSR_RNE) {
espi              531 drivers/spi/spi-ep93xx.c 		readl(espi->mmio + SSPDR);
espi              538 drivers/spi/spi-ep93xx.c 	espi->fifo_level = 0;
espi              545 drivers/spi/spi-ep93xx.c 	struct ep93xx_spi *espi = spi_master_get_devdata(master);
espi              549 drivers/spi/spi-ep93xx.c 	ret = clk_enable(espi->clk);
espi              553 drivers/spi/spi-ep93xx.c 	val = readl(espi->mmio + SSPCR1);
espi              555 drivers/spi/spi-ep93xx.c 	writel(val, espi->mmio + SSPCR1);
espi              562 drivers/spi/spi-ep93xx.c 	struct ep93xx_spi *espi = spi_master_get_devdata(master);
espi              565 drivers/spi/spi-ep93xx.c 	val = readl(espi->mmio + SSPCR1);
espi              567 drivers/spi/spi-ep93xx.c 	writel(val, espi->mmio + SSPCR1);
espi              569 drivers/spi/spi-ep93xx.c 	clk_disable(espi->clk);
espi              583 drivers/spi/spi-ep93xx.c static int ep93xx_spi_setup_dma(struct ep93xx_spi *espi)
espi              588 drivers/spi/spi-ep93xx.c 	espi->zeropage = (void *)get_zeroed_page(GFP_KERNEL);
espi              589 drivers/spi/spi-ep93xx.c 	if (!espi->zeropage)
espi              595 drivers/spi/spi-ep93xx.c 	espi->dma_rx_data.port = EP93XX_DMA_SSP;
espi              596 drivers/spi/spi-ep93xx.c 	espi->dma_rx_data.direction = DMA_DEV_TO_MEM;
espi              597 drivers/spi/spi-ep93xx.c 	espi->dma_rx_data.name = "ep93xx-spi-rx";
espi              599 drivers/spi/spi-ep93xx.c 	espi->dma_rx = dma_request_channel(mask, ep93xx_spi_dma_filter,
espi              600 drivers/spi/spi-ep93xx.c 					   &espi->dma_rx_data);
espi              601 drivers/spi/spi-ep93xx.c 	if (!espi->dma_rx) {
espi              606 drivers/spi/spi-ep93xx.c 	espi->dma_tx_data.port = EP93XX_DMA_SSP;
espi              607 drivers/spi/spi-ep93xx.c 	espi->dma_tx_data.direction = DMA_MEM_TO_DEV;
espi              608 drivers/spi/spi-ep93xx.c 	espi->dma_tx_data.name = "ep93xx-spi-tx";
espi              610 drivers/spi/spi-ep93xx.c 	espi->dma_tx = dma_request_channel(mask, ep93xx_spi_dma_filter,
espi              611 drivers/spi/spi-ep93xx.c 					   &espi->dma_tx_data);
espi              612 drivers/spi/spi-ep93xx.c 	if (!espi->dma_tx) {
espi              620 drivers/spi/spi-ep93xx.c 	dma_release_channel(espi->dma_rx);
espi              621 drivers/spi/spi-ep93xx.c 	espi->dma_rx = NULL;
espi              623 drivers/spi/spi-ep93xx.c 	free_page((unsigned long)espi->zeropage);
espi              628 drivers/spi/spi-ep93xx.c static void ep93xx_spi_release_dma(struct ep93xx_spi *espi)
espi              630 drivers/spi/spi-ep93xx.c 	if (espi->dma_rx) {
espi              631 drivers/spi/spi-ep93xx.c 		dma_release_channel(espi->dma_rx);
espi              632 drivers/spi/spi-ep93xx.c 		sg_free_table(&espi->rx_sgt);
espi              634 drivers/spi/spi-ep93xx.c 	if (espi->dma_tx) {
espi              635 drivers/spi/spi-ep93xx.c 		dma_release_channel(espi->dma_tx);
espi              636 drivers/spi/spi-ep93xx.c 		sg_free_table(&espi->tx_sgt);
espi              639 drivers/spi/spi-ep93xx.c 	if (espi->zeropage)
espi              640 drivers/spi/spi-ep93xx.c 		free_page((unsigned long)espi->zeropage);
espi              647 drivers/spi/spi-ep93xx.c 	struct ep93xx_spi *espi;
espi              668 drivers/spi/spi-ep93xx.c 	master = spi_alloc_master(&pdev->dev, sizeof(*espi));
espi              688 drivers/spi/spi-ep93xx.c 	espi = spi_master_get_devdata(master);
espi              690 drivers/spi/spi-ep93xx.c 	espi->clk = devm_clk_get(&pdev->dev, NULL);
espi              691 drivers/spi/spi-ep93xx.c 	if (IS_ERR(espi->clk)) {
espi              693 drivers/spi/spi-ep93xx.c 		error = PTR_ERR(espi->clk);
espi              701 drivers/spi/spi-ep93xx.c 	master->max_speed_hz = clk_get_rate(espi->clk) / 2;
espi              702 drivers/spi/spi-ep93xx.c 	master->min_speed_hz = clk_get_rate(espi->clk) / (254 * 256);
espi              704 drivers/spi/spi-ep93xx.c 	espi->sspdr_phys = res->start + SSPDR;
espi              706 drivers/spi/spi-ep93xx.c 	espi->mmio = devm_ioremap_resource(&pdev->dev, res);
espi              707 drivers/spi/spi-ep93xx.c 	if (IS_ERR(espi->mmio)) {
espi              708 drivers/spi/spi-ep93xx.c 		error = PTR_ERR(espi->mmio);
espi              719 drivers/spi/spi-ep93xx.c 	if (info->use_dma && ep93xx_spi_setup_dma(espi))
espi              723 drivers/spi/spi-ep93xx.c 	writel(0, espi->mmio + SSPCR1);
espi              737 drivers/spi/spi-ep93xx.c 	ep93xx_spi_release_dma(espi);
espi              747 drivers/spi/spi-ep93xx.c 	struct ep93xx_spi *espi = spi_master_get_devdata(master);
espi              749 drivers/spi/spi-ep93xx.c 	ep93xx_spi_release_dma(espi);
espi              116 drivers/spi/spi-fsl-espi.c static inline u32 fsl_espi_read_reg(struct fsl_espi *espi, int offset)
espi              118 drivers/spi/spi-fsl-espi.c 	return ioread32be(espi->reg_base + offset);
espi              121 drivers/spi/spi-fsl-espi.c static inline u16 fsl_espi_read_reg16(struct fsl_espi *espi, int offset)
espi              123 drivers/spi/spi-fsl-espi.c 	return ioread16be(espi->reg_base + offset);
espi              126 drivers/spi/spi-fsl-espi.c static inline u8 fsl_espi_read_reg8(struct fsl_espi *espi, int offset)
espi              128 drivers/spi/spi-fsl-espi.c 	return ioread8(espi->reg_base + offset);
espi              131 drivers/spi/spi-fsl-espi.c static inline void fsl_espi_write_reg(struct fsl_espi *espi, int offset,
espi              134 drivers/spi/spi-fsl-espi.c 	iowrite32be(val, espi->reg_base + offset);
espi              137 drivers/spi/spi-fsl-espi.c static inline void fsl_espi_write_reg16(struct fsl_espi *espi, int offset,
espi              140 drivers/spi/spi-fsl-espi.c 	iowrite16be(val, espi->reg_base + offset);
espi              143 drivers/spi/spi-fsl-espi.c static inline void fsl_espi_write_reg8(struct fsl_espi *espi, int offset,
espi              146 drivers/spi/spi-fsl-espi.c 	iowrite8(val, espi->reg_base + offset);
espi              151 drivers/spi/spi-fsl-espi.c 	struct fsl_espi *espi = spi_master_get_devdata(m->spi->master);
espi              155 drivers/spi/spi-fsl-espi.c 		dev_err(espi->dev, "message too long, size is %u bytes\n",
espi              166 drivers/spi/spi-fsl-espi.c 			dev_err(espi->dev, "bits_per_word/speed_hz should be the same for all transfers\n");
espi              174 drivers/spi/spi-fsl-espi.c 		dev_err(espi->dev,
espi              214 drivers/spi/spi-fsl-espi.c static void fsl_espi_fill_tx_fifo(struct fsl_espi *espi, u32 events)
espi              223 drivers/spi/spi-fsl-espi.c 	tx_left = espi->tx_t->len - espi->tx_pos;
espi              224 drivers/spi/spi-fsl-espi.c 	tx_buf = espi->tx_t->tx_buf;
espi              228 drivers/spi/spi-fsl-espi.c 				fsl_espi_write_reg(espi, ESPI_SPITF, 0);
espi              229 drivers/spi/spi-fsl-espi.c 			else if (espi->swab)
espi              230 drivers/spi/spi-fsl-espi.c 				fsl_espi_write_reg(espi, ESPI_SPITF,
espi              231 drivers/spi/spi-fsl-espi.c 					swahb32p(tx_buf + espi->tx_pos));
espi              233 drivers/spi/spi-fsl-espi.c 				fsl_espi_write_reg(espi, ESPI_SPITF,
espi              234 drivers/spi/spi-fsl-espi.c 					*(u32 *)(tx_buf + espi->tx_pos));
espi              235 drivers/spi/spi-fsl-espi.c 			espi->tx_pos += 4;
espi              238 drivers/spi/spi-fsl-espi.c 		} else if (tx_left >= 2 && tx_buf && espi->swab) {
espi              239 drivers/spi/spi-fsl-espi.c 			fsl_espi_write_reg16(espi, ESPI_SPITF,
espi              240 drivers/spi/spi-fsl-espi.c 					swab16p(tx_buf + espi->tx_pos));
espi              241 drivers/spi/spi-fsl-espi.c 			espi->tx_pos += 2;
espi              246 drivers/spi/spi-fsl-espi.c 				fsl_espi_write_reg8(espi, ESPI_SPITF, 0);
espi              248 drivers/spi/spi-fsl-espi.c 				fsl_espi_write_reg8(espi, ESPI_SPITF,
espi              249 drivers/spi/spi-fsl-espi.c 					*(u8 *)(tx_buf + espi->tx_pos));
espi              250 drivers/spi/spi-fsl-espi.c 			espi->tx_pos += 1;
espi              258 drivers/spi/spi-fsl-espi.c 		if (list_is_last(&espi->tx_t->transfer_list,
espi              259 drivers/spi/spi-fsl-espi.c 		    espi->m_transfers) || espi->rxskip) {
espi              260 drivers/spi/spi-fsl-espi.c 			espi->tx_done = true;
espi              263 drivers/spi/spi-fsl-espi.c 		espi->tx_t = list_next_entry(espi->tx_t, transfer_list);
espi              264 drivers/spi/spi-fsl-espi.c 		espi->tx_pos = 0;
espi              271 drivers/spi/spi-fsl-espi.c static void fsl_espi_read_rx_fifo(struct fsl_espi *espi, u32 events)
espi              278 drivers/spi/spi-fsl-espi.c 	rx_left = espi->rx_t->len - espi->rx_pos;
espi              279 drivers/spi/spi-fsl-espi.c 	rx_buf = espi->rx_t->rx_buf;
espi              282 drivers/spi/spi-fsl-espi.c 			u32 val = fsl_espi_read_reg(espi, ESPI_SPIRF);
espi              284 drivers/spi/spi-fsl-espi.c 			if (rx_buf && espi->swab)
espi              285 drivers/spi/spi-fsl-espi.c 				*(u32 *)(rx_buf + espi->rx_pos) = swahb32(val);
espi              287 drivers/spi/spi-fsl-espi.c 				*(u32 *)(rx_buf + espi->rx_pos) = val;
espi              288 drivers/spi/spi-fsl-espi.c 			espi->rx_pos += 4;
espi              291 drivers/spi/spi-fsl-espi.c 		} else if (rx_left >= 2 && rx_buf && espi->swab) {
espi              292 drivers/spi/spi-fsl-espi.c 			u16 val = fsl_espi_read_reg16(espi, ESPI_SPIRF);
espi              294 drivers/spi/spi-fsl-espi.c 			*(u16 *)(rx_buf + espi->rx_pos) = swab16(val);
espi              295 drivers/spi/spi-fsl-espi.c 			espi->rx_pos += 2;
espi              299 drivers/spi/spi-fsl-espi.c 			u8 val = fsl_espi_read_reg8(espi, ESPI_SPIRF);
espi              302 drivers/spi/spi-fsl-espi.c 				*(u8 *)(rx_buf + espi->rx_pos) = val;
espi              303 drivers/spi/spi-fsl-espi.c 			espi->rx_pos += 1;
espi              310 drivers/spi/spi-fsl-espi.c 		if (list_is_last(&espi->rx_t->transfer_list,
espi              311 drivers/spi/spi-fsl-espi.c 		    espi->m_transfers)) {
espi              312 drivers/spi/spi-fsl-espi.c 			espi->rx_done = true;
espi              315 drivers/spi/spi-fsl-espi.c 		espi->rx_t = list_next_entry(espi->rx_t, transfer_list);
espi              316 drivers/spi/spi-fsl-espi.c 		espi->rx_pos = 0;
espi              326 drivers/spi/spi-fsl-espi.c 	struct fsl_espi *espi = spi_master_get_devdata(spi->master);
espi              337 drivers/spi/spi-fsl-espi.c 	pm = DIV_ROUND_UP(espi->spibrg, hz * 4) - 1;
espi              341 drivers/spi/spi-fsl-espi.c 		pm = DIV_ROUND_UP(espi->spibrg, hz * 16 * 4) - 1;
espi              348 drivers/spi/spi-fsl-espi.c 		fsl_espi_write_reg(espi, ESPI_SPMODEx(spi->chip_select),
espi              354 drivers/spi/spi-fsl-espi.c 	struct fsl_espi *espi = spi_master_get_devdata(spi->master);
espi              359 drivers/spi/spi-fsl-espi.c 	reinit_completion(&espi->done);
espi              366 drivers/spi/spi-fsl-espi.c 	if (espi->rxskip) {
espi              367 drivers/spi/spi-fsl-espi.c 		spcom |= SPCOM_RXSKIP(espi->rxskip);
espi              368 drivers/spi/spi-fsl-espi.c 		rx_len = t->len - espi->rxskip;
espi              373 drivers/spi/spi-fsl-espi.c 	fsl_espi_write_reg(espi, ESPI_SPCOM, spcom);
espi              379 drivers/spi/spi-fsl-espi.c 	fsl_espi_write_reg(espi, ESPI_SPIM, mask);
espi              382 drivers/spi/spi-fsl-espi.c 	spin_lock_irq(&espi->lock);
espi              383 drivers/spi/spi-fsl-espi.c 	fsl_espi_fill_tx_fifo(espi, 0);
espi              384 drivers/spi/spi-fsl-espi.c 	spin_unlock_irq(&espi->lock);
espi              387 drivers/spi/spi-fsl-espi.c 	ret = wait_for_completion_timeout(&espi->done, 2 * HZ);
espi              389 drivers/spi/spi-fsl-espi.c 		dev_err(espi->dev, "Transfer timed out!\n");
espi              392 drivers/spi/spi-fsl-espi.c 	fsl_espi_write_reg(espi, ESPI_SPIM, 0);
espi              399 drivers/spi/spi-fsl-espi.c 	struct fsl_espi *espi = spi_master_get_devdata(m->spi->master);
espi              404 drivers/spi/spi-fsl-espi.c 	espi->swab = spi->mode & SPI_LSB_FIRST && trans->bits_per_word > 8;
espi              406 drivers/spi/spi-fsl-espi.c 	espi->m_transfers = &m->transfers;
espi              407 drivers/spi/spi-fsl-espi.c 	espi->tx_t = list_first_entry(&m->transfers, struct spi_transfer,
espi              409 drivers/spi/spi-fsl-espi.c 	espi->tx_pos = 0;
espi              410 drivers/spi/spi-fsl-espi.c 	espi->tx_done = false;
espi              411 drivers/spi/spi-fsl-espi.c 	espi->rx_t = list_first_entry(&m->transfers, struct spi_transfer,
espi              413 drivers/spi/spi-fsl-espi.c 	espi->rx_pos = 0;
espi              414 drivers/spi/spi-fsl-espi.c 	espi->rx_done = false;
espi              416 drivers/spi/spi-fsl-espi.c 	espi->rxskip = fsl_espi_check_rxskip_mode(m);
espi              417 drivers/spi/spi-fsl-espi.c 	if (trans->rx_nbits == SPI_NBITS_DUAL && !espi->rxskip) {
espi              418 drivers/spi/spi-fsl-espi.c 		dev_err(espi->dev, "Dual output mode requires RXSKIP mode!\n");
espi              423 drivers/spi/spi-fsl-espi.c 	if (espi->rxskip)
espi              424 drivers/spi/spi-fsl-espi.c 		espi->rx_t = list_next_entry(espi->rx_t, transfer_list);
espi              478 drivers/spi/spi-fsl-espi.c 	struct fsl_espi *espi;
espi              489 drivers/spi/spi-fsl-espi.c 	espi = spi_master_get_devdata(spi->master);
espi              491 drivers/spi/spi-fsl-espi.c 	pm_runtime_get_sync(espi->dev);
espi              493 drivers/spi/spi-fsl-espi.c 	cs->hw_mode = fsl_espi_read_reg(espi, ESPI_SPMODEx(spi->chip_select));
espi              506 drivers/spi/spi-fsl-espi.c 	loop_mode = fsl_espi_read_reg(espi, ESPI_SPMODE);
espi              510 drivers/spi/spi-fsl-espi.c 	fsl_espi_write_reg(espi, ESPI_SPMODE, loop_mode);
espi              514 drivers/spi/spi-fsl-espi.c 	pm_runtime_mark_last_busy(espi->dev);
espi              515 drivers/spi/spi-fsl-espi.c 	pm_runtime_put_autosuspend(espi->dev);
espi              528 drivers/spi/spi-fsl-espi.c static void fsl_espi_cpu_irq(struct fsl_espi *espi, u32 events)
espi              530 drivers/spi/spi-fsl-espi.c 	if (!espi->rx_done)
espi              531 drivers/spi/spi-fsl-espi.c 		fsl_espi_read_rx_fifo(espi, events);
espi              533 drivers/spi/spi-fsl-espi.c 	if (!espi->tx_done)
espi              534 drivers/spi/spi-fsl-espi.c 		fsl_espi_fill_tx_fifo(espi, events);
espi              536 drivers/spi/spi-fsl-espi.c 	if (!espi->tx_done || !espi->rx_done)
espi              540 drivers/spi/spi-fsl-espi.c 	events = fsl_espi_read_reg(espi, ESPI_SPIE);
espi              543 drivers/spi/spi-fsl-espi.c 		dev_err(espi->dev,
espi              547 drivers/spi/spi-fsl-espi.c 		dev_err(espi->dev, "Transfer done but rx/tx fifo's aren't empty!\n");
espi              548 drivers/spi/spi-fsl-espi.c 		dev_err(espi->dev, "SPIE_RXCNT = %d, SPIE_TXCNT = %d\n",
espi              552 drivers/spi/spi-fsl-espi.c 	complete(&espi->done);
espi              557 drivers/spi/spi-fsl-espi.c 	struct fsl_espi *espi = context_data;
espi              560 drivers/spi/spi-fsl-espi.c 	spin_lock(&espi->lock);
espi              563 drivers/spi/spi-fsl-espi.c 	events = fsl_espi_read_reg(espi, ESPI_SPIE);
espi              565 drivers/spi/spi-fsl-espi.c 		spin_unlock(&espi->lock);
espi              569 drivers/spi/spi-fsl-espi.c 	dev_vdbg(espi->dev, "%s: events %x\n", __func__, events);
espi              571 drivers/spi/spi-fsl-espi.c 	fsl_espi_cpu_irq(espi, events);
espi              574 drivers/spi/spi-fsl-espi.c 	fsl_espi_write_reg(espi, ESPI_SPIE, events);
espi              576 drivers/spi/spi-fsl-espi.c 	spin_unlock(&espi->lock);
espi              585 drivers/spi/spi-fsl-espi.c 	struct fsl_espi *espi = spi_master_get_devdata(master);
espi              588 drivers/spi/spi-fsl-espi.c 	regval = fsl_espi_read_reg(espi, ESPI_SPMODE);
espi              590 drivers/spi/spi-fsl-espi.c 	fsl_espi_write_reg(espi, ESPI_SPMODE, regval);
espi              598 drivers/spi/spi-fsl-espi.c 	struct fsl_espi *espi = spi_master_get_devdata(master);
espi              601 drivers/spi/spi-fsl-espi.c 	regval = fsl_espi_read_reg(espi, ESPI_SPMODE);
espi              603 drivers/spi/spi-fsl-espi.c 	fsl_espi_write_reg(espi, ESPI_SPMODE, regval);
espi              617 drivers/spi/spi-fsl-espi.c 	struct fsl_espi *espi = spi_master_get_devdata(master);
espi              623 drivers/spi/spi-fsl-espi.c 	fsl_espi_write_reg(espi, ESPI_SPMODE, 0);
espi              624 drivers/spi/spi-fsl-espi.c 	fsl_espi_write_reg(espi, ESPI_SPIM, 0);
espi              625 drivers/spi/spi-fsl-espi.c 	fsl_espi_write_reg(espi, ESPI_SPCOM, 0);
espi              626 drivers/spi/spi-fsl-espi.c 	fsl_espi_write_reg(espi, ESPI_SPIE, 0xffffffff);
espi              651 drivers/spi/spi-fsl-espi.c 		fsl_espi_write_reg(espi, ESPI_SPMODEx(cs), csmode);
espi              658 drivers/spi/spi-fsl-espi.c 	fsl_espi_write_reg(espi, ESPI_SPMODE, SPMODE_INIT_VAL | SPMODE_ENABLE);
espi              665 drivers/spi/spi-fsl-espi.c 	struct fsl_espi *espi;
espi              685 drivers/spi/spi-fsl-espi.c 	espi = spi_master_get_devdata(master);
espi              686 drivers/spi/spi-fsl-espi.c 	spin_lock_init(&espi->lock);
espi              688 drivers/spi/spi-fsl-espi.c 	espi->dev = dev;
espi              689 drivers/spi/spi-fsl-espi.c 	espi->spibrg = fsl_get_sys_freq();
espi              690 drivers/spi/spi-fsl-espi.c 	if (espi->spibrg == -1) {
espi              696 drivers/spi/spi-fsl-espi.c 	master->min_speed_hz = DIV_ROUND_UP(espi->spibrg, 4 * 16 * 16);
espi              697 drivers/spi/spi-fsl-espi.c 	master->max_speed_hz = DIV_ROUND_UP(espi->spibrg, 4);
espi              699 drivers/spi/spi-fsl-espi.c 	init_completion(&espi->done);
espi              701 drivers/spi/spi-fsl-espi.c 	espi->reg_base = devm_ioremap_resource(dev, mem);
espi              702 drivers/spi/spi-fsl-espi.c 	if (IS_ERR(espi->reg_base)) {
espi              703 drivers/spi/spi-fsl-espi.c 		ret = PTR_ERR(espi->reg_base);
espi              708 drivers/spi/spi-fsl-espi.c 	ret = devm_request_irq(dev, irq, fsl_espi_irq, 0, "fsl_espi", espi);
espi              724 drivers/spi/spi-fsl-espi.c 	dev_info(dev, "at 0x%p (irq = %u)\n", espi->reg_base, irq);