Lines Matching +full:pwm +full:- +full:leds

1 // SPDX-License-Identifier: GPL-2.0
13 #include <linux/leds.h>
14 #include <linux/platform_data/wilco-ec.h>
33 * struct wilco_keyboard_leds_msg - Message to/from EC for keyboard LED control.
40 * @percent: Brightness in 0-100. Only meaningful in PWM mode.
71 dev_err(ec->dev, in send_kbbl_msg()
72 "Failed sending keyboard LEDs command: %d\n", ret); in send_kbbl_msg()
96 dev_err(ec->dev, in set_kbbl()
97 "EC reported failure sending keyboard LEDs command: %d\n", in set_kbbl()
99 return -EIO; in set_kbbl()
125 * kbbl_init() - Initialize the state of the keyboard backlight.
129 * backlight to PWM mode. If not in PWM mode, then the current brightness is
149 dev_err(ec->dev, in kbbl_init()
150 "EC reported failure sending keyboard LEDs command: %d\n", in kbbl_init()
152 return -EIO; in kbbl_init()
170 return set_kbbl(wkl->ec, brightness); in wilco_keyboard_leds_set()
181 dev_err(ec->dev, in wilco_keyboard_leds_init()
182 "Failed checking keyboard LEDs support: %d\n", ret); in wilco_keyboard_leds_init()
188 wkl = devm_kzalloc(ec->dev, sizeof(*wkl), GFP_KERNEL); in wilco_keyboard_leds_init()
190 return -ENOMEM; in wilco_keyboard_leds_init()
192 wkl->ec = ec; in wilco_keyboard_leds_init()
193 wkl->keyboard.name = "platform::kbd_backlight"; in wilco_keyboard_leds_init()
194 wkl->keyboard.max_brightness = 100; in wilco_keyboard_leds_init()
195 wkl->keyboard.flags = LED_CORE_SUSPENDRESUME; in wilco_keyboard_leds_init()
196 wkl->keyboard.brightness_set_blocking = wilco_keyboard_leds_set; in wilco_keyboard_leds_init()
200 wkl->keyboard.brightness = ret; in wilco_keyboard_leds_init()
202 return devm_led_classdev_register(ec->dev, &wkl->keyboard); in wilco_keyboard_leds_init()