leds-lp5521.c 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608
  1. /*
  2. * LP5521 LED chip driver.
  3. *
  4. * Copyright (C) 2010 Nokia Corporation
  5. * Copyright (C) 2012 Texas Instruments
  6. *
  7. * Contact: Samu Onkalo <samu.p.onkalo@nokia.com>
  8. * Milo(Woogyom) Kim <milo.kim@ti.com>
  9. *
  10. * This program is free software; you can redistribute it and/or
  11. * modify it under the terms of the GNU General Public License
  12. * version 2 as published by the Free Software Foundation.
  13. *
  14. * This program is distributed in the hope that it will be useful, but
  15. * WITHOUT ANY WARRANTY; without even the implied warranty of
  16. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  17. * General Public License for more details.
  18. *
  19. * You should have received a copy of the GNU General Public License
  20. * along with this program; if not, write to the Free Software
  21. * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
  22. * 02110-1301 USA
  23. */
  24. #include <linux/delay.h>
  25. #include <linux/firmware.h>
  26. #include <linux/i2c.h>
  27. #include <linux/init.h>
  28. #include <linux/leds.h>
  29. #include <linux/module.h>
  30. #include <linux/mutex.h>
  31. #include <linux/platform_data/leds-lp55xx.h>
  32. #include <linux/slab.h>
  33. #include <linux/of.h>
  34. #include "leds-lp55xx-common.h"
  35. #define LP5521_PROGRAM_LENGTH 32
  36. #define LP5521_MAX_LEDS 3
  37. #define LP5521_CMD_DIRECT 0x3F
  38. /* Registers */
  39. #define LP5521_REG_ENABLE 0x00
  40. #define LP5521_REG_OP_MODE 0x01
  41. #define LP5521_REG_R_PWM 0x02
  42. #define LP5521_REG_G_PWM 0x03
  43. #define LP5521_REG_B_PWM 0x04
  44. #define LP5521_REG_R_CURRENT 0x05
  45. #define LP5521_REG_G_CURRENT 0x06
  46. #define LP5521_REG_B_CURRENT 0x07
  47. #define LP5521_REG_CONFIG 0x08
  48. #define LP5521_REG_STATUS 0x0C
  49. #define LP5521_REG_RESET 0x0D
  50. #define LP5521_REG_R_PROG_MEM 0x10
  51. #define LP5521_REG_G_PROG_MEM 0x30
  52. #define LP5521_REG_B_PROG_MEM 0x50
  53. /* Base register to set LED current */
  54. #define LP5521_REG_LED_CURRENT_BASE LP5521_REG_R_CURRENT
  55. /* Base register to set the brightness */
  56. #define LP5521_REG_LED_PWM_BASE LP5521_REG_R_PWM
  57. /* Bits in ENABLE register */
  58. #define LP5521_MASTER_ENABLE 0x40 /* Chip master enable */
  59. #define LP5521_LOGARITHMIC_PWM 0x80 /* Logarithmic PWM adjustment */
  60. #define LP5521_EXEC_RUN 0x2A
  61. #define LP5521_ENABLE_DEFAULT \
  62. (LP5521_MASTER_ENABLE | LP5521_LOGARITHMIC_PWM)
  63. #define LP5521_ENABLE_RUN_PROGRAM \
  64. (LP5521_ENABLE_DEFAULT | LP5521_EXEC_RUN)
  65. /* CONFIG register */
  66. #define LP5521_PWM_HF 0x40 /* PWM: 0 = 256Hz, 1 = 558Hz */
  67. #define LP5521_PWRSAVE_EN 0x20 /* 1 = Power save mode */
  68. #define LP5521_CP_MODE_OFF 0 /* Charge pump (CP) off */
  69. #define LP5521_CP_MODE_BYPASS 8 /* CP forced to bypass mode */
  70. #define LP5521_CP_MODE_1X5 0x10 /* CP forced to 1.5x mode */
  71. #define LP5521_CP_MODE_AUTO 0x18 /* Automatic mode selection */
  72. #define LP5521_R_TO_BATT 0x04 /* R out: 0 = CP, 1 = Vbat */
  73. #define LP5521_CLK_INT 0x01 /* Internal clock */
  74. #define LP5521_DEFAULT_CFG \
  75. (LP5521_PWM_HF | LP5521_PWRSAVE_EN | LP5521_CP_MODE_AUTO)
  76. /* Status */
  77. #define LP5521_EXT_CLK_USED 0x08
  78. /* default R channel current register value */
  79. #define LP5521_REG_R_CURR_DEFAULT 0xAF
  80. /* Reset register value */
  81. #define LP5521_RESET 0xFF
  82. /* Program Memory Operations */
  83. #define LP5521_MODE_R_M 0x30 /* Operation Mode Register */
  84. #define LP5521_MODE_G_M 0x0C
  85. #define LP5521_MODE_B_M 0x03
  86. #define LP5521_LOAD_R 0x10
  87. #define LP5521_LOAD_G 0x04
  88. #define LP5521_LOAD_B 0x01
  89. #define LP5521_R_IS_LOADING(mode) \
  90. ((mode & LP5521_MODE_R_M) == LP5521_LOAD_R)
  91. #define LP5521_G_IS_LOADING(mode) \
  92. ((mode & LP5521_MODE_G_M) == LP5521_LOAD_G)
  93. #define LP5521_B_IS_LOADING(mode) \
  94. ((mode & LP5521_MODE_B_M) == LP5521_LOAD_B)
  95. #define LP5521_EXEC_R_M 0x30 /* Enable Register */
  96. #define LP5521_EXEC_G_M 0x0C
  97. #define LP5521_EXEC_B_M 0x03
  98. #define LP5521_EXEC_M 0x3F
  99. #define LP5521_RUN_R 0x20
  100. #define LP5521_RUN_G 0x08
  101. #define LP5521_RUN_B 0x02
  102. static inline void lp5521_wait_opmode_done(void)
  103. {
  104. /* operation mode change needs to be longer than 153 us */
  105. usleep_range(200, 300);
  106. }
  107. static inline void lp5521_wait_enable_done(void)
  108. {
  109. /* it takes more 488 us to update ENABLE register */
  110. usleep_range(500, 600);
  111. }
  112. static void lp5521_set_led_current(struct lp55xx_led *led, u8 led_current)
  113. {
  114. led->led_current = led_current;
  115. lp55xx_write(led->chip, LP5521_REG_LED_CURRENT_BASE + led->chan_nr,
  116. led_current);
  117. }
  118. static void lp5521_load_engine(struct lp55xx_chip *chip)
  119. {
  120. enum lp55xx_engine_index idx = chip->engine_idx;
  121. u8 mask[] = {
  122. [LP55XX_ENGINE_1] = LP5521_MODE_R_M,
  123. [LP55XX_ENGINE_2] = LP5521_MODE_G_M,
  124. [LP55XX_ENGINE_3] = LP5521_MODE_B_M,
  125. };
  126. u8 val[] = {
  127. [LP55XX_ENGINE_1] = LP5521_LOAD_R,
  128. [LP55XX_ENGINE_2] = LP5521_LOAD_G,
  129. [LP55XX_ENGINE_3] = LP5521_LOAD_B,
  130. };
  131. lp55xx_update_bits(chip, LP5521_REG_OP_MODE, mask[idx], val[idx]);
  132. lp5521_wait_opmode_done();
  133. }
  134. static void lp5521_stop_engine(struct lp55xx_chip *chip)
  135. {
  136. lp55xx_write(chip, LP5521_REG_OP_MODE, 0);
  137. lp5521_wait_opmode_done();
  138. }
  139. static void lp5521_run_engine(struct lp55xx_chip *chip, bool start)
  140. {
  141. int ret;
  142. u8 mode;
  143. u8 exec;
  144. /* stop engine */
  145. if (!start) {
  146. lp5521_stop_engine(chip);
  147. lp55xx_write(chip, LP5521_REG_OP_MODE, LP5521_CMD_DIRECT);
  148. lp5521_wait_opmode_done();
  149. return;
  150. }
  151. /*
  152. * To run the engine,
  153. * operation mode and enable register should updated at the same time
  154. */
  155. ret = lp55xx_read(chip, LP5521_REG_OP_MODE, &mode);
  156. if (ret)
  157. return;
  158. ret = lp55xx_read(chip, LP5521_REG_ENABLE, &exec);
  159. if (ret)
  160. return;
  161. /* change operation mode to RUN only when each engine is loading */
  162. if (LP5521_R_IS_LOADING(mode)) {
  163. mode = (mode & ~LP5521_MODE_R_M) | LP5521_RUN_R;
  164. exec = (exec & ~LP5521_EXEC_R_M) | LP5521_RUN_R;
  165. }
  166. if (LP5521_G_IS_LOADING(mode)) {
  167. mode = (mode & ~LP5521_MODE_G_M) | LP5521_RUN_G;
  168. exec = (exec & ~LP5521_EXEC_G_M) | LP5521_RUN_G;
  169. }
  170. if (LP5521_B_IS_LOADING(mode)) {
  171. mode = (mode & ~LP5521_MODE_B_M) | LP5521_RUN_B;
  172. exec = (exec & ~LP5521_EXEC_B_M) | LP5521_RUN_B;
  173. }
  174. lp55xx_write(chip, LP5521_REG_OP_MODE, mode);
  175. lp5521_wait_opmode_done();
  176. lp55xx_update_bits(chip, LP5521_REG_ENABLE, LP5521_EXEC_M, exec);
  177. lp5521_wait_enable_done();
  178. }
  179. static int lp5521_update_program_memory(struct lp55xx_chip *chip,
  180. const u8 *data, size_t size)
  181. {
  182. enum lp55xx_engine_index idx = chip->engine_idx;
  183. u8 pattern[LP5521_PROGRAM_LENGTH] = {0};
  184. u8 addr[] = {
  185. [LP55XX_ENGINE_1] = LP5521_REG_R_PROG_MEM,
  186. [LP55XX_ENGINE_2] = LP5521_REG_G_PROG_MEM,
  187. [LP55XX_ENGINE_3] = LP5521_REG_B_PROG_MEM,
  188. };
  189. unsigned cmd;
  190. char c[3];
  191. int nrchars;
  192. int ret;
  193. int offset = 0;
  194. int i = 0;
  195. while ((offset < size - 1) && (i < LP5521_PROGRAM_LENGTH)) {
  196. /* separate sscanfs because length is working only for %s */
  197. ret = sscanf(data + offset, "%2s%n ", c, &nrchars);
  198. if (ret != 1)
  199. goto err;
  200. ret = sscanf(c, "%2x", &cmd);
  201. if (ret != 1)
  202. goto err;
  203. pattern[i] = (u8)cmd;
  204. offset += nrchars;
  205. i++;
  206. }
  207. /* Each instruction is 16bit long. Check that length is even */
  208. if (i % 2)
  209. goto err;
  210. mutex_lock(&chip->lock);
  211. for (i = 0; i < LP5521_PROGRAM_LENGTH; i++) {
  212. ret = lp55xx_write(chip, addr[idx] + i, pattern[i]);
  213. if (ret) {
  214. mutex_unlock(&chip->lock);
  215. return -EINVAL;
  216. }
  217. }
  218. mutex_unlock(&chip->lock);
  219. return size;
  220. err:
  221. dev_err(&chip->cl->dev, "wrong pattern format\n");
  222. return -EINVAL;
  223. }
  224. static void lp5521_firmware_loaded(struct lp55xx_chip *chip)
  225. {
  226. const struct firmware *fw = chip->fw;
  227. if (fw->size > LP5521_PROGRAM_LENGTH) {
  228. dev_err(&chip->cl->dev, "firmware data size overflow: %zu\n",
  229. fw->size);
  230. return;
  231. }
  232. /*
  233. * Program momery sequence
  234. * 1) set engine mode to "LOAD"
  235. * 2) write firmware data into program memory
  236. */
  237. lp5521_load_engine(chip);
  238. lp5521_update_program_memory(chip, fw->data, fw->size);
  239. }
  240. static int lp5521_post_init_device(struct lp55xx_chip *chip)
  241. {
  242. int ret;
  243. u8 val;
  244. /*
  245. * Make sure that the chip is reset by reading back the r channel
  246. * current reg. This is dummy read is required on some platforms -
  247. * otherwise further access to the R G B channels in the
  248. * LP5521_REG_ENABLE register will not have any effect - strange!
  249. */
  250. ret = lp55xx_read(chip, LP5521_REG_R_CURRENT, &val);
  251. if (ret) {
  252. dev_err(&chip->cl->dev, "error in resetting chip\n");
  253. return ret;
  254. }
  255. if (val != LP5521_REG_R_CURR_DEFAULT) {
  256. dev_err(&chip->cl->dev,
  257. "unexpected data in register (expected 0x%x got 0x%x)\n",
  258. LP5521_REG_R_CURR_DEFAULT, val);
  259. ret = -EINVAL;
  260. return ret;
  261. }
  262. usleep_range(10000, 20000);
  263. /* Set all PWMs to direct control mode */
  264. ret = lp55xx_write(chip, LP5521_REG_OP_MODE, LP5521_CMD_DIRECT);
  265. /* Update configuration for the clock setting */
  266. val = LP5521_DEFAULT_CFG;
  267. if (!lp55xx_is_extclk_used(chip))
  268. val |= LP5521_CLK_INT;
  269. ret = lp55xx_write(chip, LP5521_REG_CONFIG, val);
  270. if (ret)
  271. return ret;
  272. /* Initialize all channels PWM to zero -> leds off */
  273. lp55xx_write(chip, LP5521_REG_R_PWM, 0);
  274. lp55xx_write(chip, LP5521_REG_G_PWM, 0);
  275. lp55xx_write(chip, LP5521_REG_B_PWM, 0);
  276. /* Set engines are set to run state when OP_MODE enables engines */
  277. ret = lp55xx_write(chip, LP5521_REG_ENABLE, LP5521_ENABLE_RUN_PROGRAM);
  278. if (ret)
  279. return ret;
  280. lp5521_wait_enable_done();
  281. return 0;
  282. }
  283. static int lp5521_run_selftest(struct lp55xx_chip *chip, char *buf)
  284. {
  285. struct lp55xx_platform_data *pdata = chip->pdata;
  286. int ret;
  287. u8 status;
  288. ret = lp55xx_read(chip, LP5521_REG_STATUS, &status);
  289. if (ret < 0)
  290. return ret;
  291. if (pdata->clock_mode != LP55XX_CLOCK_EXT)
  292. return 0;
  293. /* Check that ext clock is really in use if requested */
  294. if ((status & LP5521_EXT_CLK_USED) == 0)
  295. return -EIO;
  296. return 0;
  297. }
  298. static void lp5521_led_brightness_work(struct work_struct *work)
  299. {
  300. struct lp55xx_led *led = container_of(work, struct lp55xx_led,
  301. brightness_work);
  302. struct lp55xx_chip *chip = led->chip;
  303. mutex_lock(&chip->lock);
  304. lp55xx_write(chip, LP5521_REG_LED_PWM_BASE + led->chan_nr,
  305. led->brightness);
  306. mutex_unlock(&chip->lock);
  307. }
  308. static ssize_t show_engine_mode(struct device *dev,
  309. struct device_attribute *attr,
  310. char *buf, int nr)
  311. {
  312. struct lp55xx_led *led = i2c_get_clientdata(to_i2c_client(dev));
  313. struct lp55xx_chip *chip = led->chip;
  314. enum lp55xx_engine_mode mode = chip->engines[nr - 1].mode;
  315. switch (mode) {
  316. case LP55XX_ENGINE_RUN:
  317. return sprintf(buf, "run\n");
  318. case LP55XX_ENGINE_LOAD:
  319. return sprintf(buf, "load\n");
  320. case LP55XX_ENGINE_DISABLED:
  321. default:
  322. return sprintf(buf, "disabled\n");
  323. }
  324. }
  325. show_mode(1)
  326. show_mode(2)
  327. show_mode(3)
  328. static ssize_t store_engine_mode(struct device *dev,
  329. struct device_attribute *attr,
  330. const char *buf, size_t len, int nr)
  331. {
  332. struct lp55xx_led *led = i2c_get_clientdata(to_i2c_client(dev));
  333. struct lp55xx_chip *chip = led->chip;
  334. struct lp55xx_engine *engine = &chip->engines[nr - 1];
  335. mutex_lock(&chip->lock);
  336. chip->engine_idx = nr;
  337. if (!strncmp(buf, "run", 3)) {
  338. lp5521_run_engine(chip, true);
  339. engine->mode = LP55XX_ENGINE_RUN;
  340. } else if (!strncmp(buf, "load", 4)) {
  341. lp5521_stop_engine(chip);
  342. lp5521_load_engine(chip);
  343. engine->mode = LP55XX_ENGINE_LOAD;
  344. } else if (!strncmp(buf, "disabled", 8)) {
  345. lp5521_stop_engine(chip);
  346. engine->mode = LP55XX_ENGINE_DISABLED;
  347. }
  348. mutex_unlock(&chip->lock);
  349. return len;
  350. }
  351. store_mode(1)
  352. store_mode(2)
  353. store_mode(3)
  354. static ssize_t store_engine_load(struct device *dev,
  355. struct device_attribute *attr,
  356. const char *buf, size_t len, int nr)
  357. {
  358. struct lp55xx_led *led = i2c_get_clientdata(to_i2c_client(dev));
  359. struct lp55xx_chip *chip = led->chip;
  360. mutex_lock(&chip->lock);
  361. chip->engine_idx = nr;
  362. lp5521_load_engine(chip);
  363. mutex_unlock(&chip->lock);
  364. return lp5521_update_program_memory(chip, buf, len);
  365. }
  366. store_load(1)
  367. store_load(2)
  368. store_load(3)
  369. static ssize_t lp5521_selftest(struct device *dev,
  370. struct device_attribute *attr,
  371. char *buf)
  372. {
  373. struct lp55xx_led *led = i2c_get_clientdata(to_i2c_client(dev));
  374. struct lp55xx_chip *chip = led->chip;
  375. int ret;
  376. mutex_lock(&chip->lock);
  377. ret = lp5521_run_selftest(chip, buf);
  378. mutex_unlock(&chip->lock);
  379. return scnprintf(buf, PAGE_SIZE, "%s\n", ret ? "FAIL" : "OK");
  380. }
  381. /* device attributes */
  382. static LP55XX_DEV_ATTR_RW(engine1_mode, show_engine1_mode, store_engine1_mode);
  383. static LP55XX_DEV_ATTR_RW(engine2_mode, show_engine2_mode, store_engine2_mode);
  384. static LP55XX_DEV_ATTR_RW(engine3_mode, show_engine3_mode, store_engine3_mode);
  385. static LP55XX_DEV_ATTR_WO(engine1_load, store_engine1_load);
  386. static LP55XX_DEV_ATTR_WO(engine2_load, store_engine2_load);
  387. static LP55XX_DEV_ATTR_WO(engine3_load, store_engine3_load);
  388. static LP55XX_DEV_ATTR_RO(selftest, lp5521_selftest);
  389. static struct attribute *lp5521_attributes[] = {
  390. &dev_attr_engine1_mode.attr,
  391. &dev_attr_engine2_mode.attr,
  392. &dev_attr_engine3_mode.attr,
  393. &dev_attr_engine1_load.attr,
  394. &dev_attr_engine2_load.attr,
  395. &dev_attr_engine3_load.attr,
  396. &dev_attr_selftest.attr,
  397. NULL
  398. };
  399. static const struct attribute_group lp5521_group = {
  400. .attrs = lp5521_attributes,
  401. };
  402. /* Chip specific configurations */
  403. static struct lp55xx_device_config lp5521_cfg = {
  404. .reset = {
  405. .addr = LP5521_REG_RESET,
  406. .val = LP5521_RESET,
  407. },
  408. .enable = {
  409. .addr = LP5521_REG_ENABLE,
  410. .val = LP5521_ENABLE_DEFAULT,
  411. },
  412. .max_channel = LP5521_MAX_LEDS,
  413. .post_init_device = lp5521_post_init_device,
  414. .brightness_work_fn = lp5521_led_brightness_work,
  415. .set_led_current = lp5521_set_led_current,
  416. .firmware_cb = lp5521_firmware_loaded,
  417. .run_engine = lp5521_run_engine,
  418. .dev_attr_group = &lp5521_group,
  419. };
  420. static int lp5521_probe(struct i2c_client *client,
  421. const struct i2c_device_id *id)
  422. {
  423. int ret;
  424. struct lp55xx_chip *chip;
  425. struct lp55xx_led *led;
  426. struct lp55xx_platform_data *pdata;
  427. struct device_node *np = client->dev.of_node;
  428. if (!dev_get_platdata(&client->dev)) {
  429. if (np) {
  430. ret = lp55xx_of_populate_pdata(&client->dev, np);
  431. if (ret < 0)
  432. return ret;
  433. } else {
  434. dev_err(&client->dev, "no platform data\n");
  435. return -EINVAL;
  436. }
  437. }
  438. pdata = dev_get_platdata(&client->dev);
  439. chip = devm_kzalloc(&client->dev, sizeof(*chip), GFP_KERNEL);
  440. if (!chip)
  441. return -ENOMEM;
  442. led = devm_kzalloc(&client->dev,
  443. sizeof(*led) * pdata->num_channels, GFP_KERNEL);
  444. if (!led)
  445. return -ENOMEM;
  446. chip->cl = client;
  447. chip->pdata = pdata;
  448. chip->cfg = &lp5521_cfg;
  449. mutex_init(&chip->lock);
  450. i2c_set_clientdata(client, led);
  451. ret = lp55xx_init_device(chip);
  452. if (ret)
  453. goto err_init;
  454. dev_info(&client->dev, "%s programmable led chip found\n", id->name);
  455. ret = lp55xx_register_leds(led, chip);
  456. if (ret)
  457. goto err_register_leds;
  458. ret = lp55xx_register_sysfs(chip);
  459. if (ret) {
  460. dev_err(&client->dev, "registering sysfs failed\n");
  461. goto err_register_sysfs;
  462. }
  463. return 0;
  464. err_register_sysfs:
  465. lp55xx_unregister_leds(led, chip);
  466. err_register_leds:
  467. lp55xx_deinit_device(chip);
  468. err_init:
  469. return ret;
  470. }
  471. static int lp5521_remove(struct i2c_client *client)
  472. {
  473. struct lp55xx_led *led = i2c_get_clientdata(client);
  474. struct lp55xx_chip *chip = led->chip;
  475. lp5521_stop_engine(chip);
  476. lp55xx_unregister_sysfs(chip);
  477. lp55xx_unregister_leds(led, chip);
  478. lp55xx_deinit_device(chip);
  479. return 0;
  480. }
  481. static const struct i2c_device_id lp5521_id[] = {
  482. { "lp5521", 0 }, /* Three channel chip */
  483. { }
  484. };
  485. MODULE_DEVICE_TABLE(i2c, lp5521_id);
  486. #ifdef CONFIG_OF
  487. static const struct of_device_id of_lp5521_leds_match[] = {
  488. { .compatible = "national,lp5521", },
  489. {},
  490. };
  491. MODULE_DEVICE_TABLE(of, of_lp5521_leds_match);
  492. #endif
  493. static struct i2c_driver lp5521_driver = {
  494. .driver = {
  495. .name = "lp5521",
  496. .of_match_table = of_match_ptr(of_lp5521_leds_match),
  497. },
  498. .probe = lp5521_probe,
  499. .remove = lp5521_remove,
  500. .id_table = lp5521_id,
  501. };
  502. module_i2c_driver(lp5521_driver);
  503. MODULE_AUTHOR("Mathias Nyman, Yuri Zaporozhets, Samu Onkalo");
  504. MODULE_AUTHOR("Milo Kim <milo.kim@ti.com>");
  505. MODULE_DESCRIPTION("LP5521 LED engine");
  506. MODULE_LICENSE("GPL v2");