Commit | Line | Data |
---|---|---|
27f37e4b WS |
1 | /* |
2 | * max8660.c -- Voltage regulation for the Maxim 8660/8661 | |
3 | * | |
4 | * based on max1586.c and wm8400-regulator.c | |
5 | * | |
6 | * Copyright (C) 2009 Wolfram Sang, Pengutronix e.K. | |
7 | * | |
8 | * This program is free software; you can redistribute it and/or modify it | |
9 | * under the terms of the GNU General Public License as published by the Free | |
10 | * Software Foundation; version 2 of the License. | |
11 | * | |
12 | * This program is distributed in the hope that it will be useful, but WITHOUT | |
13 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or | |
14 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for | |
15 | * more details. | |
16 | * | |
17 | * You should have received a copy of the GNU General Public License along with | |
18 | * this program; if not, write to the Free Software Foundation, Inc., 59 Temple | |
19 | * Place, Suite 330, Boston, MA 02111-1307 USA | |
20 | * | |
21 | * Some info: | |
22 | * | |
23 | * Datasheet: http://datasheets.maxim-ic.com/en/ds/MAX8660-MAX8661.pdf | |
24 | * | |
25 | * This chip is a bit nasty because it is a write-only device. Thus, the driver | |
26 | * uses shadow registers to keep track of its values. The main problem appears | |
27 | * to be the initialization: When Linux boots up, we cannot know if the chip is | |
28 | * in the default state or not, so we would have to pass such information in | |
29 | * platform_data. As this adds a bit of complexity to the driver, this is left | |
30 | * out for now until it is really needed. | |
31 | * | |
32 | * [A|S|M]DTV1 registers are currently not used, but [A|S|M]DTV2. | |
33 | * | |
34 | * If the driver is feature complete, it might be worth to check if one set of | |
35 | * functions for V3-V7 is sufficient. For maximum flexibility during | |
36 | * development, they are separated for now. | |
37 | * | |
38 | */ | |
39 | ||
40 | #include <linux/module.h> | |
41 | #include <linux/err.h> | |
42 | #include <linux/i2c.h> | |
43 | #include <linux/platform_device.h> | |
44 | #include <linux/regulator/driver.h> | |
5a0e3ad6 | 45 | #include <linux/slab.h> |
27f37e4b WS |
46 | #include <linux/regulator/max8660.h> |
47 | ||
48 | #define MAX8660_DCDC_MIN_UV 725000 | |
49 | #define MAX8660_DCDC_MAX_UV 1800000 | |
50 | #define MAX8660_DCDC_STEP 25000 | |
51 | #define MAX8660_DCDC_MAX_SEL 0x2b | |
52 | ||
53 | #define MAX8660_LDO5_MIN_UV 1700000 | |
54 | #define MAX8660_LDO5_MAX_UV 2000000 | |
55 | #define MAX8660_LDO5_STEP 25000 | |
56 | #define MAX8660_LDO5_MAX_SEL 0x0c | |
57 | ||
58 | #define MAX8660_LDO67_MIN_UV 1800000 | |
59 | #define MAX8660_LDO67_MAX_UV 3300000 | |
60 | #define MAX8660_LDO67_STEP 100000 | |
61 | #define MAX8660_LDO67_MAX_SEL 0x0f | |
62 | ||
63 | enum { | |
64 | MAX8660_OVER1, | |
65 | MAX8660_OVER2, | |
66 | MAX8660_VCC1, | |
67 | MAX8660_ADTV1, | |
68 | MAX8660_ADTV2, | |
69 | MAX8660_SDTV1, | |
70 | MAX8660_SDTV2, | |
71 | MAX8660_MDTV1, | |
72 | MAX8660_MDTV2, | |
73 | MAX8660_L12VCR, | |
74 | MAX8660_FPWM, | |
75 | MAX8660_N_REGS, /* not a real register */ | |
76 | }; | |
77 | ||
78 | struct max8660 { | |
79 | struct i2c_client *client; | |
80 | u8 shadow_regs[MAX8660_N_REGS]; /* as chip is write only */ | |
81 | struct regulator_dev *rdev[]; | |
82 | }; | |
83 | ||
84 | static int max8660_write(struct max8660 *max8660, u8 reg, u8 mask, u8 val) | |
85 | { | |
86 | static const u8 max8660_addresses[MAX8660_N_REGS] = | |
87 | { 0x10, 0x12, 0x20, 0x23, 0x24, 0x29, 0x2a, 0x32, 0x33, 0x39, 0x80 }; | |
88 | ||
89 | int ret; | |
90 | u8 reg_val = (max8660->shadow_regs[reg] & mask) | val; | |
91 | dev_vdbg(&max8660->client->dev, "Writing reg %02x with %02x\n", | |
92 | max8660_addresses[reg], reg_val); | |
93 | ||
94 | ret = i2c_smbus_write_byte_data(max8660->client, | |
95 | max8660_addresses[reg], reg_val); | |
96 | if (ret == 0) | |
97 | max8660->shadow_regs[reg] = reg_val; | |
98 | ||
99 | return ret; | |
100 | } | |
101 | ||
102 | ||
103 | /* | |
104 | * DCDC functions | |
105 | */ | |
106 | ||
107 | static int max8660_dcdc_is_enabled(struct regulator_dev *rdev) | |
108 | { | |
109 | struct max8660 *max8660 = rdev_get_drvdata(rdev); | |
110 | u8 val = max8660->shadow_regs[MAX8660_OVER1]; | |
111 | u8 mask = (rdev_get_id(rdev) == MAX8660_V3) ? 1 : 4; | |
112 | return !!(val & mask); | |
113 | } | |
114 | ||
115 | static int max8660_dcdc_enable(struct regulator_dev *rdev) | |
116 | { | |
117 | struct max8660 *max8660 = rdev_get_drvdata(rdev); | |
118 | u8 bit = (rdev_get_id(rdev) == MAX8660_V3) ? 1 : 4; | |
119 | return max8660_write(max8660, MAX8660_OVER1, 0xff, bit); | |
120 | } | |
121 | ||
122 | static int max8660_dcdc_disable(struct regulator_dev *rdev) | |
123 | { | |
124 | struct max8660 *max8660 = rdev_get_drvdata(rdev); | |
125 | u8 mask = (rdev_get_id(rdev) == MAX8660_V3) ? ~1 : ~4; | |
126 | return max8660_write(max8660, MAX8660_OVER1, mask, 0); | |
127 | } | |
128 | ||
9392c4f0 | 129 | static int max8660_dcdc_get_voltage_sel(struct regulator_dev *rdev) |
27f37e4b WS |
130 | { |
131 | struct max8660 *max8660 = rdev_get_drvdata(rdev); | |
9392c4f0 | 132 | |
27f37e4b WS |
133 | u8 reg = (rdev_get_id(rdev) == MAX8660_V3) ? MAX8660_ADTV2 : MAX8660_SDTV2; |
134 | u8 selector = max8660->shadow_regs[reg]; | |
9392c4f0 | 135 | return selector; |
27f37e4b WS |
136 | } |
137 | ||
3a93f2a9 MB |
138 | static int max8660_dcdc_set(struct regulator_dev *rdev, int min_uV, int max_uV, |
139 | unsigned int *s) | |
27f37e4b WS |
140 | { |
141 | struct max8660 *max8660 = rdev_get_drvdata(rdev); | |
142 | u8 reg, selector, bits; | |
143 | int ret; | |
144 | ||
145 | if (min_uV < MAX8660_DCDC_MIN_UV || min_uV > MAX8660_DCDC_MAX_UV) | |
146 | return -EINVAL; | |
147 | if (max_uV < MAX8660_DCDC_MIN_UV || max_uV > MAX8660_DCDC_MAX_UV) | |
148 | return -EINVAL; | |
149 | ||
ab353c23 AL |
150 | selector = DIV_ROUND_UP(min_uV - MAX8660_DCDC_MIN_UV, |
151 | MAX8660_DCDC_STEP); | |
27f37e4b | 152 | |
134d34a8 | 153 | ret = regulator_list_voltage_linear(rdev, selector); |
27f37e4b WS |
154 | if (ret < 0 || ret > max_uV) |
155 | return -EINVAL; | |
156 | ||
ab353c23 AL |
157 | *s = selector; |
158 | ||
27f37e4b WS |
159 | reg = (rdev_get_id(rdev) == MAX8660_V3) ? MAX8660_ADTV2 : MAX8660_SDTV2; |
160 | ret = max8660_write(max8660, reg, 0, selector); | |
161 | if (ret) | |
162 | return ret; | |
163 | ||
164 | /* Select target voltage register and activate regulation */ | |
165 | bits = (rdev_get_id(rdev) == MAX8660_V3) ? 0x03 : 0x30; | |
166 | return max8660_write(max8660, MAX8660_VCC1, 0xff, bits); | |
167 | } | |
168 | ||
169 | static struct regulator_ops max8660_dcdc_ops = { | |
170 | .is_enabled = max8660_dcdc_is_enabled, | |
134d34a8 | 171 | .list_voltage = regulator_list_voltage_linear, |
27f37e4b | 172 | .set_voltage = max8660_dcdc_set, |
9392c4f0 | 173 | .get_voltage_sel = max8660_dcdc_get_voltage_sel, |
27f37e4b WS |
174 | }; |
175 | ||
176 | ||
177 | /* | |
178 | * LDO5 functions | |
179 | */ | |
180 | ||
9392c4f0 | 181 | static int max8660_ldo5_get_voltage_sel(struct regulator_dev *rdev) |
27f37e4b WS |
182 | { |
183 | struct max8660 *max8660 = rdev_get_drvdata(rdev); | |
27f37e4b | 184 | |
9392c4f0 AL |
185 | u8 selector = max8660->shadow_regs[MAX8660_MDTV2]; |
186 | return selector; | |
27f37e4b WS |
187 | } |
188 | ||
3a93f2a9 MB |
189 | static int max8660_ldo5_set(struct regulator_dev *rdev, int min_uV, int max_uV, |
190 | unsigned int *s) | |
27f37e4b WS |
191 | { |
192 | struct max8660 *max8660 = rdev_get_drvdata(rdev); | |
193 | u8 selector; | |
194 | int ret; | |
195 | ||
196 | if (min_uV < MAX8660_LDO5_MIN_UV || min_uV > MAX8660_LDO5_MAX_UV) | |
197 | return -EINVAL; | |
198 | if (max_uV < MAX8660_LDO5_MIN_UV || max_uV > MAX8660_LDO5_MAX_UV) | |
199 | return -EINVAL; | |
200 | ||
ab353c23 AL |
201 | selector = DIV_ROUND_UP(min_uV - MAX8660_LDO5_MIN_UV, |
202 | MAX8660_LDO5_STEP); | |
203 | ||
134d34a8 | 204 | ret = regulator_list_voltage_linear(rdev, selector); |
27f37e4b WS |
205 | if (ret < 0 || ret > max_uV) |
206 | return -EINVAL; | |
207 | ||
3a93f2a9 MB |
208 | *s = selector; |
209 | ||
27f37e4b WS |
210 | ret = max8660_write(max8660, MAX8660_MDTV2, 0, selector); |
211 | if (ret) | |
212 | return ret; | |
213 | ||
214 | /* Select target voltage register and activate regulation */ | |
215 | return max8660_write(max8660, MAX8660_VCC1, 0xff, 0xc0); | |
216 | } | |
217 | ||
218 | static struct regulator_ops max8660_ldo5_ops = { | |
134d34a8 | 219 | .list_voltage = regulator_list_voltage_linear, |
27f37e4b | 220 | .set_voltage = max8660_ldo5_set, |
9392c4f0 | 221 | .get_voltage_sel = max8660_ldo5_get_voltage_sel, |
27f37e4b WS |
222 | }; |
223 | ||
224 | ||
225 | /* | |
226 | * LDO67 functions | |
227 | */ | |
228 | ||
229 | static int max8660_ldo67_is_enabled(struct regulator_dev *rdev) | |
230 | { | |
231 | struct max8660 *max8660 = rdev_get_drvdata(rdev); | |
232 | u8 val = max8660->shadow_regs[MAX8660_OVER2]; | |
233 | u8 mask = (rdev_get_id(rdev) == MAX8660_V6) ? 2 : 4; | |
234 | return !!(val & mask); | |
235 | } | |
236 | ||
237 | static int max8660_ldo67_enable(struct regulator_dev *rdev) | |
238 | { | |
239 | struct max8660 *max8660 = rdev_get_drvdata(rdev); | |
240 | u8 bit = (rdev_get_id(rdev) == MAX8660_V6) ? 2 : 4; | |
241 | return max8660_write(max8660, MAX8660_OVER2, 0xff, bit); | |
242 | } | |
243 | ||
244 | static int max8660_ldo67_disable(struct regulator_dev *rdev) | |
245 | { | |
246 | struct max8660 *max8660 = rdev_get_drvdata(rdev); | |
247 | u8 mask = (rdev_get_id(rdev) == MAX8660_V6) ? ~2 : ~4; | |
248 | return max8660_write(max8660, MAX8660_OVER2, mask, 0); | |
249 | } | |
250 | ||
9392c4f0 | 251 | static int max8660_ldo67_get_voltage_sel(struct regulator_dev *rdev) |
27f37e4b WS |
252 | { |
253 | struct max8660 *max8660 = rdev_get_drvdata(rdev); | |
9392c4f0 | 254 | |
27f37e4b WS |
255 | u8 shift = (rdev_get_id(rdev) == MAX8660_V6) ? 0 : 4; |
256 | u8 selector = (max8660->shadow_regs[MAX8660_L12VCR] >> shift) & 0xf; | |
9392c4f0 | 257 | return selector; |
27f37e4b WS |
258 | } |
259 | ||
3a93f2a9 MB |
260 | static int max8660_ldo67_set(struct regulator_dev *rdev, int min_uV, |
261 | int max_uV, unsigned int *s) | |
27f37e4b WS |
262 | { |
263 | struct max8660 *max8660 = rdev_get_drvdata(rdev); | |
264 | u8 selector; | |
265 | int ret; | |
266 | ||
267 | if (min_uV < MAX8660_LDO67_MIN_UV || min_uV > MAX8660_LDO67_MAX_UV) | |
268 | return -EINVAL; | |
269 | if (max_uV < MAX8660_LDO67_MIN_UV || max_uV > MAX8660_LDO67_MAX_UV) | |
270 | return -EINVAL; | |
271 | ||
ab353c23 AL |
272 | selector = DIV_ROUND_UP(min_uV - MAX8660_LDO67_MIN_UV, |
273 | MAX8660_LDO67_STEP); | |
27f37e4b | 274 | |
134d34a8 | 275 | ret = regulator_list_voltage_linear(rdev, selector); |
27f37e4b WS |
276 | if (ret < 0 || ret > max_uV) |
277 | return -EINVAL; | |
278 | ||
3a93f2a9 MB |
279 | *s = selector; |
280 | ||
27f37e4b WS |
281 | if (rdev_get_id(rdev) == MAX8660_V6) |
282 | return max8660_write(max8660, MAX8660_L12VCR, 0xf0, selector); | |
283 | else | |
284 | return max8660_write(max8660, MAX8660_L12VCR, 0x0f, selector << 4); | |
285 | } | |
286 | ||
287 | static struct regulator_ops max8660_ldo67_ops = { | |
288 | .is_enabled = max8660_ldo67_is_enabled, | |
289 | .enable = max8660_ldo67_enable, | |
290 | .disable = max8660_ldo67_disable, | |
134d34a8 | 291 | .list_voltage = regulator_list_voltage_linear, |
9392c4f0 | 292 | .get_voltage_sel = max8660_ldo67_get_voltage_sel, |
27f37e4b WS |
293 | .set_voltage = max8660_ldo67_set, |
294 | }; | |
295 | ||
621adb30 | 296 | static const struct regulator_desc max8660_reg[] = { |
27f37e4b WS |
297 | { |
298 | .name = "V3(DCDC)", | |
299 | .id = MAX8660_V3, | |
300 | .ops = &max8660_dcdc_ops, | |
301 | .type = REGULATOR_VOLTAGE, | |
302 | .n_voltages = MAX8660_DCDC_MAX_SEL + 1, | |
303 | .owner = THIS_MODULE, | |
134d34a8 AL |
304 | .min_uV = MAX8660_DCDC_MIN_UV, |
305 | .uV_step = MAX8660_DCDC_STEP, | |
27f37e4b WS |
306 | }, |
307 | { | |
308 | .name = "V4(DCDC)", | |
309 | .id = MAX8660_V4, | |
310 | .ops = &max8660_dcdc_ops, | |
311 | .type = REGULATOR_VOLTAGE, | |
312 | .n_voltages = MAX8660_DCDC_MAX_SEL + 1, | |
313 | .owner = THIS_MODULE, | |
134d34a8 AL |
314 | .min_uV = MAX8660_DCDC_MIN_UV, |
315 | .uV_step = MAX8660_DCDC_STEP, | |
27f37e4b WS |
316 | }, |
317 | { | |
318 | .name = "V5(LDO)", | |
319 | .id = MAX8660_V5, | |
320 | .ops = &max8660_ldo5_ops, | |
321 | .type = REGULATOR_VOLTAGE, | |
322 | .n_voltages = MAX8660_LDO5_MAX_SEL + 1, | |
323 | .owner = THIS_MODULE, | |
134d34a8 AL |
324 | .min_uV = MAX8660_LDO5_MIN_UV, |
325 | .uV_step = MAX8660_LDO5_STEP, | |
27f37e4b WS |
326 | }, |
327 | { | |
328 | .name = "V6(LDO)", | |
329 | .id = MAX8660_V6, | |
330 | .ops = &max8660_ldo67_ops, | |
331 | .type = REGULATOR_VOLTAGE, | |
332 | .n_voltages = MAX8660_LDO67_MAX_SEL + 1, | |
333 | .owner = THIS_MODULE, | |
134d34a8 AL |
334 | .min_uV = MAX8660_LDO67_MIN_UV, |
335 | .uV_step = MAX8660_LDO67_STEP, | |
27f37e4b WS |
336 | }, |
337 | { | |
338 | .name = "V7(LDO)", | |
339 | .id = MAX8660_V7, | |
340 | .ops = &max8660_ldo67_ops, | |
341 | .type = REGULATOR_VOLTAGE, | |
342 | .n_voltages = MAX8660_LDO67_MAX_SEL + 1, | |
343 | .owner = THIS_MODULE, | |
134d34a8 AL |
344 | .min_uV = MAX8660_LDO67_MIN_UV, |
345 | .uV_step = MAX8660_LDO67_STEP, | |
27f37e4b WS |
346 | }, |
347 | }; | |
348 | ||
308f100f DT |
349 | static int __devinit max8660_probe(struct i2c_client *client, |
350 | const struct i2c_device_id *i2c_id) | |
27f37e4b WS |
351 | { |
352 | struct regulator_dev **rdev; | |
353 | struct max8660_platform_data *pdata = client->dev.platform_data; | |
c172708d | 354 | struct regulator_config config = { }; |
27f37e4b WS |
355 | struct max8660 *max8660; |
356 | int boot_on, i, id, ret = -EINVAL; | |
357 | ||
358 | if (pdata->num_subdevs > MAX8660_V_END) { | |
308f100f | 359 | dev_err(&client->dev, "Too many regulators found!\n"); |
4d26f7d5 | 360 | return -EINVAL; |
27f37e4b WS |
361 | } |
362 | ||
575f690d | 363 | max8660 = devm_kzalloc(&client->dev, sizeof(struct max8660) + |
27f37e4b WS |
364 | sizeof(struct regulator_dev *) * MAX8660_V_END, |
365 | GFP_KERNEL); | |
4d26f7d5 AL |
366 | if (!max8660) |
367 | return -ENOMEM; | |
27f37e4b WS |
368 | |
369 | max8660->client = client; | |
370 | rdev = max8660->rdev; | |
371 | ||
372 | if (pdata->en34_is_high) { | |
373 | /* Simulate always on */ | |
374 | max8660->shadow_regs[MAX8660_OVER1] = 5; | |
375 | } else { | |
376 | /* Otherwise devices can be toggled via software */ | |
377 | max8660_dcdc_ops.enable = max8660_dcdc_enable; | |
378 | max8660_dcdc_ops.disable = max8660_dcdc_disable; | |
379 | } | |
380 | ||
381 | /* | |
382 | * First, set up shadow registers to prevent glitches. As some | |
383 | * registers are shared between regulators, everything must be properly | |
384 | * set up for all regulators in advance. | |
385 | */ | |
386 | max8660->shadow_regs[MAX8660_ADTV1] = | |
387 | max8660->shadow_regs[MAX8660_ADTV2] = | |
388 | max8660->shadow_regs[MAX8660_SDTV1] = | |
389 | max8660->shadow_regs[MAX8660_SDTV2] = 0x1b; | |
390 | max8660->shadow_regs[MAX8660_MDTV1] = | |
391 | max8660->shadow_regs[MAX8660_MDTV2] = 0x04; | |
392 | ||
393 | for (i = 0; i < pdata->num_subdevs; i++) { | |
394 | ||
395 | if (!pdata->subdevs[i].platform_data) | |
4d26f7d5 | 396 | goto err_out; |
27f37e4b WS |
397 | |
398 | boot_on = pdata->subdevs[i].platform_data->constraints.boot_on; | |
399 | ||
400 | switch (pdata->subdevs[i].id) { | |
401 | case MAX8660_V3: | |
402 | if (boot_on) | |
403 | max8660->shadow_regs[MAX8660_OVER1] |= 1; | |
404 | break; | |
405 | ||
406 | case MAX8660_V4: | |
407 | if (boot_on) | |
408 | max8660->shadow_regs[MAX8660_OVER1] |= 4; | |
409 | break; | |
410 | ||
411 | case MAX8660_V5: | |
412 | break; | |
413 | ||
414 | case MAX8660_V6: | |
415 | if (boot_on) | |
416 | max8660->shadow_regs[MAX8660_OVER2] |= 2; | |
417 | break; | |
418 | ||
419 | case MAX8660_V7: | |
420 | if (!strcmp(i2c_id->name, "max8661")) { | |
421 | dev_err(&client->dev, "Regulator not on this chip!\n"); | |
4d26f7d5 | 422 | goto err_out; |
27f37e4b WS |
423 | } |
424 | ||
425 | if (boot_on) | |
426 | max8660->shadow_regs[MAX8660_OVER2] |= 4; | |
427 | break; | |
428 | ||
429 | default: | |
430 | dev_err(&client->dev, "invalid regulator %s\n", | |
431 | pdata->subdevs[i].name); | |
4d26f7d5 | 432 | goto err_out; |
27f37e4b WS |
433 | } |
434 | } | |
435 | ||
436 | /* Finally register devices */ | |
437 | for (i = 0; i < pdata->num_subdevs; i++) { | |
438 | ||
439 | id = pdata->subdevs[i].id; | |
440 | ||
c172708d MB |
441 | config.dev = &client->dev; |
442 | config.init_data = pdata->subdevs[i].platform_data; | |
443 | config.driver_data = max8660; | |
444 | ||
445 | rdev[i] = regulator_register(&max8660_reg[id], &config); | |
27f37e4b WS |
446 | if (IS_ERR(rdev[i])) { |
447 | ret = PTR_ERR(rdev[i]); | |
448 | dev_err(&client->dev, "failed to register %s\n", | |
449 | max8660_reg[id].name); | |
450 | goto err_unregister; | |
451 | } | |
452 | } | |
453 | ||
53a4befa | 454 | i2c_set_clientdata(client, max8660); |
27f37e4b WS |
455 | return 0; |
456 | ||
457 | err_unregister: | |
458 | while (--i >= 0) | |
459 | regulator_unregister(rdev[i]); | |
4d26f7d5 | 460 | err_out: |
27f37e4b WS |
461 | return ret; |
462 | } | |
463 | ||
308f100f | 464 | static int __devexit max8660_remove(struct i2c_client *client) |
27f37e4b | 465 | { |
53a4befa | 466 | struct max8660 *max8660 = i2c_get_clientdata(client); |
27f37e4b WS |
467 | int i; |
468 | ||
469 | for (i = 0; i < MAX8660_V_END; i++) | |
53a4befa AL |
470 | if (max8660->rdev[i]) |
471 | regulator_unregister(max8660->rdev[i]); | |
27f37e4b WS |
472 | return 0; |
473 | } | |
474 | ||
475 | static const struct i2c_device_id max8660_id[] = { | |
476 | { "max8660", 0 }, | |
477 | { "max8661", 0 }, | |
478 | { } | |
479 | }; | |
480 | MODULE_DEVICE_TABLE(i2c, max8660_id); | |
481 | ||
482 | static struct i2c_driver max8660_driver = { | |
483 | .probe = max8660_probe, | |
308f100f | 484 | .remove = __devexit_p(max8660_remove), |
27f37e4b WS |
485 | .driver = { |
486 | .name = "max8660", | |
308f100f | 487 | .owner = THIS_MODULE, |
27f37e4b WS |
488 | }, |
489 | .id_table = max8660_id, | |
490 | }; | |
491 | ||
492 | static int __init max8660_init(void) | |
493 | { | |
494 | return i2c_add_driver(&max8660_driver); | |
495 | } | |
496 | subsys_initcall(max8660_init); | |
497 | ||
498 | static void __exit max8660_exit(void) | |
499 | { | |
500 | i2c_del_driver(&max8660_driver); | |
501 | } | |
502 | module_exit(max8660_exit); | |
503 | ||
504 | /* Module information */ | |
505 | MODULE_DESCRIPTION("MAXIM 8660/8661 voltage regulator driver"); | |
506 | MODULE_AUTHOR("Wolfram Sang"); | |
507 | MODULE_LICENSE("GPL v2"); |