Lines Matching refs:bd
1462 static int read_brightness(struct backlight_device *bd) in read_brightness() argument
1464 struct asus_wmi *asus = bl_get_data(bd); in read_brightness()
1476 static u32 get_scalar_command(struct backlight_device *bd) in get_scalar_command() argument
1478 struct asus_wmi *asus = bl_get_data(bd); in get_scalar_command()
1481 if ((asus->driver->brightness < bd->props.brightness) || in get_scalar_command()
1482 bd->props.brightness == bd->props.max_brightness) in get_scalar_command()
1484 else if ((asus->driver->brightness > bd->props.brightness) || in get_scalar_command()
1485 bd->props.brightness == 0) in get_scalar_command()
1488 asus->driver->brightness = bd->props.brightness; in get_scalar_command()
1493 static int update_bl_status(struct backlight_device *bd) in update_bl_status() argument
1495 struct asus_wmi *asus = bl_get_data(bd); in update_bl_status()
1500 if (power != -ENODEV && bd->props.power != power) { in update_bl_status()
1501 ctrl_param = !!(bd->props.power == FB_BLANK_UNBLANK); in update_bl_status()
1505 asus->driver->panel_power = bd->props.power; in update_bl_status()
1514 ctrl_param = get_scalar_command(bd); in update_bl_status()
1516 ctrl_param = bd->props.brightness; in update_bl_status()
1531 struct backlight_device *bd = asus->backlight_device; in asus_wmi_backlight_notify() local
1532 int old = bd->props.brightness; in asus_wmi_backlight_notify()
1540 bd->props.brightness = new; in asus_wmi_backlight_notify()
1541 backlight_update_status(bd); in asus_wmi_backlight_notify()
1542 backlight_force_update(bd, BACKLIGHT_UPDATE_HOTKEY); in asus_wmi_backlight_notify()
1549 struct backlight_device *bd; in asus_wmi_backlight_init() local
1568 bd = backlight_device_register(asus->driver->name, in asus_wmi_backlight_init()
1571 if (IS_ERR(bd)) { in asus_wmi_backlight_init()
1573 return PTR_ERR(bd); in asus_wmi_backlight_init()
1576 asus->backlight_device = bd; in asus_wmi_backlight_init()
1581 bd->props.brightness = read_brightness(bd); in asus_wmi_backlight_init()
1582 bd->props.power = power; in asus_wmi_backlight_init()
1583 backlight_update_status(bd); in asus_wmi_backlight_init()
1585 asus->driver->brightness = bd->props.brightness; in asus_wmi_backlight_init()