fsl_lpspi 138 drivers/spi/spi-fsl-lpspi.c static void fsl_lpspi_buf_rx_##type(struct fsl_lpspi_data *fsl_lpspi) \ fsl_lpspi 140 drivers/spi/spi-fsl-lpspi.c unsigned int val = readl(fsl_lpspi->base + IMX7ULP_RDR); \ fsl_lpspi 142 drivers/spi/spi-fsl-lpspi.c if (fsl_lpspi->rx_buf) { \ fsl_lpspi 143 drivers/spi/spi-fsl-lpspi.c *(type *)fsl_lpspi->rx_buf = val; \ fsl_lpspi 144 drivers/spi/spi-fsl-lpspi.c fsl_lpspi->rx_buf += sizeof(type); \ fsl_lpspi 149 drivers/spi/spi-fsl-lpspi.c static void fsl_lpspi_buf_tx_##type(struct fsl_lpspi_data *fsl_lpspi) \ fsl_lpspi 153 drivers/spi/spi-fsl-lpspi.c if (fsl_lpspi->tx_buf) { \ fsl_lpspi 154 drivers/spi/spi-fsl-lpspi.c val = *(type *)fsl_lpspi->tx_buf; \ fsl_lpspi 155 drivers/spi/spi-fsl-lpspi.c fsl_lpspi->tx_buf += sizeof(type); \ fsl_lpspi 158 drivers/spi/spi-fsl-lpspi.c fsl_lpspi->remain -= sizeof(type); \ fsl_lpspi 159 drivers/spi/spi-fsl-lpspi.c writel(val, fsl_lpspi->base + IMX7ULP_TDR); \ fsl_lpspi 169 drivers/spi/spi-fsl-lpspi.c static void fsl_lpspi_intctrl(struct fsl_lpspi_data *fsl_lpspi, fsl_lpspi 172 drivers/spi/spi-fsl-lpspi.c writel(enable, fsl_lpspi->base + IMX7ULP_IER); fsl_lpspi 206 drivers/spi/spi-fsl-lpspi.c struct fsl_lpspi_data *fsl_lpspi = fsl_lpspi 210 drivers/spi/spi-fsl-lpspi.c ret = pm_runtime_get_sync(fsl_lpspi->dev); fsl_lpspi 212 drivers/spi/spi-fsl-lpspi.c dev_err(fsl_lpspi->dev, "failed to enable clock\n"); fsl_lpspi 221 drivers/spi/spi-fsl-lpspi.c struct fsl_lpspi_data *fsl_lpspi = fsl_lpspi 224 drivers/spi/spi-fsl-lpspi.c pm_runtime_mark_last_busy(fsl_lpspi->dev); fsl_lpspi 225 drivers/spi/spi-fsl-lpspi.c pm_runtime_put_autosuspend(fsl_lpspi->dev); fsl_lpspi 233 drivers/spi/spi-fsl-lpspi.c struct fsl_lpspi_data *fsl_lpspi = fsl_lpspi 236 drivers/spi/spi-fsl-lpspi.c int gpio = fsl_lpspi->chipselect[spi->chip_select]; fsl_lpspi 244 drivers/spi/spi-fsl-lpspi.c static void fsl_lpspi_write_tx_fifo(struct fsl_lpspi_data *fsl_lpspi) fsl_lpspi 249 drivers/spi/spi-fsl-lpspi.c txfifo_cnt = readl(fsl_lpspi->base + IMX7ULP_FSR) & 0xff; fsl_lpspi 251 drivers/spi/spi-fsl-lpspi.c while (txfifo_cnt < fsl_lpspi->txfifosize) { fsl_lpspi 252 drivers/spi/spi-fsl-lpspi.c if (!fsl_lpspi->remain) fsl_lpspi 254 drivers/spi/spi-fsl-lpspi.c fsl_lpspi->tx(fsl_lpspi); fsl_lpspi 258 drivers/spi/spi-fsl-lpspi.c if (txfifo_cnt < fsl_lpspi->txfifosize) { fsl_lpspi 259 drivers/spi/spi-fsl-lpspi.c if (!fsl_lpspi->is_slave) { fsl_lpspi 260 drivers/spi/spi-fsl-lpspi.c temp = readl(fsl_lpspi->base + IMX7ULP_TCR); fsl_lpspi 262 drivers/spi/spi-fsl-lpspi.c writel(temp, fsl_lpspi->base + IMX7ULP_TCR); fsl_lpspi 265 drivers/spi/spi-fsl-lpspi.c fsl_lpspi_intctrl(fsl_lpspi, IER_FCIE); fsl_lpspi 267 drivers/spi/spi-fsl-lpspi.c fsl_lpspi_intctrl(fsl_lpspi, IER_TDIE); fsl_lpspi 270 drivers/spi/spi-fsl-lpspi.c static void fsl_lpspi_read_rx_fifo(struct fsl_lpspi_data *fsl_lpspi) fsl_lpspi 272 drivers/spi/spi-fsl-lpspi.c while (!(readl(fsl_lpspi->base + IMX7ULP_RSR) & RSR_RXEMPTY)) fsl_lpspi 273 drivers/spi/spi-fsl-lpspi.c fsl_lpspi->rx(fsl_lpspi); fsl_lpspi 276 drivers/spi/spi-fsl-lpspi.c static void fsl_lpspi_set_cmd(struct fsl_lpspi_data *fsl_lpspi) fsl_lpspi 280 drivers/spi/spi-fsl-lpspi.c temp |= fsl_lpspi->config.bpw - 1; fsl_lpspi 281 drivers/spi/spi-fsl-lpspi.c temp |= (fsl_lpspi->config.mode & 0x3) << 30; fsl_lpspi 282 drivers/spi/spi-fsl-lpspi.c if (!fsl_lpspi->is_slave) { fsl_lpspi 283 drivers/spi/spi-fsl-lpspi.c temp |= fsl_lpspi->config.prescale << 27; fsl_lpspi 284 drivers/spi/spi-fsl-lpspi.c temp |= (fsl_lpspi->config.chip_select & 0x3) << 24; fsl_lpspi 291 drivers/spi/spi-fsl-lpspi.c if (!fsl_lpspi->usedma) { fsl_lpspi 293 drivers/spi/spi-fsl-lpspi.c if (fsl_lpspi->is_first_byte) fsl_lpspi 299 drivers/spi/spi-fsl-lpspi.c writel(temp, fsl_lpspi->base + IMX7ULP_TCR); fsl_lpspi 301 drivers/spi/spi-fsl-lpspi.c dev_dbg(fsl_lpspi->dev, "TCR=0x%x\n", temp); fsl_lpspi 304 drivers/spi/spi-fsl-lpspi.c static void fsl_lpspi_set_watermark(struct fsl_lpspi_data *fsl_lpspi) fsl_lpspi 308 drivers/spi/spi-fsl-lpspi.c if (!fsl_lpspi->usedma) fsl_lpspi 309 drivers/spi/spi-fsl-lpspi.c temp = fsl_lpspi->watermark >> 1 | fsl_lpspi 310 drivers/spi/spi-fsl-lpspi.c (fsl_lpspi->watermark >> 1) << 16; fsl_lpspi 312 drivers/spi/spi-fsl-lpspi.c temp = fsl_lpspi->watermark >> 1; fsl_lpspi 314 drivers/spi/spi-fsl-lpspi.c writel(temp, fsl_lpspi->base + IMX7ULP_FCR); fsl_lpspi 316 drivers/spi/spi-fsl-lpspi.c dev_dbg(fsl_lpspi->dev, "FCR=0x%x\n", temp); fsl_lpspi 319 drivers/spi/spi-fsl-lpspi.c static int fsl_lpspi_set_bitrate(struct fsl_lpspi_data *fsl_lpspi) fsl_lpspi 321 drivers/spi/spi-fsl-lpspi.c struct lpspi_config config = fsl_lpspi->config; fsl_lpspi 325 drivers/spi/spi-fsl-lpspi.c perclk_rate = clk_get_rate(fsl_lpspi->clk_per); fsl_lpspi 328 drivers/spi/spi-fsl-lpspi.c dev_err(fsl_lpspi->dev, fsl_lpspi 337 drivers/spi/spi-fsl-lpspi.c fsl_lpspi->config.prescale = prescale; fsl_lpspi 346 drivers/spi/spi-fsl-lpspi.c fsl_lpspi->base + IMX7ULP_CCR); fsl_lpspi 348 drivers/spi/spi-fsl-lpspi.c dev_dbg(fsl_lpspi->dev, "perclk=%d, speed=%d, prescale=%d, scldiv=%d\n", fsl_lpspi 359 drivers/spi/spi-fsl-lpspi.c struct fsl_lpspi_data *fsl_lpspi = fsl_lpspi 362 drivers/spi/spi-fsl-lpspi.c switch (fsl_lpspi_bytes_per_word(fsl_lpspi->config.bpw)) { fsl_lpspi 377 drivers/spi/spi-fsl-lpspi.c tx.dst_addr = fsl_lpspi->base_phys + IMX7ULP_TDR; fsl_lpspi 382 drivers/spi/spi-fsl-lpspi.c dev_err(fsl_lpspi->dev, "TX dma configuration failed with %d\n", fsl_lpspi 388 drivers/spi/spi-fsl-lpspi.c rx.src_addr = fsl_lpspi->base_phys + IMX7ULP_RDR; fsl_lpspi 393 drivers/spi/spi-fsl-lpspi.c dev_err(fsl_lpspi->dev, "RX dma configuration failed with %d\n", fsl_lpspi 401 drivers/spi/spi-fsl-lpspi.c static int fsl_lpspi_config(struct fsl_lpspi_data *fsl_lpspi) fsl_lpspi 406 drivers/spi/spi-fsl-lpspi.c if (!fsl_lpspi->is_slave) { fsl_lpspi 407 drivers/spi/spi-fsl-lpspi.c ret = fsl_lpspi_set_bitrate(fsl_lpspi); fsl_lpspi 412 drivers/spi/spi-fsl-lpspi.c fsl_lpspi_set_watermark(fsl_lpspi); fsl_lpspi 414 drivers/spi/spi-fsl-lpspi.c if (!fsl_lpspi->is_slave) fsl_lpspi 418 drivers/spi/spi-fsl-lpspi.c if (fsl_lpspi->config.mode & SPI_CS_HIGH) fsl_lpspi 420 drivers/spi/spi-fsl-lpspi.c writel(temp, fsl_lpspi->base + IMX7ULP_CFGR1); fsl_lpspi 422 drivers/spi/spi-fsl-lpspi.c temp = readl(fsl_lpspi->base + IMX7ULP_CR); fsl_lpspi 424 drivers/spi/spi-fsl-lpspi.c writel(temp, fsl_lpspi->base + IMX7ULP_CR); fsl_lpspi 427 drivers/spi/spi-fsl-lpspi.c if (fsl_lpspi->usedma) fsl_lpspi 429 drivers/spi/spi-fsl-lpspi.c writel(temp, fsl_lpspi->base + IMX7ULP_DER); fsl_lpspi 438 drivers/spi/spi-fsl-lpspi.c struct fsl_lpspi_data *fsl_lpspi = fsl_lpspi 444 drivers/spi/spi-fsl-lpspi.c fsl_lpspi->config.mode = spi->mode; fsl_lpspi 445 drivers/spi/spi-fsl-lpspi.c fsl_lpspi->config.bpw = t->bits_per_word; fsl_lpspi 446 drivers/spi/spi-fsl-lpspi.c fsl_lpspi->config.speed_hz = t->speed_hz; fsl_lpspi 447 drivers/spi/spi-fsl-lpspi.c fsl_lpspi->config.chip_select = spi->chip_select; fsl_lpspi 449 drivers/spi/spi-fsl-lpspi.c if (!fsl_lpspi->config.speed_hz) fsl_lpspi 450 drivers/spi/spi-fsl-lpspi.c fsl_lpspi->config.speed_hz = spi->max_speed_hz; fsl_lpspi 451 drivers/spi/spi-fsl-lpspi.c if (!fsl_lpspi->config.bpw) fsl_lpspi 452 drivers/spi/spi-fsl-lpspi.c fsl_lpspi->config.bpw = spi->bits_per_word; fsl_lpspi 455 drivers/spi/spi-fsl-lpspi.c if (fsl_lpspi->config.bpw <= 8) { fsl_lpspi 456 drivers/spi/spi-fsl-lpspi.c fsl_lpspi->rx = fsl_lpspi_buf_rx_u8; fsl_lpspi 457 drivers/spi/spi-fsl-lpspi.c fsl_lpspi->tx = fsl_lpspi_buf_tx_u8; fsl_lpspi 458 drivers/spi/spi-fsl-lpspi.c } else if (fsl_lpspi->config.bpw <= 16) { fsl_lpspi 459 drivers/spi/spi-fsl-lpspi.c fsl_lpspi->rx = fsl_lpspi_buf_rx_u16; fsl_lpspi 460 drivers/spi/spi-fsl-lpspi.c fsl_lpspi->tx = fsl_lpspi_buf_tx_u16; fsl_lpspi 462 drivers/spi/spi-fsl-lpspi.c fsl_lpspi->rx = fsl_lpspi_buf_rx_u32; fsl_lpspi 463 drivers/spi/spi-fsl-lpspi.c fsl_lpspi->tx = fsl_lpspi_buf_tx_u32; fsl_lpspi 466 drivers/spi/spi-fsl-lpspi.c if (t->len <= fsl_lpspi->txfifosize) fsl_lpspi 467 drivers/spi/spi-fsl-lpspi.c fsl_lpspi->watermark = t->len; fsl_lpspi 469 drivers/spi/spi-fsl-lpspi.c fsl_lpspi->watermark = fsl_lpspi->txfifosize; fsl_lpspi 472 drivers/spi/spi-fsl-lpspi.c fsl_lpspi->usedma = 1; fsl_lpspi 474 drivers/spi/spi-fsl-lpspi.c fsl_lpspi->usedma = 0; fsl_lpspi 476 drivers/spi/spi-fsl-lpspi.c return fsl_lpspi_config(fsl_lpspi); fsl_lpspi 481 drivers/spi/spi-fsl-lpspi.c struct fsl_lpspi_data *fsl_lpspi = fsl_lpspi 484 drivers/spi/spi-fsl-lpspi.c fsl_lpspi->slave_aborted = true; fsl_lpspi 485 drivers/spi/spi-fsl-lpspi.c if (!fsl_lpspi->usedma) fsl_lpspi 486 drivers/spi/spi-fsl-lpspi.c complete(&fsl_lpspi->xfer_done); fsl_lpspi 488 drivers/spi/spi-fsl-lpspi.c complete(&fsl_lpspi->dma_tx_completion); fsl_lpspi 489 drivers/spi/spi-fsl-lpspi.c complete(&fsl_lpspi->dma_rx_completion); fsl_lpspi 497 drivers/spi/spi-fsl-lpspi.c struct fsl_lpspi_data *fsl_lpspi = fsl_lpspi 500 drivers/spi/spi-fsl-lpspi.c if (fsl_lpspi->is_slave) { fsl_lpspi 501 drivers/spi/spi-fsl-lpspi.c if (wait_for_completion_interruptible(&fsl_lpspi->xfer_done) || fsl_lpspi 502 drivers/spi/spi-fsl-lpspi.c fsl_lpspi->slave_aborted) { fsl_lpspi 503 drivers/spi/spi-fsl-lpspi.c dev_dbg(fsl_lpspi->dev, "interrupted\n"); fsl_lpspi 507 drivers/spi/spi-fsl-lpspi.c if (!wait_for_completion_timeout(&fsl_lpspi->xfer_done, HZ)) { fsl_lpspi 508 drivers/spi/spi-fsl-lpspi.c dev_dbg(fsl_lpspi->dev, "wait for completion timeout\n"); fsl_lpspi 516 drivers/spi/spi-fsl-lpspi.c static int fsl_lpspi_reset(struct fsl_lpspi_data *fsl_lpspi) fsl_lpspi 520 drivers/spi/spi-fsl-lpspi.c if (!fsl_lpspi->usedma) { fsl_lpspi 522 drivers/spi/spi-fsl-lpspi.c fsl_lpspi_intctrl(fsl_lpspi, 0); fsl_lpspi 527 drivers/spi/spi-fsl-lpspi.c writel(temp, fsl_lpspi->base + IMX7ULP_SR); fsl_lpspi 531 drivers/spi/spi-fsl-lpspi.c writel(temp, fsl_lpspi->base + IMX7ULP_CR); fsl_lpspi 538 drivers/spi/spi-fsl-lpspi.c struct fsl_lpspi_data *fsl_lpspi = (struct fsl_lpspi_data *)cookie; fsl_lpspi 540 drivers/spi/spi-fsl-lpspi.c complete(&fsl_lpspi->dma_rx_completion); fsl_lpspi 545 drivers/spi/spi-fsl-lpspi.c struct fsl_lpspi_data *fsl_lpspi = (struct fsl_lpspi_data *)cookie; fsl_lpspi 547 drivers/spi/spi-fsl-lpspi.c complete(&fsl_lpspi->dma_tx_completion); fsl_lpspi 550 drivers/spi/spi-fsl-lpspi.c static int fsl_lpspi_calculate_timeout(struct fsl_lpspi_data *fsl_lpspi, fsl_lpspi 556 drivers/spi/spi-fsl-lpspi.c timeout = (8 + 4) * size / fsl_lpspi->config.speed_hz; fsl_lpspi 566 drivers/spi/spi-fsl-lpspi.c struct fsl_lpspi_data *fsl_lpspi, fsl_lpspi 586 drivers/spi/spi-fsl-lpspi.c desc_rx->callback_param = (void *)fsl_lpspi; fsl_lpspi 588 drivers/spi/spi-fsl-lpspi.c reinit_completion(&fsl_lpspi->dma_rx_completion); fsl_lpspi 600 drivers/spi/spi-fsl-lpspi.c desc_tx->callback_param = (void *)fsl_lpspi; fsl_lpspi 602 drivers/spi/spi-fsl-lpspi.c reinit_completion(&fsl_lpspi->dma_tx_completion); fsl_lpspi 605 drivers/spi/spi-fsl-lpspi.c fsl_lpspi->slave_aborted = false; fsl_lpspi 607 drivers/spi/spi-fsl-lpspi.c if (!fsl_lpspi->is_slave) { fsl_lpspi 608 drivers/spi/spi-fsl-lpspi.c transfer_timeout = fsl_lpspi_calculate_timeout(fsl_lpspi, fsl_lpspi 612 drivers/spi/spi-fsl-lpspi.c timeout = wait_for_completion_timeout(&fsl_lpspi->dma_tx_completion, fsl_lpspi 615 drivers/spi/spi-fsl-lpspi.c dev_err(fsl_lpspi->dev, "I/O Error in DMA TX\n"); fsl_lpspi 618 drivers/spi/spi-fsl-lpspi.c fsl_lpspi_reset(fsl_lpspi); fsl_lpspi 622 drivers/spi/spi-fsl-lpspi.c timeout = wait_for_completion_timeout(&fsl_lpspi->dma_rx_completion, fsl_lpspi 625 drivers/spi/spi-fsl-lpspi.c dev_err(fsl_lpspi->dev, "I/O Error in DMA RX\n"); fsl_lpspi 628 drivers/spi/spi-fsl-lpspi.c fsl_lpspi_reset(fsl_lpspi); fsl_lpspi 632 drivers/spi/spi-fsl-lpspi.c if (wait_for_completion_interruptible(&fsl_lpspi->dma_tx_completion) || fsl_lpspi 633 drivers/spi/spi-fsl-lpspi.c fsl_lpspi->slave_aborted) { fsl_lpspi 634 drivers/spi/spi-fsl-lpspi.c dev_dbg(fsl_lpspi->dev, fsl_lpspi 638 drivers/spi/spi-fsl-lpspi.c fsl_lpspi_reset(fsl_lpspi); fsl_lpspi 642 drivers/spi/spi-fsl-lpspi.c if (wait_for_completion_interruptible(&fsl_lpspi->dma_rx_completion) || fsl_lpspi 643 drivers/spi/spi-fsl-lpspi.c fsl_lpspi->slave_aborted) { fsl_lpspi 644 drivers/spi/spi-fsl-lpspi.c dev_dbg(fsl_lpspi->dev, fsl_lpspi 648 drivers/spi/spi-fsl-lpspi.c fsl_lpspi_reset(fsl_lpspi); fsl_lpspi 653 drivers/spi/spi-fsl-lpspi.c fsl_lpspi_reset(fsl_lpspi); fsl_lpspi 672 drivers/spi/spi-fsl-lpspi.c struct fsl_lpspi_data *fsl_lpspi, fsl_lpspi 695 drivers/spi/spi-fsl-lpspi.c init_completion(&fsl_lpspi->dma_rx_completion); fsl_lpspi 696 drivers/spi/spi-fsl-lpspi.c init_completion(&fsl_lpspi->dma_tx_completion); fsl_lpspi 709 drivers/spi/spi-fsl-lpspi.c struct fsl_lpspi_data *fsl_lpspi = fsl_lpspi 713 drivers/spi/spi-fsl-lpspi.c fsl_lpspi->tx_buf = t->tx_buf; fsl_lpspi 714 drivers/spi/spi-fsl-lpspi.c fsl_lpspi->rx_buf = t->rx_buf; fsl_lpspi 715 drivers/spi/spi-fsl-lpspi.c fsl_lpspi->remain = t->len; fsl_lpspi 717 drivers/spi/spi-fsl-lpspi.c reinit_completion(&fsl_lpspi->xfer_done); fsl_lpspi 718 drivers/spi/spi-fsl-lpspi.c fsl_lpspi->slave_aborted = false; fsl_lpspi 720 drivers/spi/spi-fsl-lpspi.c fsl_lpspi_write_tx_fifo(fsl_lpspi); fsl_lpspi 726 drivers/spi/spi-fsl-lpspi.c fsl_lpspi_reset(fsl_lpspi); fsl_lpspi 735 drivers/spi/spi-fsl-lpspi.c struct fsl_lpspi_data *fsl_lpspi = fsl_lpspi 739 drivers/spi/spi-fsl-lpspi.c fsl_lpspi->is_first_byte = true; fsl_lpspi 744 drivers/spi/spi-fsl-lpspi.c fsl_lpspi_set_cmd(fsl_lpspi); fsl_lpspi 745 drivers/spi/spi-fsl-lpspi.c fsl_lpspi->is_first_byte = false; fsl_lpspi 747 drivers/spi/spi-fsl-lpspi.c if (fsl_lpspi->usedma) fsl_lpspi 748 drivers/spi/spi-fsl-lpspi.c ret = fsl_lpspi_dma_transfer(controller, fsl_lpspi, t); fsl_lpspi 760 drivers/spi/spi-fsl-lpspi.c struct fsl_lpspi_data *fsl_lpspi = dev_id; fsl_lpspi 762 drivers/spi/spi-fsl-lpspi.c temp_IER = readl(fsl_lpspi->base + IMX7ULP_IER); fsl_lpspi 763 drivers/spi/spi-fsl-lpspi.c fsl_lpspi_intctrl(fsl_lpspi, 0); fsl_lpspi 764 drivers/spi/spi-fsl-lpspi.c temp_SR = readl(fsl_lpspi->base + IMX7ULP_SR); fsl_lpspi 766 drivers/spi/spi-fsl-lpspi.c fsl_lpspi_read_rx_fifo(fsl_lpspi); fsl_lpspi 769 drivers/spi/spi-fsl-lpspi.c fsl_lpspi_write_tx_fifo(fsl_lpspi); fsl_lpspi 774 drivers/spi/spi-fsl-lpspi.c readl(fsl_lpspi->base + IMX7ULP_FSR) & FSR_TXCOUNT) { fsl_lpspi 775 drivers/spi/spi-fsl-lpspi.c writel(SR_FCF, fsl_lpspi->base + IMX7ULP_SR); fsl_lpspi 776 drivers/spi/spi-fsl-lpspi.c fsl_lpspi_intctrl(fsl_lpspi, IER_FCIE); fsl_lpspi 781 drivers/spi/spi-fsl-lpspi.c writel(SR_FCF, fsl_lpspi->base + IMX7ULP_SR); fsl_lpspi 782 drivers/spi/spi-fsl-lpspi.c complete(&fsl_lpspi->xfer_done); fsl_lpspi 793 drivers/spi/spi-fsl-lpspi.c struct fsl_lpspi_data *fsl_lpspi; fsl_lpspi 796 drivers/spi/spi-fsl-lpspi.c fsl_lpspi = spi_controller_get_devdata(controller); fsl_lpspi 798 drivers/spi/spi-fsl-lpspi.c ret = clk_prepare_enable(fsl_lpspi->clk_per); fsl_lpspi 802 drivers/spi/spi-fsl-lpspi.c ret = clk_prepare_enable(fsl_lpspi->clk_ipg); fsl_lpspi 804 drivers/spi/spi-fsl-lpspi.c clk_disable_unprepare(fsl_lpspi->clk_per); fsl_lpspi 814 drivers/spi/spi-fsl-lpspi.c struct fsl_lpspi_data *fsl_lpspi; fsl_lpspi 816 drivers/spi/spi-fsl-lpspi.c fsl_lpspi = spi_controller_get_devdata(controller); fsl_lpspi 818 drivers/spi/spi-fsl-lpspi.c clk_disable_unprepare(fsl_lpspi->clk_per); fsl_lpspi 819 drivers/spi/spi-fsl-lpspi.c clk_disable_unprepare(fsl_lpspi->clk_ipg); fsl_lpspi 825 drivers/spi/spi-fsl-lpspi.c static int fsl_lpspi_init_rpm(struct fsl_lpspi_data *fsl_lpspi) fsl_lpspi 827 drivers/spi/spi-fsl-lpspi.c struct device *dev = fsl_lpspi->dev; fsl_lpspi 839 drivers/spi/spi-fsl-lpspi.c struct fsl_lpspi_data *fsl_lpspi; fsl_lpspi 861 drivers/spi/spi-fsl-lpspi.c fsl_lpspi = spi_controller_get_devdata(controller); fsl_lpspi 862 drivers/spi/spi-fsl-lpspi.c fsl_lpspi->dev = &pdev->dev; fsl_lpspi 863 drivers/spi/spi-fsl-lpspi.c fsl_lpspi->is_slave = is_slave; fsl_lpspi 881 drivers/spi/spi-fsl-lpspi.c if (!fsl_lpspi->is_slave) { fsl_lpspi 888 drivers/spi/spi-fsl-lpspi.c fsl_lpspi->chipselect[i] = cs_gpio; fsl_lpspi 893 drivers/spi/spi-fsl-lpspi.c fsl_lpspi->chipselect[i], fsl_lpspi 900 drivers/spi/spi-fsl-lpspi.c controller->cs_gpios = fsl_lpspi->chipselect; fsl_lpspi 904 drivers/spi/spi-fsl-lpspi.c init_completion(&fsl_lpspi->xfer_done); fsl_lpspi 907 drivers/spi/spi-fsl-lpspi.c fsl_lpspi->base = devm_ioremap_resource(&pdev->dev, res); fsl_lpspi 908 drivers/spi/spi-fsl-lpspi.c if (IS_ERR(fsl_lpspi->base)) { fsl_lpspi 909 drivers/spi/spi-fsl-lpspi.c ret = PTR_ERR(fsl_lpspi->base); fsl_lpspi 912 drivers/spi/spi-fsl-lpspi.c fsl_lpspi->base_phys = res->start; fsl_lpspi 921 drivers/spi/spi-fsl-lpspi.c dev_name(&pdev->dev), fsl_lpspi); fsl_lpspi 927 drivers/spi/spi-fsl-lpspi.c fsl_lpspi->clk_per = devm_clk_get(&pdev->dev, "per"); fsl_lpspi 928 drivers/spi/spi-fsl-lpspi.c if (IS_ERR(fsl_lpspi->clk_per)) { fsl_lpspi 929 drivers/spi/spi-fsl-lpspi.c ret = PTR_ERR(fsl_lpspi->clk_per); fsl_lpspi 933 drivers/spi/spi-fsl-lpspi.c fsl_lpspi->clk_ipg = devm_clk_get(&pdev->dev, "ipg"); fsl_lpspi 934 drivers/spi/spi-fsl-lpspi.c if (IS_ERR(fsl_lpspi->clk_ipg)) { fsl_lpspi 935 drivers/spi/spi-fsl-lpspi.c ret = PTR_ERR(fsl_lpspi->clk_ipg); fsl_lpspi 940 drivers/spi/spi-fsl-lpspi.c ret = fsl_lpspi_init_rpm(fsl_lpspi); fsl_lpspi 944 drivers/spi/spi-fsl-lpspi.c ret = pm_runtime_get_sync(fsl_lpspi->dev); fsl_lpspi 946 drivers/spi/spi-fsl-lpspi.c dev_err(fsl_lpspi->dev, "failed to enable clock\n"); fsl_lpspi 950 drivers/spi/spi-fsl-lpspi.c temp = readl(fsl_lpspi->base + IMX7ULP_PARAM); fsl_lpspi 951 drivers/spi/spi-fsl-lpspi.c fsl_lpspi->txfifosize = 1 << (temp & 0x0f); fsl_lpspi 952 drivers/spi/spi-fsl-lpspi.c fsl_lpspi->rxfifosize = 1 << ((temp >> 8) & 0x0f); fsl_lpspi 954 drivers/spi/spi-fsl-lpspi.c ret = fsl_lpspi_dma_init(&pdev->dev, fsl_lpspi, controller); fsl_lpspi 972 drivers/spi/spi-fsl-lpspi.c struct fsl_lpspi_data *fsl_lpspi = fsl_lpspi 975 drivers/spi/spi-fsl-lpspi.c pm_runtime_disable(fsl_lpspi->dev);