Lines Matching refs:bd
1181 static int read_brightness(struct backlight_device *bd) in read_brightness() argument
1183 struct asus_wmi *asus = bl_get_data(bd); in read_brightness()
1195 static u32 get_scalar_command(struct backlight_device *bd) in get_scalar_command() argument
1197 struct asus_wmi *asus = bl_get_data(bd); in get_scalar_command()
1200 if ((asus->driver->brightness < bd->props.brightness) || in get_scalar_command()
1201 bd->props.brightness == bd->props.max_brightness) in get_scalar_command()
1203 else if ((asus->driver->brightness > bd->props.brightness) || in get_scalar_command()
1204 bd->props.brightness == 0) in get_scalar_command()
1207 asus->driver->brightness = bd->props.brightness; in get_scalar_command()
1212 static int update_bl_status(struct backlight_device *bd) in update_bl_status() argument
1214 struct asus_wmi *asus = bl_get_data(bd); in update_bl_status()
1219 if (power != -ENODEV && bd->props.power != power) { in update_bl_status()
1220 ctrl_param = !!(bd->props.power == FB_BLANK_UNBLANK); in update_bl_status()
1224 asus->driver->panel_power = bd->props.power; in update_bl_status()
1233 ctrl_param = get_scalar_command(bd); in update_bl_status()
1235 ctrl_param = bd->props.brightness; in update_bl_status()
1250 struct backlight_device *bd = asus->backlight_device; in asus_wmi_backlight_notify() local
1251 int old = bd->props.brightness; in asus_wmi_backlight_notify()
1259 bd->props.brightness = new; in asus_wmi_backlight_notify()
1260 backlight_update_status(bd); in asus_wmi_backlight_notify()
1261 backlight_force_update(bd, BACKLIGHT_UPDATE_HOTKEY); in asus_wmi_backlight_notify()
1268 struct backlight_device *bd; in asus_wmi_backlight_init() local
1287 bd = backlight_device_register(asus->driver->name, in asus_wmi_backlight_init()
1290 if (IS_ERR(bd)) { in asus_wmi_backlight_init()
1292 return PTR_ERR(bd); in asus_wmi_backlight_init()
1295 asus->backlight_device = bd; in asus_wmi_backlight_init()
1300 bd->props.brightness = read_brightness(bd); in asus_wmi_backlight_init()
1301 bd->props.power = power; in asus_wmi_backlight_init()
1302 backlight_update_status(bd); in asus_wmi_backlight_init()
1304 asus->driver->brightness = bd->props.brightness; in asus_wmi_backlight_init()