Skip to content

Commit 78e5479

Browse files
committed
Merge pull request #44 from HarveyHunt/ci20-v3.18-leds
Use the new Ci20's LEDs to show CPU and NAND activity
2 parents 0f231e7 + 2f6e4c1 commit 78e5479

File tree

2 files changed

+22
-2
lines changed

2 files changed

+22
-2
lines changed

arch/mips/boot/dts/ci20.dts

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,22 @@
101101
type = <RFKILL_TYPE_BLUETOOTH>;
102102
vrfkill-supply = <&bt_reset>;
103103
};
104+
105+
leds {
106+
compatible = "gpio-leds";
107+
led1 {
108+
gpios = <&gpc 0 0>;
109+
linux,default-trigger = "cpu0";
110+
};
111+
led2 {
112+
gpios = <&gpc 1 0>;
113+
linux,default-trigger = "cpu1";
114+
};
115+
led3 {
116+
gpios = <&gpc 2 0>;
117+
linux,default-trigger = "nand-disk";
118+
};
119+
};
104120
};
105121

106122
&ext {

arch/mips/kernel/idle.c

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
#include <linux/export.h>
1515
#include <linux/init.h>
1616
#include <linux/irqflags.h>
17+
#include <linux/leds.h>
1718
#include <linux/printk.h>
1819
#include <linux/sched.h>
1920
#include <asm/cpu.h>
@@ -259,10 +260,13 @@ void __init check_wait(void)
259260

260261
void arch_cpu_idle(void)
261262
{
262-
if (cpu_wait)
263+
if (cpu_wait) {
264+
ledtrig_cpu(CPU_LED_IDLE_START);
263265
cpu_wait();
264-
else
266+
ledtrig_cpu(CPU_LED_IDLE_END);
267+
} else {
265268
local_irq_enable();
269+
}
266270
}
267271

268272
#ifdef CONFIG_CPU_IDLE

0 commit comments

Comments
 (0)