diff options
author | Stephen Kitt <[email protected]> | 2022-06-07 21:23:33 +0200 |
---|---|---|
committer | Helge Deller <[email protected]> | 2023-01-09 09:57:51 +0100 |
commit | 1cc17590ddfec590d7301f5e4cf6183ea19afa25 (patch) | |
tree | 66c4d135a692ba2bb5834384f0011554c33a82ca | |
parent | 973fcf37c267f937fbec656f4643571d7bd09a37 (diff) |
fbdev: nvidia: Use backlight helper
Instead of retrieving the backlight brightness in struct
backlight_properties manually, and then checking whether the backlight
should be on at all, use backlight_get_brightness() which does all
this and insulates this from future changes.
Signed-off-by: Stephen Kitt <[email protected]>
Cc: Antonino Daplas <[email protected]>
Cc: Helge Deller <[email protected]>
Cc: [email protected]
Cc: [email protected]
Reviewed-by: Daniel Thompson <[email protected]>
Signed-off-by: Helge Deller <[email protected]>
-rw-r--r-- | drivers/video/fbdev/nvidia/nv_backlight.c | 8 |
1 files changed, 1 insertions, 7 deletions
diff --git a/drivers/video/fbdev/nvidia/nv_backlight.c b/drivers/video/fbdev/nvidia/nv_backlight.c index 2ce53529f636..503a7a683855 100644 --- a/drivers/video/fbdev/nvidia/nv_backlight.c +++ b/drivers/video/fbdev/nvidia/nv_backlight.c @@ -49,17 +49,11 @@ static int nvidia_bl_update_status(struct backlight_device *bd) { struct nvidia_par *par = bl_get_data(bd); u32 tmp_pcrt, tmp_pmc, fpcontrol; - int level; + int level = backlight_get_brightness(bd); if (!par->FlatPanel) return 0; - if (bd->props.power != FB_BLANK_UNBLANK || - bd->props.fb_blank != FB_BLANK_UNBLANK) - level = 0; - else - level = bd->props.brightness; - tmp_pmc = NV_RD32(par->PMC, 0x10F0) & 0x0000FFFF; tmp_pcrt = NV_RD32(par->PCRTC0, 0x081C) & 0xFFFFFFFC; fpcontrol = NV_RD32(par->PRAMDAC, 0x0848) & 0xCFFFFFCC; |