1 // SPDX-License-Identifier: GPL-2.0-only
3 * ADP5061 I2C Programmable Linear Battery Charger
5 * Copyright 2018 Analog Devices Inc.
8 #include <linux/init.h>
9 #include <linux/module.h>
10 #include <linux/slab.h>
11 #include <linux/i2c.h>
12 #include <linux/delay.h>
14 #include <linux/mod_devicetable.h>
15 #include <linux/power_supply.h>
16 #include <linux/platform_device.h>
18 #include <linux/regmap.h>
20 /* ADP5061 registers definition */
21 #define ADP5061_ID 0x00
22 #define ADP5061_REV 0x01
23 #define ADP5061_VINX_SET 0x02
24 #define ADP5061_TERM_SET 0x03
25 #define ADP5061_CHG_CURR 0x04
26 #define ADP5061_VOLTAGE_TH 0x05
27 #define ADP5061_TIMER_SET 0x06
28 #define ADP5061_FUNC_SET_1 0x07
29 #define ADP5061_FUNC_SET_2 0x08
30 #define ADP5061_INT_EN 0x09
31 #define ADP5061_INT_ACT 0x0A
32 #define ADP5061_CHG_STATUS_1 0x0B
33 #define ADP5061_CHG_STATUS_2 0x0C
34 #define ADP5061_FAULT 0x0D
35 #define ADP5061_BATTERY_SHORT 0x10
36 #define ADP5061_IEND 0x11
38 /* ADP5061_VINX_SET */
39 #define ADP5061_VINX_SET_ILIM_MSK GENMASK(3, 0)
40 #define ADP5061_VINX_SET_ILIM_MODE(x) (((x) & 0x0F) << 0)
42 /* ADP5061_TERM_SET */
43 #define ADP5061_TERM_SET_VTRM_MSK GENMASK(7, 2)
44 #define ADP5061_TERM_SET_VTRM_MODE(x) (((x) & 0x3F) << 2)
45 #define ADP5061_TERM_SET_CHG_VLIM_MSK GENMASK(1, 0)
46 #define ADP5061_TERM_SET_CHG_VLIM_MODE(x) (((x) & 0x03) << 0)
48 /* ADP5061_CHG_CURR */
49 #define ADP5061_CHG_CURR_ICHG_MSK GENMASK(6, 2)
50 #define ADP5061_CHG_CURR_ICHG_MODE(x) (((x) & 0x1F) << 2)
51 #define ADP5061_CHG_CURR_ITRK_DEAD_MSK GENMASK(1, 0)
52 #define ADP5061_CHG_CURR_ITRK_DEAD_MODE(x) (((x) & 0x03) << 0)
54 /* ADP5061_VOLTAGE_TH */
55 #define ADP5061_VOLTAGE_TH_DIS_RCH_MSK BIT(7)
56 #define ADP5061_VOLTAGE_TH_DIS_RCH_MODE(x) (((x) & 0x01) << 7)
57 #define ADP5061_VOLTAGE_TH_VRCH_MSK GENMASK(6, 5)
58 #define ADP5061_VOLTAGE_TH_VRCH_MODE(x) (((x) & 0x03) << 5)
59 #define ADP5061_VOLTAGE_TH_VTRK_DEAD_MSK GENMASK(4, 3)
60 #define ADP5061_VOLTAGE_TH_VTRK_DEAD_MODE(x) (((x) & 0x03) << 3)
61 #define ADP5061_VOLTAGE_TH_VWEAK_MSK GENMASK(2, 0)
62 #define ADP5061_VOLTAGE_TH_VWEAK_MODE(x) (((x) & 0x07) << 0)
64 /* ADP5061_CHG_STATUS_1 */
65 #define ADP5061_CHG_STATUS_1_VIN_OV(x) (((x) >> 7) & 0x1)
66 #define ADP5061_CHG_STATUS_1_VIN_OK(x) (((x) >> 6) & 0x1)
67 #define ADP5061_CHG_STATUS_1_VIN_ILIM(x) (((x) >> 5) & 0x1)
68 #define ADP5061_CHG_STATUS_1_THERM_LIM(x) (((x) >> 4) & 0x1)
69 #define ADP5061_CHG_STATUS_1_CHDONE(x) (((x) >> 3) & 0x1)
70 #define ADP5061_CHG_STATUS_1_CHG_STATUS(x) (((x) >> 0) & 0x7)
72 /* ADP5061_CHG_STATUS_2 */
73 #define ADP5061_CHG_STATUS_2_THR_STATUS(x) (((x) >> 5) & 0x7)
74 #define ADP5061_CHG_STATUS_2_RCH_LIM_INFO(x) (((x) >> 3) & 0x1)
75 #define ADP5061_CHG_STATUS_2_BAT_STATUS(x) (((x) >> 0) & 0x7)
78 #define ADP5061_IEND_IEND_MSK GENMASK(7, 5)
79 #define ADP5061_IEND_IEND_MODE(x) (((x) & 0x07) << 5)
81 #define ADP5061_NO_BATTERY 0x01
82 #define ADP5061_ICHG_MAX 1300 // mA
84 enum adp5061_chg_status
{
91 ADP5061_CHG_TIMER_EXP
,
95 static const int adp5061_chg_type
[4] = {
96 [ADP5061_CHG_OFF
] = POWER_SUPPLY_CHARGE_TYPE_NONE
,
97 [ADP5061_CHG_TRICKLE
] = POWER_SUPPLY_CHARGE_TYPE_TRICKLE
,
98 [ADP5061_CHG_FAST_CC
] = POWER_SUPPLY_CHARGE_TYPE_FAST
,
99 [ADP5061_CHG_FAST_CV
] = POWER_SUPPLY_CHARGE_TYPE_FAST
,
102 static const int adp5061_vweak_th
[8] = {
103 2700, 2800, 2900, 3000, 3100, 3200, 3300, 3400,
106 static const int adp5061_prechg_current
[4] = {
110 static const int adp5061_vmin
[4] = {
111 2000, 2500, 2600, 2900,
114 static const int adp5061_const_chg_vmax
[4] = {
115 3200, 3400, 3700, 3800,
118 static const int adp5061_const_ichg
[24] = {
119 50, 100, 150, 200, 250, 300, 350, 400, 450, 500, 550, 600, 650,
120 700, 750, 800, 850, 900, 950, 1000, 1050, 1100, 1200, 1300,
123 static const int adp5061_vmax
[36] = {
124 3800, 3820, 3840, 3860, 3880, 3900, 3920, 3940, 3960, 3980,
125 4000, 4020, 4040, 4060, 4080, 4100, 4120, 4140, 4160, 4180,
126 4200, 4220, 4240, 4260, 4280, 4300, 4320, 4340, 4360, 4380,
127 4400, 4420, 4440, 4460, 4480, 4500,
130 static const int adp5061_in_current_lim
[16] = {
131 100, 150, 200, 250, 300, 400, 500, 600, 700,
132 800, 900, 1000, 1200, 1500, 1800, 2100,
135 static const int adp5061_iend
[8] = {
136 12500, 32500, 52500, 72500, 92500, 117500, 142500, 170000,
139 struct adp5061_state
{
140 struct i2c_client
*client
;
141 struct regmap
*regmap
;
142 struct power_supply
*psy
;
145 static int adp5061_get_array_index(const int *array
, u8 size
, int val
)
149 for (i
= 1; i
< size
; i
++) {
157 static int adp5061_get_status(struct adp5061_state
*st
,
158 u8
*status1
, u8
*status2
)
163 /* CHG_STATUS1 and CHG_STATUS2 are adjacent regs */
164 ret
= regmap_bulk_read(st
->regmap
, ADP5061_CHG_STATUS_1
,
175 static int adp5061_get_input_current_limit(struct adp5061_state
*st
,
176 union power_supply_propval
*val
)
181 ret
= regmap_read(st
->regmap
, ADP5061_VINX_SET
, ®val
);
185 mode
= ADP5061_VINX_SET_ILIM_MODE(regval
);
186 val
->intval
= adp5061_in_current_lim
[mode
] * 1000;
191 static int adp5061_set_input_current_limit(struct adp5061_state
*st
, int val
)
195 /* Convert from uA to mA */
197 index
= adp5061_get_array_index(adp5061_in_current_lim
,
198 ARRAY_SIZE(adp5061_in_current_lim
),
203 return regmap_update_bits(st
->regmap
, ADP5061_VINX_SET
,
204 ADP5061_VINX_SET_ILIM_MSK
,
205 ADP5061_VINX_SET_ILIM_MODE(index
));
208 static int adp5061_set_min_voltage(struct adp5061_state
*st
, int val
)
212 /* Convert from uV to mV */
214 index
= adp5061_get_array_index(adp5061_vmin
,
215 ARRAY_SIZE(adp5061_vmin
),
220 return regmap_update_bits(st
->regmap
, ADP5061_VOLTAGE_TH
,
221 ADP5061_VOLTAGE_TH_VTRK_DEAD_MSK
,
222 ADP5061_VOLTAGE_TH_VTRK_DEAD_MODE(index
));
225 static int adp5061_get_min_voltage(struct adp5061_state
*st
,
226 union power_supply_propval
*val
)
231 ret
= regmap_read(st
->regmap
, ADP5061_VOLTAGE_TH
, ®val
);
235 regval
= ((regval
& ADP5061_VOLTAGE_TH_VTRK_DEAD_MSK
) >> 3);
236 val
->intval
= adp5061_vmin
[regval
] * 1000;
241 static int adp5061_get_chg_volt_lim(struct adp5061_state
*st
,
242 union power_supply_propval
*val
)
247 ret
= regmap_read(st
->regmap
, ADP5061_TERM_SET
, ®val
);
251 mode
= ADP5061_TERM_SET_CHG_VLIM_MODE(regval
);
252 val
->intval
= adp5061_const_chg_vmax
[mode
] * 1000;
257 static int adp5061_get_max_voltage(struct adp5061_state
*st
,
258 union power_supply_propval
*val
)
263 ret
= regmap_read(st
->regmap
, ADP5061_TERM_SET
, ®val
);
267 regval
= ((regval
& ADP5061_TERM_SET_VTRM_MSK
) >> 2) - 0x0F;
268 if (regval
>= ARRAY_SIZE(adp5061_vmax
))
269 regval
= ARRAY_SIZE(adp5061_vmax
) - 1;
271 val
->intval
= adp5061_vmax
[regval
] * 1000;
276 static int adp5061_set_max_voltage(struct adp5061_state
*st
, int val
)
280 /* Convert from uV to mV */
285 vmax_index
= adp5061_get_array_index(adp5061_vmax
,
286 ARRAY_SIZE(adp5061_vmax
), val
);
292 return regmap_update_bits(st
->regmap
, ADP5061_TERM_SET
,
293 ADP5061_TERM_SET_VTRM_MSK
,
294 ADP5061_TERM_SET_VTRM_MODE(vmax_index
));
297 static int adp5061_set_const_chg_vmax(struct adp5061_state
*st
, int val
)
301 /* Convert from uV to mV */
303 index
= adp5061_get_array_index(adp5061_const_chg_vmax
,
304 ARRAY_SIZE(adp5061_const_chg_vmax
),
309 return regmap_update_bits(st
->regmap
, ADP5061_TERM_SET
,
310 ADP5061_TERM_SET_CHG_VLIM_MSK
,
311 ADP5061_TERM_SET_CHG_VLIM_MODE(index
));
314 static int adp5061_set_const_chg_current(struct adp5061_state
*st
, int val
)
319 /* Convert from uA to mA */
321 if (val
> ADP5061_ICHG_MAX
)
322 val
= ADP5061_ICHG_MAX
;
324 index
= adp5061_get_array_index(adp5061_const_ichg
,
325 ARRAY_SIZE(adp5061_const_ichg
),
330 return regmap_update_bits(st
->regmap
, ADP5061_CHG_CURR
,
331 ADP5061_CHG_CURR_ICHG_MSK
,
332 ADP5061_CHG_CURR_ICHG_MODE(index
));
335 static int adp5061_get_const_chg_current(struct adp5061_state
*st
,
336 union power_supply_propval
*val
)
341 ret
= regmap_read(st
->regmap
, ADP5061_CHG_CURR
, ®val
);
345 regval
= ((regval
& ADP5061_CHG_CURR_ICHG_MSK
) >> 2);
346 if (regval
>= ARRAY_SIZE(adp5061_const_ichg
))
347 regval
= ARRAY_SIZE(adp5061_const_ichg
) - 1;
349 val
->intval
= adp5061_const_ichg
[regval
] * 1000;
354 static int adp5061_get_prechg_current(struct adp5061_state
*st
,
355 union power_supply_propval
*val
)
360 ret
= regmap_read(st
->regmap
, ADP5061_CHG_CURR
, ®val
);
364 regval
&= ADP5061_CHG_CURR_ITRK_DEAD_MSK
;
365 val
->intval
= adp5061_prechg_current
[regval
] * 1000;
370 static int adp5061_set_prechg_current(struct adp5061_state
*st
, int val
)
374 /* Convert from uA to mA */
376 index
= adp5061_get_array_index(adp5061_prechg_current
,
377 ARRAY_SIZE(adp5061_prechg_current
),
382 return regmap_update_bits(st
->regmap
, ADP5061_CHG_CURR
,
383 ADP5061_CHG_CURR_ITRK_DEAD_MSK
,
384 ADP5061_CHG_CURR_ITRK_DEAD_MODE(index
));
387 static int adp5061_get_vweak_th(struct adp5061_state
*st
,
388 union power_supply_propval
*val
)
393 ret
= regmap_read(st
->regmap
, ADP5061_VOLTAGE_TH
, ®val
);
397 regval
&= ADP5061_VOLTAGE_TH_VWEAK_MSK
;
398 val
->intval
= adp5061_vweak_th
[regval
] * 1000;
403 static int adp5061_set_vweak_th(struct adp5061_state
*st
, int val
)
407 /* Convert from uV to mV */
409 index
= adp5061_get_array_index(adp5061_vweak_th
,
410 ARRAY_SIZE(adp5061_vweak_th
),
415 return regmap_update_bits(st
->regmap
, ADP5061_VOLTAGE_TH
,
416 ADP5061_VOLTAGE_TH_VWEAK_MSK
,
417 ADP5061_VOLTAGE_TH_VWEAK_MODE(index
));
420 static int adp5061_get_chg_type(struct adp5061_state
*st
,
421 union power_supply_propval
*val
)
426 ret
= adp5061_get_status(st
, &status1
, &status2
);
430 chg_type
= adp5061_chg_type
[ADP5061_CHG_STATUS_1_CHG_STATUS(status1
)];
431 if (chg_type
> ADP5061_CHG_FAST_CV
)
432 val
->intval
= POWER_SUPPLY_STATUS_UNKNOWN
;
434 val
->intval
= chg_type
;
439 static int adp5061_get_charger_status(struct adp5061_state
*st
,
440 union power_supply_propval
*val
)
445 ret
= adp5061_get_status(st
, &status1
, &status2
);
449 switch (ADP5061_CHG_STATUS_1_CHG_STATUS(status1
)) {
450 case ADP5061_CHG_OFF
:
451 val
->intval
= POWER_SUPPLY_STATUS_NOT_CHARGING
;
453 case ADP5061_CHG_TRICKLE
:
454 case ADP5061_CHG_FAST_CC
:
455 case ADP5061_CHG_FAST_CV
:
456 val
->intval
= POWER_SUPPLY_STATUS_CHARGING
;
458 case ADP5061_CHG_COMPLETE
:
459 val
->intval
= POWER_SUPPLY_STATUS_FULL
;
461 case ADP5061_CHG_TIMER_EXP
:
462 /* The battery must be discharging if there is a charge fault */
463 val
->intval
= POWER_SUPPLY_STATUS_DISCHARGING
;
466 val
->intval
= POWER_SUPPLY_STATUS_UNKNOWN
;
472 static int adp5061_get_battery_status(struct adp5061_state
*st
,
473 union power_supply_propval
*val
)
478 ret
= adp5061_get_status(st
, &status1
, &status2
);
482 switch (ADP5061_CHG_STATUS_2_BAT_STATUS(status2
)) {
483 case 0x0: /* Battery monitor off */
484 case 0x1: /* No battery */
485 val
->intval
= POWER_SUPPLY_CAPACITY_LEVEL_UNKNOWN
;
487 case 0x2: /* VBAT < VTRK */
488 val
->intval
= POWER_SUPPLY_CAPACITY_LEVEL_CRITICAL
;
490 case 0x3: /* VTRK < VBAT_SNS < VWEAK */
491 val
->intval
= POWER_SUPPLY_CAPACITY_LEVEL_LOW
;
493 case 0x4: /* VBAT_SNS > VWEAK */
494 val
->intval
= POWER_SUPPLY_CAPACITY_LEVEL_NORMAL
;
501 static int adp5061_get_termination_current(struct adp5061_state
*st
,
502 union power_supply_propval
*val
)
507 ret
= regmap_read(st
->regmap
, ADP5061_IEND
, ®val
);
511 regval
= (regval
& ADP5061_IEND_IEND_MSK
) >> 5;
512 val
->intval
= adp5061_iend
[regval
];
517 static int adp5061_set_termination_current(struct adp5061_state
*st
, int val
)
521 index
= adp5061_get_array_index(adp5061_iend
,
522 ARRAY_SIZE(adp5061_iend
),
527 return regmap_update_bits(st
->regmap
, ADP5061_IEND
,
528 ADP5061_IEND_IEND_MSK
,
529 ADP5061_IEND_IEND_MODE(index
));
532 static int adp5061_get_property(struct power_supply
*psy
,
533 enum power_supply_property psp
,
534 union power_supply_propval
*val
)
536 struct adp5061_state
*st
= power_supply_get_drvdata(psy
);
541 case POWER_SUPPLY_PROP_PRESENT
:
542 ret
= adp5061_get_status(st
, &status1
, &status2
);
546 mode
= ADP5061_CHG_STATUS_2_BAT_STATUS(status2
);
547 if (mode
== ADP5061_NO_BATTERY
)
552 case POWER_SUPPLY_PROP_CHARGE_TYPE
:
553 return adp5061_get_chg_type(st
, val
);
554 case POWER_SUPPLY_PROP_INPUT_CURRENT_LIMIT
:
555 /* This property is used to indicate the input current
556 * limit into VINx (ILIM)
558 return adp5061_get_input_current_limit(st
, val
);
559 case POWER_SUPPLY_PROP_VOLTAGE_MAX
:
560 /* This property is used to indicate the termination
563 return adp5061_get_max_voltage(st
, val
);
564 case POWER_SUPPLY_PROP_VOLTAGE_MIN
:
566 * This property is used to indicate the trickle to fast
567 * charge threshold (VTRK_DEAD)
569 return adp5061_get_min_voltage(st
, val
);
570 case POWER_SUPPLY_PROP_CONSTANT_CHARGE_VOLTAGE_MAX
:
571 /* This property is used to indicate the charging
572 * voltage limit (CHG_VLIM)
574 return adp5061_get_chg_volt_lim(st
, val
);
575 case POWER_SUPPLY_PROP_CONSTANT_CHARGE_CURRENT
:
577 * This property is used to indicate the value of the constant
578 * current charge (ICHG)
580 return adp5061_get_const_chg_current(st
, val
);
581 case POWER_SUPPLY_PROP_PRECHARGE_CURRENT
:
583 * This property is used to indicate the value of the trickle
584 * and weak charge currents (ITRK_DEAD)
586 return adp5061_get_prechg_current(st
, val
);
587 case POWER_SUPPLY_PROP_VOLTAGE_AVG
:
589 * This property is used to set the VWEAK threshold
590 * bellow this value, weak charge mode is entered
591 * above this value, fast chargerge mode is entered
593 return adp5061_get_vweak_th(st
, val
);
594 case POWER_SUPPLY_PROP_STATUS
:
596 * Indicate the charger status in relation to power
597 * supply status property
599 return adp5061_get_charger_status(st
, val
);
600 case POWER_SUPPLY_PROP_CAPACITY_LEVEL
:
602 * Indicate the battery status in relation to power
603 * supply capacity level property
605 return adp5061_get_battery_status(st
, val
);
606 case POWER_SUPPLY_PROP_CHARGE_TERM_CURRENT
:
607 /* Indicate the values of the termination current */
608 return adp5061_get_termination_current(st
, val
);
616 static int adp5061_set_property(struct power_supply
*psy
,
617 enum power_supply_property psp
,
618 const union power_supply_propval
*val
)
620 struct adp5061_state
*st
= power_supply_get_drvdata(psy
);
623 case POWER_SUPPLY_PROP_INPUT_CURRENT_LIMIT
:
624 return adp5061_set_input_current_limit(st
, val
->intval
);
625 case POWER_SUPPLY_PROP_VOLTAGE_MAX
:
626 return adp5061_set_max_voltage(st
, val
->intval
);
627 case POWER_SUPPLY_PROP_VOLTAGE_MIN
:
628 return adp5061_set_min_voltage(st
, val
->intval
);
629 case POWER_SUPPLY_PROP_CONSTANT_CHARGE_VOLTAGE_MAX
:
630 return adp5061_set_const_chg_vmax(st
, val
->intval
);
631 case POWER_SUPPLY_PROP_CONSTANT_CHARGE_CURRENT
:
632 return adp5061_set_const_chg_current(st
, val
->intval
);
633 case POWER_SUPPLY_PROP_PRECHARGE_CURRENT
:
634 return adp5061_set_prechg_current(st
, val
->intval
);
635 case POWER_SUPPLY_PROP_VOLTAGE_AVG
:
636 return adp5061_set_vweak_th(st
, val
->intval
);
637 case POWER_SUPPLY_PROP_CHARGE_TERM_CURRENT
:
638 return adp5061_set_termination_current(st
, val
->intval
);
646 static int adp5061_prop_writeable(struct power_supply
*psy
,
647 enum power_supply_property psp
)
650 case POWER_SUPPLY_PROP_INPUT_CURRENT_LIMIT
:
651 case POWER_SUPPLY_PROP_VOLTAGE_MAX
:
652 case POWER_SUPPLY_PROP_VOLTAGE_MIN
:
653 case POWER_SUPPLY_PROP_CONSTANT_CHARGE_VOLTAGE_MAX
:
654 case POWER_SUPPLY_PROP_CONSTANT_CHARGE_CURRENT
:
655 case POWER_SUPPLY_PROP_PRECHARGE_CURRENT
:
656 case POWER_SUPPLY_PROP_VOLTAGE_AVG
:
657 case POWER_SUPPLY_PROP_CHARGE_TERM_CURRENT
:
664 static enum power_supply_property adp5061_props
[] = {
665 POWER_SUPPLY_PROP_PRESENT
,
666 POWER_SUPPLY_PROP_CHARGE_TYPE
,
667 POWER_SUPPLY_PROP_INPUT_CURRENT_LIMIT
,
668 POWER_SUPPLY_PROP_VOLTAGE_MAX
,
669 POWER_SUPPLY_PROP_VOLTAGE_MIN
,
670 POWER_SUPPLY_PROP_CONSTANT_CHARGE_VOLTAGE_MAX
,
671 POWER_SUPPLY_PROP_CONSTANT_CHARGE_CURRENT
,
672 POWER_SUPPLY_PROP_PRECHARGE_CURRENT
,
673 POWER_SUPPLY_PROP_VOLTAGE_AVG
,
674 POWER_SUPPLY_PROP_STATUS
,
675 POWER_SUPPLY_PROP_CAPACITY_LEVEL
,
676 POWER_SUPPLY_PROP_CHARGE_TERM_CURRENT
,
679 static const struct regmap_config adp5061_regmap_config
= {
684 static const struct power_supply_desc adp5061_desc
= {
686 .type
= POWER_SUPPLY_TYPE_USB
,
687 .get_property
= adp5061_get_property
,
688 .set_property
= adp5061_set_property
,
689 .property_is_writeable
= adp5061_prop_writeable
,
690 .properties
= adp5061_props
,
691 .num_properties
= ARRAY_SIZE(adp5061_props
),
694 static int adp5061_probe(struct i2c_client
*client
,
695 const struct i2c_device_id
*id
)
697 struct power_supply_config psy_cfg
= {};
698 struct adp5061_state
*st
;
700 st
= devm_kzalloc(&client
->dev
, sizeof(*st
), GFP_KERNEL
);
705 st
->regmap
= devm_regmap_init_i2c(client
,
706 &adp5061_regmap_config
);
707 if (IS_ERR(st
->regmap
)) {
708 dev_err(&client
->dev
, "Failed to initialize register map\n");
712 i2c_set_clientdata(client
, st
);
713 psy_cfg
.drv_data
= st
;
715 st
->psy
= devm_power_supply_register(&client
->dev
,
719 if (IS_ERR(st
->psy
)) {
720 dev_err(&client
->dev
, "Failed to register power supply\n");
721 return PTR_ERR(st
->psy
);
727 static const struct i2c_device_id adp5061_id
[] = {
731 MODULE_DEVICE_TABLE(i2c
, adp5061_id
);
733 static struct i2c_driver adp5061_driver
= {
735 .name
= KBUILD_MODNAME
,
737 .probe
= adp5061_probe
,
738 .id_table
= adp5061_id
,
740 module_i2c_driver(adp5061_driver
);
742 MODULE_DESCRIPTION("Analog Devices adp5061 battery charger driver");
743 MODULE_AUTHOR("Stefan Popa <stefan.popa@analog.com>");
744 MODULE_LICENSE("GPL v2");