diff options
author | Andrea Bastoni <bastoni@cs.unc.edu> | 2010-05-30 19:16:45 -0400 |
---|---|---|
committer | Andrea Bastoni <bastoni@cs.unc.edu> | 2010-05-30 19:16:45 -0400 |
commit | ada47b5fe13d89735805b566185f4885f5a3f750 (patch) | |
tree | 644b88f8a71896307d71438e9b3af49126ffb22b /drivers/video/backlight/omap1_bl.c | |
parent | 43e98717ad40a4ae64545b5ba047c7b86aa44f4f (diff) | |
parent | 3280f21d43ee541f97f8cda5792150d2dbec20d5 (diff) |
Merge branch 'wip-2.6.34' into old-private-masterarchived-private-master
Diffstat (limited to 'drivers/video/backlight/omap1_bl.c')
-rw-r--r-- | drivers/video/backlight/omap1_bl.c | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/drivers/video/backlight/omap1_bl.c b/drivers/video/backlight/omap1_bl.c index cbad67e89826..d3bc56296c8d 100644 --- a/drivers/video/backlight/omap1_bl.c +++ b/drivers/video/backlight/omap1_bl.c | |||
@@ -24,10 +24,11 @@ | |||
24 | #include <linux/platform_device.h> | 24 | #include <linux/platform_device.h> |
25 | #include <linux/fb.h> | 25 | #include <linux/fb.h> |
26 | #include <linux/backlight.h> | 26 | #include <linux/backlight.h> |
27 | #include <linux/slab.h> | ||
27 | 28 | ||
28 | #include <mach/hardware.h> | 29 | #include <mach/hardware.h> |
29 | #include <mach/board.h> | 30 | #include <plat/board.h> |
30 | #include <mach/mux.h> | 31 | #include <plat/mux.h> |
31 | 32 | ||
32 | #define OMAPBL_MAX_INTENSITY 0xff | 33 | #define OMAPBL_MAX_INTENSITY 0xff |
33 | 34 | ||
@@ -125,13 +126,14 @@ static int omapbl_get_intensity(struct backlight_device *dev) | |||
125 | return bl->current_intensity; | 126 | return bl->current_intensity; |
126 | } | 127 | } |
127 | 128 | ||
128 | static struct backlight_ops omapbl_ops = { | 129 | static const struct backlight_ops omapbl_ops = { |
129 | .get_brightness = omapbl_get_intensity, | 130 | .get_brightness = omapbl_get_intensity, |
130 | .update_status = omapbl_update_status, | 131 | .update_status = omapbl_update_status, |
131 | }; | 132 | }; |
132 | 133 | ||
133 | static int omapbl_probe(struct platform_device *pdev) | 134 | static int omapbl_probe(struct platform_device *pdev) |
134 | { | 135 | { |
136 | struct backlight_properties props; | ||
135 | struct backlight_device *dev; | 137 | struct backlight_device *dev; |
136 | struct omap_backlight *bl; | 138 | struct omap_backlight *bl; |
137 | struct omap_backlight_config *pdata = pdev->dev.platform_data; | 139 | struct omap_backlight_config *pdata = pdev->dev.platform_data; |
@@ -139,13 +141,14 @@ static int omapbl_probe(struct platform_device *pdev) | |||
139 | if (!pdata) | 141 | if (!pdata) |
140 | return -ENXIO; | 142 | return -ENXIO; |
141 | 143 | ||
142 | omapbl_ops.check_fb = pdata->check_fb; | ||
143 | |||
144 | bl = kzalloc(sizeof(struct omap_backlight), GFP_KERNEL); | 144 | bl = kzalloc(sizeof(struct omap_backlight), GFP_KERNEL); |
145 | if (unlikely(!bl)) | 145 | if (unlikely(!bl)) |
146 | return -ENOMEM; | 146 | return -ENOMEM; |
147 | 147 | ||
148 | dev = backlight_device_register("omap-bl", &pdev->dev, bl, &omapbl_ops); | 148 | memset(&props, 0, sizeof(struct backlight_properties)); |
149 | props.max_brightness = OMAPBL_MAX_INTENSITY; | ||
150 | dev = backlight_device_register("omap-bl", &pdev->dev, bl, &omapbl_ops, | ||
151 | &props); | ||
149 | if (IS_ERR(dev)) { | 152 | if (IS_ERR(dev)) { |
150 | kfree(bl); | 153 | kfree(bl); |
151 | return PTR_ERR(dev); | 154 | return PTR_ERR(dev); |
@@ -162,7 +165,6 @@ static int omapbl_probe(struct platform_device *pdev) | |||
162 | omap_cfg_reg(PWL); /* Conflicts with UART3 */ | 165 | omap_cfg_reg(PWL); /* Conflicts with UART3 */ |
163 | 166 | ||
164 | dev->props.fb_blank = FB_BLANK_UNBLANK; | 167 | dev->props.fb_blank = FB_BLANK_UNBLANK; |
165 | dev->props.max_brightness = OMAPBL_MAX_INTENSITY; | ||
166 | dev->props.brightness = pdata->default_intensity; | 168 | dev->props.brightness = pdata->default_intensity; |
167 | omapbl_update_status(dev); | 169 | omapbl_update_status(dev); |
168 | 170 | ||