Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 30972
b: refs/heads/master
c: cab267c
h: refs/heads/master
v: v3
  • Loading branch information
Michael Hanselmann authored and Linus Torvalds committed Jun 28, 2006
1 parent 8801be6 commit 1eec451
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 6 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 96febe9fb7b04f2a078882d08bd6a997dee7cfa3
refs/heads/master: cab267c65f44337974e4f1eae490b21dce0e9811
14 changes: 12 additions & 2 deletions trunk/arch/powerpc/platforms/powermac/backlight.c
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,14 @@ int pmac_backlight_set_legacy_brightness(int brightness)
down(&pmac_backlight->sem);
props = pmac_backlight->props;
props->brightness = brightness *
props->max_brightness / OLD_BACKLIGHT_MAX;
(props->max_brightness + 1) /
(OLD_BACKLIGHT_MAX + 1);

if (props->brightness > props->max_brightness)
props->brightness = props->max_brightness;
else if (props->brightness < 0)
props->brightness = 0;

props->update_status(pmac_backlight);
up(&pmac_backlight->sem);

Expand All @@ -140,8 +147,11 @@ int pmac_backlight_get_legacy_brightness()

down(&pmac_backlight->sem);
props = pmac_backlight->props;

result = props->brightness *
OLD_BACKLIGHT_MAX / props->max_brightness;
(OLD_BACKLIGHT_MAX + 1) /
(props->max_brightness + 1);

up(&pmac_backlight->sem);
}
mutex_unlock(&pmac_backlight_mutex);
Expand Down
6 changes: 3 additions & 3 deletions trunk/drivers/video/aty/radeon_backlight.c
Original file line number Diff line number Diff line change
Expand Up @@ -40,14 +40,14 @@ static int radeon_bl_get_level_brightness(struct radeon_bl_privdata *pdata,

mutex_unlock(&info->bl_mutex);

if (pdata->negative)
rlevel = MAX_RADEON_LEVEL - rlevel;

if (rlevel < 0)
rlevel = 0;
else if (rlevel > MAX_RADEON_LEVEL)
rlevel = MAX_RADEON_LEVEL;

if (pdata->negative)
rlevel = MAX_RADEON_LEVEL - rlevel;

return rlevel;
}

Expand Down

0 comments on commit 1eec451

Please sign in to comment.