aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/spi/spi-fsl-lib.c
diff options
context:
space:
mode:
authorEsben Haabendal <eha@deif.com>2015-01-06 08:07:34 -0500
committerMark Brown <broonie@kernel.org>2015-01-06 12:03:34 -0500
commit38455d7ac2e383d747ddee0189c7d8c078b29b09 (patch)
tree3181cc88705caa1f3d5ce2de3db4506cf6a69534 /drivers/spi/spi-fsl-lib.c
parent1004b9f146940d280a0f62ca33d241469022bce7 (diff)
spi: fsl-(e)spi: Support compile as module
Signed-off-by: Esben Haabendal <eha@deif.com> Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'drivers/spi/spi-fsl-lib.c')
-rw-r--r--drivers/spi/spi-fsl-lib.c14
1 files changed, 12 insertions, 2 deletions
diff --git a/drivers/spi/spi-fsl-lib.c b/drivers/spi/spi-fsl-lib.c
index 9d3f9e097861..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} \
40EXPORT_SYMBOL_GPL(mpc8xxx_spi_rx_buf_##type);
39 41
40#define MPC8XXX_SPI_TX_BUF(type) \ 42#define MPC8XXX_SPI_TX_BUF(type) \
41u32 mpc8xxx_spi_tx_buf_##type(struct mpc8xxx_spi *mpc8xxx_spi) \ 43u32 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} \
53EXPORT_SYMBOL_GPL(mpc8xxx_spi_tx_buf_##type);
51 54
52MPC8XXX_SPI_RX_BUF(u8) 55MPC8XXX_SPI_RX_BUF(u8)
53MPC8XXX_SPI_RX_BUF(u16) 56MPC8XXX_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}
66EXPORT_SYMBOL_GPL(to_of_pinfo);
63 67
64const char *mpc8xxx_spi_strmode(unsigned int flags) 68const 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}
82EXPORT_SYMBOL_GPL(mpc8xxx_spi_strmode);
78 83
79void mpc8xxx_spi_probe(struct device *dev, struct resource *mem, 84void mpc8xxx_spi_probe(struct device *dev, struct resource *mem,
80 unsigned int irq) 85 unsigned int irq)
@@ -107,6 +112,7 @@ void mpc8xxx_spi_probe(struct device *dev, struct resource *mem,
107 112
108 init_completion(&mpc8xxx_spi->done); 113 init_completion(&mpc8xxx_spi->done);
109} 114}
115EXPORT_SYMBOL_GPL(mpc8xxx_spi_probe);
110 116
111int mpc8xxx_spi_remove(struct device *dev) 117int mpc8xxx_spi_remove(struct device *dev)
112{ 118{
@@ -125,6 +131,7 @@ int mpc8xxx_spi_remove(struct device *dev)
125 131
126 return 0; 132 return 0;
127} 133}
134EXPORT_SYMBOL_GPL(mpc8xxx_spi_remove);
128 135
129int of_mpc8xxx_spi_probe(struct platform_device *ofdev) 136int of_mpc8xxx_spi_probe(struct platform_device *ofdev)
130{ 137{
@@ -171,3 +178,6 @@ int of_mpc8xxx_spi_probe(struct platform_device *ofdev)
171 178
172 return 0; 179 return 0;
173} 180}
181EXPORT_SYMBOL_GPL(of_mpc8xxx_spi_probe);
182
183MODULE_LICENSE("GPL");