Lines Matching full:ec

7  * Since the EC will never change the backlight level of its own accord,
14 #include <linux/platform_data/wilco-ec.h>
22 struct wilco_ec_device *ec; member
33 * struct wilco_keyboard_leds_msg - Message to/from EC for keyboard LED control.
35 * @status: Set by EC to 0 on success, 0xFF on failure.
55 static int send_kbbl_msg(struct wilco_ec_device *ec, in send_kbbl_msg() argument
69 ret = wilco_ec_mailbox(ec, &msg); in send_kbbl_msg()
71 dev_err(ec->dev, in send_kbbl_msg()
79 static int set_kbbl(struct wilco_ec_device *ec, enum led_brightness brightness) in set_kbbl() argument
91 ret = send_kbbl_msg(ec, &request, &response); in set_kbbl()
96 dev_err(ec->dev, in set_kbbl()
97 "EC reported failure sending keyboard LEDs command: %d\n", in set_kbbl()
105 static int kbbl_exist(struct wilco_ec_device *ec, bool *exists) in kbbl_exist() argument
115 ret = send_kbbl_msg(ec, &request, &response); in kbbl_exist()
126 * @ec: EC device to talk to.
134 static int kbbl_init(struct wilco_ec_device *ec) in kbbl_init() argument
144 ret = send_kbbl_msg(ec, &request, &response); in kbbl_init()
149 dev_err(ec->dev, in kbbl_init()
150 "EC reported failure sending keyboard LEDs command: %d\n", in kbbl_init()
158 ret = set_kbbl(ec, WILCO_KBBL_DEFAULT_BRIGHTNESS); in kbbl_init()
170 return set_kbbl(wkl->ec, brightness); in wilco_keyboard_leds_set()
173 int wilco_keyboard_leds_init(struct wilco_ec_device *ec) in wilco_keyboard_leds_init() argument
179 ret = kbbl_exist(ec, &leds_exist); in wilco_keyboard_leds_init()
181 dev_err(ec->dev, in wilco_keyboard_leds_init()
188 wkl = devm_kzalloc(ec->dev, sizeof(*wkl), GFP_KERNEL); in wilco_keyboard_leds_init()
192 wkl->ec = ec; in wilco_keyboard_leds_init()
197 ret = kbbl_init(ec); in wilco_keyboard_leds_init()
202 return devm_led_classdev_register(ec->dev, &wkl->keyboard); in wilco_keyboard_leds_init()