Skip to content

Commit c552d22

Browse files
committed
driver: Use backlight_get_brightness()
This was introduced in Linux 5.9 and makes the brightness code a bit simpler. Yay!
1 parent e512dfc commit c552d22

File tree

1 file changed

+1
-6
lines changed

1 file changed

+1
-6
lines changed

driver.py

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -269,13 +269,8 @@ def generate_backlight(p: Panel, options: Options) -> str:
269269
s += f'\tstruct {p.short_id} *ctx = mipi_dsi_get_drvdata(dsi);\n'
270270

271271
s += '''\
272-
u16 brightness = bl->props.brightness;
272+
u16 brightness = backlight_get_brightness(bl);
273273
int ret;
274-
275-
if (bl->props.power != FB_BLANK_UNBLANK ||
276-
bl->props.fb_blank != FB_BLANK_UNBLANK ||
277-
bl->props.state & (BL_CORE_SUSPENDED | BL_CORE_FBBLANK))
278-
brightness = 0;
279274
'''
280275

281276
if options.backlight_gpio:

0 commit comments

Comments
 (0)