dws 205 drivers/ata/sata_dwc_460ex.c struct dw_dma_slave *dws = &sata_dwc_dma_dws; dws 207 drivers/ata/sata_dwc_460ex.c if (dws->dma_dev != chan->device->dev) dws 210 drivers/ata/sata_dwc_460ex.c chan->private = dws; dws 217 drivers/ata/sata_dwc_460ex.c struct dw_dma_slave *dws = &sata_dwc_dma_dws; dws 220 drivers/ata/sata_dwc_460ex.c dws->dma_dev = hsdev->dev; dws 182 drivers/dma/dw/core.c u8 lms = DWC_LLP_LMS(dwc->dws.m_master); dws 555 drivers/dma/dw/core.c u8 m_master = dwc->dws.m_master; dws 632 drivers/dma/dw/core.c u8 m_master = dwc->dws.m_master; dws 775 drivers/dma/dw/core.c struct dw_dma_slave *dws = param; dws 777 drivers/dma/dw/core.c if (dws->dma_dev != chan->device->dev) dws 781 drivers/dma/dw/core.c memcpy(&dwc->dws, dws, sizeof(struct dw_dma_slave)); dws 1033 drivers/dma/dw/core.c memset(&dwc->dws, 0, sizeof(struct dw_dma_slave)); dws 19 drivers/dma/dw/dw.c bool hs_polarity = dwc->dws.hs_polarity; dws 21 drivers/dma/dw/dw.c cfghi |= DWC_CFGH_DST_PER(dwc->dws.dst_id); dws 22 drivers/dma/dw/dw.c cfghi |= DWC_CFGH_SRC_PER(dwc->dws.src_id); dws 73 drivers/dma/dw/dw.c u8 p_master = dwc->dws.p_master; dws 74 drivers/dma/dw/dw.c u8 m_master = dwc->dws.m_master; dws 21 drivers/dma/dw/idma32.c cfghi |= IDMA32C_CFGH_DST_PER(dwc->dws.dst_id & 0xf); dws 22 drivers/dma/dw/idma32.c cfghi |= IDMA32C_CFGH_SRC_PER(dwc->dws.src_id & 0xf); dws 25 drivers/dma/dw/idma32.c cfghi |= IDMA32C_CFGH_DST_PER_EXT(dwc->dws.dst_id >> 4 & 0x3); dws 26 drivers/dma/dw/idma32.c cfghi |= IDMA32C_CFGH_SRC_PER_EXT(dwc->dws.src_id >> 4 & 0x3); dws 288 drivers/dma/dw/regs.h struct dw_dma_slave dws; dws 87 drivers/gpu/drm/amd/amdgpu/amdgpu_rlc.c int amdgpu_gfx_rlc_init_sr(struct amdgpu_device *adev, u32 dws) dws 95 drivers/gpu/drm/amd/amdgpu/amdgpu_rlc.c r = amdgpu_bo_create_reserved(adev, dws * 4, PAGE_SIZE, dws 128 drivers/gpu/drm/amd/amdgpu/amdgpu_rlc.c u32 dws; dws 132 drivers/gpu/drm/amd/amdgpu/amdgpu_rlc.c adev->gfx.rlc.clear_state_size = dws = adev->gfx.rlc.funcs->get_csb_size(adev); dws 133 drivers/gpu/drm/amd/amdgpu/amdgpu_rlc.c r = amdgpu_bo_create_reserved(adev, dws * 4, PAGE_SIZE, dws 190 drivers/gpu/drm/amd/amdgpu/amdgpu_rlc.h int amdgpu_gfx_rlc_init_sr(struct amdgpu_device *adev, u32 dws); dws 2379 drivers/gpu/drm/amd/amdgpu/gfx_v6_0.c u32 dws; dws 2390 drivers/gpu/drm/amd/amdgpu/gfx_v6_0.c dws = adev->gfx.rlc.reg_list_size; dws 2395 drivers/gpu/drm/amd/amdgpu/gfx_v6_0.c r = amdgpu_gfx_rlc_init_sr(adev, dws); dws 2403 drivers/gpu/drm/amd/amdgpu/gfx_v6_0.c dws = adev->gfx.rlc.clear_state_size + (256 / 4); dws 2405 drivers/gpu/drm/amd/amdgpu/gfx_v6_0.c r = amdgpu_bo_create_reserved(adev, dws * 4, PAGE_SIZE, dws 3303 drivers/gpu/drm/amd/amdgpu/gfx_v7_0.c u32 dws; dws 3324 drivers/gpu/drm/amd/amdgpu/gfx_v7_0.c dws = adev->gfx.rlc.reg_list_size; dws 3325 drivers/gpu/drm/amd/amdgpu/gfx_v7_0.c dws += (5 * 16) + 48 + 48 + 64; dws 3331 drivers/gpu/drm/amd/amdgpu/gfx_v7_0.c r = amdgpu_gfx_rlc_init_sr(adev, dws); dws 4157 drivers/gpu/drm/radeon/evergreen.c u32 dws, data, i, j, k, reg_num; dws 4164 drivers/gpu/drm/radeon/evergreen.c dws = rdev->rlc.reg_list_size; dws 4166 drivers/gpu/drm/radeon/evergreen.c dws += (5 * 16) + 48 + 48 + 64; dws 4173 drivers/gpu/drm/radeon/evergreen.c r = radeon_bo_create(rdev, dws * 4, PAGE_SIZE, true, dws 4215 drivers/gpu/drm/radeon/evergreen.c for (i = 0; i < dws; i++) { dws 4218 drivers/gpu/drm/radeon/evergreen.c if (i < dws) dws 4233 drivers/gpu/drm/radeon/evergreen.c rdev->rlc.clear_state_size = dws = cik_get_csb_size(rdev); dws 4236 drivers/gpu/drm/radeon/evergreen.c dws = rdev->rlc.clear_state_size + (256 / 4); dws 4239 drivers/gpu/drm/radeon/evergreen.c dws = 0; dws 4243 drivers/gpu/drm/radeon/evergreen.c dws += cs_data[i].section[j].reg_count; dws 4247 drivers/gpu/drm/radeon/evergreen.c dws += reg_list_blk_index; dws 4248 drivers/gpu/drm/radeon/evergreen.c rdev->rlc.clear_state_size = dws; dws 4252 drivers/gpu/drm/radeon/evergreen.c r = radeon_bo_create(rdev, dws * 4, PAGE_SIZE, true, dws 38 drivers/spi/spi-dw-mid.c static int mid_spi_dma_init(struct dw_spi *dws) dws 41 drivers/spi/spi-dw-mid.c struct dw_dma_slave *tx = dws->dma_tx; dws 42 drivers/spi/spi-dw-mid.c struct dw_dma_slave *rx = dws->dma_rx; dws 58 drivers/spi/spi-dw-mid.c dws->rxchan = dma_request_channel(mask, mid_spi_dma_chan_filter, rx); dws 59 drivers/spi/spi-dw-mid.c if (!dws->rxchan) dws 61 drivers/spi/spi-dw-mid.c dws->master->dma_rx = dws->rxchan; dws 65 drivers/spi/spi-dw-mid.c dws->txchan = dma_request_channel(mask, mid_spi_dma_chan_filter, tx); dws 66 drivers/spi/spi-dw-mid.c if (!dws->txchan) dws 68 drivers/spi/spi-dw-mid.c dws->master->dma_tx = dws->txchan; dws 70 drivers/spi/spi-dw-mid.c dws->dma_inited = 1; dws 74 drivers/spi/spi-dw-mid.c dma_release_channel(dws->rxchan); dws 79 drivers/spi/spi-dw-mid.c static void mid_spi_dma_exit(struct dw_spi *dws) dws 81 drivers/spi/spi-dw-mid.c if (!dws->dma_inited) dws 84 drivers/spi/spi-dw-mid.c dmaengine_terminate_sync(dws->txchan); dws 85 drivers/spi/spi-dw-mid.c dma_release_channel(dws->txchan); dws 87 drivers/spi/spi-dw-mid.c dmaengine_terminate_sync(dws->rxchan); dws 88 drivers/spi/spi-dw-mid.c dma_release_channel(dws->rxchan); dws 91 drivers/spi/spi-dw-mid.c static irqreturn_t dma_transfer(struct dw_spi *dws) dws 93 drivers/spi/spi-dw-mid.c u16 irq_status = dw_readl(dws, DW_SPI_ISR); dws 98 drivers/spi/spi-dw-mid.c dw_readl(dws, DW_SPI_ICR); dws 99 drivers/spi/spi-dw-mid.c spi_reset_chip(dws); dws 101 drivers/spi/spi-dw-mid.c dev_err(&dws->master->dev, "%s: FIFO overrun/underrun\n", __func__); dws 102 drivers/spi/spi-dw-mid.c dws->master->cur_msg->status = -EIO; dws 103 drivers/spi/spi-dw-mid.c spi_finalize_current_transfer(dws->master); dws 110 drivers/spi/spi-dw-mid.c struct dw_spi *dws = spi_controller_get_devdata(master); dws 112 drivers/spi/spi-dw-mid.c if (!dws->dma_inited) dws 115 drivers/spi/spi-dw-mid.c return xfer->len > dws->fifo_len; dws 133 drivers/spi/spi-dw-mid.c struct dw_spi *dws = arg; dws 135 drivers/spi/spi-dw-mid.c clear_bit(TX_BUSY, &dws->dma_chan_busy); dws 136 drivers/spi/spi-dw-mid.c if (test_bit(RX_BUSY, &dws->dma_chan_busy)) dws 138 drivers/spi/spi-dw-mid.c spi_finalize_current_transfer(dws->master); dws 141 drivers/spi/spi-dw-mid.c static struct dma_async_tx_descriptor *dw_spi_dma_prepare_tx(struct dw_spi *dws, dws 151 drivers/spi/spi-dw-mid.c txconf.dst_addr = dws->dma_addr; dws 154 drivers/spi/spi-dw-mid.c txconf.dst_addr_width = convert_dma_width(dws->dma_width); dws 157 drivers/spi/spi-dw-mid.c dmaengine_slave_config(dws->txchan, &txconf); dws 159 drivers/spi/spi-dw-mid.c txdesc = dmaengine_prep_slave_sg(dws->txchan, dws 168 drivers/spi/spi-dw-mid.c txdesc->callback_param = dws; dws 179 drivers/spi/spi-dw-mid.c struct dw_spi *dws = arg; dws 181 drivers/spi/spi-dw-mid.c clear_bit(RX_BUSY, &dws->dma_chan_busy); dws 182 drivers/spi/spi-dw-mid.c if (test_bit(TX_BUSY, &dws->dma_chan_busy)) dws 184 drivers/spi/spi-dw-mid.c spi_finalize_current_transfer(dws->master); dws 187 drivers/spi/spi-dw-mid.c static struct dma_async_tx_descriptor *dw_spi_dma_prepare_rx(struct dw_spi *dws, dws 197 drivers/spi/spi-dw-mid.c rxconf.src_addr = dws->dma_addr; dws 200 drivers/spi/spi-dw-mid.c rxconf.src_addr_width = convert_dma_width(dws->dma_width); dws 203 drivers/spi/spi-dw-mid.c dmaengine_slave_config(dws->rxchan, &rxconf); dws 205 drivers/spi/spi-dw-mid.c rxdesc = dmaengine_prep_slave_sg(dws->rxchan, dws 214 drivers/spi/spi-dw-mid.c rxdesc->callback_param = dws; dws 219 drivers/spi/spi-dw-mid.c static int mid_spi_dma_setup(struct dw_spi *dws, struct spi_transfer *xfer) dws 223 drivers/spi/spi-dw-mid.c dw_writel(dws, DW_SPI_DMARDLR, 0xf); dws 224 drivers/spi/spi-dw-mid.c dw_writel(dws, DW_SPI_DMATDLR, 0x10); dws 230 drivers/spi/spi-dw-mid.c dw_writel(dws, DW_SPI_DMACR, dma_ctrl); dws 233 drivers/spi/spi-dw-mid.c spi_umask_intr(dws, SPI_INT_TXOI | SPI_INT_RXUI | SPI_INT_RXOI); dws 235 drivers/spi/spi-dw-mid.c dws->transfer_handler = dma_transfer; dws 240 drivers/spi/spi-dw-mid.c static int mid_spi_dma_transfer(struct dw_spi *dws, struct spi_transfer *xfer) dws 245 drivers/spi/spi-dw-mid.c txdesc = dw_spi_dma_prepare_tx(dws, xfer); dws 248 drivers/spi/spi-dw-mid.c rxdesc = dw_spi_dma_prepare_rx(dws, xfer); dws 252 drivers/spi/spi-dw-mid.c set_bit(RX_BUSY, &dws->dma_chan_busy); dws 254 drivers/spi/spi-dw-mid.c dma_async_issue_pending(dws->rxchan); dws 258 drivers/spi/spi-dw-mid.c set_bit(TX_BUSY, &dws->dma_chan_busy); dws 260 drivers/spi/spi-dw-mid.c dma_async_issue_pending(dws->txchan); dws 266 drivers/spi/spi-dw-mid.c static void mid_spi_dma_stop(struct dw_spi *dws) dws 268 drivers/spi/spi-dw-mid.c if (test_bit(TX_BUSY, &dws->dma_chan_busy)) { dws 269 drivers/spi/spi-dw-mid.c dmaengine_terminate_sync(dws->txchan); dws 270 drivers/spi/spi-dw-mid.c clear_bit(TX_BUSY, &dws->dma_chan_busy); dws 272 drivers/spi/spi-dw-mid.c if (test_bit(RX_BUSY, &dws->dma_chan_busy)) { dws 273 drivers/spi/spi-dw-mid.c dmaengine_terminate_sync(dws->rxchan); dws 274 drivers/spi/spi-dw-mid.c clear_bit(RX_BUSY, &dws->dma_chan_busy); dws 299 drivers/spi/spi-dw-mid.c int dw_spi_mid_init(struct dw_spi *dws) dws 309 drivers/spi/spi-dw-mid.c clk_cdiv = readl(clk_reg + dws->bus_num * sizeof(u32)); dws 312 drivers/spi/spi-dw-mid.c dws->max_freq = MRST_SPI_CLK_BASE / (clk_cdiv + 1); dws 317 drivers/spi/spi-dw-mid.c dws->dma_tx = &mid_dma_tx; dws 318 drivers/spi/spi-dw-mid.c dws->dma_rx = &mid_dma_rx; dws 319 drivers/spi/spi-dw-mid.c dws->dma_ops = &mid_dma_ops; dws 28 drivers/spi/spi-dw-mmio.c struct dw_spi dws; dws 60 drivers/spi/spi-dw-mmio.c struct dw_spi *dws = spi_master_get_devdata(spi->master); dws 61 drivers/spi/spi-dw-mmio.c struct dw_spi_mmio *dwsmmio = container_of(dws, struct dw_spi_mmio, dws); dws 105 drivers/spi/spi-dw-mmio.c dwsmmio->dws.set_cs = dw_spi_mscc_set_cs; dws 128 drivers/spi/spi-dw-mmio.c dwsmmio->dws.cs_override = 1; dws 138 drivers/spi/spi-dw-mmio.c struct dw_spi *dws; dws 147 drivers/spi/spi-dw-mmio.c dws = &dwsmmio->dws; dws 150 drivers/spi/spi-dw-mmio.c dws->regs = devm_platform_ioremap_resource(pdev, 0); dws 151 drivers/spi/spi-dw-mmio.c if (IS_ERR(dws->regs)) { dws 153 drivers/spi/spi-dw-mmio.c return PTR_ERR(dws->regs); dws 156 drivers/spi/spi-dw-mmio.c dws->irq = platform_get_irq(pdev, 0); dws 157 drivers/spi/spi-dw-mmio.c if (dws->irq < 0) dws 158 drivers/spi/spi-dw-mmio.c return dws->irq; /* -ENXIO */ dws 177 drivers/spi/spi-dw-mmio.c dws->bus_num = pdev->id; dws 179 drivers/spi/spi-dw-mmio.c dws->max_freq = clk_get_rate(dwsmmio->clk); dws 181 drivers/spi/spi-dw-mmio.c device_property_read_u32(&pdev->dev, "reg-io-width", &dws->reg_io_width); dws 187 drivers/spi/spi-dw-mmio.c dws->num_cs = num_cs; dws 196 drivers/spi/spi-dw-mmio.c ret = dw_spi_add_host(&pdev->dev, dws); dws 214 drivers/spi/spi-dw-mmio.c dw_spi_remove_host(&dwsmmio->dws); dws 45 drivers/spi/spi-dw-pci.c struct dw_spi *dws; dws 54 drivers/spi/spi-dw-pci.c dws = devm_kzalloc(&pdev->dev, sizeof(*dws), GFP_KERNEL); dws 55 drivers/spi/spi-dw-pci.c if (!dws) dws 59 drivers/spi/spi-dw-pci.c dws->paddr = pci_resource_start(pdev, pci_bar); dws 65 drivers/spi/spi-dw-pci.c dws->regs = pcim_iomap_table(pdev)[pci_bar]; dws 66 drivers/spi/spi-dw-pci.c dws->irq = pdev->irq; dws 73 drivers/spi/spi-dw-pci.c dws->num_cs = desc->num_cs; dws 74 drivers/spi/spi-dw-pci.c dws->bus_num = desc->bus_num; dws 75 drivers/spi/spi-dw-pci.c dws->max_freq = desc->max_freq; dws 78 drivers/spi/spi-dw-pci.c ret = desc->setup(dws); dws 86 drivers/spi/spi-dw-pci.c ret = dw_spi_add_host(&pdev->dev, dws); dws 91 drivers/spi/spi-dw-pci.c pci_set_drvdata(pdev, dws); dws 101 drivers/spi/spi-dw-pci.c struct dw_spi *dws = pci_get_drvdata(pdev); dws 103 drivers/spi/spi-dw-pci.c dw_spi_remove_host(dws); dws 109 drivers/spi/spi-dw-pci.c struct dw_spi *dws = dev_get_drvdata(dev); dws 111 drivers/spi/spi-dw-pci.c return dw_spi_suspend_host(dws); dws 116 drivers/spi/spi-dw-pci.c struct dw_spi *dws = dev_get_drvdata(dev); dws 118 drivers/spi/spi-dw-pci.c return dw_spi_resume_host(dws); dws 39 drivers/spi/spi-dw.c struct dw_spi *dws = file->private_data; dws 49 drivers/spi/spi-dw.c "%s registers:\n", dev_name(&dws->master->dev)); dws 53 drivers/spi/spi-dw.c "CTRL0: \t\t0x%08x\n", dw_readl(dws, DW_SPI_CTRL0)); dws 55 drivers/spi/spi-dw.c "CTRL1: \t\t0x%08x\n", dw_readl(dws, DW_SPI_CTRL1)); dws 57 drivers/spi/spi-dw.c "SSIENR: \t0x%08x\n", dw_readl(dws, DW_SPI_SSIENR)); dws 59 drivers/spi/spi-dw.c "SER: \t\t0x%08x\n", dw_readl(dws, DW_SPI_SER)); dws 61 drivers/spi/spi-dw.c "BAUDR: \t\t0x%08x\n", dw_readl(dws, DW_SPI_BAUDR)); dws 63 drivers/spi/spi-dw.c "TXFTLR: \t0x%08x\n", dw_readl(dws, DW_SPI_TXFLTR)); dws 65 drivers/spi/spi-dw.c "RXFTLR: \t0x%08x\n", dw_readl(dws, DW_SPI_RXFLTR)); dws 67 drivers/spi/spi-dw.c "TXFLR: \t\t0x%08x\n", dw_readl(dws, DW_SPI_TXFLR)); dws 69 drivers/spi/spi-dw.c "RXFLR: \t\t0x%08x\n", dw_readl(dws, DW_SPI_RXFLR)); dws 71 drivers/spi/spi-dw.c "SR: \t\t0x%08x\n", dw_readl(dws, DW_SPI_SR)); dws 73 drivers/spi/spi-dw.c "IMR: \t\t0x%08x\n", dw_readl(dws, DW_SPI_IMR)); dws 75 drivers/spi/spi-dw.c "ISR: \t\t0x%08x\n", dw_readl(dws, DW_SPI_ISR)); dws 77 drivers/spi/spi-dw.c "DMACR: \t\t0x%08x\n", dw_readl(dws, DW_SPI_DMACR)); dws 79 drivers/spi/spi-dw.c "DMATDLR: \t0x%08x\n", dw_readl(dws, DW_SPI_DMATDLR)); dws 81 drivers/spi/spi-dw.c "DMARDLR: \t0x%08x\n", dw_readl(dws, DW_SPI_DMARDLR)); dws 97 drivers/spi/spi-dw.c static int dw_spi_debugfs_init(struct dw_spi *dws) dws 101 drivers/spi/spi-dw.c snprintf(name, 32, "dw_spi%d", dws->master->bus_num); dws 102 drivers/spi/spi-dw.c dws->debugfs = debugfs_create_dir(name, NULL); dws 103 drivers/spi/spi-dw.c if (!dws->debugfs) dws 107 drivers/spi/spi-dw.c dws->debugfs, (void *)dws, &dw_spi_regs_ops); dws 111 drivers/spi/spi-dw.c static void dw_spi_debugfs_remove(struct dw_spi *dws) dws 113 drivers/spi/spi-dw.c debugfs_remove_recursive(dws->debugfs); dws 117 drivers/spi/spi-dw.c static inline int dw_spi_debugfs_init(struct dw_spi *dws) dws 122 drivers/spi/spi-dw.c static inline void dw_spi_debugfs_remove(struct dw_spi *dws) dws 129 drivers/spi/spi-dw.c struct dw_spi *dws = spi_controller_get_devdata(spi->controller); dws 145 drivers/spi/spi-dw.c dw_writel(dws, DW_SPI_SER, BIT(spi->chip_select)); dws 146 drivers/spi/spi-dw.c else if (dws->cs_override) dws 147 drivers/spi/spi-dw.c dw_writel(dws, DW_SPI_SER, 0); dws 152 drivers/spi/spi-dw.c static inline u32 tx_max(struct dw_spi *dws) dws 156 drivers/spi/spi-dw.c tx_left = (dws->tx_end - dws->tx) / dws->n_bytes; dws 157 drivers/spi/spi-dw.c tx_room = dws->fifo_len - dw_readl(dws, DW_SPI_TXFLR); dws 167 drivers/spi/spi-dw.c rxtx_gap = ((dws->rx_end - dws->rx) - (dws->tx_end - dws->tx)) dws 168 drivers/spi/spi-dw.c / dws->n_bytes; dws 170 drivers/spi/spi-dw.c return min3(tx_left, tx_room, (u32) (dws->fifo_len - rxtx_gap)); dws 174 drivers/spi/spi-dw.c static inline u32 rx_max(struct dw_spi *dws) dws 176 drivers/spi/spi-dw.c u32 rx_left = (dws->rx_end - dws->rx) / dws->n_bytes; dws 178 drivers/spi/spi-dw.c return min_t(u32, rx_left, dw_readl(dws, DW_SPI_RXFLR)); dws 181 drivers/spi/spi-dw.c static void dw_writer(struct dw_spi *dws) dws 186 drivers/spi/spi-dw.c spin_lock(&dws->buf_lock); dws 187 drivers/spi/spi-dw.c max = tx_max(dws); dws 190 drivers/spi/spi-dw.c if (dws->tx_end - dws->len) { dws 191 drivers/spi/spi-dw.c if (dws->n_bytes == 1) dws 192 drivers/spi/spi-dw.c txw = *(u8 *)(dws->tx); dws 194 drivers/spi/spi-dw.c txw = *(u16 *)(dws->tx); dws 196 drivers/spi/spi-dw.c dw_write_io_reg(dws, DW_SPI_DR, txw); dws 197 drivers/spi/spi-dw.c dws->tx += dws->n_bytes; dws 199 drivers/spi/spi-dw.c spin_unlock(&dws->buf_lock); dws 202 drivers/spi/spi-dw.c static void dw_reader(struct dw_spi *dws) dws 207 drivers/spi/spi-dw.c spin_lock(&dws->buf_lock); dws 208 drivers/spi/spi-dw.c max = rx_max(dws); dws 210 drivers/spi/spi-dw.c rxw = dw_read_io_reg(dws, DW_SPI_DR); dws 212 drivers/spi/spi-dw.c if (dws->rx_end - dws->len) { dws 213 drivers/spi/spi-dw.c if (dws->n_bytes == 1) dws 214 drivers/spi/spi-dw.c *(u8 *)(dws->rx) = rxw; dws 216 drivers/spi/spi-dw.c *(u16 *)(dws->rx) = rxw; dws 218 drivers/spi/spi-dw.c dws->rx += dws->n_bytes; dws 220 drivers/spi/spi-dw.c spin_unlock(&dws->buf_lock); dws 223 drivers/spi/spi-dw.c static void int_error_stop(struct dw_spi *dws, const char *msg) dws 225 drivers/spi/spi-dw.c spi_reset_chip(dws); dws 227 drivers/spi/spi-dw.c dev_err(&dws->master->dev, "%s\n", msg); dws 228 drivers/spi/spi-dw.c dws->master->cur_msg->status = -EIO; dws 229 drivers/spi/spi-dw.c spi_finalize_current_transfer(dws->master); dws 232 drivers/spi/spi-dw.c static irqreturn_t interrupt_transfer(struct dw_spi *dws) dws 234 drivers/spi/spi-dw.c u16 irq_status = dw_readl(dws, DW_SPI_ISR); dws 238 drivers/spi/spi-dw.c dw_readl(dws, DW_SPI_ICR); dws 239 drivers/spi/spi-dw.c int_error_stop(dws, "interrupt_transfer: fifo overrun/underrun"); dws 243 drivers/spi/spi-dw.c dw_reader(dws); dws 244 drivers/spi/spi-dw.c if (dws->rx_end == dws->rx) { dws 245 drivers/spi/spi-dw.c spi_mask_intr(dws, SPI_INT_TXEI); dws 246 drivers/spi/spi-dw.c spi_finalize_current_transfer(dws->master); dws 250 drivers/spi/spi-dw.c spi_mask_intr(dws, SPI_INT_TXEI); dws 251 drivers/spi/spi-dw.c dw_writer(dws); dws 253 drivers/spi/spi-dw.c spi_umask_intr(dws, SPI_INT_TXEI); dws 262 drivers/spi/spi-dw.c struct dw_spi *dws = spi_controller_get_devdata(master); dws 263 drivers/spi/spi-dw.c u16 irq_status = dw_readl(dws, DW_SPI_ISR) & 0x3f; dws 269 drivers/spi/spi-dw.c spi_mask_intr(dws, SPI_INT_TXEI); dws 273 drivers/spi/spi-dw.c return dws->transfer_handler(dws); dws 277 drivers/spi/spi-dw.c static int poll_transfer(struct dw_spi *dws) dws 280 drivers/spi/spi-dw.c dw_writer(dws); dws 281 drivers/spi/spi-dw.c dw_reader(dws); dws 283 drivers/spi/spi-dw.c } while (dws->rx_end > dws->rx); dws 291 drivers/spi/spi-dw.c struct dw_spi *dws = spi_controller_get_devdata(master); dws 299 drivers/spi/spi-dw.c dws->dma_mapped = 0; dws 300 drivers/spi/spi-dw.c spin_lock_irqsave(&dws->buf_lock, flags); dws 301 drivers/spi/spi-dw.c dws->tx = (void *)transfer->tx_buf; dws 302 drivers/spi/spi-dw.c dws->tx_end = dws->tx + transfer->len; dws 303 drivers/spi/spi-dw.c dws->rx = transfer->rx_buf; dws 304 drivers/spi/spi-dw.c dws->rx_end = dws->rx + transfer->len; dws 305 drivers/spi/spi-dw.c dws->len = transfer->len; dws 306 drivers/spi/spi-dw.c spin_unlock_irqrestore(&dws->buf_lock, flags); dws 311 drivers/spi/spi-dw.c spi_enable_chip(dws, 0); dws 314 drivers/spi/spi-dw.c if (transfer->speed_hz != dws->current_freq) { dws 317 drivers/spi/spi-dw.c chip->clk_div = (DIV_ROUND_UP(dws->max_freq, transfer->speed_hz) + 1) & 0xfffe; dws 320 drivers/spi/spi-dw.c dws->current_freq = transfer->speed_hz; dws 321 drivers/spi/spi-dw.c spi_set_clk(dws, chip->clk_div); dws 324 drivers/spi/spi-dw.c dws->n_bytes = DIV_ROUND_UP(transfer->bits_per_word, BITS_PER_BYTE); dws 325 drivers/spi/spi-dw.c dws->dma_width = DIV_ROUND_UP(transfer->bits_per_word, BITS_PER_BYTE); dws 340 drivers/spi/spi-dw.c if (dws->rx && dws->tx) dws 342 drivers/spi/spi-dw.c else if (dws->rx) dws 351 drivers/spi/spi-dw.c dw_writel(dws, DW_SPI_CTRL0, cr0); dws 355 drivers/spi/spi-dw.c dws->dma_mapped = master->cur_msg_mapped; dws 358 drivers/spi/spi-dw.c spi_mask_intr(dws, 0xff); dws 364 drivers/spi/spi-dw.c if (dws->dma_mapped) { dws 365 drivers/spi/spi-dw.c ret = dws->dma_ops->dma_setup(dws, transfer); dws 367 drivers/spi/spi-dw.c spi_enable_chip(dws, 1); dws 371 drivers/spi/spi-dw.c txlevel = min_t(u16, dws->fifo_len / 2, dws->len / dws->n_bytes); dws 372 drivers/spi/spi-dw.c dw_writel(dws, DW_SPI_TXFLTR, txlevel); dws 377 drivers/spi/spi-dw.c spi_umask_intr(dws, imask); dws 379 drivers/spi/spi-dw.c dws->transfer_handler = interrupt_transfer; dws 382 drivers/spi/spi-dw.c spi_enable_chip(dws, 1); dws 384 drivers/spi/spi-dw.c if (dws->dma_mapped) { dws 385 drivers/spi/spi-dw.c ret = dws->dma_ops->dma_transfer(dws, transfer); dws 391 drivers/spi/spi-dw.c return poll_transfer(dws); dws 399 drivers/spi/spi-dw.c struct dw_spi *dws = spi_controller_get_devdata(master); dws 401 drivers/spi/spi-dw.c if (dws->dma_mapped) dws 402 drivers/spi/spi-dw.c dws->dma_ops->dma_stop(dws); dws 404 drivers/spi/spi-dw.c spi_reset_chip(dws); dws 451 drivers/spi/spi-dw.c static void spi_hw_init(struct device *dev, struct dw_spi *dws) dws 453 drivers/spi/spi-dw.c spi_reset_chip(dws); dws 459 drivers/spi/spi-dw.c if (!dws->fifo_len) { dws 463 drivers/spi/spi-dw.c dw_writel(dws, DW_SPI_TXFLTR, fifo); dws 464 drivers/spi/spi-dw.c if (fifo != dw_readl(dws, DW_SPI_TXFLTR)) dws 467 drivers/spi/spi-dw.c dw_writel(dws, DW_SPI_TXFLTR, 0); dws 469 drivers/spi/spi-dw.c dws->fifo_len = (fifo == 1) ? 0 : fifo; dws 470 drivers/spi/spi-dw.c dev_dbg(dev, "Detected FIFO size: %u bytes\n", dws->fifo_len); dws 474 drivers/spi/spi-dw.c if (dws->cs_override) dws 475 drivers/spi/spi-dw.c dw_writel(dws, DW_SPI_CS_OVERRIDE, 0xF); dws 478 drivers/spi/spi-dw.c int dw_spi_add_host(struct device *dev, struct dw_spi *dws) dws 483 drivers/spi/spi-dw.c BUG_ON(dws == NULL); dws 489 drivers/spi/spi-dw.c dws->master = master; dws 490 drivers/spi/spi-dw.c dws->type = SSI_MOTO_SPI; dws 491 drivers/spi/spi-dw.c dws->dma_inited = 0; dws 492 drivers/spi/spi-dw.c dws->dma_addr = (dma_addr_t)(dws->paddr + DW_SPI_DR); dws 493 drivers/spi/spi-dw.c spin_lock_init(&dws->buf_lock); dws 495 drivers/spi/spi-dw.c spi_controller_set_devdata(master, dws); dws 497 drivers/spi/spi-dw.c ret = request_irq(dws->irq, dw_spi_irq, IRQF_SHARED, dev_name(dev), dws 507 drivers/spi/spi-dw.c master->bus_num = dws->bus_num; dws 508 drivers/spi/spi-dw.c master->num_chipselect = dws->num_cs; dws 514 drivers/spi/spi-dw.c master->max_speed_hz = dws->max_freq; dws 519 drivers/spi/spi-dw.c if (dws->set_cs) dws 520 drivers/spi/spi-dw.c master->set_cs = dws->set_cs; dws 523 drivers/spi/spi-dw.c spi_hw_init(dev, dws); dws 525 drivers/spi/spi-dw.c if (dws->dma_ops && dws->dma_ops->dma_init) { dws 526 drivers/spi/spi-dw.c ret = dws->dma_ops->dma_init(dws); dws 529 drivers/spi/spi-dw.c dws->dma_inited = 0; dws 531 drivers/spi/spi-dw.c master->can_dma = dws->dma_ops->can_dma; dws 541 drivers/spi/spi-dw.c dw_spi_debugfs_init(dws); dws 545 drivers/spi/spi-dw.c if (dws->dma_ops && dws->dma_ops->dma_exit) dws 546 drivers/spi/spi-dw.c dws->dma_ops->dma_exit(dws); dws 547 drivers/spi/spi-dw.c spi_enable_chip(dws, 0); dws 548 drivers/spi/spi-dw.c free_irq(dws->irq, master); dws 555 drivers/spi/spi-dw.c void dw_spi_remove_host(struct dw_spi *dws) dws 557 drivers/spi/spi-dw.c dw_spi_debugfs_remove(dws); dws 559 drivers/spi/spi-dw.c spi_unregister_controller(dws->master); dws 561 drivers/spi/spi-dw.c if (dws->dma_ops && dws->dma_ops->dma_exit) dws 562 drivers/spi/spi-dw.c dws->dma_ops->dma_exit(dws); dws 564 drivers/spi/spi-dw.c spi_shutdown_chip(dws); dws 566 drivers/spi/spi-dw.c free_irq(dws->irq, dws->master); dws 570 drivers/spi/spi-dw.c int dw_spi_suspend_host(struct dw_spi *dws) dws 574 drivers/spi/spi-dw.c ret = spi_controller_suspend(dws->master); dws 578 drivers/spi/spi-dw.c spi_shutdown_chip(dws); dws 583 drivers/spi/spi-dw.c int dw_spi_resume_host(struct dw_spi *dws) dws 585 drivers/spi/spi-dw.c spi_hw_init(&dws->master->dev, dws); dws 586 drivers/spi/spi-dw.c return spi_controller_resume(dws->master); dws 94 drivers/spi/spi-dw.h int (*dma_init)(struct dw_spi *dws); dws 95 drivers/spi/spi-dw.h void (*dma_exit)(struct dw_spi *dws); dws 96 drivers/spi/spi-dw.h int (*dma_setup)(struct dw_spi *dws, struct spi_transfer *xfer); dws 99 drivers/spi/spi-dw.h int (*dma_transfer)(struct dw_spi *dws, struct spi_transfer *xfer); dws 100 drivers/spi/spi-dw.h void (*dma_stop)(struct dw_spi *dws); dws 129 drivers/spi/spi-dw.h irqreturn_t (*transfer_handler)(struct dw_spi *dws); dws 149 drivers/spi/spi-dw.h static inline u32 dw_readl(struct dw_spi *dws, u32 offset) dws 151 drivers/spi/spi-dw.h return __raw_readl(dws->regs + offset); dws 154 drivers/spi/spi-dw.h static inline u16 dw_readw(struct dw_spi *dws, u32 offset) dws 156 drivers/spi/spi-dw.h return __raw_readw(dws->regs + offset); dws 159 drivers/spi/spi-dw.h static inline void dw_writel(struct dw_spi *dws, u32 offset, u32 val) dws 161 drivers/spi/spi-dw.h __raw_writel(val, dws->regs + offset); dws 164 drivers/spi/spi-dw.h static inline void dw_writew(struct dw_spi *dws, u32 offset, u16 val) dws 166 drivers/spi/spi-dw.h __raw_writew(val, dws->regs + offset); dws 169 drivers/spi/spi-dw.h static inline u32 dw_read_io_reg(struct dw_spi *dws, u32 offset) dws 171 drivers/spi/spi-dw.h switch (dws->reg_io_width) { dws 173 drivers/spi/spi-dw.h return dw_readw(dws, offset); dws 176 drivers/spi/spi-dw.h return dw_readl(dws, offset); dws 180 drivers/spi/spi-dw.h static inline void dw_write_io_reg(struct dw_spi *dws, u32 offset, u32 val) dws 182 drivers/spi/spi-dw.h switch (dws->reg_io_width) { dws 184 drivers/spi/spi-dw.h dw_writew(dws, offset, val); dws 188 drivers/spi/spi-dw.h dw_writel(dws, offset, val); dws 193 drivers/spi/spi-dw.h static inline void spi_enable_chip(struct dw_spi *dws, int enable) dws 195 drivers/spi/spi-dw.h dw_writel(dws, DW_SPI_SSIENR, (enable ? 1 : 0)); dws 198 drivers/spi/spi-dw.h static inline void spi_set_clk(struct dw_spi *dws, u16 div) dws 200 drivers/spi/spi-dw.h dw_writel(dws, DW_SPI_BAUDR, div); dws 204 drivers/spi/spi-dw.h static inline void spi_mask_intr(struct dw_spi *dws, u32 mask) dws 208 drivers/spi/spi-dw.h new_mask = dw_readl(dws, DW_SPI_IMR) & ~mask; dws 209 drivers/spi/spi-dw.h dw_writel(dws, DW_SPI_IMR, new_mask); dws 213 drivers/spi/spi-dw.h static inline void spi_umask_intr(struct dw_spi *dws, u32 mask) dws 217 drivers/spi/spi-dw.h new_mask = dw_readl(dws, DW_SPI_IMR) | mask; dws 218 drivers/spi/spi-dw.h dw_writel(dws, DW_SPI_IMR, new_mask); dws 226 drivers/spi/spi-dw.h static inline void spi_reset_chip(struct dw_spi *dws) dws 228 drivers/spi/spi-dw.h spi_enable_chip(dws, 0); dws 229 drivers/spi/spi-dw.h spi_mask_intr(dws, 0xff); dws 230 drivers/spi/spi-dw.h spi_enable_chip(dws, 1); dws 233 drivers/spi/spi-dw.h static inline void spi_shutdown_chip(struct dw_spi *dws) dws 235 drivers/spi/spi-dw.h spi_enable_chip(dws, 0); dws 236 drivers/spi/spi-dw.h spi_set_clk(dws, 0); dws 252 drivers/spi/spi-dw.h extern int dw_spi_add_host(struct device *dev, struct dw_spi *dws); dws 253 drivers/spi/spi-dw.h extern void dw_spi_remove_host(struct dw_spi *dws); dws 254 drivers/spi/spi-dw.h extern int dw_spi_suspend_host(struct dw_spi *dws); dws 255 drivers/spi/spi-dw.h extern int dw_spi_resume_host(struct dw_spi *dws); dws 258 drivers/spi/spi-dw.h extern int dw_spi_mid_init(struct dw_spi *dws); /* Intel MID platforms */ dws 65 drivers/spi/spi-pxa2xx-pci.c struct dw_dma_slave *dws = param; dws 67 drivers/spi/spi-pxa2xx-pci.c if (dws->dma_dev != chan->device->dev) dws 70 drivers/spi/spi-pxa2xx-pci.c chan->private = dws; dws 246 drivers/tty/serial/8250/8250_lpss.c struct dw_dma_slave *dws = param; dws 248 drivers/tty/serial/8250/8250_lpss.c if (dws->dma_dev != chan->device->dev) dws 251 drivers/tty/serial/8250/8250_lpss.c chan->private = dws; dws 337 sound/aoa/soundbus/i2sbus/pcm.c int dws = 0; /* data word sizes reg */ dws 475 sound/aoa/soundbus/i2sbus/pcm.c dws = (2 << I2S_DWS_NUM_CHANNELS_IN_SHIFT) | dws 479 sound/aoa/soundbus/i2sbus/pcm.c dws = (2 << I2S_DWS_NUM_CHANNELS_IN_SHIFT) | dws 486 sound/aoa/soundbus/i2sbus/pcm.c && in_le32(&i2sdev->intfregs->data_word_sizes) == dws) dws 514 sound/aoa/soundbus/i2sbus/pcm.c out_le32(&i2sdev->intfregs->data_word_sizes, dws);