Lines Matching defs:tre
532 struct gpi_tre tre[MAX_TRE];
934 void *tre = ch_ring->base + (ch_ring->el_size * imed_event->tre_index);
963 gpi_tre = tre;
975 * we need to update ring rp to tre + 1
977 tre += ch_ring->el_size;
978 if (tre >= (ch_ring->base + ch_ring->len))
979 tre = ch_ring->base;
980 ch_ring->rp = tre;
1454 /* copy tre into transfer ring */
1461 /* get next tre location we can copy */
1468 /* copy the tre info */
1503 /* reset the channels (clears any pending tre) */
1644 struct gpi_tre *tre;
1647 /* first create config tre if applicable */
1649 tre = &desc->tre[tre_idx];
1652 tre->dword[0] = u32_encode_bits(i2c->low_count, TRE_I2C_C0_TLOW);
1653 tre->dword[0] |= u32_encode_bits(i2c->high_count, TRE_I2C_C0_THIGH);
1654 tre->dword[0] |= u32_encode_bits(i2c->cycle_count, TRE_I2C_C0_TCYL);
1655 tre->dword[0] |= u32_encode_bits(i2c->pack_enable, TRE_I2C_C0_TX_PACK);
1656 tre->dword[0] |= u32_encode_bits(i2c->pack_enable, TRE_I2C_C0_RX_PACK);
1658 tre->dword[1] = 0;
1660 tre->dword[2] = u32_encode_bits(i2c->clk_div, TRE_C0_CLK_DIV);
1662 tre->dword[3] = u32_encode_bits(TRE_TYPE_CONFIG0, TRE_FLAGS_TYPE);
1663 tre->dword[3] |= u32_encode_bits(1, TRE_FLAGS_CHAIN);
1666 /* create the GO tre for Tx */
1668 tre = &desc->tre[tre_idx];
1672 tre->dword[0] = u32_encode_bits(I2C_READ, TRE_I2C_GO_CMD);
1674 tre->dword[0] = u32_encode_bits(i2c->op, TRE_I2C_GO_CMD);
1676 tre->dword[0] |= u32_encode_bits(i2c->addr, TRE_I2C_GO_ADDR);
1677 tre->dword[0] |= u32_encode_bits(i2c->stretch, TRE_I2C_GO_STRETCH);
1679 tre->dword[1] = 0;
1680 tre->dword[2] = u32_encode_bits(i2c->rx_len, TRE_RX_LEN);
1682 tre->dword[3] = u32_encode_bits(TRE_TYPE_GO, TRE_FLAGS_TYPE);
1685 tre->dword[3] |= u32_encode_bits(1, TRE_FLAGS_LINK);
1687 tre->dword[3] |= u32_encode_bits(1, TRE_FLAGS_CHAIN);
1692 tre = &desc->tre[tre_idx];
1696 tre->dword[0] = lower_32_bits(address);
1697 tre->dword[1] = upper_32_bits(address);
1699 tre->dword[2] = u32_encode_bits(sg_dma_len(sgl), TRE_DMA_LEN);
1701 tre->dword[3] = u32_encode_bits(TRE_TYPE_DMA, TRE_FLAGS_TYPE);
1702 tre->dword[3] |= u32_encode_bits(1, TRE_FLAGS_IEOT);
1706 dev_dbg(dev, "TRE:%d %x:%x:%x:%x\n", i, desc->tre[i].dword[0],
1707 desc->tre[i].dword[1], desc->tre[i].dword[2], desc->tre[i].dword[3]);
1719 struct gpi_tre *tre;
1722 /* first create config tre if applicable */
1724 tre = &desc->tre[tre_idx];
1727 tre->dword[0] = u32_encode_bits(spi->word_len, TRE_SPI_C0_WORD_SZ);
1728 tre->dword[0] |= u32_encode_bits(spi->loopback_en, TRE_SPI_C0_LOOPBACK);
1729 tre->dword[0] |= u32_encode_bits(spi->clock_pol_high, TRE_SPI_C0_CPOL);
1730 tre->dword[0] |= u32_encode_bits(spi->data_pol_high, TRE_SPI_C0_CPHA);
1731 tre->dword[0] |= u32_encode_bits(spi->pack_en, TRE_SPI_C0_TX_PACK);
1732 tre->dword[0] |= u32_encode_bits(spi->pack_en, TRE_SPI_C0_RX_PACK);
1734 tre->dword[1] = 0;
1736 tre->dword[2] = u32_encode_bits(spi->clk_div, TRE_C0_CLK_DIV);
1737 tre->dword[2] |= u32_encode_bits(spi->clk_src, TRE_C0_CLK_SRC);
1739 tre->dword[3] = u32_encode_bits(TRE_TYPE_CONFIG0, TRE_FLAGS_TYPE);
1740 tre->dword[3] |= u32_encode_bits(1, TRE_FLAGS_CHAIN);
1743 /* create the GO tre for Tx */
1745 tre = &desc->tre[tre_idx];
1748 tre->dword[0] = u32_encode_bits(spi->fragmentation, TRE_SPI_GO_FRAG);
1749 tre->dword[0] |= u32_encode_bits(spi->cs, TRE_SPI_GO_CS);
1750 tre->dword[0] |= u32_encode_bits(spi->cmd, TRE_SPI_GO_CMD);
1752 tre->dword[1] = 0;
1754 tre->dword[2] = u32_encode_bits(spi->rx_len, TRE_RX_LEN);
1756 tre->dword[3] = u32_encode_bits(TRE_TYPE_GO, TRE_FLAGS_TYPE);
1758 tre->dword[3] |= u32_encode_bits(1, TRE_FLAGS_IEOB);
1759 tre->dword[3] |= u32_encode_bits(1, TRE_FLAGS_LINK);
1761 tre->dword[3] |= u32_encode_bits(1, TRE_FLAGS_CHAIN);
1763 tre->dword[3] |= u32_encode_bits(1, TRE_FLAGS_CHAIN);
1764 tre->dword[3] |= u32_encode_bits(1, TRE_FLAGS_LINK);
1768 /* create the dma tre */
1769 tre = &desc->tre[tre_idx];
1773 tre->dword[0] = lower_32_bits(address);
1774 tre->dword[1] = upper_32_bits(address);
1776 tre->dword[2] = u32_encode_bits(sg_dma_len(sgl), TRE_DMA_LEN);
1778 tre->dword[3] = u32_encode_bits(TRE_TYPE_DMA, TRE_FLAGS_TYPE);
1780 tre->dword[3] |= u32_encode_bits(1, TRE_FLAGS_IEOT);
1783 dev_dbg(dev, "TRE:%d %x:%x:%x:%x\n", i, desc->tre[i].dword[0],
1784 desc->tre[i].dword[1], desc->tre[i].dword[2], desc->tre[i].dword[3]);
1789 /* copy tre into transfer ring */
1861 void *tre, *wp = NULL;
1881 tre = &gpi_desc->tre[i];
1882 gpi_queue_xfer(gpii, gchan, tre, &wp);