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()
1432 priv->kbd_bl.last_brightness = brightness; in ideapad_kbd_bl_init()
1434 if (ideapad_kbd_bl_check_tristate(priv->kbd_bl.type)) { in ideapad_kbd_bl_init()
1435 priv->kbd_bl.led.max_brightness = 2; in ideapad_kbd_bl_init()
1437 priv->kbd_bl.led.max_brightness = 1; in ideapad_kbd_bl_init()
1440 priv->kbd_bl.led.name = "platform::" LED_FUNCTION_KBD_BACKLIGHT; in ideapad_kbd_bl_init()
1441 priv->kbd_bl.led.brightness_get = ideapad_kbd_bl_led_cdev_brightness_get; in ideapad_kbd_bl_init()
1442 priv->kbd_bl.led.brightness_set_blocking = ideapad_kbd_bl_led_cdev_brightness_set; in ideapad_kbd_bl_init()
1443 priv->kbd_bl.led.flags = LED_BRIGHT_HW_CHANGED; in ideapad_kbd_bl_init()
1445 err = led_classdev_register(&priv->platform_device->dev, &priv->kbd_bl.led); in ideapad_kbd_bl_init()
1449 priv->kbd_bl.initialized = true; in ideapad_kbd_bl_init()
1456 if (!priv->kbd_bl.initialized) in ideapad_kbd_bl_exit()
1459 priv->kbd_bl.initialized = false; in ideapad_kbd_bl_exit()
1461 led_classdev_unregister(&priv->kbd_bl.led); in ideapad_kbd_bl_exit()
1654 priv->features.kbd_bl = true; in ideapad_check_features()
1655 priv->kbd_bl.type = KBD_BL_STANDARD; in ideapad_check_features()
1666 priv->features.kbd_bl = true; in ideapad_check_features()
1667 priv->kbd_bl.type = KBD_BL_TRISTATE; in ideapad_check_features()
1669 priv->features.kbd_bl = true; in ideapad_check_features()
1670 priv->kbd_bl.type = KBD_BL_TRISTATE_AUTO; in ideapad_check_features()