15 #include <linux/i2c.h>
20 #include <linux/slab.h>
21 #include <linux/export.h>
23 #include <asm/machdep.h>
32 { .compatible =
"ibm,plb4", },
33 { .compatible =
"ibm,opb", },
34 { .compatible =
"ibm,ebc", },
38 static int __init warp_device_probe(
void)
40 of_platform_bus_probe(
NULL, warp_of_bus,
NULL);
45 static int __init warp_probe(
void)
47 unsigned long root = of_get_flat_dt_root();
49 if (!of_flat_dt_is_compatible(root,
"pika,warp"))
69 static int __init warp_post_info(
void)
99 #ifdef CONFIG_SENSORS_AD7414
103 static unsigned green_led, red_led;
106 struct dtm_shutdown {
118 if (shutdown ==
NULL)
121 shutdown->func =
func;
124 list_add(&shutdown->list, &dtm_shutdown_list);
131 struct dtm_shutdown *shutdown;
134 if (shutdown->
func ==
func && shutdown->arg == arg) {
145 struct dtm_shutdown *shutdown;
154 shutdown->
func(shutdown->arg);
173 static int pika_setup_leds(
void)
185 green_led = of_get_gpio(child, 0);
187 red_led = of_get_gpio(child, 0);
217 ": Unable to request ad7414 irq %d = %d\n", irq, rc);
222 static inline void pika_dtm_check_fan(
void __iomem *fpga)
224 static int fan_state;
227 if (fan_state != fan) {
231 " Please check hardware.\n");
235 static int pika_dtm_thread(
void __iomem *fpga)
245 if (client ==
NULL) {
250 pika_setup_critical_temp(np, client);
261 dev_dbg(&client->
dev,
"DTM read temp failed.\n");
267 pika_dtm_check_fan(fpga);
276 static int __init pika_dtm_start(
void)
287 if (dtm_fpga ==
NULL)
293 dtm_thread =
kthread_run(pika_dtm_thread, dtm_fpga,
"pika-dtm");
294 if (IS_ERR(dtm_thread)) {
296 return PTR_ERR(dtm_thread);