Lines Matching +full:- +full:70

1 // SPDX-License-Identifier: GPL-2.0-only
7 * Based on Richard Purdie's ledtrig-timer.c and some arch's
41 led_cdev = heartbeat_data->led_cdev; in led_heartbeat_function()
48 if (test_and_clear_bit(LED_BLINK_BRIGHTNESS_CHANGE, &led_cdev->work_flags)) in led_heartbeat_function()
49 led_cdev->blink_brightness = led_cdev->new_blink_brightness; in led_heartbeat_function()
51 /* acts like an actual heart beat -- ie thump-thump-pause... */ in led_heartbeat_function()
52 switch (heartbeat_data->phase) { in led_heartbeat_function()
58 * f(0)=1260, f(1)=860, f(5)=510, f(inf)->300. in led_heartbeat_function()
60 heartbeat_data->period = 300 + in led_heartbeat_function()
62 heartbeat_data->period = in led_heartbeat_function()
63 msecs_to_jiffies(heartbeat_data->period); in led_heartbeat_function()
64 delay = msecs_to_jiffies(70); in led_heartbeat_function()
65 heartbeat_data->phase++; in led_heartbeat_function()
66 if (!heartbeat_data->invert) in led_heartbeat_function()
67 brightness = led_cdev->blink_brightness; in led_heartbeat_function()
70 delay = heartbeat_data->period / 4 - msecs_to_jiffies(70); in led_heartbeat_function()
71 heartbeat_data->phase++; in led_heartbeat_function()
72 if (heartbeat_data->invert) in led_heartbeat_function()
73 brightness = led_cdev->blink_brightness; in led_heartbeat_function()
76 delay = msecs_to_jiffies(70); in led_heartbeat_function()
77 heartbeat_data->phase++; in led_heartbeat_function()
78 if (!heartbeat_data->invert) in led_heartbeat_function()
79 brightness = led_cdev->blink_brightness; in led_heartbeat_function()
82 delay = heartbeat_data->period - heartbeat_data->period / 4 - in led_heartbeat_function()
83 msecs_to_jiffies(70); in led_heartbeat_function()
84 heartbeat_data->phase = 0; in led_heartbeat_function()
85 if (heartbeat_data->invert) in led_heartbeat_function()
86 brightness = led_cdev->blink_brightness; in led_heartbeat_function()
91 mod_timer(&heartbeat_data->timer, jiffies + delay); in led_heartbeat_function()
100 return sprintf(buf, "%u\n", heartbeat_data->invert); in led_invert_show()
115 heartbeat_data->invert = !!state; in led_invert_store()
134 return -ENOMEM; in heartbeat_trig_activate()
137 heartbeat_data->led_cdev = led_cdev; in heartbeat_trig_activate()
139 timer_setup(&heartbeat_data->timer, led_heartbeat_function, 0); in heartbeat_trig_activate()
140 heartbeat_data->phase = 0; in heartbeat_trig_activate()
141 if (!led_cdev->blink_brightness) in heartbeat_trig_activate()
142 led_cdev->blink_brightness = led_cdev->max_brightness; in heartbeat_trig_activate()
143 led_heartbeat_function(&heartbeat_data->timer); in heartbeat_trig_activate()
144 set_bit(LED_BLINK_SW, &led_cdev->work_flags); in heartbeat_trig_activate()
154 timer_shutdown_sync(&heartbeat_data->timer); in heartbeat_trig_deactivate()
156 clear_bit(LED_BLINK_SW, &led_cdev->work_flags); in heartbeat_trig_deactivate()