Lines Matching refs:kbd_bl

144 		bool kbd_bl               : 1;  member
154 } kbd_bl; member
1325 if (ideapad_kbd_bl_check_tristate(priv->kbd_bl.type)) { in ideapad_kbd_bl_brightness_get()
1327 FIELD_PREP(KBD_BL_COMMAND_TYPE, priv->kbd_bl.type) | in ideapad_kbd_bl_brightness_get()
1338 if (value <= priv->kbd_bl.led.max_brightness) in ideapad_kbd_bl_brightness_get()
1342 if (value == priv->kbd_bl.led.max_brightness + 1) in ideapad_kbd_bl_brightness_get()
1360 struct ideapad_private *priv = container_of(led_cdev, struct ideapad_private, kbd_bl.led); in ideapad_kbd_bl_led_cdev_brightness_get()
1369 int type = priv->kbd_bl.type; in ideapad_kbd_bl_brightness_set()
1372 if (brightness > priv->kbd_bl.led.max_brightness) in ideapad_kbd_bl_brightness_set()
1386 priv->kbd_bl.last_brightness = brightness; in ideapad_kbd_bl_brightness_set()
1394 struct ideapad_private *priv = container_of(led_cdev, struct ideapad_private, kbd_bl.led); in ideapad_kbd_bl_led_cdev_brightness_set()
1403 if (!priv->kbd_bl.initialized) in ideapad_kbd_bl_notify()
1410 if (brightness == priv->kbd_bl.last_brightness) in ideapad_kbd_bl_notify()
1413 priv->kbd_bl.last_brightness = brightness; in ideapad_kbd_bl_notify()
1415 led_classdev_notify_brightness_hw_changed(&priv->kbd_bl.led, brightness); in ideapad_kbd_bl_notify()
1422 if (!priv->features.kbd_bl) in ideapad_kbd_bl_init()
1425 if (WARN_ON(priv->kbd_bl.initialized)) in ideapad_kbd_bl_init()
1428 if (ideapad_kbd_bl_check_tristate(priv->kbd_bl.type)) { in ideapad_kbd_bl_init()
1429 priv->kbd_bl.led.max_brightness = 2; in ideapad_kbd_bl_init()
1431 priv->kbd_bl.led.max_brightness = 1; in ideapad_kbd_bl_init()
1438 priv->kbd_bl.last_brightness = brightness; in ideapad_kbd_bl_init()
1439 priv->kbd_bl.led.name = "platform::" LED_FUNCTION_KBD_BACKLIGHT; in ideapad_kbd_bl_init()
1440 priv->kbd_bl.led.brightness_get = ideapad_kbd_bl_led_cdev_brightness_get; in ideapad_kbd_bl_init()
1441 priv->kbd_bl.led.brightness_set_blocking = ideapad_kbd_bl_led_cdev_brightness_set; in ideapad_kbd_bl_init()
1442 priv->kbd_bl.led.flags = LED_BRIGHT_HW_CHANGED; in ideapad_kbd_bl_init()
1444 err = led_classdev_register(&priv->platform_device->dev, &priv->kbd_bl.led); in ideapad_kbd_bl_init()
1448 priv->kbd_bl.initialized = true; in ideapad_kbd_bl_init()
1455 if (!priv->kbd_bl.initialized) in ideapad_kbd_bl_exit()
1458 priv->kbd_bl.initialized = false; in ideapad_kbd_bl_exit()
1460 led_classdev_unregister(&priv->kbd_bl.led); in ideapad_kbd_bl_exit()
1653 priv->features.kbd_bl = true; in ideapad_check_features()
1654 priv->kbd_bl.type = KBD_BL_STANDARD; in ideapad_check_features()
1665 priv->features.kbd_bl = true; in ideapad_check_features()
1666 priv->kbd_bl.type = KBD_BL_TRISTATE; in ideapad_check_features()
1668 priv->features.kbd_bl = true; in ideapad_check_features()
1669 priv->kbd_bl.type = KBD_BL_TRISTATE_AUTO; in ideapad_check_features()