diff options
author | Hauke Mehrtens <hauke@hauke-m.de> | 2012-11-26 18:31:55 -0500 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2012-11-30 13:38:14 -0500 |
commit | 0362063b7be97f6f8e2c644b970f5726489aacdf (patch) | |
tree | 11230e5afa3c4c74499a5dfa895a419a22b57ea4 | |
parent | 4a7267c9a03b9627e5e85c80b307eb4541bab902 (diff) |
ssb: extif: fix compile errors
If CONFIG_SSB_EMBEDDED or CONFIG_SSB_DRIVER_MIPS is set and
CONFIG_SSB_DRIVER_EXTIF is not set, it will cause compile problems
because of missing functions. This patch fixes these problems.
The mips driver now also uses ssb_chipco_available() instead of
checking bus->chipco.dev manually.
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
-rw-r--r-- | drivers/ssb/driver_mipscore.c | 14 | ||||
-rw-r--r-- | include/linux/ssb/ssb_driver_extif.h | 42 |
2 files changed, 49 insertions, 7 deletions
diff --git a/drivers/ssb/driver_mipscore.c b/drivers/ssb/driver_mipscore.c index b918ba922306..5bd05b136d22 100644 --- a/drivers/ssb/driver_mipscore.c +++ b/drivers/ssb/driver_mipscore.c | |||
@@ -178,9 +178,9 @@ static void ssb_mips_serial_init(struct ssb_mipscore *mcore) | |||
178 | { | 178 | { |
179 | struct ssb_bus *bus = mcore->dev->bus; | 179 | struct ssb_bus *bus = mcore->dev->bus; |
180 | 180 | ||
181 | if (bus->extif.dev) | 181 | if (ssb_extif_available(&bus->extif)) |
182 | mcore->nr_serial_ports = ssb_extif_serial_init(&bus->extif, mcore->serial_ports); | 182 | mcore->nr_serial_ports = ssb_extif_serial_init(&bus->extif, mcore->serial_ports); |
183 | else if (bus->chipco.dev) | 183 | else if (ssb_chipco_available(&bus->chipco)) |
184 | mcore->nr_serial_ports = ssb_chipco_serial_init(&bus->chipco, mcore->serial_ports); | 184 | mcore->nr_serial_ports = ssb_chipco_serial_init(&bus->chipco, mcore->serial_ports); |
185 | else | 185 | else |
186 | mcore->nr_serial_ports = 0; | 186 | mcore->nr_serial_ports = 0; |
@@ -191,7 +191,7 @@ static void ssb_mips_flash_detect(struct ssb_mipscore *mcore) | |||
191 | struct ssb_bus *bus = mcore->dev->bus; | 191 | struct ssb_bus *bus = mcore->dev->bus; |
192 | 192 | ||
193 | /* When there is no chipcommon on the bus there is 4MB flash */ | 193 | /* When there is no chipcommon on the bus there is 4MB flash */ |
194 | if (!bus->chipco.dev) { | 194 | if (!ssb_chipco_available(&bus->chipco)) { |
195 | mcore->pflash.present = true; | 195 | mcore->pflash.present = true; |
196 | mcore->pflash.buswidth = 2; | 196 | mcore->pflash.buswidth = 2; |
197 | mcore->pflash.window = SSB_FLASH1; | 197 | mcore->pflash.window = SSB_FLASH1; |
@@ -227,9 +227,9 @@ u32 ssb_cpu_clock(struct ssb_mipscore *mcore) | |||
227 | if (bus->chipco.capabilities & SSB_CHIPCO_CAP_PMU) | 227 | if (bus->chipco.capabilities & SSB_CHIPCO_CAP_PMU) |
228 | return ssb_pmu_get_cpu_clock(&bus->chipco); | 228 | return ssb_pmu_get_cpu_clock(&bus->chipco); |
229 | 229 | ||
230 | if (bus->extif.dev) { | 230 | if (ssb_extif_available(&bus->extif)) { |
231 | ssb_extif_get_clockcontrol(&bus->extif, &pll_type, &n, &m); | 231 | ssb_extif_get_clockcontrol(&bus->extif, &pll_type, &n, &m); |
232 | } else if (bus->chipco.dev) { | 232 | } else if (ssb_chipco_available(&bus->chipco)) { |
233 | ssb_chipco_get_clockcpu(&bus->chipco, &pll_type, &n, &m); | 233 | ssb_chipco_get_clockcpu(&bus->chipco, &pll_type, &n, &m); |
234 | } else | 234 | } else |
235 | return 0; | 235 | return 0; |
@@ -265,9 +265,9 @@ void ssb_mipscore_init(struct ssb_mipscore *mcore) | |||
265 | hz = 100000000; | 265 | hz = 100000000; |
266 | ns = 1000000000 / hz; | 266 | ns = 1000000000 / hz; |
267 | 267 | ||
268 | if (bus->extif.dev) | 268 | if (ssb_extif_available(&bus->extif)) |
269 | ssb_extif_timing_init(&bus->extif, ns); | 269 | ssb_extif_timing_init(&bus->extif, ns); |
270 | else if (bus->chipco.dev) | 270 | else if (ssb_chipco_available(&bus->chipco)) |
271 | ssb_chipco_timing_init(&bus->chipco, ns); | 271 | ssb_chipco_timing_init(&bus->chipco, ns); |
272 | 272 | ||
273 | /* Assign IRQs to all cores on the bus, start with irq line 2, because serial usually takes 1 */ | 273 | /* Assign IRQs to all cores on the bus, start with irq line 2, because serial usually takes 1 */ |
diff --git a/include/linux/ssb/ssb_driver_extif.h b/include/linux/ssb/ssb_driver_extif.h index 91161f0aa22b..2604efa7dc4d 100644 --- a/include/linux/ssb/ssb_driver_extif.h +++ b/include/linux/ssb/ssb_driver_extif.h | |||
@@ -205,10 +205,52 @@ void ssb_extif_get_clockcontrol(struct ssb_extif *extif, | |||
205 | } | 205 | } |
206 | 206 | ||
207 | static inline | 207 | static inline |
208 | void ssb_extif_timing_init(struct ssb_extif *extif, unsigned long ns) | ||
209 | { | ||
210 | } | ||
211 | |||
212 | static inline | ||
208 | void ssb_extif_watchdog_timer_set(struct ssb_extif *extif, | 213 | void ssb_extif_watchdog_timer_set(struct ssb_extif *extif, |
209 | u32 ticks) | 214 | u32 ticks) |
210 | { | 215 | { |
211 | } | 216 | } |
212 | 217 | ||
218 | static inline u32 ssb_extif_gpio_in(struct ssb_extif *extif, u32 mask) | ||
219 | { | ||
220 | return 0; | ||
221 | } | ||
222 | |||
223 | static inline u32 ssb_extif_gpio_out(struct ssb_extif *extif, u32 mask, | ||
224 | u32 value) | ||
225 | { | ||
226 | return 0; | ||
227 | } | ||
228 | |||
229 | static inline u32 ssb_extif_gpio_outen(struct ssb_extif *extif, u32 mask, | ||
230 | u32 value) | ||
231 | { | ||
232 | return 0; | ||
233 | } | ||
234 | |||
235 | static inline u32 ssb_extif_gpio_polarity(struct ssb_extif *extif, u32 mask, | ||
236 | u32 value) | ||
237 | { | ||
238 | return 0; | ||
239 | } | ||
240 | |||
241 | static inline u32 ssb_extif_gpio_intmask(struct ssb_extif *extif, u32 mask, | ||
242 | u32 value) | ||
243 | { | ||
244 | return 0; | ||
245 | } | ||
246 | |||
247 | #ifdef CONFIG_SSB_SERIAL | ||
248 | static inline int ssb_extif_serial_init(struct ssb_extif *extif, | ||
249 | struct ssb_serial_port *ports) | ||
250 | { | ||
251 | return 0; | ||
252 | } | ||
253 | #endif /* CONFIG_SSB_SERIAL */ | ||
254 | |||
213 | #endif /* CONFIG_SSB_DRIVER_EXTIF */ | 255 | #endif /* CONFIG_SSB_DRIVER_EXTIF */ |
214 | #endif /* LINUX_SSB_EXTIFCORE_H_ */ | 256 | #endif /* LINUX_SSB_EXTIFCORE_H_ */ |