23 #include <linux/module.h>
24 #include <linux/slab.h>
43 static int max8997_battery_get_property(
struct power_supply *psy,
59 if ((reg & (1 << 0)) == 0x1)
68 if ((reg & (1 << 2)) == 0x0)
100 int val = (pdata->
eoc_mA - 50) / 10;
132 dev_err(&pdev->
dev,
"incorrect timeout value (%d)\n",
142 if (charger ==
NULL) {
143 dev_err(&pdev->
dev,
"Cannot allocate memory.\n");
147 platform_set_drvdata(pdev, charger);
149 charger->
battery.name =
"max8997_pmic";
151 charger->
battery.get_property = max8997_battery_get_property;
152 charger->
battery.properties = max8997_battery_props;
155 charger->
dev = &pdev->
dev;
156 charger->
iodev = iodev;
160 dev_err(&pdev->
dev,
"failed: power supply register\n");
172 struct charger_data *charger = platform_get_drvdata(pdev);
180 {
"max8997-battery", 0 },
186 .name =
"max8997-battery",
189 .probe = max8997_battery_probe,
191 .id_table = max8997_battery_id,
194 static int __init max8997_battery_init(
void)
200 static void __exit max8997_battery_cleanup(
void)