OSDN Git Service

regulator: act8865: Fix act8600_sudcdc_voltage_ranges setting
[sagit-ice-cold/kernel_xiaomi_msm8998.git] / drivers / regulator / act8865-regulator.c
1 /*
2  * act8865-regulator.c - Voltage regulation for active-semi ACT88xx PMUs
3  *
4  * http://www.active-semi.com/products/power-management-units/act88xx/
5  *
6  * Copyright (C) 2013 Atmel Corporation
7  *
8  * This program is free software; you can redistribute it and/or modify
9  * it under the terms of the GNU General Public License as published by
10  * the Free Software Foundation; either version 2 of the License, or
11  * (at your option) any later version.
12  *
13  * This program is distributed in the hope that it will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16  * GNU General Public License for more details.
17  */
18
19 #include <linux/module.h>
20 #include <linux/init.h>
21 #include <linux/i2c.h>
22 #include <linux/err.h>
23 #include <linux/platform_device.h>
24 #include <linux/regulator/driver.h>
25 #include <linux/regulator/act8865.h>
26 #include <linux/of.h>
27 #include <linux/of_device.h>
28 #include <linux/regulator/of_regulator.h>
29 #include <linux/regmap.h>
30
31 /*
32  * ACT8600 Global Register Map.
33  */
34 #define ACT8600_SYS_MODE        0x00
35 #define ACT8600_SYS_CTRL        0x01
36 #define ACT8600_DCDC1_VSET      0x10
37 #define ACT8600_DCDC1_CTRL      0x12
38 #define ACT8600_DCDC2_VSET      0x20
39 #define ACT8600_DCDC2_CTRL      0x22
40 #define ACT8600_DCDC3_VSET      0x30
41 #define ACT8600_DCDC3_CTRL      0x32
42 #define ACT8600_SUDCDC4_VSET    0x40
43 #define ACT8600_SUDCDC4_CTRL    0x41
44 #define ACT8600_LDO5_VSET       0x50
45 #define ACT8600_LDO5_CTRL       0x51
46 #define ACT8600_LDO6_VSET       0x60
47 #define ACT8600_LDO6_CTRL       0x61
48 #define ACT8600_LDO7_VSET       0x70
49 #define ACT8600_LDO7_CTRL       0x71
50 #define ACT8600_LDO8_VSET       0x80
51 #define ACT8600_LDO8_CTRL       0x81
52 #define ACT8600_LDO910_CTRL     0x91
53 #define ACT8600_APCH0           0xA1
54 #define ACT8600_APCH1           0xA8
55 #define ACT8600_APCH2           0xA9
56 #define ACT8600_APCH_STAT       0xAA
57 #define ACT8600_OTG0            0xB0
58 #define ACT8600_OTG1            0xB2
59
60 /*
61  * ACT8846 Global Register Map.
62  */
63 #define ACT8846_SYS0            0x00
64 #define ACT8846_SYS1            0x01
65 #define ACT8846_REG1_VSET       0x10
66 #define ACT8846_REG1_CTRL       0x12
67 #define ACT8846_REG2_VSET0      0x20
68 #define ACT8846_REG2_VSET1      0x21
69 #define ACT8846_REG2_CTRL       0x22
70 #define ACT8846_REG3_VSET0      0x30
71 #define ACT8846_REG3_VSET1      0x31
72 #define ACT8846_REG3_CTRL       0x32
73 #define ACT8846_REG4_VSET0      0x40
74 #define ACT8846_REG4_VSET1      0x41
75 #define ACT8846_REG4_CTRL       0x42
76 #define ACT8846_REG5_VSET       0x50
77 #define ACT8846_REG5_CTRL       0x51
78 #define ACT8846_REG6_VSET       0x58
79 #define ACT8846_REG6_CTRL       0x59
80 #define ACT8846_REG7_VSET       0x60
81 #define ACT8846_REG7_CTRL       0x61
82 #define ACT8846_REG8_VSET       0x68
83 #define ACT8846_REG8_CTRL       0x69
84 #define ACT8846_REG9_VSET       0x70
85 #define ACT8846_REG9_CTRL       0x71
86 #define ACT8846_REG10_VSET      0x80
87 #define ACT8846_REG10_CTRL      0x81
88 #define ACT8846_REG11_VSET      0x90
89 #define ACT8846_REG11_CTRL      0x91
90 #define ACT8846_REG12_VSET      0xa0
91 #define ACT8846_REG12_CTRL      0xa1
92 #define ACT8846_REG13_CTRL      0xb1
93 #define ACT8846_GLB_OFF_CTRL    0xc3
94 #define ACT8846_OFF_SYSMASK     0x18
95
96 /*
97  * ACT8865 Global Register Map.
98  */
99 #define ACT8865_SYS_MODE        0x00
100 #define ACT8865_SYS_CTRL        0x01
101 #define ACT8865_DCDC1_VSET1     0x20
102 #define ACT8865_DCDC1_VSET2     0x21
103 #define ACT8865_DCDC1_CTRL      0x22
104 #define ACT8865_DCDC2_VSET1     0x30
105 #define ACT8865_DCDC2_VSET2     0x31
106 #define ACT8865_DCDC2_CTRL      0x32
107 #define ACT8865_DCDC3_VSET1     0x40
108 #define ACT8865_DCDC3_VSET2     0x41
109 #define ACT8865_DCDC3_CTRL      0x42
110 #define ACT8865_LDO1_VSET       0x50
111 #define ACT8865_LDO1_CTRL       0x51
112 #define ACT8865_LDO2_VSET       0x54
113 #define ACT8865_LDO2_CTRL       0x55
114 #define ACT8865_LDO3_VSET       0x60
115 #define ACT8865_LDO3_CTRL       0x61
116 #define ACT8865_LDO4_VSET       0x64
117 #define ACT8865_LDO4_CTRL       0x65
118 #define ACT8865_MSTROFF         0x20
119
120 /*
121  * Field Definitions.
122  */
123 #define ACT8865_ENA             0x80    /* ON - [7] */
124 #define ACT8865_VSEL_MASK       0x3F    /* VSET - [5:0] */
125
126
127 #define ACT8600_LDO10_ENA               0x40    /* ON - [6] */
128 #define ACT8600_SUDCDC_VSEL_MASK        0xFF    /* SUDCDC VSET - [7:0] */
129
130 /*
131  * ACT8865 voltage number
132  */
133 #define ACT8865_VOLTAGE_NUM     64
134 #define ACT8600_SUDCDC_VOLTAGE_NUM      256
135
136 struct act8865 {
137         struct regmap *regmap;
138         int off_reg;
139         int off_mask;
140 };
141
142 static const struct regmap_config act8865_regmap_config = {
143         .reg_bits = 8,
144         .val_bits = 8,
145 };
146
147 static const struct regulator_linear_range act8865_voltage_ranges[] = {
148         REGULATOR_LINEAR_RANGE(600000, 0, 23, 25000),
149         REGULATOR_LINEAR_RANGE(1200000, 24, 47, 50000),
150         REGULATOR_LINEAR_RANGE(2400000, 48, 63, 100000),
151 };
152
153 static const struct regulator_linear_range act8600_sudcdc_voltage_ranges[] = {
154         REGULATOR_LINEAR_RANGE(3000000, 0, 63, 0),
155         REGULATOR_LINEAR_RANGE(3000000, 64, 159, 100000),
156         REGULATOR_LINEAR_RANGE(12600000, 160, 191, 200000),
157         REGULATOR_LINEAR_RANGE(19000000, 192, 247, 400000),
158         REGULATOR_LINEAR_RANGE(41400000, 248, 255, 0),
159 };
160
161 static struct regulator_ops act8865_ops = {
162         .list_voltage           = regulator_list_voltage_linear_range,
163         .map_voltage            = regulator_map_voltage_linear_range,
164         .get_voltage_sel        = regulator_get_voltage_sel_regmap,
165         .set_voltage_sel        = regulator_set_voltage_sel_regmap,
166         .enable                 = regulator_enable_regmap,
167         .disable                = regulator_disable_regmap,
168         .is_enabled             = regulator_is_enabled_regmap,
169 };
170
171 static struct regulator_ops act8865_ldo_ops = {
172         .enable                 = regulator_enable_regmap,
173         .disable                = regulator_disable_regmap,
174         .is_enabled             = regulator_is_enabled_regmap,
175 };
176
177 #define ACT88xx_REG(_name, _family, _id, _vsel_reg, _supply)            \
178         [_family##_ID_##_id] = {                                        \
179                 .name                   = _name,                        \
180                 .supply_name            = _supply,                      \
181                 .id                     = _family##_ID_##_id,           \
182                 .type                   = REGULATOR_VOLTAGE,            \
183                 .ops                    = &act8865_ops,                 \
184                 .n_voltages             = ACT8865_VOLTAGE_NUM,          \
185                 .linear_ranges          = act8865_voltage_ranges,       \
186                 .n_linear_ranges        = ARRAY_SIZE(act8865_voltage_ranges), \
187                 .vsel_reg               = _family##_##_id##_##_vsel_reg, \
188                 .vsel_mask              = ACT8865_VSEL_MASK,            \
189                 .enable_reg             = _family##_##_id##_CTRL,       \
190                 .enable_mask            = ACT8865_ENA,                  \
191                 .owner                  = THIS_MODULE,                  \
192         }
193
194 static const struct regulator_desc act8600_regulators[] = {
195         ACT88xx_REG("DCDC1", ACT8600, DCDC1, VSET, "vp1"),
196         ACT88xx_REG("DCDC2", ACT8600, DCDC2, VSET, "vp2"),
197         ACT88xx_REG("DCDC3", ACT8600, DCDC3, VSET, "vp3"),
198         {
199                 .name = "SUDCDC_REG4",
200                 .id = ACT8600_ID_SUDCDC4,
201                 .ops = &act8865_ops,
202                 .type = REGULATOR_VOLTAGE,
203                 .n_voltages = ACT8600_SUDCDC_VOLTAGE_NUM,
204                 .linear_ranges = act8600_sudcdc_voltage_ranges,
205                 .n_linear_ranges = ARRAY_SIZE(act8600_sudcdc_voltage_ranges),
206                 .vsel_reg = ACT8600_SUDCDC4_VSET,
207                 .vsel_mask = ACT8600_SUDCDC_VSEL_MASK,
208                 .enable_reg = ACT8600_SUDCDC4_CTRL,
209                 .enable_mask = ACT8865_ENA,
210                 .owner = THIS_MODULE,
211         },
212         ACT88xx_REG("LDO5", ACT8600, LDO5, VSET, "inl"),
213         ACT88xx_REG("LDO6", ACT8600, LDO6, VSET, "inl"),
214         ACT88xx_REG("LDO7", ACT8600, LDO7, VSET, "inl"),
215         ACT88xx_REG("LDO8", ACT8600, LDO8, VSET, "inl"),
216         {
217                 .name = "LDO_REG9",
218                 .id = ACT8600_ID_LDO9,
219                 .ops = &act8865_ldo_ops,
220                 .type = REGULATOR_VOLTAGE,
221                 .n_voltages = 1,
222                 .fixed_uV = 1800000,
223                 .enable_reg = ACT8600_LDO910_CTRL,
224                 .enable_mask = ACT8865_ENA,
225                 .owner = THIS_MODULE,
226         },
227         {
228                 .name = "LDO_REG10",
229                 .id = ACT8600_ID_LDO10,
230                 .ops = &act8865_ldo_ops,
231                 .type = REGULATOR_VOLTAGE,
232                 .n_voltages = 1,
233                 .fixed_uV = 1200000,
234                 .enable_reg = ACT8600_LDO910_CTRL,
235                 .enable_mask = ACT8600_LDO10_ENA,
236                 .owner = THIS_MODULE,
237         },
238 };
239
240 static const struct regulator_desc act8846_regulators[] = {
241         ACT88xx_REG("REG1", ACT8846, REG1, VSET, "vp1"),
242         ACT88xx_REG("REG2", ACT8846, REG2, VSET0, "vp2"),
243         ACT88xx_REG("REG3", ACT8846, REG3, VSET0, "vp3"),
244         ACT88xx_REG("REG4", ACT8846, REG4, VSET0, "vp4"),
245         ACT88xx_REG("REG5", ACT8846, REG5, VSET, "inl1"),
246         ACT88xx_REG("REG6", ACT8846, REG6, VSET, "inl1"),
247         ACT88xx_REG("REG7", ACT8846, REG7, VSET, "inl1"),
248         ACT88xx_REG("REG8", ACT8846, REG8, VSET, "inl2"),
249         ACT88xx_REG("REG9", ACT8846, REG9, VSET, "inl2"),
250         ACT88xx_REG("REG10", ACT8846, REG10, VSET, "inl3"),
251         ACT88xx_REG("REG11", ACT8846, REG11, VSET, "inl3"),
252         ACT88xx_REG("REG12", ACT8846, REG12, VSET, "inl3"),
253 };
254
255 static const struct regulator_desc act8865_regulators[] = {
256         ACT88xx_REG("DCDC_REG1", ACT8865, DCDC1, VSET1, "vp1"),
257         ACT88xx_REG("DCDC_REG2", ACT8865, DCDC2, VSET1, "vp2"),
258         ACT88xx_REG("DCDC_REG3", ACT8865, DCDC3, VSET1, "vp3"),
259         ACT88xx_REG("LDO_REG1", ACT8865, LDO1, VSET, "inl45"),
260         ACT88xx_REG("LDO_REG2", ACT8865, LDO2, VSET, "inl45"),
261         ACT88xx_REG("LDO_REG3", ACT8865, LDO3, VSET, "inl67"),
262         ACT88xx_REG("LDO_REG4", ACT8865, LDO4, VSET, "inl67"),
263 };
264
265 static const struct regulator_desc act8865_alt_regulators[] = {
266         ACT88xx_REG("DCDC_REG1", ACT8865, DCDC1, VSET2, "vp1"),
267         ACT88xx_REG("DCDC_REG2", ACT8865, DCDC2, VSET2, "vp2"),
268         ACT88xx_REG("DCDC_REG3", ACT8865, DCDC3, VSET2, "vp3"),
269         ACT88xx_REG("LDO_REG1", ACT8865, LDO1, VSET, "inl45"),
270         ACT88xx_REG("LDO_REG2", ACT8865, LDO2, VSET, "inl45"),
271         ACT88xx_REG("LDO_REG3", ACT8865, LDO3, VSET, "inl67"),
272         ACT88xx_REG("LDO_REG4", ACT8865, LDO4, VSET, "inl67"),
273 };
274
275 #ifdef CONFIG_OF
276 static const struct of_device_id act8865_dt_ids[] = {
277         { .compatible = "active-semi,act8600", .data = (void *)ACT8600 },
278         { .compatible = "active-semi,act8846", .data = (void *)ACT8846 },
279         { .compatible = "active-semi,act8865", .data = (void *)ACT8865 },
280         { }
281 };
282 MODULE_DEVICE_TABLE(of, act8865_dt_ids);
283
284 static struct of_regulator_match act8846_matches[] = {
285         [ACT8846_ID_REG1]       = { .name = "REG1" },
286         [ACT8846_ID_REG2]       = { .name = "REG2" },
287         [ACT8846_ID_REG3]       = { .name = "REG3" },
288         [ACT8846_ID_REG4]       = { .name = "REG4" },
289         [ACT8846_ID_REG5]       = { .name = "REG5" },
290         [ACT8846_ID_REG6]       = { .name = "REG6" },
291         [ACT8846_ID_REG7]       = { .name = "REG7" },
292         [ACT8846_ID_REG8]       = { .name = "REG8" },
293         [ACT8846_ID_REG9]       = { .name = "REG9" },
294         [ACT8846_ID_REG10]      = { .name = "REG10" },
295         [ACT8846_ID_REG11]      = { .name = "REG11" },
296         [ACT8846_ID_REG12]      = { .name = "REG12" },
297 };
298
299 static struct of_regulator_match act8865_matches[] = {
300         [ACT8865_ID_DCDC1]      = { .name = "DCDC_REG1"},
301         [ACT8865_ID_DCDC2]      = { .name = "DCDC_REG2"},
302         [ACT8865_ID_DCDC3]      = { .name = "DCDC_REG3"},
303         [ACT8865_ID_LDO1]       = { .name = "LDO_REG1"},
304         [ACT8865_ID_LDO2]       = { .name = "LDO_REG2"},
305         [ACT8865_ID_LDO3]       = { .name = "LDO_REG3"},
306         [ACT8865_ID_LDO4]       = { .name = "LDO_REG4"},
307 };
308
309 static struct of_regulator_match act8600_matches[] = {
310         [ACT8600_ID_DCDC1]      = { .name = "DCDC_REG1"},
311         [ACT8600_ID_DCDC2]      = { .name = "DCDC_REG2"},
312         [ACT8600_ID_DCDC3]      = { .name = "DCDC_REG3"},
313         [ACT8600_ID_SUDCDC4]    = { .name = "SUDCDC_REG4"},
314         [ACT8600_ID_LDO5]       = { .name = "LDO_REG5"},
315         [ACT8600_ID_LDO6]       = { .name = "LDO_REG6"},
316         [ACT8600_ID_LDO7]       = { .name = "LDO_REG7"},
317         [ACT8600_ID_LDO8]       = { .name = "LDO_REG8"},
318         [ACT8600_ID_LDO9]       = { .name = "LDO_REG9"},
319         [ACT8600_ID_LDO10]      = { .name = "LDO_REG10"},
320 };
321
322 static int act8865_pdata_from_dt(struct device *dev,
323                                  struct device_node **of_node,
324                                  struct act8865_platform_data *pdata,
325                                  unsigned long type)
326 {
327         int matched, i, num_matches;
328         struct device_node *np;
329         struct act8865_regulator_data *regulator;
330         struct of_regulator_match *matches;
331
332         np = of_get_child_by_name(dev->of_node, "regulators");
333         if (!np) {
334                 dev_err(dev, "missing 'regulators' subnode in DT\n");
335                 return -EINVAL;
336         }
337
338         switch (type) {
339         case ACT8600:
340                 matches = act8600_matches;
341                 num_matches = ARRAY_SIZE(act8600_matches);
342                 break;
343         case ACT8846:
344                 matches = act8846_matches;
345                 num_matches = ARRAY_SIZE(act8846_matches);
346                 break;
347         case ACT8865:
348                 matches = act8865_matches;
349                 num_matches = ARRAY_SIZE(act8865_matches);
350                 break;
351         default:
352                 dev_err(dev, "invalid device id %lu\n", type);
353                 return -EINVAL;
354         }
355
356         matched = of_regulator_match(dev, np, matches, num_matches);
357         of_node_put(np);
358         if (matched <= 0)
359                 return matched;
360
361         pdata->regulators = devm_kzalloc(dev,
362                                          sizeof(struct act8865_regulator_data) *
363                                          num_matches, GFP_KERNEL);
364         if (!pdata->regulators)
365                 return -ENOMEM;
366
367         pdata->num_regulators = num_matches;
368         regulator = pdata->regulators;
369
370         for (i = 0; i < num_matches; i++) {
371                 regulator->id = i;
372                 regulator->name = matches[i].name;
373                 regulator->platform_data = matches[i].init_data;
374                 of_node[i] = matches[i].of_node;
375                 regulator++;
376         }
377
378         return 0;
379 }
380 #else
381 static inline int act8865_pdata_from_dt(struct device *dev,
382                                         struct device_node **of_node,
383                                         struct act8865_platform_data *pdata,
384                                         unsigned long type)
385 {
386         return 0;
387 }
388 #endif
389
390 static struct regulator_init_data
391 *act8865_get_init_data(int id, struct act8865_platform_data *pdata)
392 {
393         int i;
394
395         if (!pdata)
396                 return NULL;
397
398         for (i = 0; i < pdata->num_regulators; i++) {
399                 if (pdata->regulators[i].id == id)
400                         return pdata->regulators[i].platform_data;
401         }
402
403         return NULL;
404 }
405
406 static struct i2c_client *act8865_i2c_client;
407 static void act8865_power_off(void)
408 {
409         struct act8865 *act8865;
410
411         act8865 = i2c_get_clientdata(act8865_i2c_client);
412         regmap_write(act8865->regmap, act8865->off_reg, act8865->off_mask);
413         while (1);
414 }
415
416 static int act8865_pmic_probe(struct i2c_client *client,
417                               const struct i2c_device_id *i2c_id)
418 {
419         static const struct regulator_desc *regulators;
420         struct act8865_platform_data pdata_of, *pdata;
421         struct device *dev = &client->dev;
422         struct device_node **of_node;
423         int i, ret, num_regulators;
424         struct act8865 *act8865;
425         unsigned long type;
426         int off_reg, off_mask;
427         int voltage_select = 0;
428
429         pdata = dev_get_platdata(dev);
430
431         if (dev->of_node && !pdata) {
432                 const struct of_device_id *id;
433
434                 id = of_match_device(of_match_ptr(act8865_dt_ids), dev);
435                 if (!id)
436                         return -ENODEV;
437
438                 type = (unsigned long) id->data;
439
440                 voltage_select = !!of_get_property(dev->of_node,
441                                                    "active-semi,vsel-high",
442                                                    NULL);
443         } else {
444                 type = i2c_id->driver_data;
445         }
446
447         switch (type) {
448         case ACT8600:
449                 regulators = act8600_regulators;
450                 num_regulators = ARRAY_SIZE(act8600_regulators);
451                 off_reg = -1;
452                 off_mask = -1;
453                 break;
454         case ACT8846:
455                 regulators = act8846_regulators;
456                 num_regulators = ARRAY_SIZE(act8846_regulators);
457                 off_reg = ACT8846_GLB_OFF_CTRL;
458                 off_mask = ACT8846_OFF_SYSMASK;
459                 break;
460         case ACT8865:
461                 if (voltage_select) {
462                         regulators = act8865_alt_regulators;
463                         num_regulators = ARRAY_SIZE(act8865_alt_regulators);
464                 } else {
465                         regulators = act8865_regulators;
466                         num_regulators = ARRAY_SIZE(act8865_regulators);
467                 }
468                 off_reg = ACT8865_SYS_CTRL;
469                 off_mask = ACT8865_MSTROFF;
470                 break;
471         default:
472                 dev_err(dev, "invalid device id %lu\n", type);
473                 return -EINVAL;
474         }
475
476         of_node = devm_kzalloc(dev, sizeof(struct device_node *) *
477                                num_regulators, GFP_KERNEL);
478         if (!of_node)
479                 return -ENOMEM;
480
481         if (dev->of_node && !pdata) {
482                 ret = act8865_pdata_from_dt(dev, of_node, &pdata_of, type);
483                 if (ret < 0)
484                         return ret;
485
486                 pdata = &pdata_of;
487         }
488
489         if (pdata->num_regulators > num_regulators) {
490                 dev_err(dev, "too many regulators: %d\n",
491                         pdata->num_regulators);
492                 return -EINVAL;
493         }
494
495         act8865 = devm_kzalloc(dev, sizeof(struct act8865), GFP_KERNEL);
496         if (!act8865)
497                 return -ENOMEM;
498
499         act8865->regmap = devm_regmap_init_i2c(client, &act8865_regmap_config);
500         if (IS_ERR(act8865->regmap)) {
501                 ret = PTR_ERR(act8865->regmap);
502                 dev_err(&client->dev, "Failed to allocate register map: %d\n",
503                         ret);
504                 return ret;
505         }
506
507         if (of_device_is_system_power_controller(dev->of_node)) {
508                 if (!pm_power_off && (off_reg > 0)) {
509                         act8865_i2c_client = client;
510                         act8865->off_reg = off_reg;
511                         act8865->off_mask = off_mask;
512                         pm_power_off = act8865_power_off;
513                 } else {
514                         dev_err(dev, "Failed to set poweroff capability, already defined\n");
515                 }
516         }
517
518         /* Finally register devices */
519         for (i = 0; i < num_regulators; i++) {
520                 const struct regulator_desc *desc = &regulators[i];
521                 struct regulator_config config = { };
522                 struct regulator_dev *rdev;
523
524                 config.dev = dev;
525                 config.init_data = act8865_get_init_data(desc->id, pdata);
526                 config.of_node = of_node[i];
527                 config.driver_data = act8865;
528                 config.regmap = act8865->regmap;
529
530                 rdev = devm_regulator_register(&client->dev, desc, &config);
531                 if (IS_ERR(rdev)) {
532                         dev_err(dev, "failed to register %s\n", desc->name);
533                         return PTR_ERR(rdev);
534                 }
535         }
536
537         i2c_set_clientdata(client, act8865);
538         devm_kfree(dev, of_node);
539
540         return 0;
541 }
542
543 static const struct i2c_device_id act8865_ids[] = {
544         { .name = "act8600", .driver_data = ACT8600 },
545         { .name = "act8846", .driver_data = ACT8846 },
546         { .name = "act8865", .driver_data = ACT8865 },
547         { },
548 };
549 MODULE_DEVICE_TABLE(i2c, act8865_ids);
550
551 static struct i2c_driver act8865_pmic_driver = {
552         .driver = {
553                 .name   = "act8865",
554         },
555         .probe          = act8865_pmic_probe,
556         .id_table       = act8865_ids,
557 };
558
559 module_i2c_driver(act8865_pmic_driver);
560
561 MODULE_DESCRIPTION("active-semi act88xx voltage regulator driver");
562 MODULE_AUTHOR("Wenyou Yang <wenyou.yang@atmel.com>");
563 MODULE_LICENSE("GPL v2");