11 #include <linux/module.h>
15 #include <linux/slab.h>
28 static int wm831x_backup_read_voltage(
struct wm831x *
wm831x,
51 if (!wm831x_pdata || !wm831x_pdata->
backup) {
53 "No backup battery charger configuration\n");
57 pdata = wm831x_pdata->
backup;
66 switch (pdata->
vlim) {
73 dev_err(wm831x->
dev,
"Invalid backup voltage limit %dmV\n",
77 switch (pdata->
ilim) {
90 dev_err(wm831x->
dev,
"Invalid backup current limit %duA\n",
96 dev_err(wm831x->
dev,
"Failed to unlock registers: %d\n", ret);
109 "Failed to set backup charger config: %d\n", ret);
114 static int wm831x_backup_get_prop(
struct power_supply *psy,
119 struct wm831x *wm831x = devdata->
wm831x;
140 if (ret & WM831X_BKUP_CHG_STS)
167 struct wm831x_pdata *wm831x_pdata = wm831x->
dev->platform_data;
177 platform_set_drvdata(pdev, devdata);
179 backup = &devdata->
backup;
185 wm831x_config_backup(wm831x);
189 "wm831x-backup.%d", wm831x_pdata->
wm831x_num);
222 .probe = wm831x_backup_probe,
225 .name =
"wm831x-backup",