diff options
author | Andreas Larsson <andreas@gaisler.com> | 2013-02-15 10:52:21 -0500 |
---|---|---|
committer | Grant Likely <grant.likely@secretlab.ca> | 2013-04-07 05:07:54 -0400 |
commit | e8beacbb85a5c1de1117400c5ddb450514a8372c (patch) | |
tree | 3853de80b818360820443a34eb22885224c5628f /drivers/spi/spi-fsl-lib.h | |
parent | 58ad60bbb2abada33fbeae88943ab038e2fcc0ef (diff) |
spi/spi-fsl-spi: Make driver usable in CPU mode outside of an FSL_SOC environment
This makes the spi-fsl-spi driver usable in CPU mode outside of an FSL_SOC and
even an powerpc environment by moving CPM mode functionality to a separate file
that is only compiled and linked in an FSL_SOC environment and adding some
ifdefs to hide types and functions or provide alternatives.
For devicetree probing a "clock-frequency" property is used for clock frequency
instead of calls to FSL_SOC-specific functions.
Acked-by: Anton Vorontsov <anton@enomsg.org>
Signed-off-by: Andreas Larsson <andreas@gaisler.com>
Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
Diffstat (limited to 'drivers/spi/spi-fsl-lib.h')
-rw-r--r-- | drivers/spi/spi-fsl-lib.h | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/drivers/spi/spi-fsl-lib.h b/drivers/spi/spi-fsl-lib.h index cbe881b9ea76..d785595c206e 100644 --- a/drivers/spi/spi-fsl-lib.h +++ b/drivers/spi/spi-fsl-lib.h | |||
@@ -34,8 +34,10 @@ struct mpc8xxx_spi { | |||
34 | 34 | ||
35 | int subblock; | 35 | int subblock; |
36 | struct spi_pram __iomem *pram; | 36 | struct spi_pram __iomem *pram; |
37 | #ifdef CONFIG_FSL_SOC | ||
37 | struct cpm_buf_desc __iomem *tx_bd; | 38 | struct cpm_buf_desc __iomem *tx_bd; |
38 | struct cpm_buf_desc __iomem *rx_bd; | 39 | struct cpm_buf_desc __iomem *rx_bd; |
40 | #endif | ||
39 | 41 | ||
40 | struct spi_transfer *xfer_in_progress; | 42 | struct spi_transfer *xfer_in_progress; |
41 | 43 | ||
@@ -87,12 +89,12 @@ struct spi_mpc8xxx_cs { | |||
87 | 89 | ||
88 | static inline void mpc8xxx_spi_write_reg(__be32 __iomem *reg, u32 val) | 90 | static inline void mpc8xxx_spi_write_reg(__be32 __iomem *reg, u32 val) |
89 | { | 91 | { |
90 | out_be32(reg, val); | 92 | iowrite32be(val, reg); |
91 | } | 93 | } |
92 | 94 | ||
93 | static inline u32 mpc8xxx_spi_read_reg(__be32 __iomem *reg) | 95 | static inline u32 mpc8xxx_spi_read_reg(__be32 __iomem *reg) |
94 | { | 96 | { |
95 | return in_be32(reg); | 97 | return ioread32be(reg); |
96 | } | 98 | } |
97 | 99 | ||
98 | struct mpc8xxx_spi_probe_info { | 100 | struct mpc8xxx_spi_probe_info { |