diff options
author | Richard Purdie <rpurdie@rpsys.net> | 2007-02-10 18:07:48 -0500 |
---|---|---|
committer | Richard Purdie <rpurdie@rpsys.net> | 2007-02-20 04:26:53 -0500 |
commit | 599a52d12629394236d785615808845823875868 (patch) | |
tree | 4e2dfa3a25ce761be0ecc0490acabac553f77a67 /drivers/video/aty/aty128fb.c | |
parent | 321709c5994f952b78d567fd7083dbebbdc381b7 (diff) |
backlight: Separate backlight properties from backlight ops pointers
Per device data such as brightness belongs to the indivdual device
and should therefore be separate from the the backlight operation
function pointers. This patch splits the two types of data and
allows simplifcation of some code.
Signed-off-by: Richard Purdie <rpurdie@rpsys.net>
Diffstat (limited to 'drivers/video/aty/aty128fb.c')
-rw-r--r-- | drivers/video/aty/aty128fb.c | 20 |
1 files changed, 9 insertions, 11 deletions
diff --git a/drivers/video/aty/aty128fb.c b/drivers/video/aty/aty128fb.c index 4de8d6252c3c..8726c3669713 100644 --- a/drivers/video/aty/aty128fb.c +++ b/drivers/video/aty/aty128fb.c | |||
@@ -1695,8 +1695,6 @@ static int __devinit aty128fb_setup(char *options) | |||
1695 | #ifdef CONFIG_FB_ATY128_BACKLIGHT | 1695 | #ifdef CONFIG_FB_ATY128_BACKLIGHT |
1696 | #define MAX_LEVEL 0xFF | 1696 | #define MAX_LEVEL 0xFF |
1697 | 1697 | ||
1698 | static struct backlight_properties aty128_bl_data; | ||
1699 | |||
1700 | static int aty128_bl_get_level_brightness(struct aty128fb_par *par, | 1698 | static int aty128_bl_get_level_brightness(struct aty128fb_par *par, |
1701 | int level) | 1699 | int level) |
1702 | { | 1700 | { |
@@ -1730,12 +1728,12 @@ static int aty128_bl_update_status(struct backlight_device *bd) | |||
1730 | unsigned int reg = aty_ld_le32(LVDS_GEN_CNTL); | 1728 | unsigned int reg = aty_ld_le32(LVDS_GEN_CNTL); |
1731 | int level; | 1729 | int level; |
1732 | 1730 | ||
1733 | if (bd->props->power != FB_BLANK_UNBLANK || | 1731 | if (bd->props.power != FB_BLANK_UNBLANK || |
1734 | bd->props->fb_blank != FB_BLANK_UNBLANK || | 1732 | bd->props.fb_blank != FB_BLANK_UNBLANK || |
1735 | !par->lcd_on) | 1733 | !par->lcd_on) |
1736 | level = 0; | 1734 | level = 0; |
1737 | else | 1735 | else |
1738 | level = bd->props->brightness; | 1736 | level = bd->props.brightness; |
1739 | 1737 | ||
1740 | reg |= LVDS_BL_MOD_EN | LVDS_BLON; | 1738 | reg |= LVDS_BL_MOD_EN | LVDS_BLON; |
1741 | if (level > 0) { | 1739 | if (level > 0) { |
@@ -1779,19 +1777,18 @@ static int aty128_bl_update_status(struct backlight_device *bd) | |||
1779 | 1777 | ||
1780 | static int aty128_bl_get_brightness(struct backlight_device *bd) | 1778 | static int aty128_bl_get_brightness(struct backlight_device *bd) |
1781 | { | 1779 | { |
1782 | return bd->props->brightness; | 1780 | return bd->props.brightness; |
1783 | } | 1781 | } |
1784 | 1782 | ||
1785 | static struct backlight_properties aty128_bl_data = { | 1783 | static struct backlight_ops aty128_bl_data = { |
1786 | .get_brightness = aty128_bl_get_brightness, | 1784 | .get_brightness = aty128_bl_get_brightness, |
1787 | .update_status = aty128_bl_update_status, | 1785 | .update_status = aty128_bl_update_status, |
1788 | .max_brightness = (FB_BACKLIGHT_LEVELS - 1), | ||
1789 | }; | 1786 | }; |
1790 | 1787 | ||
1791 | static void aty128_bl_set_power(struct fb_info *info, int power) | 1788 | static void aty128_bl_set_power(struct fb_info *info, int power) |
1792 | { | 1789 | { |
1793 | if (info->bl_dev) { | 1790 | if (info->bl_dev) { |
1794 | info->bl_dev->props->power = power; | 1791 | info->bl_dev->props.power = power; |
1795 | backlight_update_status(info->bl_dev); | 1792 | backlight_update_status(info->bl_dev); |
1796 | } | 1793 | } |
1797 | } | 1794 | } |
@@ -1825,8 +1822,9 @@ static void aty128_bl_init(struct aty128fb_par *par) | |||
1825 | 63 * FB_BACKLIGHT_MAX / MAX_LEVEL, | 1822 | 63 * FB_BACKLIGHT_MAX / MAX_LEVEL, |
1826 | 219 * FB_BACKLIGHT_MAX / MAX_LEVEL); | 1823 | 219 * FB_BACKLIGHT_MAX / MAX_LEVEL); |
1827 | 1824 | ||
1828 | bd->props->brightness = aty128_bl_data.max_brightness; | 1825 | bd->props.max_brightness = FB_BACKLIGHT_LEVELS - 1; |
1829 | bd->props->power = FB_BLANK_UNBLANK; | 1826 | bd->props.brightness = bd->props.max_brightness; |
1827 | bd->props.power = FB_BLANK_UNBLANK; | ||
1830 | backlight_update_status(bd); | 1828 | backlight_update_status(bd); |
1831 | 1829 | ||
1832 | printk("aty128: Backlight initialized (%s)\n", name); | 1830 | printk("aty128: Backlight initialized (%s)\n", name); |