1 // SPDX-License-Identifier: GPL-2.0
3 * Fuel gauge driver for CellWise 2013 / 2015
5 * Copyright (C) 2012, RockChip
6 * Copyright (C) 2020, Tobias Schramm
8 * Authors: xuhuicong <xhc@rock-chips.com>
9 * Authors: Tobias Schramm <t.schramm@manjaro.org>
12 #include <linux/bits.h>
13 #include <linux/delay.h>
14 #include <linux/i2c.h>
15 #include <linux/gfp.h>
16 #include <linux/gpio/consumer.h>
17 #include <linux/kernel.h>
18 #include <linux/module.h>
19 #include <linux/power_supply.h>
20 #include <linux/property.h>
21 #include <linux/regmap.h>
22 #include <linux/time.h>
23 #include <linux/workqueue.h>
25 #define CW2015_SIZE_BATINFO 64
27 #define CW2015_RESET_TRIES 5
29 #define CW2015_REG_VERSION 0x00
30 #define CW2015_REG_VCELL 0x02
31 #define CW2015_REG_SOC 0x04
32 #define CW2015_REG_RRT_ALERT 0x06
33 #define CW2015_REG_CONFIG 0x08
34 #define CW2015_REG_MODE 0x0A
35 #define CW2015_REG_BATINFO 0x10
37 #define CW2015_MODE_SLEEP_MASK GENMASK(7, 6)
38 #define CW2015_MODE_SLEEP (0x03 << 6)
39 #define CW2015_MODE_NORMAL (0x00 << 6)
40 #define CW2015_MODE_QUICK_START (0x03 << 4)
41 #define CW2015_MODE_RESTART (0x0f << 0)
43 #define CW2015_CONFIG_UPDATE_FLG (0x01 << 1)
44 #define CW2015_ATHD(x) ((x) << 3)
45 #define CW2015_MASK_ATHD GENMASK(7, 3)
46 #define CW2015_MASK_SOC GENMASK(12, 0)
48 /* reset gauge of no valid state of charge could be polled for 40s */
49 #define CW2015_BAT_SOC_ERROR_MS (40 * MSEC_PER_SEC)
50 /* reset gauge if state of charge stuck for half an hour during charging */
51 #define CW2015_BAT_CHARGING_STUCK_MS (1800 * MSEC_PER_SEC)
53 /* poll interval from CellWise GPL Android driver example */
54 #define CW2015_DEFAULT_POLL_INTERVAL_MS 8000
56 #define CW2015_AVERAGING_SAMPLES 3
60 struct workqueue_struct
*battery_workqueue
;
61 struct delayed_work battery_delay_work
;
62 struct regmap
*regmap
;
63 struct power_supply
*rk_bat
;
64 struct power_supply_battery_info battery
;
67 bool charger_attached
;
79 unsigned int read_errors
;
80 unsigned int charge_stuck_cnt
;
83 static int cw_read_word(struct cw_battery
*cw_bat
, u8 reg
, u16
*val
)
88 ret
= regmap_bulk_read(cw_bat
->regmap
, reg
, &value
, sizeof(value
));
92 *val
= be16_to_cpu(value
);
96 static int cw_update_profile(struct cw_battery
*cw_bat
)
102 /* make sure gauge is not in sleep mode */
103 ret
= regmap_read(cw_bat
->regmap
, CW2015_REG_MODE
, ®_val
);
108 if ((reg_val
& CW2015_MODE_SLEEP_MASK
) == CW2015_MODE_SLEEP
) {
110 "Gauge is in sleep mode, can't update battery info\n");
114 /* write new battery info */
115 ret
= regmap_raw_write(cw_bat
->regmap
, CW2015_REG_BATINFO
,
117 CW2015_SIZE_BATINFO
);
121 /* set config update flag */
122 reg_val
|= CW2015_CONFIG_UPDATE_FLG
;
123 reg_val
&= ~CW2015_MASK_ATHD
;
124 reg_val
|= CW2015_ATHD(cw_bat
->alert_level
);
125 ret
= regmap_write(cw_bat
->regmap
, CW2015_REG_CONFIG
, reg_val
);
129 /* reset gauge to apply new battery profile */
130 reset_val
&= ~CW2015_MODE_RESTART
;
131 reg_val
= reset_val
| CW2015_MODE_RESTART
;
132 ret
= regmap_write(cw_bat
->regmap
, CW2015_REG_MODE
, reg_val
);
136 /* wait for gauge to reset */
139 /* clear reset flag */
140 ret
= regmap_write(cw_bat
->regmap
, CW2015_REG_MODE
, reset_val
);
144 /* wait for gauge to become ready */
145 ret
= regmap_read_poll_timeout(cw_bat
->regmap
, CW2015_REG_SOC
,
146 reg_val
, reg_val
<= 100,
147 10 * USEC_PER_MSEC
, 10 * USEC_PER_SEC
);
150 "Gauge did not become ready after profile upload\n");
152 dev_dbg(cw_bat
->dev
, "Battery profile updated\n");
157 static int cw_init(struct cw_battery
*cw_bat
)
160 unsigned int reg_val
= CW2015_MODE_SLEEP
;
162 if ((reg_val
& CW2015_MODE_SLEEP_MASK
) == CW2015_MODE_SLEEP
) {
163 reg_val
= CW2015_MODE_NORMAL
;
164 ret
= regmap_write(cw_bat
->regmap
, CW2015_REG_MODE
, reg_val
);
169 ret
= regmap_read(cw_bat
->regmap
, CW2015_REG_CONFIG
, ®_val
);
173 if ((reg_val
& CW2015_MASK_ATHD
) != CW2015_ATHD(cw_bat
->alert_level
)) {
174 dev_dbg(cw_bat
->dev
, "Setting new alert level\n");
175 reg_val
&= ~CW2015_MASK_ATHD
;
176 reg_val
|= ~CW2015_ATHD(cw_bat
->alert_level
);
177 ret
= regmap_write(cw_bat
->regmap
, CW2015_REG_CONFIG
, reg_val
);
182 ret
= regmap_read(cw_bat
->regmap
, CW2015_REG_CONFIG
, ®_val
);
186 if (!(reg_val
& CW2015_CONFIG_UPDATE_FLG
)) {
188 "Battery profile not present, uploading battery profile\n");
189 if (cw_bat
->bat_profile
) {
190 ret
= cw_update_profile(cw_bat
);
193 "Failed to upload battery profile\n");
197 dev_warn(cw_bat
->dev
,
198 "No profile specified, continuing without profile\n");
200 } else if (cw_bat
->bat_profile
) {
201 u8 bat_info
[CW2015_SIZE_BATINFO
];
203 ret
= regmap_raw_read(cw_bat
->regmap
, CW2015_REG_BATINFO
,
204 bat_info
, CW2015_SIZE_BATINFO
);
207 "Failed to read stored battery profile\n");
211 if (memcmp(bat_info
, cw_bat
->bat_profile
, CW2015_SIZE_BATINFO
)) {
212 dev_warn(cw_bat
->dev
, "Replacing stored battery profile\n");
213 ret
= cw_update_profile(cw_bat
);
218 dev_warn(cw_bat
->dev
,
219 "Can't check current battery profile, no profile provided\n");
222 dev_dbg(cw_bat
->dev
, "Battery profile configured\n");
226 static int cw_power_on_reset(struct cw_battery
*cw_bat
)
229 unsigned char reset_val
;
231 reset_val
= CW2015_MODE_SLEEP
;
232 ret
= regmap_write(cw_bat
->regmap
, CW2015_REG_MODE
, reset_val
);
236 /* wait for gauge to enter sleep */
239 reset_val
= CW2015_MODE_NORMAL
;
240 ret
= regmap_write(cw_bat
->regmap
, CW2015_REG_MODE
, reset_val
);
244 ret
= cw_init(cw_bat
);
250 #define HYSTERESIS(current, previous, up, down) \
251 (((current) < (previous) + (up)) && ((current) > (previous) - (down)))
253 static int cw_get_soc(struct cw_battery
*cw_bat
)
258 ret
= regmap_read(cw_bat
->regmap
, CW2015_REG_SOC
, &soc
);
263 int max_error_cycles
=
264 CW2015_BAT_SOC_ERROR_MS
/ cw_bat
->poll_interval_ms
;
266 dev_err(cw_bat
->dev
, "Invalid SoC %d%%\n", soc
);
267 cw_bat
->read_errors
++;
268 if (cw_bat
->read_errors
> max_error_cycles
) {
269 dev_warn(cw_bat
->dev
,
270 "Too many invalid SoC reports, resetting gauge\n");
271 cw_power_on_reset(cw_bat
);
272 cw_bat
->read_errors
= 0;
276 cw_bat
->read_errors
= 0;
278 /* Reset gauge if stuck while charging */
279 if (cw_bat
->status
== POWER_SUPPLY_STATUS_CHARGING
&& soc
== cw_bat
->soc
) {
280 int max_stuck_cycles
=
281 CW2015_BAT_CHARGING_STUCK_MS
/ cw_bat
->poll_interval_ms
;
283 cw_bat
->charge_stuck_cnt
++;
284 if (cw_bat
->charge_stuck_cnt
> max_stuck_cycles
) {
285 dev_warn(cw_bat
->dev
,
286 "SoC stuck @%u%%, resetting gauge\n", soc
);
287 cw_power_on_reset(cw_bat
);
288 cw_bat
->charge_stuck_cnt
= 0;
291 cw_bat
->charge_stuck_cnt
= 0;
294 /* Ignore voltage dips during charge */
295 if (cw_bat
->charger_attached
&& HYSTERESIS(soc
, cw_bat
->soc
, 0, 3))
298 /* Ignore voltage spikes during discharge */
299 if (!cw_bat
->charger_attached
&& HYSTERESIS(soc
, cw_bat
->soc
, 3, 0))
305 static int cw_get_voltage(struct cw_battery
*cw_bat
)
307 int ret
, i
, voltage_mv
;
311 for (i
= 0; i
< CW2015_AVERAGING_SAMPLES
; i
++) {
312 ret
= cw_read_word(cw_bat
, CW2015_REG_VCELL
, ®_val
);
318 avg
/= CW2015_AVERAGING_SAMPLES
;
321 * 305 uV per ADC step
322 * Use 312 / 1024 as efficient approximation of 305 / 1000
323 * Negligible error of 0.1%
325 voltage_mv
= avg
* 312 / 1024;
327 dev_dbg(cw_bat
->dev
, "Read voltage: %d mV, raw=0x%04x\n",
328 voltage_mv
, reg_val
);
332 static int cw_get_time_to_empty(struct cw_battery
*cw_bat
)
337 ret
= cw_read_word(cw_bat
, CW2015_REG_RRT_ALERT
, &value16
);
341 return value16
& CW2015_MASK_SOC
;
344 static void cw_update_charge_status(struct cw_battery
*cw_bat
)
348 ret
= power_supply_am_i_supplied(cw_bat
->rk_bat
);
350 dev_warn(cw_bat
->dev
, "Failed to get supply state: %d\n", ret
);
352 bool charger_attached
;
354 charger_attached
= !!ret
;
355 if (cw_bat
->charger_attached
!= charger_attached
) {
356 cw_bat
->battery_changed
= true;
357 if (charger_attached
)
358 cw_bat
->charge_count
++;
360 cw_bat
->charger_attached
= charger_attached
;
364 static void cw_update_soc(struct cw_battery
*cw_bat
)
368 soc
= cw_get_soc(cw_bat
);
370 dev_err(cw_bat
->dev
, "Failed to get SoC from gauge: %d\n", soc
);
371 else if (cw_bat
->soc
!= soc
) {
373 cw_bat
->battery_changed
= true;
377 static void cw_update_voltage(struct cw_battery
*cw_bat
)
381 voltage_mv
= cw_get_voltage(cw_bat
);
383 dev_err(cw_bat
->dev
, "Failed to get voltage from gauge: %d\n",
386 cw_bat
->voltage_mv
= voltage_mv
;
389 static void cw_update_status(struct cw_battery
*cw_bat
)
391 int status
= POWER_SUPPLY_STATUS_DISCHARGING
;
393 if (cw_bat
->charger_attached
) {
394 if (cw_bat
->soc
>= 100)
395 status
= POWER_SUPPLY_STATUS_FULL
;
397 status
= POWER_SUPPLY_STATUS_CHARGING
;
400 if (cw_bat
->status
!= status
)
401 cw_bat
->battery_changed
= true;
402 cw_bat
->status
= status
;
405 static void cw_update_time_to_empty(struct cw_battery
*cw_bat
)
409 time_to_empty
= cw_get_time_to_empty(cw_bat
);
410 if (time_to_empty
< 0)
411 dev_err(cw_bat
->dev
, "Failed to get time to empty from gauge: %d\n",
413 else if (cw_bat
->time_to_empty
!= time_to_empty
) {
414 cw_bat
->time_to_empty
= time_to_empty
;
415 cw_bat
->battery_changed
= true;
419 static void cw_bat_work(struct work_struct
*work
)
421 struct delayed_work
*delay_work
;
422 struct cw_battery
*cw_bat
;
424 unsigned int reg_val
;
426 delay_work
= to_delayed_work(work
);
427 cw_bat
= container_of(delay_work
, struct cw_battery
, battery_delay_work
);
428 ret
= regmap_read(cw_bat
->regmap
, CW2015_REG_MODE
, ®_val
);
430 dev_err(cw_bat
->dev
, "Failed to read mode from gauge: %d\n", ret
);
432 if ((reg_val
& CW2015_MODE_SLEEP_MASK
) == CW2015_MODE_SLEEP
) {
435 for (i
= 0; i
< CW2015_RESET_TRIES
; i
++) {
436 if (!cw_power_on_reset(cw_bat
))
440 cw_update_soc(cw_bat
);
441 cw_update_voltage(cw_bat
);
442 cw_update_charge_status(cw_bat
);
443 cw_update_status(cw_bat
);
444 cw_update_time_to_empty(cw_bat
);
446 dev_dbg(cw_bat
->dev
, "charger_attached = %d\n", cw_bat
->charger_attached
);
447 dev_dbg(cw_bat
->dev
, "status = %d\n", cw_bat
->status
);
448 dev_dbg(cw_bat
->dev
, "soc = %d%%\n", cw_bat
->soc
);
449 dev_dbg(cw_bat
->dev
, "voltage = %dmV\n", cw_bat
->voltage_mv
);
451 if (cw_bat
->battery_changed
)
452 power_supply_changed(cw_bat
->rk_bat
);
453 cw_bat
->battery_changed
= false;
455 queue_delayed_work(cw_bat
->battery_workqueue
,
456 &cw_bat
->battery_delay_work
,
457 msecs_to_jiffies(cw_bat
->poll_interval_ms
));
460 static bool cw_battery_valid_time_to_empty(struct cw_battery
*cw_bat
)
462 return cw_bat
->time_to_empty
> 0 &&
463 cw_bat
->time_to_empty
< CW2015_MASK_SOC
&&
464 cw_bat
->status
== POWER_SUPPLY_STATUS_DISCHARGING
;
467 static int cw_battery_get_property(struct power_supply
*psy
,
468 enum power_supply_property psp
,
469 union power_supply_propval
*val
)
471 struct cw_battery
*cw_bat
;
473 cw_bat
= power_supply_get_drvdata(psy
);
475 case POWER_SUPPLY_PROP_CAPACITY
:
476 val
->intval
= cw_bat
->soc
;
479 case POWER_SUPPLY_PROP_STATUS
:
480 val
->intval
= cw_bat
->status
;
483 case POWER_SUPPLY_PROP_PRESENT
:
484 val
->intval
= !!cw_bat
->voltage_mv
;
487 case POWER_SUPPLY_PROP_VOLTAGE_NOW
:
488 val
->intval
= cw_bat
->voltage_mv
* 1000;
491 case POWER_SUPPLY_PROP_TIME_TO_EMPTY_NOW
:
492 if (cw_battery_valid_time_to_empty(cw_bat
))
493 val
->intval
= cw_bat
->time_to_empty
;
498 case POWER_SUPPLY_PROP_TECHNOLOGY
:
499 val
->intval
= POWER_SUPPLY_TECHNOLOGY_LION
;
502 case POWER_SUPPLY_PROP_CHARGE_COUNTER
:
503 val
->intval
= cw_bat
->charge_count
;
506 case POWER_SUPPLY_PROP_CHARGE_FULL
:
507 case POWER_SUPPLY_PROP_CHARGE_FULL_DESIGN
:
508 if (cw_bat
->battery
.charge_full_design_uah
> 0)
509 val
->intval
= cw_bat
->battery
.charge_full_design_uah
;
514 case POWER_SUPPLY_PROP_CURRENT_NOW
:
515 if (cw_battery_valid_time_to_empty(cw_bat
) &&
516 cw_bat
->battery
.charge_full_design_uah
> 0) {
517 /* calculate remaining capacity */
518 val
->intval
= cw_bat
->battery
.charge_full_design_uah
;
519 val
->intval
= val
->intval
* cw_bat
->soc
/ 100;
521 /* estimate current based on time to empty */
522 val
->intval
= 60 * val
->intval
/ cw_bat
->time_to_empty
;
535 static enum power_supply_property cw_battery_properties
[] = {
536 POWER_SUPPLY_PROP_CAPACITY
,
537 POWER_SUPPLY_PROP_STATUS
,
538 POWER_SUPPLY_PROP_PRESENT
,
539 POWER_SUPPLY_PROP_VOLTAGE_NOW
,
540 POWER_SUPPLY_PROP_TIME_TO_EMPTY_NOW
,
541 POWER_SUPPLY_PROP_TECHNOLOGY
,
542 POWER_SUPPLY_PROP_CHARGE_COUNTER
,
543 POWER_SUPPLY_PROP_CHARGE_FULL
,
544 POWER_SUPPLY_PROP_CHARGE_FULL_DESIGN
,
545 POWER_SUPPLY_PROP_CURRENT_NOW
,
548 static const struct power_supply_desc cw2015_bat_desc
= {
549 .name
= "cw2015-battery",
550 .type
= POWER_SUPPLY_TYPE_BATTERY
,
551 .properties
= cw_battery_properties
,
552 .num_properties
= ARRAY_SIZE(cw_battery_properties
),
553 .get_property
= cw_battery_get_property
,
556 static int cw2015_parse_properties(struct cw_battery
*cw_bat
)
558 struct device
*dev
= cw_bat
->dev
;
562 length
= device_property_count_u8(dev
, "cellwise,battery-profile");
564 dev_warn(cw_bat
->dev
,
565 "No battery-profile found, using current flash contents\n");
566 } else if (length
!= CW2015_SIZE_BATINFO
) {
567 dev_err(cw_bat
->dev
, "battery-profile must be %d bytes\n",
568 CW2015_SIZE_BATINFO
);
571 cw_bat
->bat_profile
= devm_kzalloc(dev
, length
, GFP_KERNEL
);
572 if (!cw_bat
->bat_profile
)
575 ret
= device_property_read_u8_array(dev
,
576 "cellwise,battery-profile",
583 ret
= device_property_read_u32(dev
, "cellwise,monitor-interval-ms",
584 &cw_bat
->poll_interval_ms
);
586 dev_dbg(cw_bat
->dev
, "Using default poll interval\n");
587 cw_bat
->poll_interval_ms
= CW2015_DEFAULT_POLL_INTERVAL_MS
;
593 static const struct regmap_range regmap_ranges_rd_yes
[] = {
594 regmap_reg_range(CW2015_REG_VERSION
, CW2015_REG_VERSION
),
595 regmap_reg_range(CW2015_REG_VCELL
, CW2015_REG_CONFIG
),
596 regmap_reg_range(CW2015_REG_MODE
, CW2015_REG_MODE
),
597 regmap_reg_range(CW2015_REG_BATINFO
,
598 CW2015_REG_BATINFO
+ CW2015_SIZE_BATINFO
- 1),
601 static const struct regmap_access_table regmap_rd_table
= {
602 .yes_ranges
= regmap_ranges_rd_yes
,
606 static const struct regmap_range regmap_ranges_wr_yes
[] = {
607 regmap_reg_range(CW2015_REG_RRT_ALERT
, CW2015_REG_CONFIG
),
608 regmap_reg_range(CW2015_REG_MODE
, CW2015_REG_MODE
),
609 regmap_reg_range(CW2015_REG_BATINFO
,
610 CW2015_REG_BATINFO
+ CW2015_SIZE_BATINFO
- 1),
613 static const struct regmap_access_table regmap_wr_table
= {
614 .yes_ranges
= regmap_ranges_wr_yes
,
618 static const struct regmap_range regmap_ranges_vol_yes
[] = {
619 regmap_reg_range(CW2015_REG_VCELL
, CW2015_REG_SOC
+ 1),
622 static const struct regmap_access_table regmap_vol_table
= {
623 .yes_ranges
= regmap_ranges_vol_yes
,
627 static const struct regmap_config cw2015_regmap_config
= {
630 .rd_table
= ®map_rd_table
,
631 .wr_table
= ®map_wr_table
,
632 .volatile_table
= ®map_vol_table
,
633 .max_register
= CW2015_REG_BATINFO
+ CW2015_SIZE_BATINFO
- 1,
636 static int cw_bat_probe(struct i2c_client
*client
)
639 struct cw_battery
*cw_bat
;
640 struct power_supply_config psy_cfg
= { 0 };
642 cw_bat
= devm_kzalloc(&client
->dev
, sizeof(*cw_bat
), GFP_KERNEL
);
646 i2c_set_clientdata(client
, cw_bat
);
647 cw_bat
->dev
= &client
->dev
;
650 ret
= cw2015_parse_properties(cw_bat
);
652 dev_err(cw_bat
->dev
, "Failed to parse cw2015 properties\n");
656 cw_bat
->regmap
= devm_regmap_init_i2c(client
, &cw2015_regmap_config
);
657 if (IS_ERR(cw_bat
->regmap
)) {
658 dev_err(cw_bat
->dev
, "Failed to allocate regmap: %ld\n",
659 PTR_ERR(cw_bat
->regmap
));
660 return PTR_ERR(cw_bat
->regmap
);
663 ret
= cw_init(cw_bat
);
665 dev_err(cw_bat
->dev
, "Init failed: %d\n", ret
);
669 psy_cfg
.drv_data
= cw_bat
;
670 psy_cfg
.fwnode
= dev_fwnode(cw_bat
->dev
);
672 cw_bat
->rk_bat
= devm_power_supply_register(&client
->dev
,
675 if (IS_ERR(cw_bat
->rk_bat
)) {
676 dev_err(cw_bat
->dev
, "Failed to register power supply\n");
677 return PTR_ERR(cw_bat
->rk_bat
);
680 ret
= power_supply_get_battery_info(cw_bat
->rk_bat
, &cw_bat
->battery
);
682 dev_warn(cw_bat
->dev
,
683 "No monitored battery, some properties will be missing\n");
686 cw_bat
->battery_workqueue
= create_singlethread_workqueue("rk_battery");
687 INIT_DELAYED_WORK(&cw_bat
->battery_delay_work
, cw_bat_work
);
688 queue_delayed_work(cw_bat
->battery_workqueue
,
689 &cw_bat
->battery_delay_work
, msecs_to_jiffies(10));
693 static int __maybe_unused
cw_bat_suspend(struct device
*dev
)
695 struct i2c_client
*client
= to_i2c_client(dev
);
696 struct cw_battery
*cw_bat
= i2c_get_clientdata(client
);
698 cancel_delayed_work_sync(&cw_bat
->battery_delay_work
);
702 static int __maybe_unused
cw_bat_resume(struct device
*dev
)
704 struct i2c_client
*client
= to_i2c_client(dev
);
705 struct cw_battery
*cw_bat
= i2c_get_clientdata(client
);
707 queue_delayed_work(cw_bat
->battery_workqueue
,
708 &cw_bat
->battery_delay_work
, 0);
712 static SIMPLE_DEV_PM_OPS(cw_bat_pm_ops
, cw_bat_suspend
, cw_bat_resume
);
714 static int cw_bat_remove(struct i2c_client
*client
)
716 struct cw_battery
*cw_bat
= i2c_get_clientdata(client
);
718 cancel_delayed_work_sync(&cw_bat
->battery_delay_work
);
719 power_supply_put_battery_info(cw_bat
->rk_bat
, &cw_bat
->battery
);
723 static const struct i2c_device_id cw_bat_id_table
[] = {
728 static const struct of_device_id cw2015_of_match
[] = {
729 { .compatible
= "cellwise,cw2015" },
732 MODULE_DEVICE_TABLE(of
, cw2015_of_match
);
734 static struct i2c_driver cw_bat_driver
= {
737 .of_match_table
= cw2015_of_match
,
738 .pm
= &cw_bat_pm_ops
,
740 .probe_new
= cw_bat_probe
,
741 .remove
= cw_bat_remove
,
742 .id_table
= cw_bat_id_table
,
745 module_i2c_driver(cw_bat_driver
);
747 MODULE_AUTHOR("xhc<xhc@rock-chips.com>");
748 MODULE_AUTHOR("Tobias Schramm <t.schramm@manjaro.org>");
749 MODULE_DESCRIPTION("cw2015/cw2013 battery driver");
750 MODULE_LICENSE("GPL");