23 #include <linux/module.h>
24 #include <linux/slab.h>
42 static int max8998_battery_get_property(
struct power_supply *psy,
87 dev_err(pdev->
dev.parent,
"No platform init data supplied\n");
96 max8998->
iodev = iodev;
97 platform_set_drvdata(pdev, max8998);
98 i2c = max8998->
iodev->i2c;
103 if (pdata->
eoc >= 10 && pdata->
eoc <= 45) {
105 (pdata->
eoc / 5 - 2) << 5, 0x7 << 5);
106 }
else if (pdata->
eoc == 0) {
108 "EOC value not set: leave it unchanged.\n");
131 "Restart Level not set: leave it unchanged.\n");
134 dev_err(max8998->
dev,
"Invalid Restart Level\n");
155 "Full Timeout not set: leave it unchanged.\n");
158 dev_err(max8998->
dev,
"Invalid Full Timeout value\n");
163 max8998->
battery.name =
"max8998_pmic";
165 max8998->
battery.get_property = max8998_battery_get_property;
166 max8998->
battery.properties = max8998_battery_props;
171 dev_err(max8998->
dev,
"failed: power supply register\n");
198 .name =
"max8998-battery",
201 .probe = max8998_battery_probe,
203 .id_table = max8998_battery_id,