diff options
Diffstat (limited to 'drivers/spi/spi-fsl-lib.c')
-rw-r--r-- | drivers/spi/spi-fsl-lib.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/drivers/spi/spi-fsl-lib.c b/drivers/spi/spi-fsl-lib.c index 8ade675a04f1..a91db0e57b23 100644 --- a/drivers/spi/spi-fsl-lib.c +++ b/drivers/spi/spi-fsl-lib.c | |||
@@ -23,7 +23,9 @@ | |||
23 | #include <linux/mm.h> | 23 | #include <linux/mm.h> |
24 | #include <linux/of_platform.h> | 24 | #include <linux/of_platform.h> |
25 | #include <linux/spi/spi.h> | 25 | #include <linux/spi/spi.h> |
26 | #ifdef CONFIG_FSL_SOC | ||
26 | #include <sysdev/fsl_soc.h> | 27 | #include <sysdev/fsl_soc.h> |
28 | #endif | ||
27 | 29 | ||
28 | #include "spi-fsl-lib.h" | 30 | #include "spi-fsl-lib.h" |
29 | 31 | ||
@@ -208,6 +210,7 @@ int of_mpc8xxx_spi_probe(struct platform_device *ofdev) | |||
208 | /* Allocate bus num dynamically. */ | 210 | /* Allocate bus num dynamically. */ |
209 | pdata->bus_num = -1; | 211 | pdata->bus_num = -1; |
210 | 212 | ||
213 | #ifdef CONFIG_FSL_SOC | ||
211 | /* SPI controller is either clocked from QE or SoC clock. */ | 214 | /* SPI controller is either clocked from QE or SoC clock. */ |
212 | pdata->sysclk = get_brgfreq(); | 215 | pdata->sysclk = get_brgfreq(); |
213 | if (pdata->sysclk == -1) { | 216 | if (pdata->sysclk == -1) { |
@@ -217,6 +220,11 @@ int of_mpc8xxx_spi_probe(struct platform_device *ofdev) | |||
217 | goto err; | 220 | goto err; |
218 | } | 221 | } |
219 | } | 222 | } |
223 | #else | ||
224 | ret = of_property_read_u32(np, "clock-frequency", &pdata->sysclk); | ||
225 | if (ret) | ||
226 | goto err; | ||
227 | #endif | ||
220 | 228 | ||
221 | prop = of_get_property(np, "mode", NULL); | 229 | prop = of_get_property(np, "mode", NULL); |
222 | if (prop && !strcmp(prop, "cpu-qe")) | 230 | if (prop && !strcmp(prop, "cpu-qe")) |