aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/video/backlight/tosa_bl.c
diff options
context:
space:
mode:
authorAndrea Bastoni <bastoni@cs.unc.edu>2010-05-30 19:16:45 -0400
committerAndrea Bastoni <bastoni@cs.unc.edu>2010-05-30 19:16:45 -0400
commitada47b5fe13d89735805b566185f4885f5a3f750 (patch)
tree644b88f8a71896307d71438e9b3af49126ffb22b /drivers/video/backlight/tosa_bl.c
parent43e98717ad40a4ae64545b5ba047c7b86aa44f4f (diff)
parent3280f21d43ee541f97f8cda5792150d2dbec20d5 (diff)
Merge branch 'wip-2.6.34' into old-private-masterarchived-private-master
Diffstat (limited to 'drivers/video/backlight/tosa_bl.c')
-rw-r--r--drivers/video/backlight/tosa_bl.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/drivers/video/backlight/tosa_bl.c b/drivers/video/backlight/tosa_bl.c
index 43edbada12d1..e03e60bbfd85 100644
--- a/drivers/video/backlight/tosa_bl.c
+++ b/drivers/video/backlight/tosa_bl.c
@@ -18,6 +18,7 @@
18#include <linux/gpio.h> 18#include <linux/gpio.h>
19#include <linux/fb.h> 19#include <linux/fb.h>
20#include <linux/backlight.h> 20#include <linux/backlight.h>
21#include <linux/slab.h>
21 22
22#include <asm/mach/sharpsl_param.h> 23#include <asm/mach/sharpsl_param.h>
23 24
@@ -72,7 +73,7 @@ static int tosa_bl_get_brightness(struct backlight_device *dev)
72 return props->brightness; 73 return props->brightness;
73} 74}
74 75
75static struct backlight_ops bl_ops = { 76static const struct backlight_ops bl_ops = {
76 .get_brightness = tosa_bl_get_brightness, 77 .get_brightness = tosa_bl_get_brightness,
77 .update_status = tosa_bl_update_status, 78 .update_status = tosa_bl_update_status,
78}; 79};
@@ -80,6 +81,7 @@ static struct backlight_ops bl_ops = {
80static int __devinit tosa_bl_probe(struct i2c_client *client, 81static int __devinit tosa_bl_probe(struct i2c_client *client,
81 const struct i2c_device_id *id) 82 const struct i2c_device_id *id)
82{ 83{
84 struct backlight_properties props;
83 struct tosa_bl_data *data = kzalloc(sizeof(struct tosa_bl_data), GFP_KERNEL); 85 struct tosa_bl_data *data = kzalloc(sizeof(struct tosa_bl_data), GFP_KERNEL);
84 int ret = 0; 86 int ret = 0;
85 if (!data) 87 if (!data)
@@ -99,15 +101,16 @@ static int __devinit tosa_bl_probe(struct i2c_client *client,
99 i2c_set_clientdata(client, data); 101 i2c_set_clientdata(client, data);
100 data->i2c = client; 102 data->i2c = client;
101 103
102 data->bl = backlight_device_register("tosa-bl", &client->dev, 104 memset(&props, 0, sizeof(struct backlight_properties));
103 data, &bl_ops); 105 props.max_brightness = 512 - 1;
106 data->bl = backlight_device_register("tosa-bl", &client->dev, data,
107 &bl_ops, &props);
104 if (IS_ERR(data->bl)) { 108 if (IS_ERR(data->bl)) {
105 ret = PTR_ERR(data->bl); 109 ret = PTR_ERR(data->bl);
106 goto err_reg; 110 goto err_reg;
107 } 111 }
108 112
109 data->bl->props.brightness = 69; 113 data->bl->props.brightness = 69;
110 data->bl->props.max_brightness = 512 - 1;
111 data->bl->props.power = FB_BLANK_UNBLANK; 114 data->bl->props.power = FB_BLANK_UNBLANK;
112 115
113 backlight_update_status(data->bl); 116 backlight_update_status(data->bl);