mpc8xxx_spi 51 drivers/spi/spi-fsl-cpm.c void fsl_spi_cpm_reinit_txrx(struct mpc8xxx_spi *mspi) mpc8xxx_spi 71 drivers/spi/spi-fsl-cpm.c static void fsl_spi_cpm_bufs_start(struct mpc8xxx_spi *mspi) mpc8xxx_spi 100 drivers/spi/spi-fsl-cpm.c int fsl_spi_cpm_bufs(struct mpc8xxx_spi *mspi, mpc8xxx_spi 166 drivers/spi/spi-fsl-cpm.c void fsl_spi_cpm_bufs_complete(struct mpc8xxx_spi *mspi) mpc8xxx_spi 179 drivers/spi/spi-fsl-cpm.c void fsl_spi_cpm_irq(struct mpc8xxx_spi *mspi, u32 events) mpc8xxx_spi 238 drivers/spi/spi-fsl-cpm.c static unsigned long fsl_spi_cpm_get_pram(struct mpc8xxx_spi *mspi) mpc8xxx_spi 275 drivers/spi/spi-fsl-cpm.c int fsl_spi_cpm_init(struct mpc8xxx_spi *mspi) mpc8xxx_spi 385 drivers/spi/spi-fsl-cpm.c void fsl_spi_cpm_free(struct mpc8xxx_spi *mspi) mpc8xxx_spi 21 drivers/spi/spi-fsl-cpm.h extern void fsl_spi_cpm_reinit_txrx(struct mpc8xxx_spi *mspi); mpc8xxx_spi 22 drivers/spi/spi-fsl-cpm.h extern int fsl_spi_cpm_bufs(struct mpc8xxx_spi *mspi, mpc8xxx_spi 24 drivers/spi/spi-fsl-cpm.h extern void fsl_spi_cpm_bufs_complete(struct mpc8xxx_spi *mspi); mpc8xxx_spi 25 drivers/spi/spi-fsl-cpm.h extern void fsl_spi_cpm_irq(struct mpc8xxx_spi *mspi, u32 events); mpc8xxx_spi 26 drivers/spi/spi-fsl-cpm.h extern int fsl_spi_cpm_init(struct mpc8xxx_spi *mspi); mpc8xxx_spi 27 drivers/spi/spi-fsl-cpm.h extern void fsl_spi_cpm_free(struct mpc8xxx_spi *mspi); mpc8xxx_spi 29 drivers/spi/spi-fsl-cpm.h static inline void fsl_spi_cpm_reinit_txrx(struct mpc8xxx_spi *mspi) { } mpc8xxx_spi 30 drivers/spi/spi-fsl-cpm.h static inline int fsl_spi_cpm_bufs(struct mpc8xxx_spi *mspi, mpc8xxx_spi 33 drivers/spi/spi-fsl-cpm.h static inline void fsl_spi_cpm_bufs_complete(struct mpc8xxx_spi *mspi) { } mpc8xxx_spi 34 drivers/spi/spi-fsl-cpm.h static inline void fsl_spi_cpm_irq(struct mpc8xxx_spi *mspi, u32 events) { } mpc8xxx_spi 35 drivers/spi/spi-fsl-cpm.h static inline int fsl_spi_cpm_init(struct mpc8xxx_spi *mspi) { return 0; } mpc8xxx_spi 36 drivers/spi/spi-fsl-cpm.h static inline void fsl_spi_cpm_free(struct mpc8xxx_spi *mspi) { } mpc8xxx_spi 30 drivers/spi/spi-fsl-lib.c void mpc8xxx_spi_rx_buf_##type(u32 data, struct mpc8xxx_spi *mpc8xxx_spi) \ mpc8xxx_spi 32 drivers/spi/spi-fsl-lib.c type *rx = mpc8xxx_spi->rx; \ mpc8xxx_spi 33 drivers/spi/spi-fsl-lib.c *rx++ = (type)(data >> mpc8xxx_spi->rx_shift); \ mpc8xxx_spi 34 drivers/spi/spi-fsl-lib.c mpc8xxx_spi->rx = rx; \ mpc8xxx_spi 39 drivers/spi/spi-fsl-lib.c u32 mpc8xxx_spi_tx_buf_##type(struct mpc8xxx_spi *mpc8xxx_spi) \ mpc8xxx_spi 42 drivers/spi/spi-fsl-lib.c const type *tx = mpc8xxx_spi->tx; \ mpc8xxx_spi 45 drivers/spi/spi-fsl-lib.c data = *tx++ << mpc8xxx_spi->tx_shift; \ mpc8xxx_spi 46 drivers/spi/spi-fsl-lib.c mpc8xxx_spi->tx = tx; \ mpc8xxx_spi 85 drivers/spi/spi-fsl-lib.c struct mpc8xxx_spi *mpc8xxx_spi; mpc8xxx_spi 95 drivers/spi/spi-fsl-lib.c mpc8xxx_spi = spi_master_get_devdata(master); mpc8xxx_spi 96 drivers/spi/spi-fsl-lib.c mpc8xxx_spi->dev = dev; mpc8xxx_spi 97 drivers/spi/spi-fsl-lib.c mpc8xxx_spi->get_rx = mpc8xxx_spi_rx_buf_u8; mpc8xxx_spi 98 drivers/spi/spi-fsl-lib.c mpc8xxx_spi->get_tx = mpc8xxx_spi_tx_buf_u8; mpc8xxx_spi 99 drivers/spi/spi-fsl-lib.c mpc8xxx_spi->flags = pdata->flags; mpc8xxx_spi 100 drivers/spi/spi-fsl-lib.c mpc8xxx_spi->spibrg = pdata->sysclk; mpc8xxx_spi 101 drivers/spi/spi-fsl-lib.c mpc8xxx_spi->irq = irq; mpc8xxx_spi 103 drivers/spi/spi-fsl-lib.c mpc8xxx_spi->rx_shift = 0; mpc8xxx_spi 104 drivers/spi/spi-fsl-lib.c mpc8xxx_spi->tx_shift = 0; mpc8xxx_spi 109 drivers/spi/spi-fsl-lib.c init_completion(&mpc8xxx_spi->done); mpc8xxx_spi 47 drivers/spi/spi-fsl-lib.h void (*get_rx) (u32 rx_data, struct mpc8xxx_spi *); mpc8xxx_spi 48 drivers/spi/spi-fsl-lib.h u32(*get_tx) (struct mpc8xxx_spi *); mpc8xxx_spi 75 drivers/spi/spi-fsl-lib.h void (*get_rx) (u32 rx_data, struct mpc8xxx_spi *); mpc8xxx_spi 76 drivers/spi/spi-fsl-lib.h u32 (*get_tx) (struct mpc8xxx_spi *); mpc8xxx_spi 97 drivers/spi/spi-fsl-lib.h extern u32 mpc8xxx_spi_tx_buf_u8(struct mpc8xxx_spi *mpc8xxx_spi); mpc8xxx_spi 98 drivers/spi/spi-fsl-lib.h extern u32 mpc8xxx_spi_tx_buf_u16(struct mpc8xxx_spi *mpc8xxx_spi); mpc8xxx_spi 99 drivers/spi/spi-fsl-lib.h extern u32 mpc8xxx_spi_tx_buf_u32(struct mpc8xxx_spi *mpc8xxx_spi); mpc8xxx_spi 100 drivers/spi/spi-fsl-lib.h extern void mpc8xxx_spi_rx_buf_u8(u32 data, struct mpc8xxx_spi *mpc8xxx_spi); mpc8xxx_spi 101 drivers/spi/spi-fsl-lib.h extern void mpc8xxx_spi_rx_buf_u16(u32 data, struct mpc8xxx_spi *mpc8xxx_spi); mpc8xxx_spi 102 drivers/spi/spi-fsl-lib.h extern void mpc8xxx_spi_rx_buf_u32(u32 data, struct mpc8xxx_spi *mpc8xxx_spi); mpc8xxx_spi 106 drivers/spi/spi-fsl-lib.h extern int mpc8xxx_spi_bufs(struct mpc8xxx_spi *mspi, mpc8xxx_spi 91 drivers/spi/spi-fsl-spi.c struct mpc8xxx_spi *mspi = spi_master_get_devdata(spi->master); mpc8xxx_spi 116 drivers/spi/spi-fsl-spi.c struct mpc8xxx_spi *mpc8xxx_spi = spi_master_get_devdata(spi->master); mpc8xxx_spi 129 drivers/spi/spi-fsl-spi.c mpc8xxx_spi->rx_shift = cs->rx_shift; mpc8xxx_spi 130 drivers/spi/spi-fsl-spi.c mpc8xxx_spi->tx_shift = cs->tx_shift; mpc8xxx_spi 131 drivers/spi/spi-fsl-spi.c mpc8xxx_spi->get_rx = cs->get_rx; mpc8xxx_spi 132 drivers/spi/spi-fsl-spi.c mpc8xxx_spi->get_tx = cs->get_tx; mpc8xxx_spi 177 drivers/spi/spi-fsl-spi.c struct mpc8xxx_spi *mpc8xxx_spi, mpc8xxx_spi 194 drivers/spi/spi-fsl-spi.c if (mpc8xxx_spi->set_shifts) mpc8xxx_spi 195 drivers/spi/spi-fsl-spi.c mpc8xxx_spi->set_shifts(&cs->rx_shift, &cs->tx_shift, mpc8xxx_spi 199 drivers/spi/spi-fsl-spi.c mpc8xxx_spi->rx_shift = cs->rx_shift; mpc8xxx_spi 200 drivers/spi/spi-fsl-spi.c mpc8xxx_spi->tx_shift = cs->tx_shift; mpc8xxx_spi 201 drivers/spi/spi-fsl-spi.c mpc8xxx_spi->get_rx = cs->get_rx; mpc8xxx_spi 202 drivers/spi/spi-fsl-spi.c mpc8xxx_spi->get_tx = cs->get_tx; mpc8xxx_spi 228 drivers/spi/spi-fsl-spi.c struct mpc8xxx_spi *mpc8xxx_spi; mpc8xxx_spi 234 drivers/spi/spi-fsl-spi.c mpc8xxx_spi = spi_master_get_devdata(spi->master); mpc8xxx_spi 248 drivers/spi/spi-fsl-spi.c if (!(mpc8xxx_spi->flags & SPI_CPM_MODE)) mpc8xxx_spi 250 drivers/spi/spi-fsl-spi.c mpc8xxx_spi, mpc8xxx_spi 252 drivers/spi/spi-fsl-spi.c else if (mpc8xxx_spi->flags & SPI_QE) mpc8xxx_spi 270 drivers/spi/spi-fsl-spi.c if ((mpc8xxx_spi->spibrg / hz) > 64) { mpc8xxx_spi 272 drivers/spi/spi-fsl-spi.c pm = (mpc8xxx_spi->spibrg - 1) / (hz * 64) + 1; mpc8xxx_spi 275 drivers/spi/spi-fsl-spi.c dev_name(&spi->dev), hz, mpc8xxx_spi->spibrg / 1024); mpc8xxx_spi 279 drivers/spi/spi-fsl-spi.c pm = (mpc8xxx_spi->spibrg - 1) / (hz * 4) + 1; mpc8xxx_spi 290 drivers/spi/spi-fsl-spi.c static int fsl_spi_cpu_bufs(struct mpc8xxx_spi *mspi, mpc8xxx_spi 311 drivers/spi/spi-fsl-spi.c struct mpc8xxx_spi *mpc8xxx_spi = spi_master_get_devdata(spi->master); mpc8xxx_spi 317 drivers/spi/spi-fsl-spi.c reg_base = mpc8xxx_spi->reg_base; mpc8xxx_spi 335 drivers/spi/spi-fsl-spi.c mpc8xxx_spi->tx = t->tx_buf; mpc8xxx_spi 336 drivers/spi/spi-fsl-spi.c mpc8xxx_spi->rx = t->rx_buf; mpc8xxx_spi 338 drivers/spi/spi-fsl-spi.c reinit_completion(&mpc8xxx_spi->done); mpc8xxx_spi 340 drivers/spi/spi-fsl-spi.c if (mpc8xxx_spi->flags & SPI_CPM_MODE) mpc8xxx_spi 341 drivers/spi/spi-fsl-spi.c ret = fsl_spi_cpm_bufs(mpc8xxx_spi, t, is_dma_mapped); mpc8xxx_spi 343 drivers/spi/spi-fsl-spi.c ret = fsl_spi_cpu_bufs(mpc8xxx_spi, t, len); mpc8xxx_spi 347 drivers/spi/spi-fsl-spi.c wait_for_completion(&mpc8xxx_spi->done); mpc8xxx_spi 352 drivers/spi/spi-fsl-spi.c if (mpc8xxx_spi->flags & SPI_CPM_MODE) mpc8xxx_spi 353 drivers/spi/spi-fsl-spi.c fsl_spi_cpm_bufs_complete(mpc8xxx_spi); mpc8xxx_spi 355 drivers/spi/spi-fsl-spi.c return mpc8xxx_spi->count; mpc8xxx_spi 361 drivers/spi/spi-fsl-spi.c struct mpc8xxx_spi *mpc8xxx_spi = spi_master_get_devdata(master); mpc8xxx_spi 372 drivers/spi/spi-fsl-spi.c if (!(mpc8xxx_spi->flags & SPI_CPM_MODE)) { mpc8xxx_spi 443 drivers/spi/spi-fsl-spi.c struct mpc8xxx_spi *mpc8xxx_spi; mpc8xxx_spi 458 drivers/spi/spi-fsl-spi.c mpc8xxx_spi = spi_master_get_devdata(spi->master); mpc8xxx_spi 460 drivers/spi/spi-fsl-spi.c reg_base = mpc8xxx_spi->reg_base; mpc8xxx_spi 497 drivers/spi/spi-fsl-spi.c static void fsl_spi_cpu_irq(struct mpc8xxx_spi *mspi, u32 events) mpc8xxx_spi 531 drivers/spi/spi-fsl-spi.c struct mpc8xxx_spi *mspi = context_data; mpc8xxx_spi 553 drivers/spi/spi-fsl-spi.c struct mpc8xxx_spi *mpc8xxx_spi = spi_master_get_devdata(spi->master); mpc8xxx_spi 554 drivers/spi/spi-fsl-spi.c struct fsl_spi_reg *reg_base = mpc8xxx_spi->reg_base; mpc8xxx_spi 560 drivers/spi/spi-fsl-spi.c } else if (cs < mpc8xxx_spi->native_chipselects) { mpc8xxx_spi 571 drivers/spi/spi-fsl-spi.c struct mpc8xxx_spi *mpc8xxx_spi = spi_master_get_devdata(master); mpc8xxx_spi 572 drivers/spi/spi-fsl-spi.c struct fsl_spi_reg *reg_base = mpc8xxx_spi->reg_base; mpc8xxx_spi 578 drivers/spi/spi-fsl-spi.c mpc8xxx_spi->set_shifts = fsl_spi_grlib_set_shifts; mpc8xxx_spi 581 drivers/spi/spi-fsl-spi.c mpc8xxx_spi->max_bits_per_word = mbits + 1; mpc8xxx_spi 583 drivers/spi/spi-fsl-spi.c mpc8xxx_spi->native_chipselects = 0; mpc8xxx_spi 585 drivers/spi/spi-fsl-spi.c mpc8xxx_spi->native_chipselects = SPCAP_SSSZ(capabilities); mpc8xxx_spi 588 drivers/spi/spi-fsl-spi.c master->num_chipselect = mpc8xxx_spi->native_chipselects; mpc8xxx_spi 597 drivers/spi/spi-fsl-spi.c struct mpc8xxx_spi *mpc8xxx_spi; mpc8xxx_spi 602 drivers/spi/spi-fsl-spi.c master = spi_alloc_master(dev, sizeof(struct mpc8xxx_spi)); mpc8xxx_spi 617 drivers/spi/spi-fsl-spi.c mpc8xxx_spi = spi_master_get_devdata(master); mpc8xxx_spi 618 drivers/spi/spi-fsl-spi.c mpc8xxx_spi->max_bits_per_word = 32; mpc8xxx_spi 619 drivers/spi/spi-fsl-spi.c mpc8xxx_spi->type = fsl_spi_get_type(dev); mpc8xxx_spi 621 drivers/spi/spi-fsl-spi.c ret = fsl_spi_cpm_init(mpc8xxx_spi); mpc8xxx_spi 625 drivers/spi/spi-fsl-spi.c mpc8xxx_spi->reg_base = devm_ioremap_resource(dev, mem); mpc8xxx_spi 626 drivers/spi/spi-fsl-spi.c if (IS_ERR(mpc8xxx_spi->reg_base)) { mpc8xxx_spi 627 drivers/spi/spi-fsl-spi.c ret = PTR_ERR(mpc8xxx_spi->reg_base); mpc8xxx_spi 631 drivers/spi/spi-fsl-spi.c if (mpc8xxx_spi->type == TYPE_GRLIB) mpc8xxx_spi 636 drivers/spi/spi-fsl-spi.c SPI_BPW_RANGE_MASK(1, mpc8xxx_spi->max_bits_per_word); mpc8xxx_spi 638 drivers/spi/spi-fsl-spi.c if (mpc8xxx_spi->flags & SPI_QE_CPU_MODE) mpc8xxx_spi 639 drivers/spi/spi-fsl-spi.c mpc8xxx_spi->set_shifts = fsl_spi_qe_cpu_set_shifts; mpc8xxx_spi 641 drivers/spi/spi-fsl-spi.c if (mpc8xxx_spi->set_shifts) mpc8xxx_spi 643 drivers/spi/spi-fsl-spi.c mpc8xxx_spi->set_shifts(&mpc8xxx_spi->rx_shift, mpc8xxx_spi 644 drivers/spi/spi-fsl-spi.c &mpc8xxx_spi->tx_shift, 8, 1); mpc8xxx_spi 647 drivers/spi/spi-fsl-spi.c ret = devm_request_irq(dev, mpc8xxx_spi->irq, fsl_spi_irq, mpc8xxx_spi 648 drivers/spi/spi-fsl-spi.c 0, "fsl_spi", mpc8xxx_spi); mpc8xxx_spi 653 drivers/spi/spi-fsl-spi.c reg_base = mpc8xxx_spi->reg_base; mpc8xxx_spi 663 drivers/spi/spi-fsl-spi.c if (mpc8xxx_spi->max_bits_per_word < 8) { mpc8xxx_spi 665 drivers/spi/spi-fsl-spi.c regval |= SPMODE_LEN(mpc8xxx_spi->max_bits_per_word - 1); mpc8xxx_spi 667 drivers/spi/spi-fsl-spi.c if (mpc8xxx_spi->flags & SPI_QE_CPU_MODE) mpc8xxx_spi 677 drivers/spi/spi-fsl-spi.c mpc8xxx_spi->irq, mpc8xxx_spi_strmode(mpc8xxx_spi->flags)); mpc8xxx_spi 682 drivers/spi/spi-fsl-spi.c fsl_spi_cpm_free(mpc8xxx_spi); mpc8xxx_spi 771 drivers/spi/spi-fsl-spi.c struct mpc8xxx_spi *mpc8xxx_spi = spi_master_get_devdata(master); mpc8xxx_spi 773 drivers/spi/spi-fsl-spi.c fsl_spi_cpm_free(mpc8xxx_spi); mpc8xxx_spi 818 drivers/spi/spi-fsl-spi.c struct mpc8xxx_spi *mpc8xxx_spi = spi_master_get_devdata(master); mpc8xxx_spi 820 drivers/spi/spi-fsl-spi.c fsl_spi_cpm_free(mpc8xxx_spi);