blob: e5b14f52628fdd365ac1a9318cc8ad8be7fe89ca [file] [log] [blame]
Kim, Milo7be865a2012-03-23 15:02:01 -07001/*
2 * TI LP855x Backlight Driver
3 *
4 * Copyright (C) 2011 Texas Instruments
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License version 2 as
8 * published by the Free Software Foundation.
9 *
10 */
11
12#include <linux/module.h>
13#include <linux/slab.h>
14#include <linux/i2c.h>
15#include <linux/backlight.h>
16#include <linux/err.h>
Kim, Milo4add0662013-04-29 16:18:06 -070017#include <linux/of.h>
Kim, Milof7f95052012-07-30 14:40:53 -070018#include <linux/platform_data/lp855x.h>
Kim, Milo8cc97642012-12-17 16:00:43 -080019#include <linux/pwm.h>
Sean Paul829b0302014-12-02 17:39:12 -080020#include <linux/regulator/consumer.h>
Kim, Milo7be865a2012-03-23 15:02:01 -070021
Kim, Milo26e8ccc2013-02-21 16:44:06 -080022/* LP8550/1/2/3/6 Registers */
23#define LP855X_BRIGHTNESS_CTRL 0x00
24#define LP855X_DEVICE_CTRL 0x01
25#define LP855X_EEPROM_START 0xA0
26#define LP855X_EEPROM_END 0xA7
27#define LP8556_EPROM_START 0xA0
28#define LP8556_EPROM_END 0xAF
29
Milo Kim5812c132013-11-12 15:08:57 -080030/* LP8555/7 Registers */
Kim, Milo26e8ccc2013-02-21 16:44:06 -080031#define LP8557_BL_CMD 0x00
32#define LP8557_BL_MASK 0x01
33#define LP8557_BL_ON 0x01
34#define LP8557_BL_OFF 0x00
35#define LP8557_BRIGHTNESS_CTRL 0x04
36#define LP8557_CONFIG 0x10
Milo Kim5812c132013-11-12 15:08:57 -080037#define LP8555_EPROM_START 0x10
38#define LP8555_EPROM_END 0x7A
Kim, Milo26e8ccc2013-02-21 16:44:06 -080039#define LP8557_EPROM_START 0x10
40#define LP8557_EPROM_END 0x1E
Kim, Milo7be865a2012-03-23 15:02:01 -070041
Kim, Milo7be865a2012-03-23 15:02:01 -070042#define DEFAULT_BL_NAME "lcd-backlight"
43#define MAX_BRIGHTNESS 255
44
Kim, Milo0b818572013-04-29 16:18:03 -070045enum lp855x_brightness_ctrl_mode {
46 PWM_BASED = 1,
47 REGISTER_BASED,
48};
49
Kim, Milo68853bc2013-02-21 16:44:05 -080050struct lp855x;
51
52/*
53 * struct lp855x_device_config
54 * @pre_init_device: init device function call before updating the brightness
55 * @reg_brightness: register address for brigthenss control
56 * @reg_devicectrl: register address for device control
57 * @post_init_device: late init device function call
58 */
59struct lp855x_device_config {
60 int (*pre_init_device)(struct lp855x *);
61 u8 reg_brightness;
62 u8 reg_devicectrl;
63 int (*post_init_device)(struct lp855x *);
64};
65
Kim, Milo7be865a2012-03-23 15:02:01 -070066struct lp855x {
67 const char *chipname;
68 enum lp855x_chip_id chip_id;
Kim, Milo0b818572013-04-29 16:18:03 -070069 enum lp855x_brightness_ctrl_mode mode;
Kim, Milo68853bc2013-02-21 16:44:05 -080070 struct lp855x_device_config *cfg;
Kim, Milo7be865a2012-03-23 15:02:01 -070071 struct i2c_client *client;
72 struct backlight_device *bl;
73 struct device *dev;
Kim, Milo7be865a2012-03-23 15:02:01 -070074 struct lp855x_platform_data *pdata;
Kim, Milo8cc97642012-12-17 16:00:43 -080075 struct pwm_device *pwm;
Milo Kimfe009172015-07-20 15:45:38 +090076 struct regulator *supply; /* regulator for VDD input */
Kim, Milo7be865a2012-03-23 15:02:01 -070077};
78
Kim, Milo7be865a2012-03-23 15:02:01 -070079static int lp855x_write_byte(struct lp855x *lp, u8 reg, u8 data)
80{
Kim, Miloeaa4d022012-12-17 16:00:45 -080081 return i2c_smbus_write_byte_data(lp->client, reg, data);
Kim, Milo7be865a2012-03-23 15:02:01 -070082}
83
Kim, Milo26e8ccc2013-02-21 16:44:06 -080084static int lp855x_update_bit(struct lp855x *lp, u8 reg, u8 mask, u8 data)
85{
86 int ret;
87 u8 tmp;
88
89 ret = i2c_smbus_read_byte_data(lp->client, reg);
90 if (ret < 0) {
91 dev_err(lp->dev, "failed to read 0x%.2x\n", reg);
92 return ret;
93 }
94
95 tmp = (u8)ret;
96 tmp &= ~mask;
97 tmp |= data & mask;
98
99 return lp855x_write_byte(lp, reg, tmp);
100}
101
Kim, Milo7be865a2012-03-23 15:02:01 -0700102static bool lp855x_is_valid_rom_area(struct lp855x *lp, u8 addr)
103{
104 u8 start, end;
105
106 switch (lp->chip_id) {
107 case LP8550:
108 case LP8551:
109 case LP8552:
110 case LP8553:
Kim, Milo26e8ccc2013-02-21 16:44:06 -0800111 start = LP855X_EEPROM_START;
112 end = LP855X_EEPROM_END;
Kim, Milo7be865a2012-03-23 15:02:01 -0700113 break;
114 case LP8556:
Kim, Milo26e8ccc2013-02-21 16:44:06 -0800115 start = LP8556_EPROM_START;
116 end = LP8556_EPROM_END;
117 break;
Milo Kim5812c132013-11-12 15:08:57 -0800118 case LP8555:
119 start = LP8555_EPROM_START;
120 end = LP8555_EPROM_END;
121 break;
Kim, Milo26e8ccc2013-02-21 16:44:06 -0800122 case LP8557:
123 start = LP8557_EPROM_START;
124 end = LP8557_EPROM_END;
Kim, Milo7be865a2012-03-23 15:02:01 -0700125 break;
126 default:
127 return false;
128 }
129
Jingoo Han2ce23862014-01-23 15:54:32 -0800130 return addr >= start && addr <= end;
Kim, Milo7be865a2012-03-23 15:02:01 -0700131}
132
Kim, Milo26e8ccc2013-02-21 16:44:06 -0800133static int lp8557_bl_off(struct lp855x *lp)
134{
135 /* BL_ON = 0 before updating EPROM settings */
136 return lp855x_update_bit(lp, LP8557_BL_CMD, LP8557_BL_MASK,
137 LP8557_BL_OFF);
138}
139
140static int lp8557_bl_on(struct lp855x *lp)
141{
142 /* BL_ON = 1 after updating EPROM settings */
143 return lp855x_update_bit(lp, LP8557_BL_CMD, LP8557_BL_MASK,
144 LP8557_BL_ON);
145}
146
Kim, Milo68853bc2013-02-21 16:44:05 -0800147static struct lp855x_device_config lp855x_dev_cfg = {
Kim, Milo26e8ccc2013-02-21 16:44:06 -0800148 .reg_brightness = LP855X_BRIGHTNESS_CTRL,
149 .reg_devicectrl = LP855X_DEVICE_CTRL,
150};
151
152static struct lp855x_device_config lp8557_dev_cfg = {
153 .reg_brightness = LP8557_BRIGHTNESS_CTRL,
154 .reg_devicectrl = LP8557_CONFIG,
155 .pre_init_device = lp8557_bl_off,
156 .post_init_device = lp8557_bl_on,
Kim, Milo68853bc2013-02-21 16:44:05 -0800157};
158
159/*
160 * Device specific configuration flow
161 *
162 * a) pre_init_device(optional)
163 * b) update the brightness register
164 * c) update device control register
165 * d) update ROM area(optional)
166 * e) post_init_device(optional)
167 *
168 */
169static int lp855x_configure(struct lp855x *lp)
Kim, Milo7be865a2012-03-23 15:02:01 -0700170{
171 u8 val, addr;
172 int i, ret;
173 struct lp855x_platform_data *pd = lp->pdata;
174
Kim, Milo68853bc2013-02-21 16:44:05 -0800175 switch (lp->chip_id) {
Milo Kim5812c132013-11-12 15:08:57 -0800176 case LP8550:
177 case LP8551:
178 case LP8552:
179 case LP8553:
180 case LP8556:
Kim, Milo68853bc2013-02-21 16:44:05 -0800181 lp->cfg = &lp855x_dev_cfg;
182 break;
Milo Kim5812c132013-11-12 15:08:57 -0800183 case LP8555:
Kim, Milo26e8ccc2013-02-21 16:44:06 -0800184 case LP8557:
185 lp->cfg = &lp8557_dev_cfg;
186 break;
Kim, Milo68853bc2013-02-21 16:44:05 -0800187 default:
188 return -EINVAL;
189 }
190
191 if (lp->cfg->pre_init_device) {
192 ret = lp->cfg->pre_init_device(lp);
193 if (ret) {
194 dev_err(lp->dev, "pre init device err: %d\n", ret);
195 goto err;
196 }
197 }
198
Kim, Milo7be865a2012-03-23 15:02:01 -0700199 val = pd->initial_brightness;
Kim, Milo68853bc2013-02-21 16:44:05 -0800200 ret = lp855x_write_byte(lp, lp->cfg->reg_brightness, val);
Kim, Milo7be865a2012-03-23 15:02:01 -0700201 if (ret)
Kim, Milo68853bc2013-02-21 16:44:05 -0800202 goto err;
Kim, Milo7be865a2012-03-23 15:02:01 -0700203
204 val = pd->device_control;
Kim, Milo68853bc2013-02-21 16:44:05 -0800205 ret = lp855x_write_byte(lp, lp->cfg->reg_devicectrl, val);
Kim, Milo7be865a2012-03-23 15:02:01 -0700206 if (ret)
Kim, Milo68853bc2013-02-21 16:44:05 -0800207 goto err;
Kim, Milo7be865a2012-03-23 15:02:01 -0700208
Kim, Miloc365e592013-04-29 16:18:05 -0700209 if (pd->size_program > 0) {
Kim, Milo7be865a2012-03-23 15:02:01 -0700210 for (i = 0; i < pd->size_program; i++) {
211 addr = pd->rom_data[i].addr;
212 val = pd->rom_data[i].val;
213 if (!lp855x_is_valid_rom_area(lp, addr))
214 continue;
215
216 ret = lp855x_write_byte(lp, addr, val);
217 if (ret)
Kim, Milo68853bc2013-02-21 16:44:05 -0800218 goto err;
Kim, Milo7be865a2012-03-23 15:02:01 -0700219 }
220 }
221
Kim, Milo68853bc2013-02-21 16:44:05 -0800222 if (lp->cfg->post_init_device) {
223 ret = lp->cfg->post_init_device(lp);
224 if (ret) {
225 dev_err(lp->dev, "post init device err: %d\n", ret);
226 goto err;
227 }
228 }
229
230 return 0;
231
232err:
Kim, Milo7be865a2012-03-23 15:02:01 -0700233 return ret;
234}
235
Kim, Milo8cc97642012-12-17 16:00:43 -0800236static void lp855x_pwm_ctrl(struct lp855x *lp, int br, int max_br)
237{
238 unsigned int period = lp->pdata->period_ns;
239 unsigned int duty = br * period / max_br;
240 struct pwm_device *pwm;
241
242 /* request pwm device with the consumer name */
243 if (!lp->pwm) {
244 pwm = devm_pwm_get(lp->dev, lp->chipname);
245 if (IS_ERR(pwm))
246 return;
247
248 lp->pwm = pwm;
Boris Brezillon6fbab832016-04-14 21:17:31 +0200249
250 /*
251 * FIXME: pwm_apply_args() should be removed when switching to
252 * the atomic PWM API.
253 */
254 pwm_apply_args(pwm);
Kim, Milo8cc97642012-12-17 16:00:43 -0800255 }
256
257 pwm_config(lp->pwm, duty, period);
258 if (duty)
259 pwm_enable(lp->pwm);
260 else
261 pwm_disable(lp->pwm);
262}
263
Kim, Milo7be865a2012-03-23 15:02:01 -0700264static int lp855x_bl_update_status(struct backlight_device *bl)
265{
266 struct lp855x *lp = bl_get_data(bl);
Sean Paul61c1c612015-05-11 13:32:05 -0700267 int brightness = bl->props.brightness;
Kim, Milo7be865a2012-03-23 15:02:01 -0700268
Shingo Nakao9f0a5112013-07-02 14:15:54 +0200269 if (bl->props.state & (BL_CORE_SUSPENDED | BL_CORE_FBBLANK))
Sean Paul61c1c612015-05-11 13:32:05 -0700270 brightness = 0;
Kim, Milo7be865a2012-03-23 15:02:01 -0700271
Sean Paul61c1c612015-05-11 13:32:05 -0700272 if (lp->mode == PWM_BASED)
273 lp855x_pwm_ctrl(lp, brightness, bl->props.max_brightness);
274 else if (lp->mode == REGISTER_BASED)
275 lp855x_write_byte(lp, lp->cfg->reg_brightness, (u8)brightness);
Kim, Milo7be865a2012-03-23 15:02:01 -0700276
277 return 0;
278}
279
Kim, Milo7be865a2012-03-23 15:02:01 -0700280static const struct backlight_ops lp855x_bl_ops = {
281 .options = BL_CORE_SUSPENDRESUME,
282 .update_status = lp855x_bl_update_status,
Kim, Milo7be865a2012-03-23 15:02:01 -0700283};
284
285static int lp855x_backlight_register(struct lp855x *lp)
286{
287 struct backlight_device *bl;
288 struct backlight_properties props;
289 struct lp855x_platform_data *pdata = lp->pdata;
Kim, Milo600ffd32013-04-29 16:18:02 -0700290 const char *name = pdata->name ? : DEFAULT_BL_NAME;
Kim, Milo7be865a2012-03-23 15:02:01 -0700291
Werner Johansson9f7898f2015-08-27 10:41:15 -0700292 memset(&props, 0, sizeof(props));
Kim, Milo7be865a2012-03-23 15:02:01 -0700293 props.type = BACKLIGHT_PLATFORM;
294 props.max_brightness = MAX_BRIGHTNESS;
295
296 if (pdata->initial_brightness > props.max_brightness)
297 pdata->initial_brightness = props.max_brightness;
298
299 props.brightness = pdata->initial_brightness;
300
Jingoo Han6255e8e2013-11-12 15:09:19 -0800301 bl = devm_backlight_device_register(lp->dev, name, lp->dev, lp,
Kim, Milo7be865a2012-03-23 15:02:01 -0700302 &lp855x_bl_ops, &props);
303 if (IS_ERR(bl))
304 return PTR_ERR(bl);
305
306 lp->bl = bl;
307
308 return 0;
309}
310
Kim, Milo7be865a2012-03-23 15:02:01 -0700311static ssize_t lp855x_get_chip_id(struct device *dev,
312 struct device_attribute *attr, char *buf)
313{
314 struct lp855x *lp = dev_get_drvdata(dev);
Jingoo Hana94cb122014-08-27 10:12:53 +0900315
Kim, Milo6a7aeb12013-04-29 16:17:52 -0700316 return scnprintf(buf, PAGE_SIZE, "%s\n", lp->chipname);
Kim, Milo7be865a2012-03-23 15:02:01 -0700317}
318
319static ssize_t lp855x_get_bl_ctl_mode(struct device *dev,
320 struct device_attribute *attr, char *buf)
321{
322 struct lp855x *lp = dev_get_drvdata(dev);
Kim, Milo7be865a2012-03-23 15:02:01 -0700323 char *strmode = NULL;
324
Kim, Milo0b818572013-04-29 16:18:03 -0700325 if (lp->mode == PWM_BASED)
Kim, Milo7be865a2012-03-23 15:02:01 -0700326 strmode = "pwm based";
Kim, Milo0b818572013-04-29 16:18:03 -0700327 else if (lp->mode == REGISTER_BASED)
Kim, Milo7be865a2012-03-23 15:02:01 -0700328 strmode = "register based";
329
Kim, Milo6a7aeb12013-04-29 16:17:52 -0700330 return scnprintf(buf, PAGE_SIZE, "%s\n", strmode);
Kim, Milo7be865a2012-03-23 15:02:01 -0700331}
332
333static DEVICE_ATTR(chip_id, S_IRUGO, lp855x_get_chip_id, NULL);
334static DEVICE_ATTR(bl_ctl_mode, S_IRUGO, lp855x_get_bl_ctl_mode, NULL);
335
336static struct attribute *lp855x_attributes[] = {
337 &dev_attr_chip_id.attr,
338 &dev_attr_bl_ctl_mode.attr,
339 NULL,
340};
341
342static const struct attribute_group lp855x_attr_group = {
343 .attrs = lp855x_attributes,
344};
345
Kim, Milo4add0662013-04-29 16:18:06 -0700346#ifdef CONFIG_OF
Sean Paul47726652014-12-02 17:39:11 -0800347static int lp855x_parse_dt(struct lp855x *lp)
Kim, Milo4add0662013-04-29 16:18:06 -0700348{
Sean Paul47726652014-12-02 17:39:11 -0800349 struct device *dev = lp->dev;
350 struct device_node *node = dev->of_node;
Kim, Milo4add0662013-04-29 16:18:06 -0700351 struct lp855x_platform_data *pdata;
352 int rom_length;
353
354 if (!node) {
355 dev_err(dev, "no platform data\n");
356 return -EINVAL;
357 }
358
359 pdata = devm_kzalloc(dev, sizeof(*pdata), GFP_KERNEL);
360 if (!pdata)
361 return -ENOMEM;
362
363 of_property_read_string(node, "bl-name", &pdata->name);
364 of_property_read_u8(node, "dev-ctrl", &pdata->device_control);
365 of_property_read_u8(node, "init-brt", &pdata->initial_brightness);
366 of_property_read_u32(node, "pwm-period", &pdata->period_ns);
367
368 /* Fill ROM platform data if defined */
369 rom_length = of_get_child_count(node);
370 if (rom_length > 0) {
371 struct lp855x_rom_data *rom;
372 struct device_node *child;
373 int i = 0;
374
375 rom = devm_kzalloc(dev, sizeof(*rom) * rom_length, GFP_KERNEL);
376 if (!rom)
377 return -ENOMEM;
378
379 for_each_child_of_node(node, child) {
380 of_property_read_u8(child, "rom-addr", &rom[i].addr);
381 of_property_read_u8(child, "rom-val", &rom[i].val);
382 i++;
383 }
384
385 pdata->size_program = rom_length;
386 pdata->rom_data = &rom[0];
387 }
388
Sean Paul47726652014-12-02 17:39:11 -0800389 lp->pdata = pdata;
Kim, Milo4add0662013-04-29 16:18:06 -0700390
391 return 0;
392}
393#else
Sean Paul47726652014-12-02 17:39:11 -0800394static int lp855x_parse_dt(struct lp855x *lp)
Kim, Milo4add0662013-04-29 16:18:06 -0700395{
396 return -EINVAL;
397}
398#endif
399
Kim, Milo7be865a2012-03-23 15:02:01 -0700400static int lp855x_probe(struct i2c_client *cl, const struct i2c_device_id *id)
401{
402 struct lp855x *lp;
Kim, Milo7be865a2012-03-23 15:02:01 -0700403 int ret;
404
Kim, Milo7be865a2012-03-23 15:02:01 -0700405 if (!i2c_check_functionality(cl->adapter, I2C_FUNC_SMBUS_I2C_BLOCK))
406 return -EIO;
407
408 lp = devm_kzalloc(&cl->dev, sizeof(struct lp855x), GFP_KERNEL);
409 if (!lp)
410 return -ENOMEM;
411
Sean Paul47726652014-12-02 17:39:11 -0800412 lp->client = cl;
413 lp->dev = &cl->dev;
414 lp->chipname = id->name;
415 lp->chip_id = id->driver_data;
416 lp->pdata = dev_get_platdata(&cl->dev);
417
418 if (!lp->pdata) {
419 ret = lp855x_parse_dt(lp);
420 if (ret < 0)
421 return ret;
422 }
423
424 if (lp->pdata->period_ns > 0)
Kim, Milo0b818572013-04-29 16:18:03 -0700425 lp->mode = PWM_BASED;
426 else
427 lp->mode = REGISTER_BASED;
428
Milo Kimfe009172015-07-20 15:45:38 +0900429 lp->supply = devm_regulator_get(lp->dev, "power");
430 if (IS_ERR(lp->supply)) {
431 if (PTR_ERR(lp->supply) == -EPROBE_DEFER)
432 return -EPROBE_DEFER;
433 lp->supply = NULL;
434 }
435
436 if (lp->supply) {
437 ret = regulator_enable(lp->supply);
Sean Paul829b0302014-12-02 17:39:12 -0800438 if (ret < 0) {
439 dev_err(&cl->dev, "failed to enable supply: %d\n", ret);
440 return ret;
441 }
442 }
443
Kim, Milo7be865a2012-03-23 15:02:01 -0700444 i2c_set_clientdata(cl, lp);
445
Kim, Milo68853bc2013-02-21 16:44:05 -0800446 ret = lp855x_configure(lp);
Kim, Milo7be865a2012-03-23 15:02:01 -0700447 if (ret) {
Kim, Milo68853bc2013-02-21 16:44:05 -0800448 dev_err(lp->dev, "device config err: %d", ret);
Jingoo Han6255e8e2013-11-12 15:09:19 -0800449 return ret;
Kim, Milo7be865a2012-03-23 15:02:01 -0700450 }
451
452 ret = lp855x_backlight_register(lp);
453 if (ret) {
454 dev_err(lp->dev,
455 "failed to register backlight. err: %d\n", ret);
Jingoo Han6255e8e2013-11-12 15:09:19 -0800456 return ret;
Kim, Milo7be865a2012-03-23 15:02:01 -0700457 }
458
459 ret = sysfs_create_group(&lp->dev->kobj, &lp855x_attr_group);
460 if (ret) {
461 dev_err(lp->dev, "failed to register sysfs. err: %d\n", ret);
Jingoo Han6255e8e2013-11-12 15:09:19 -0800462 return ret;
Kim, Milo7be865a2012-03-23 15:02:01 -0700463 }
464
465 backlight_update_status(lp->bl);
466 return 0;
Kim, Milo7be865a2012-03-23 15:02:01 -0700467}
468
Bill Pemberton7e4b9d02012-11-19 13:26:34 -0500469static int lp855x_remove(struct i2c_client *cl)
Kim, Milo7be865a2012-03-23 15:02:01 -0700470{
471 struct lp855x *lp = i2c_get_clientdata(cl);
472
473 lp->bl->props.brightness = 0;
474 backlight_update_status(lp->bl);
Milo Kimfe009172015-07-20 15:45:38 +0900475 if (lp->supply)
476 regulator_disable(lp->supply);
Kim, Milo7be865a2012-03-23 15:02:01 -0700477 sysfs_remove_group(&lp->dev->kobj, &lp855x_attr_group);
Kim, Milo7be865a2012-03-23 15:02:01 -0700478
479 return 0;
480}
481
Kim, Milo4add0662013-04-29 16:18:06 -0700482static const struct of_device_id lp855x_dt_ids[] = {
483 { .compatible = "ti,lp8550", },
484 { .compatible = "ti,lp8551", },
485 { .compatible = "ti,lp8552", },
486 { .compatible = "ti,lp8553", },
Milo Kim5812c132013-11-12 15:08:57 -0800487 { .compatible = "ti,lp8555", },
Kim, Milo4add0662013-04-29 16:18:06 -0700488 { .compatible = "ti,lp8556", },
489 { .compatible = "ti,lp8557", },
490 { }
491};
492MODULE_DEVICE_TABLE(of, lp855x_dt_ids);
493
Kim, Milo7be865a2012-03-23 15:02:01 -0700494static const struct i2c_device_id lp855x_ids[] = {
495 {"lp8550", LP8550},
496 {"lp8551", LP8551},
497 {"lp8552", LP8552},
498 {"lp8553", LP8553},
Milo Kim5812c132013-11-12 15:08:57 -0800499 {"lp8555", LP8555},
Kim, Milo7be865a2012-03-23 15:02:01 -0700500 {"lp8556", LP8556},
Kim, Milo26e8ccc2013-02-21 16:44:06 -0800501 {"lp8557", LP8557},
Kim, Milo7be865a2012-03-23 15:02:01 -0700502 { }
503};
504MODULE_DEVICE_TABLE(i2c, lp855x_ids);
505
506static struct i2c_driver lp855x_driver = {
507 .driver = {
508 .name = "lp855x",
Kim, Milo4add0662013-04-29 16:18:06 -0700509 .of_match_table = of_match_ptr(lp855x_dt_ids),
Kim, Milo7be865a2012-03-23 15:02:01 -0700510 },
511 .probe = lp855x_probe,
Bill Pembertond1723fa2012-11-19 13:21:09 -0500512 .remove = lp855x_remove,
Kim, Milo7be865a2012-03-23 15:02:01 -0700513 .id_table = lp855x_ids,
514};
515
516module_i2c_driver(lp855x_driver);
517
518MODULE_DESCRIPTION("Texas Instruments LP855x Backlight driver");
519MODULE_AUTHOR("Milo Kim <milo.kim@ti.com>");
520MODULE_LICENSE("GPL");