15 #include <linux/i2c.h>
18 #include <linux/module.h>
19 #include <linux/slab.h>
21 #define MAX_LP8788_REGISTERS 0xA2
23 #define MFD_DEV_SIMPLE(_name) \
25 .name = LP8788_DEV_##_name, \
28 #define MFD_DEV_WITH_ID(_name, _id) \
30 .name = LP8788_DEV_##_name, \
34 #define MFD_DEV_WITH_RESOURCE(_name, _resource, num_resource) \
36 .name = LP8788_DEV_##_name, \
37 .resources = _resource, \
38 .num_resources = num_resource, \
41 static struct resource chg_irqs[] = {
65 static struct resource rtc_irqs[] = {
74 static struct mfd_cell lp8788_devs[] = {
133 dev_err(lp->
dev,
"failed to read 0x%.2x\n", reg);
160 static int lp8788_platform_init(
struct lp8788 *
lp)
167 static const struct regmap_config lp8788_regmap_config = {
185 ret = PTR_ERR(lp->
regmap);
186 dev_err(&cl->
dev,
"regmap init i2c err: %d\n", ret);
192 i2c_set_clientdata(cl, lp);
194 ret = lp8788_platform_init(lp);
208 struct lp8788 *lp = i2c_get_clientdata(cl);
226 .probe = lp8788_probe,
228 .id_table = lp8788_ids,
231 static int __init lp8788_init(
void)
233 return i2c_add_driver(&lp8788_driver);
237 static void __exit lp8788_exit(
void)