Skip to content

Commit

Permalink
fbdev: nvidia: Use backlight helper
Browse files Browse the repository at this point in the history
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]>
  • Loading branch information
skitt authored and hdeller committed Jan 9, 2023
1 parent 973fcf3 commit 1cc1759
Showing 1 changed file with 1 addition and 7 deletions.
8 changes: 1 addition & 7 deletions drivers/video/fbdev/nvidia/nv_backlight.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 1cc1759

Please sign in to comment.