This source file includes following definitions.
- ledtrig_power_off_init
- cobalt_machine_halt
- cobalt_machine_restart
1
2
3
4
5
6
7
8
9
10
11 #include <linux/init.h>
12 #include <linux/io.h>
13 #include <linux/leds.h>
14
15 #include <asm/idle.h>
16 #include <asm/processor.h>
17
18 #include <cobalt.h>
19
20 #define RESET_PORT ((void __iomem *)CKSEG1ADDR(0x1c000000))
21 #define RESET 0x0f
22
23 DEFINE_LED_TRIGGER(power_off_led_trigger);
24
25 static int __init ledtrig_power_off_init(void)
26 {
27 led_trigger_register_simple("power-off", &power_off_led_trigger);
28 return 0;
29 }
30 device_initcall(ledtrig_power_off_init);
31
32 void cobalt_machine_halt(void)
33 {
34
35
36
37 led_trigger_event(power_off_led_trigger, LED_FULL);
38
39 local_irq_disable();
40 while (1) {
41 if (cpu_wait)
42 cpu_wait();
43 }
44 }
45
46 void cobalt_machine_restart(char *command)
47 {
48 writeb(RESET, RESET_PORT);
49
50
51 cobalt_machine_halt();
52 }