diff options
author | Len Brown <len.brown@intel.com> | 2006-06-29 19:57:46 -0400 |
---|---|---|
committer | Len Brown <len.brown@intel.com> | 2006-06-29 19:57:46 -0400 |
commit | d120cfb544ed6161b9d32fb6c4648c471807ee6b (patch) | |
tree | 7757ad0198d8df76ff5c60f939a687687c41da00 /arch/powerpc/platforms/powermac/backlight.c | |
parent | 9dce0e950dbfab4148f35ac6f297d8638cdc63c4 (diff) | |
parent | bf7e8511088963078484132636839b59e25cf14f (diff) |
merge linus into release branch
Conflicts:
drivers/acpi/acpi_memhotplug.c
Diffstat (limited to 'arch/powerpc/platforms/powermac/backlight.c')
-rw-r--r-- | arch/powerpc/platforms/powermac/backlight.c | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/arch/powerpc/platforms/powermac/backlight.c b/arch/powerpc/platforms/powermac/backlight.c index 498b042e1837..c7a27eddca6d 100644 --- a/arch/powerpc/platforms/powermac/backlight.c +++ b/arch/powerpc/platforms/powermac/backlight.c | |||
@@ -119,7 +119,14 @@ int pmac_backlight_set_legacy_brightness(int brightness) | |||
119 | down(&pmac_backlight->sem); | 119 | down(&pmac_backlight->sem); |
120 | props = pmac_backlight->props; | 120 | props = pmac_backlight->props; |
121 | props->brightness = brightness * | 121 | props->brightness = brightness * |
122 | props->max_brightness / OLD_BACKLIGHT_MAX; | 122 | (props->max_brightness + 1) / |
123 | (OLD_BACKLIGHT_MAX + 1); | ||
124 | |||
125 | if (props->brightness > props->max_brightness) | ||
126 | props->brightness = props->max_brightness; | ||
127 | else if (props->brightness < 0) | ||
128 | props->brightness = 0; | ||
129 | |||
123 | props->update_status(pmac_backlight); | 130 | props->update_status(pmac_backlight); |
124 | up(&pmac_backlight->sem); | 131 | up(&pmac_backlight->sem); |
125 | 132 | ||
@@ -140,8 +147,11 @@ int pmac_backlight_get_legacy_brightness() | |||
140 | 147 | ||
141 | down(&pmac_backlight->sem); | 148 | down(&pmac_backlight->sem); |
142 | props = pmac_backlight->props; | 149 | props = pmac_backlight->props; |
150 | |||
143 | result = props->brightness * | 151 | result = props->brightness * |
144 | OLD_BACKLIGHT_MAX / props->max_brightness; | 152 | (OLD_BACKLIGHT_MAX + 1) / |
153 | (props->max_brightness + 1); | ||
154 | |||
145 | up(&pmac_backlight->sem); | 155 | up(&pmac_backlight->sem); |
146 | } | 156 | } |
147 | mutex_unlock(&pmac_backlight_mutex); | 157 | mutex_unlock(&pmac_backlight_mutex); |