Lines Matching +full:turn +full:- +full:on
1 // SPDX-License-Identifier: GPL-2.0-only
3 * ledtrig-cpu.c - LED trigger based on CPU activity
7 * is on when any CPU is active.
19 * Copyright 2011 - 2012 Bryan Wu <bryan.wu@canonical.com>
45 * ledtrig_cpu - emit a CPU event as a trigger
48 * Emit a CPU event on a CPU core, which will trigger a
49 * bound LED to turn on or turn off.
54 bool is_active = trig->is_active; in ledtrig_cpu()
60 /* Will turn the LED on, max brightness */ in ledtrig_cpu()
67 /* Will turn the LED off */ 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()
159 snprintf(trig->name, MAX_NAME_LEN, "cpu%u", cpu); in ledtrig_cpu_init()
161 led_trigger_register_simple(trig->name, &trig->_trig); in ledtrig_cpu_init()
169 pr_err("CPU hotplug notifier for ledtrig-cpu could not be registered: %d\n", in ledtrig_cpu_init()
172 pr_info("ledtrig-cpu: registered to indicate activity on CPUs\n"); in ledtrig_cpu_init()