diff options
Diffstat (limited to 'drivers/spi/spi-fsl-lib.c')
| -rw-r--r-- | drivers/spi/spi-fsl-lib.c | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/drivers/spi/spi-fsl-lib.c b/drivers/spi/spi-fsl-lib.c index 446b737e1532..cb35d2f0d0e6 100644 --- a/drivers/spi/spi-fsl-lib.c +++ b/drivers/spi/spi-fsl-lib.c | |||
| @@ -21,6 +21,7 @@ | |||
| 21 | #include <linux/interrupt.h> | 21 | #include <linux/interrupt.h> |
| 22 | #include <linux/kernel.h> | 22 | #include <linux/kernel.h> |
| 23 | #include <linux/mm.h> | 23 | #include <linux/mm.h> |
| 24 | #include <linux/module.h> | ||
| 24 | #include <linux/of_platform.h> | 25 | #include <linux/of_platform.h> |
| 25 | #include <linux/spi/spi.h> | 26 | #include <linux/spi/spi.h> |
| 26 | #ifdef CONFIG_FSL_SOC | 27 | #ifdef CONFIG_FSL_SOC |
| @@ -35,7 +36,8 @@ void mpc8xxx_spi_rx_buf_##type(u32 data, struct mpc8xxx_spi *mpc8xxx_spi) \ | |||
| 35 | type *rx = mpc8xxx_spi->rx; \ | 36 | type *rx = mpc8xxx_spi->rx; \ |
| 36 | *rx++ = (type)(data >> mpc8xxx_spi->rx_shift); \ | 37 | *rx++ = (type)(data >> mpc8xxx_spi->rx_shift); \ |
| 37 | mpc8xxx_spi->rx = rx; \ | 38 | mpc8xxx_spi->rx = rx; \ |
| 38 | } | 39 | } \ |
| 40 | EXPORT_SYMBOL_GPL(mpc8xxx_spi_rx_buf_##type); | ||
| 39 | 41 | ||
| 40 | #define MPC8XXX_SPI_TX_BUF(type) \ | 42 | #define MPC8XXX_SPI_TX_BUF(type) \ |
| 41 | u32 mpc8xxx_spi_tx_buf_##type(struct mpc8xxx_spi *mpc8xxx_spi) \ | 43 | u32 mpc8xxx_spi_tx_buf_##type(struct mpc8xxx_spi *mpc8xxx_spi) \ |
| @@ -47,7 +49,8 @@ u32 mpc8xxx_spi_tx_buf_##type(struct mpc8xxx_spi *mpc8xxx_spi) \ | |||
| 47 | data = *tx++ << mpc8xxx_spi->tx_shift; \ | 49 | data = *tx++ << mpc8xxx_spi->tx_shift; \ |
| 48 | mpc8xxx_spi->tx = tx; \ | 50 | mpc8xxx_spi->tx = tx; \ |
| 49 | return data; \ | 51 | return data; \ |
| 50 | } | 52 | } \ |
| 53 | EXPORT_SYMBOL_GPL(mpc8xxx_spi_tx_buf_##type); | ||
| 51 | 54 | ||
| 52 | MPC8XXX_SPI_RX_BUF(u8) | 55 | MPC8XXX_SPI_RX_BUF(u8) |
| 53 | MPC8XXX_SPI_RX_BUF(u16) | 56 | MPC8XXX_SPI_RX_BUF(u16) |
| @@ -60,6 +63,7 @@ struct mpc8xxx_spi_probe_info *to_of_pinfo(struct fsl_spi_platform_data *pdata) | |||
| 60 | { | 63 | { |
| 61 | return container_of(pdata, struct mpc8xxx_spi_probe_info, pdata); | 64 | return container_of(pdata, struct mpc8xxx_spi_probe_info, pdata); |
| 62 | } | 65 | } |
| 66 | EXPORT_SYMBOL_GPL(to_of_pinfo); | ||
| 63 | 67 | ||
| 64 | const char *mpc8xxx_spi_strmode(unsigned int flags) | 68 | const char *mpc8xxx_spi_strmode(unsigned int flags) |
| 65 | { | 69 | { |
| @@ -75,6 +79,7 @@ const char *mpc8xxx_spi_strmode(unsigned int flags) | |||
| 75 | } | 79 | } |
| 76 | return "CPU"; | 80 | return "CPU"; |
| 77 | } | 81 | } |
| 82 | EXPORT_SYMBOL_GPL(mpc8xxx_spi_strmode); | ||
| 78 | 83 | ||
| 79 | void mpc8xxx_spi_probe(struct device *dev, struct resource *mem, | 84 | void mpc8xxx_spi_probe(struct device *dev, struct resource *mem, |
| 80 | unsigned int irq) | 85 | unsigned int irq) |
| @@ -102,13 +107,12 @@ void mpc8xxx_spi_probe(struct device *dev, struct resource *mem, | |||
| 102 | mpc8xxx_spi->rx_shift = 0; | 107 | mpc8xxx_spi->rx_shift = 0; |
| 103 | mpc8xxx_spi->tx_shift = 0; | 108 | mpc8xxx_spi->tx_shift = 0; |
| 104 | 109 | ||
| 105 | init_completion(&mpc8xxx_spi->done); | ||
| 106 | |||
| 107 | master->bus_num = pdata->bus_num; | 110 | master->bus_num = pdata->bus_num; |
| 108 | master->num_chipselect = pdata->max_chipselect; | 111 | master->num_chipselect = pdata->max_chipselect; |
| 109 | 112 | ||
| 110 | init_completion(&mpc8xxx_spi->done); | 113 | init_completion(&mpc8xxx_spi->done); |
| 111 | } | 114 | } |
| 115 | EXPORT_SYMBOL_GPL(mpc8xxx_spi_probe); | ||
| 112 | 116 | ||
| 113 | int mpc8xxx_spi_remove(struct device *dev) | 117 | int mpc8xxx_spi_remove(struct device *dev) |
| 114 | { | 118 | { |
| @@ -127,6 +131,7 @@ int mpc8xxx_spi_remove(struct device *dev) | |||
| 127 | 131 | ||
| 128 | return 0; | 132 | return 0; |
| 129 | } | 133 | } |
| 134 | EXPORT_SYMBOL_GPL(mpc8xxx_spi_remove); | ||
| 130 | 135 | ||
| 131 | int of_mpc8xxx_spi_probe(struct platform_device *ofdev) | 136 | int of_mpc8xxx_spi_probe(struct platform_device *ofdev) |
| 132 | { | 137 | { |
| @@ -173,3 +178,6 @@ int of_mpc8xxx_spi_probe(struct platform_device *ofdev) | |||
| 173 | 178 | ||
| 174 | return 0; | 179 | return 0; |
| 175 | } | 180 | } |
| 181 | EXPORT_SYMBOL_GPL(of_mpc8xxx_spi_probe); | ||
| 182 | |||
| 183 | MODULE_LICENSE("GPL"); | ||
