25 #include <linux/export.h>
26 #include <linux/slab.h>
27 #include <linux/i2c.h>
29 #include <linux/module.h>
35 #define I2C_ADDR_RTC (0x0C >> 1)
37 static struct mfd_cell max77686_devs[] = {
38 { .name =
"max77686-pmic", },
39 { .name =
"max77686-rtc", },
42 static struct regmap_config max77686_regmap_config = {
49 {.compatible =
"maxim,max77686", .data = 0},
60 dev_err(dev,
"could not allocate memory for pdata\n");
75 static int max77686_i2c_probe(
struct i2c_client *i2c,
84 pdata = max77686_i2c_parse_dt_pdata(&i2c->
dev);
88 dev_err(&i2c->
dev,
"No platform data found.\n");
97 if (IS_ERR(max77686->
regmap)) {
98 ret = PTR_ERR(max77686->
regmap);
99 dev_err(max77686->
dev,
"Failed to allocate register map: %d\n",
105 i2c_set_clientdata(i2c, max77686);
106 max77686->
dev = &i2c->
dev;
108 max77686->
type =
id->driver_data;
117 "device not found on this channel (this is not an error)\n");
124 i2c_set_clientdata(max77686->
rtc, max77686);
144 static int max77686_i2c_remove(
struct i2c_client *i2c)
146 struct max77686_dev *max77686 = i2c_get_clientdata(i2c);
161 static struct i2c_driver max77686_i2c_driver = {
167 .probe = max77686_i2c_probe,
168 .remove = max77686_i2c_remove,
169 .id_table = max77686_i2c_id,
172 static int __init max77686_i2c_init(
void)
174 return i2c_add_driver(&max77686_i2c_driver);
179 static void __exit max77686_i2c_exit(
void)