blob: 321bec6e3f8dfed983ba38ee959149c3a36ab8b6 [file] [log] [blame]
Thomas Gleixnerd2912cb2019-06-04 10:11:33 +02001// SPDX-License-Identifier: GPL-2.0-only
Daniel Jeongb59320c2012-12-17 10:24:06 +09002/*
3 * LP8755 High Performance Power Management Unit : System Interface Driver
4 * (based on rev. 0.26)
5 * Copyright 2012 Texas Instruments
6 *
7 * Author: Daniel(Geon Si) Jeong <daniel.jeong@ti.com>
Daniel Jeongb59320c2012-12-17 10:24:06 +09008 */
9
10#include <linux/module.h>
11#include <linux/slab.h>
12#include <linux/i2c.h>
13#include <linux/err.h>
14#include <linux/irq.h>
15#include <linux/interrupt.h>
16#include <linux/gpio.h>
17#include <linux/regmap.h>
Daniel Jeongb59320c2012-12-17 10:24:06 +090018#include <linux/uaccess.h>
19#include <linux/regulator/driver.h>
20#include <linux/regulator/machine.h>
21#include <linux/platform_data/lp8755.h>
22
23#define LP8755_REG_BUCK0 0x00
24#define LP8755_REG_BUCK1 0x03
25#define LP8755_REG_BUCK2 0x04
26#define LP8755_REG_BUCK3 0x01
27#define LP8755_REG_BUCK4 0x05
28#define LP8755_REG_BUCK5 0x02
29#define LP8755_REG_MAX 0xFF
30
31#define LP8755_BUCK_EN_M BIT(7)
32#define LP8755_BUCK_LINEAR_OUT_MAX 0x76
33#define LP8755_BUCK_VOUT_M 0x7F
34
Daniel Jeongb59320c2012-12-17 10:24:06 +090035struct lp8755_mphase {
36 int nreg;
37 int buck_num[LP8755_BUCK_MAX];
38};
39
40struct lp8755_chip {
41 struct device *dev;
42 struct regmap *regmap;
43 struct lp8755_platform_data *pdata;
44
45 int irq;
46 unsigned int irqmask;
47
48 int mphase;
49 struct regulator_dev *rdev[LP8755_BUCK_MAX];
50};
51
Daniel Jeongb59320c2012-12-17 10:24:06 +090052static int lp8755_buck_enable_time(struct regulator_dev *rdev)
53{
54 int ret;
55 unsigned int regval;
56 enum lp8755_bucks id = rdev_get_id(rdev);
Daniel Jeongb59320c2012-12-17 10:24:06 +090057
Axel Lin4cf12732020-08-02 17:06:38 +080058 ret = regmap_read(rdev->regmap, 0x12 + id, &regval);
Daniel Jeongb59320c2012-12-17 10:24:06 +090059 if (ret < 0) {
Axel Lin4cf12732020-08-02 17:06:38 +080060 dev_err(&rdev->dev, "i2c access error %s\n", __func__);
Daniel Jeongb59320c2012-12-17 10:24:06 +090061 return ret;
62 }
63 return (regval & 0xff) * 100;
64}
65
66static int lp8755_buck_set_mode(struct regulator_dev *rdev, unsigned int mode)
67{
68 int ret;
69 unsigned int regbval = 0x0;
70 enum lp8755_bucks id = rdev_get_id(rdev);
71 struct lp8755_chip *pchip = rdev_get_drvdata(rdev);
72
73 switch (mode) {
74 case REGULATOR_MODE_FAST:
75 /* forced pwm mode */
76 regbval = (0x01 << id);
77 break;
78 case REGULATOR_MODE_NORMAL:
79 /* enable automatic pwm/pfm mode */
Axel Lin4cf12732020-08-02 17:06:38 +080080 ret = regmap_update_bits(rdev->regmap, 0x08 + id, 0x20, 0x00);
Daniel Jeongb59320c2012-12-17 10:24:06 +090081 if (ret < 0)
82 goto err_i2c;
83 break;
84 case REGULATOR_MODE_IDLE:
85 /* enable automatic pwm/pfm/lppfm mode */
Axel Lin4cf12732020-08-02 17:06:38 +080086 ret = regmap_update_bits(rdev->regmap, 0x08 + id, 0x20, 0x20);
Daniel Jeongb59320c2012-12-17 10:24:06 +090087 if (ret < 0)
88 goto err_i2c;
89
Axel Lin4cf12732020-08-02 17:06:38 +080090 ret = regmap_update_bits(rdev->regmap, 0x10, 0x01, 0x01);
Daniel Jeongb59320c2012-12-17 10:24:06 +090091 if (ret < 0)
92 goto err_i2c;
93 break;
94 default:
95 dev_err(pchip->dev, "Not supported buck mode %s\n", __func__);
96 /* forced pwm mode */
97 regbval = (0x01 << id);
98 }
99
Axel Lin4cf12732020-08-02 17:06:38 +0800100 ret = regmap_update_bits(rdev->regmap, 0x06, 0x01 << id, regbval);
Daniel Jeongb59320c2012-12-17 10:24:06 +0900101 if (ret < 0)
102 goto err_i2c;
103 return ret;
104err_i2c:
Axel Lin4cf12732020-08-02 17:06:38 +0800105 dev_err(&rdev->dev, "i2c access error %s\n", __func__);
Daniel Jeongb59320c2012-12-17 10:24:06 +0900106 return ret;
107}
108
109static unsigned int lp8755_buck_get_mode(struct regulator_dev *rdev)
110{
111 int ret;
112 unsigned int regval;
113 enum lp8755_bucks id = rdev_get_id(rdev);
Daniel Jeongb59320c2012-12-17 10:24:06 +0900114
Axel Lin4cf12732020-08-02 17:06:38 +0800115 ret = regmap_read(rdev->regmap, 0x06, &regval);
Daniel Jeongb59320c2012-12-17 10:24:06 +0900116 if (ret < 0)
117 goto err_i2c;
118
119 /* mode fast means forced pwm mode */
120 if (regval & (0x01 << id))
121 return REGULATOR_MODE_FAST;
122
Axel Lin4cf12732020-08-02 17:06:38 +0800123 ret = regmap_read(rdev->regmap, 0x08 + id, &regval);
Daniel Jeongb59320c2012-12-17 10:24:06 +0900124 if (ret < 0)
125 goto err_i2c;
126
127 /* mode idle means automatic pwm/pfm/lppfm mode */
128 if (regval & 0x20)
129 return REGULATOR_MODE_IDLE;
130
131 /* mode normal means automatic pwm/pfm mode */
132 return REGULATOR_MODE_NORMAL;
133
134err_i2c:
Axel Lin4cf12732020-08-02 17:06:38 +0800135 dev_err(&rdev->dev, "i2c access error %s\n", __func__);
Daniel Jeongb59320c2012-12-17 10:24:06 +0900136 return 0;
137}
138
Axel Linfbd168c2021-05-27 22:42:48 +0800139static const unsigned int lp8755_buck_ramp_table[] = {
140 30000, 15000, 7500, 3800, 1900, 940, 470, 230
141};
Daniel Jeongb59320c2012-12-17 10:24:06 +0900142
Bhumika Goyald42797a2017-01-28 19:41:30 +0530143static const struct regulator_ops lp8755_buck_ops = {
Mark Brown56a942e2013-07-02 23:57:35 +0100144 .map_voltage = regulator_map_voltage_linear,
Daniel Jeongb59320c2012-12-17 10:24:06 +0900145 .list_voltage = regulator_list_voltage_linear,
146 .set_voltage_sel = regulator_set_voltage_sel_regmap,
147 .get_voltage_sel = regulator_get_voltage_sel_regmap,
148 .enable = regulator_enable_regmap,
149 .disable = regulator_disable_regmap,
150 .is_enabled = regulator_is_enabled_regmap,
151 .enable_time = lp8755_buck_enable_time,
152 .set_mode = lp8755_buck_set_mode,
153 .get_mode = lp8755_buck_get_mode,
Axel Linfbd168c2021-05-27 22:42:48 +0800154 .set_ramp_delay = regulator_set_ramp_delay_regmap,
Daniel Jeongb59320c2012-12-17 10:24:06 +0900155};
156
157#define lp8755_rail(_id) "lp8755_buck"#_id
158#define lp8755_buck_init(_id)\
159{\
160 .constraints = {\
161 .name = lp8755_rail(_id),\
162 .valid_ops_mask = REGULATOR_CHANGE_VOLTAGE,\
163 .min_uV = 500000,\
164 .max_uV = 1675000,\
165 },\
166}
167
168static struct regulator_init_data lp8755_reg_default[LP8755_BUCK_MAX] = {
Axel Lin510799e2013-01-07 10:28:31 +0800169 [LP8755_BUCK0] = lp8755_buck_init(0),
170 [LP8755_BUCK1] = lp8755_buck_init(1),
171 [LP8755_BUCK2] = lp8755_buck_init(2),
172 [LP8755_BUCK3] = lp8755_buck_init(3),
173 [LP8755_BUCK4] = lp8755_buck_init(4),
174 [LP8755_BUCK5] = lp8755_buck_init(5),
Daniel Jeongb59320c2012-12-17 10:24:06 +0900175};
176
177static const struct lp8755_mphase mphase_buck[MPHASE_CONF_MAX] = {
Axel Lin510799e2013-01-07 10:28:31 +0800178 { 3, { LP8755_BUCK0, LP8755_BUCK3, LP8755_BUCK5 } },
179 { 6, { LP8755_BUCK0, LP8755_BUCK1, LP8755_BUCK2, LP8755_BUCK3,
180 LP8755_BUCK4, LP8755_BUCK5 } },
181 { 5, { LP8755_BUCK0, LP8755_BUCK2, LP8755_BUCK3, LP8755_BUCK4,
182 LP8755_BUCK5} },
183 { 4, { LP8755_BUCK0, LP8755_BUCK3, LP8755_BUCK4, LP8755_BUCK5} },
184 { 3, { LP8755_BUCK0, LP8755_BUCK4, LP8755_BUCK5} },
185 { 2, { LP8755_BUCK0, LP8755_BUCK5} },
186 { 1, { LP8755_BUCK0} },
187 { 2, { LP8755_BUCK0, LP8755_BUCK3} },
188 { 4, { LP8755_BUCK0, LP8755_BUCK2, LP8755_BUCK3, LP8755_BUCK5} },
Daniel Jeongb59320c2012-12-17 10:24:06 +0900189};
190
191static int lp8755_init_data(struct lp8755_chip *pchip)
192{
193 unsigned int regval;
194 int ret, icnt, buck_num;
195 struct lp8755_platform_data *pdata = pchip->pdata;
196
197 /* read back muti-phase configuration */
Axel Lin4cf12732020-08-02 17:06:38 +0800198 ret = regmap_read(pchip->regmap, 0x3D, &regval);
Daniel Jeongb59320c2012-12-17 10:24:06 +0900199 if (ret < 0)
200 goto out_i2c_error;
Axel Lincad877e2012-12-26 11:56:37 +0800201 pchip->mphase = regval & 0x0F;
Daniel Jeongb59320c2012-12-17 10:24:06 +0900202
203 /* set default data based on multi-phase config */
204 for (icnt = 0; icnt < mphase_buck[pchip->mphase].nreg; icnt++) {
205 buck_num = mphase_buck[pchip->mphase].buck_num[icnt];
206 pdata->buck_data[buck_num] = &lp8755_reg_default[buck_num];
207 }
208 return ret;
209
210out_i2c_error:
Colin Ian King80aec6f2017-05-10 09:30:20 +0100211 dev_err(pchip->dev, "i2c access error %s\n", __func__);
Daniel Jeongb59320c2012-12-17 10:24:06 +0900212 return ret;
213}
214
215#define lp8755_buck_desc(_id)\
216{\
217 .name = lp8755_rail(_id),\
218 .id = LP8755_BUCK##_id,\
219 .ops = &lp8755_buck_ops,\
220 .n_voltages = LP8755_BUCK_LINEAR_OUT_MAX+1,\
221 .uV_step = 10000,\
222 .min_uV = 500000,\
223 .type = REGULATOR_VOLTAGE,\
224 .owner = THIS_MODULE,\
225 .enable_reg = LP8755_REG_BUCK##_id,\
226 .enable_mask = LP8755_BUCK_EN_M,\
227 .vsel_reg = LP8755_REG_BUCK##_id,\
228 .vsel_mask = LP8755_BUCK_VOUT_M,\
Axel Linfbd168c2021-05-27 22:42:48 +0800229 .ramp_reg = (LP8755_BUCK##_id) + 0x7,\
230 .ramp_mask = 0x7,\
231 .ramp_delay_table = lp8755_buck_ramp_table,\
232 .n_ramp_values = ARRAY_SIZE(lp8755_buck_ramp_table),\
Daniel Jeongb59320c2012-12-17 10:24:06 +0900233}
234
Axel Lin367e90d2019-01-26 11:39:04 +0800235static const struct regulator_desc lp8755_regulators[] = {
Daniel Jeongb59320c2012-12-17 10:24:06 +0900236 lp8755_buck_desc(0),
237 lp8755_buck_desc(1),
238 lp8755_buck_desc(2),
239 lp8755_buck_desc(3),
240 lp8755_buck_desc(4),
241 lp8755_buck_desc(5),
242};
243
244static int lp8755_regulator_init(struct lp8755_chip *pchip)
245{
246 int ret, icnt, buck_num;
247 struct lp8755_platform_data *pdata = pchip->pdata;
248 struct regulator_config rconfig = { };
249
250 rconfig.regmap = pchip->regmap;
251 rconfig.dev = pchip->dev;
252 rconfig.driver_data = pchip;
253
254 for (icnt = 0; icnt < mphase_buck[pchip->mphase].nreg; icnt++) {
255 buck_num = mphase_buck[pchip->mphase].buck_num[icnt];
256 rconfig.init_data = pdata->buck_data[buck_num];
257 rconfig.of_node = pchip->dev->of_node;
258 pchip->rdev[buck_num] =
Himangi Saraogi57135252014-07-07 21:12:14 +0530259 devm_regulator_register(pchip->dev,
260 &lp8755_regulators[buck_num], &rconfig);
Daniel Jeongb59320c2012-12-17 10:24:06 +0900261 if (IS_ERR(pchip->rdev[buck_num])) {
262 ret = PTR_ERR(pchip->rdev[buck_num]);
Axel Lina1a41ab2012-12-25 10:06:20 +0800263 pchip->rdev[buck_num] = NULL;
264 dev_err(pchip->dev, "regulator init failed: buck %d\n",
265 buck_num);
Himangi Saraogi57135252014-07-07 21:12:14 +0530266 return ret;
Daniel Jeongb59320c2012-12-17 10:24:06 +0900267 }
268 }
269
270 return 0;
Daniel Jeongb59320c2012-12-17 10:24:06 +0900271}
272
273static irqreturn_t lp8755_irq_handler(int irq, void *data)
274{
275 int ret, icnt;
276 unsigned int flag0, flag1;
277 struct lp8755_chip *pchip = data;
278
279 /* read flag0 register */
Axel Lin4cf12732020-08-02 17:06:38 +0800280 ret = regmap_read(pchip->regmap, 0x0D, &flag0);
Daniel Jeongb59320c2012-12-17 10:24:06 +0900281 if (ret < 0)
282 goto err_i2c;
283 /* clear flag register to pull up int. pin */
Axel Lin4cf12732020-08-02 17:06:38 +0800284 ret = regmap_write(pchip->regmap, 0x0D, 0x00);
Daniel Jeongb59320c2012-12-17 10:24:06 +0900285 if (ret < 0)
286 goto err_i2c;
287
288 /* sent power fault detection event to specific regulator */
Axel Lin1200c602013-01-26 13:19:47 +0800289 for (icnt = 0; icnt < LP8755_BUCK_MAX; icnt++)
Daniel Jeongb59320c2012-12-17 10:24:06 +0900290 if ((flag0 & (0x4 << icnt))
291 && (pchip->irqmask & (0x04 << icnt))
Steve Twiss89b2758c2019-02-26 15:32:18 +0000292 && (pchip->rdev[icnt] != NULL)) {
Daniel Jeongb59320c2012-12-17 10:24:06 +0900293 regulator_notifier_call_chain(pchip->rdev[icnt],
294 LP8755_EVENT_PWR_FAULT,
295 NULL);
Steve Twiss89b2758c2019-02-26 15:32:18 +0000296 }
Daniel Jeongb59320c2012-12-17 10:24:06 +0900297
298 /* read flag1 register */
Axel Lin4cf12732020-08-02 17:06:38 +0800299 ret = regmap_read(pchip->regmap, 0x0E, &flag1);
Daniel Jeongb59320c2012-12-17 10:24:06 +0900300 if (ret < 0)
301 goto err_i2c;
302 /* clear flag register to pull up int. pin */
Axel Lin4cf12732020-08-02 17:06:38 +0800303 ret = regmap_write(pchip->regmap, 0x0E, 0x00);
Daniel Jeongb59320c2012-12-17 10:24:06 +0900304 if (ret < 0)
305 goto err_i2c;
306
Krzysztof Kozlowski48f1b4e2019-01-08 13:12:33 +0100307 /* send OCP event to all regulator devices */
Daniel Jeongb59320c2012-12-17 10:24:06 +0900308 if ((flag1 & 0x01) && (pchip->irqmask & 0x01))
309 for (icnt = 0; icnt < LP8755_BUCK_MAX; icnt++)
Steve Twiss89b2758c2019-02-26 15:32:18 +0000310 if (pchip->rdev[icnt] != NULL) {
Daniel Jeongb59320c2012-12-17 10:24:06 +0900311 regulator_notifier_call_chain(pchip->rdev[icnt],
312 LP8755_EVENT_OCP,
313 NULL);
Steve Twiss89b2758c2019-02-26 15:32:18 +0000314 }
Daniel Jeongb59320c2012-12-17 10:24:06 +0900315
Krzysztof Kozlowski48f1b4e2019-01-08 13:12:33 +0100316 /* send OVP event to all regulator devices */
Daniel Jeongb59320c2012-12-17 10:24:06 +0900317 if ((flag1 & 0x02) && (pchip->irqmask & 0x02))
318 for (icnt = 0; icnt < LP8755_BUCK_MAX; icnt++)
Steve Twiss89b2758c2019-02-26 15:32:18 +0000319 if (pchip->rdev[icnt] != NULL) {
Daniel Jeongb59320c2012-12-17 10:24:06 +0900320 regulator_notifier_call_chain(pchip->rdev[icnt],
321 LP8755_EVENT_OVP,
322 NULL);
Steve Twiss89b2758c2019-02-26 15:32:18 +0000323 }
Daniel Jeongb59320c2012-12-17 10:24:06 +0900324 return IRQ_HANDLED;
325
326err_i2c:
Colin Ian King80aec6f2017-05-10 09:30:20 +0100327 dev_err(pchip->dev, "i2c access error %s\n", __func__);
Daniel Jeongb59320c2012-12-17 10:24:06 +0900328 return IRQ_NONE;
329}
330
331static int lp8755_int_config(struct lp8755_chip *pchip)
332{
333 int ret;
334 unsigned int regval;
335
336 if (pchip->irq == 0) {
337 dev_warn(pchip->dev, "not use interrupt : %s\n", __func__);
338 return 0;
339 }
340
Axel Lin4cf12732020-08-02 17:06:38 +0800341 ret = regmap_read(pchip->regmap, 0x0F, &regval);
Axel Lin840499a2015-05-31 14:06:46 +0800342 if (ret < 0) {
Colin Ian King80aec6f2017-05-10 09:30:20 +0100343 dev_err(pchip->dev, "i2c access error %s\n", __func__);
Daniel Jeongb59320c2012-12-17 10:24:06 +0900344 return ret;
Axel Lin840499a2015-05-31 14:06:46 +0800345 }
Daniel Jeongb59320c2012-12-17 10:24:06 +0900346
Axel Lin840499a2015-05-31 14:06:46 +0800347 pchip->irqmask = regval;
348 return devm_request_threaded_irq(pchip->dev, pchip->irq, NULL,
349 lp8755_irq_handler,
350 IRQF_TRIGGER_FALLING | IRQF_ONESHOT,
351 "lp8755-irq", pchip);
Daniel Jeongb59320c2012-12-17 10:24:06 +0900352}
353
354static const struct regmap_config lp8755_regmap = {
355 .reg_bits = 8,
356 .val_bits = 8,
357 .max_register = LP8755_REG_MAX,
358};
359
360static int lp8755_probe(struct i2c_client *client,
361 const struct i2c_device_id *id)
362{
363 int ret, icnt;
364 struct lp8755_chip *pchip;
Jingoo Handff91d02013-07-30 17:20:47 +0900365 struct lp8755_platform_data *pdata = dev_get_platdata(&client->dev);
Daniel Jeongb59320c2012-12-17 10:24:06 +0900366
367 if (!i2c_check_functionality(client->adapter, I2C_FUNC_I2C)) {
368 dev_err(&client->dev, "i2c functionality check fail.\n");
369 return -EOPNOTSUPP;
370 }
371
372 pchip = devm_kzalloc(&client->dev,
373 sizeof(struct lp8755_chip), GFP_KERNEL);
374 if (!pchip)
375 return -ENOMEM;
376
377 pchip->dev = &client->dev;
378 pchip->regmap = devm_regmap_init_i2c(client, &lp8755_regmap);
379 if (IS_ERR(pchip->regmap)) {
380 ret = PTR_ERR(pchip->regmap);
381 dev_err(&client->dev, "fail to allocate regmap %d\n", ret);
382 return ret;
383 }
384 i2c_set_clientdata(client, pchip);
385
386 if (pdata != NULL) {
387 pchip->pdata = pdata;
388 pchip->mphase = pdata->mphase;
389 } else {
390 pchip->pdata = devm_kzalloc(pchip->dev,
391 sizeof(struct lp8755_platform_data),
392 GFP_KERNEL);
393 if (!pchip->pdata)
394 return -ENOMEM;
395 ret = lp8755_init_data(pchip);
Axel Lin240a5292013-01-12 14:58:35 +0800396 if (ret < 0) {
397 dev_err(&client->dev, "fail to initialize chip\n");
398 return ret;
399 }
Daniel Jeongb59320c2012-12-17 10:24:06 +0900400 }
401
402 ret = lp8755_regulator_init(pchip);
Axel Lin240a5292013-01-12 14:58:35 +0800403 if (ret < 0) {
404 dev_err(&client->dev, "fail to initialize regulators\n");
Himangi Saraogi57135252014-07-07 21:12:14 +0530405 goto err;
Axel Lin240a5292013-01-12 14:58:35 +0800406 }
Daniel Jeongb59320c2012-12-17 10:24:06 +0900407
408 pchip->irq = client->irq;
409 ret = lp8755_int_config(pchip);
Axel Lin240a5292013-01-12 14:58:35 +0800410 if (ret < 0) {
411 dev_err(&client->dev, "fail to irq config\n");
Himangi Saraogi57135252014-07-07 21:12:14 +0530412 goto err;
Axel Lin240a5292013-01-12 14:58:35 +0800413 }
Daniel Jeongb59320c2012-12-17 10:24:06 +0900414
415 return ret;
416
Himangi Saraogi57135252014-07-07 21:12:14 +0530417err:
Daniel Jeongb59320c2012-12-17 10:24:06 +0900418 /* output disable */
Axel Lin1200c602013-01-26 13:19:47 +0800419 for (icnt = 0; icnt < LP8755_BUCK_MAX; icnt++)
Axel Lin4cf12732020-08-02 17:06:38 +0800420 regmap_write(pchip->regmap, icnt, 0x00);
Daniel Jeongb59320c2012-12-17 10:24:06 +0900421
Daniel Jeongb59320c2012-12-17 10:24:06 +0900422 return ret;
423}
424
425static int lp8755_remove(struct i2c_client *client)
426{
427 int icnt;
428 struct lp8755_chip *pchip = i2c_get_clientdata(client);
429
Axel Lin1200c602013-01-26 13:19:47 +0800430 for (icnt = 0; icnt < LP8755_BUCK_MAX; icnt++)
Axel Lin4cf12732020-08-02 17:06:38 +0800431 regmap_write(pchip->regmap, icnt, 0x00);
Daniel Jeongb59320c2012-12-17 10:24:06 +0900432
Daniel Jeongb59320c2012-12-17 10:24:06 +0900433 return 0;
434}
435
436static const struct i2c_device_id lp8755_id[] = {
437 {LP8755_NAME, 0},
438 {}
439};
440
441MODULE_DEVICE_TABLE(i2c, lp8755_id);
442
443static struct i2c_driver lp8755_i2c_driver = {
444 .driver = {
445 .name = LP8755_NAME,
446 },
447 .probe = lp8755_probe,
Axel Lina1a41ab2012-12-25 10:06:20 +0800448 .remove = lp8755_remove,
Daniel Jeongb59320c2012-12-17 10:24:06 +0900449 .id_table = lp8755_id,
450};
451
452static int __init lp8755_init(void)
453{
454 return i2c_add_driver(&lp8755_i2c_driver);
455}
456
457subsys_initcall(lp8755_init);
458
459static void __exit lp8755_exit(void)
460{
461 i2c_del_driver(&lp8755_i2c_driver);
462}
463
464module_exit(lp8755_exit);
465
466MODULE_DESCRIPTION("Texas Instruments lp8755 driver");
467MODULE_AUTHOR("Daniel Jeong <daniel.jeong@ti.com>");
468MODULE_LICENSE("GPL v2");