Lines Matching +full:led +full:- +full:8
1 // SPDX-License-Identifier: GPL-2.0-only
3 * ledtrig-cpu.c - LED trigger based on CPU activity
5 * This LED trigger will be registered for first 8 CPUs and named
12 * It can be bound to any LED just like other triggers using either a
19 * Copyright 2011 - 2012 Bryan Wu <bryan.wu@canonical.com>
31 #define MAX_NAME_LEN 8
45 * ledtrig_cpu - emit a CPU event as a trigger
49 * bound LED to turn on or turn off.
54 bool is_active = trig->is_active; in ledtrig_cpu()
56 /* Locate the correct CPU LED */ in ledtrig_cpu()
60 /* Will turn the LED on, max brightness */ in ledtrig_cpu()
67 /* Will turn the LED off */ in ledtrig_cpu()
72 /* Will leave the LED as it is */ in ledtrig_cpu()
76 if (is_active != trig->is_active) { in ledtrig_cpu()
81 trig->is_active = is_active; in ledtrig_cpu()
82 atomic_add(is_active ? 1 : -1, &num_active_cpus); in ledtrig_cpu()
86 led_trigger_event(trig->_trig, in ledtrig_cpu()
145 * Registering CPU led trigger for each CPU core here in ledtrig_cpu_init()
152 if (cpu >= 8) in ledtrig_cpu_init()
155 snprintf(trig->name, MAX_NAME_LEN, "cpu%d", cpu); in ledtrig_cpu_init()
157 led_trigger_register_simple(trig->name, &trig->_trig); in ledtrig_cpu_init()
165 pr_err("CPU hotplug notifier for ledtrig-cpu could not be registered: %d\n", in ledtrig_cpu_init()
168 pr_info("ledtrig-cpu: registered to indicate activity on CPUs\n"); in ledtrig_cpu_init()