diff options
Diffstat (limited to 'drivers/mfd/max8998.c')
-rw-r--r-- | drivers/mfd/max8998.c | 26 |
1 files changed, 23 insertions, 3 deletions
diff --git a/drivers/mfd/max8998.c b/drivers/mfd/max8998.c index 5ce00ad5241a..bbfe86732602 100644 --- a/drivers/mfd/max8998.c +++ b/drivers/mfd/max8998.c | |||
@@ -42,6 +42,14 @@ static struct mfd_cell max8998_devs[] = { | |||
42 | }, | 42 | }, |
43 | }; | 43 | }; |
44 | 44 | ||
45 | static struct mfd_cell lp3974_devs[] = { | ||
46 | { | ||
47 | .name = "lp3974-pmic", | ||
48 | }, { | ||
49 | .name = "lp3974-rtc", | ||
50 | }, | ||
51 | }; | ||
52 | |||
45 | int max8998_read_reg(struct i2c_client *i2c, u8 reg, u8 *dest) | 53 | int max8998_read_reg(struct i2c_client *i2c, u8 reg, u8 *dest) |
46 | { | 54 | { |
47 | struct max8998_dev *max8998 = i2c_get_clientdata(i2c); | 55 | struct max8998_dev *max8998 = i2c_get_clientdata(i2c); |
@@ -146,11 +154,23 @@ static int max8998_i2c_probe(struct i2c_client *i2c, | |||
146 | 154 | ||
147 | max8998_irq_init(max8998); | 155 | max8998_irq_init(max8998); |
148 | 156 | ||
149 | ret = mfd_add_devices(max8998->dev, -1, | ||
150 | max8998_devs, ARRAY_SIZE(max8998_devs), | ||
151 | NULL, 0); | ||
152 | pm_runtime_set_active(max8998->dev); | 157 | pm_runtime_set_active(max8998->dev); |
153 | 158 | ||
159 | switch (id->driver_data) { | ||
160 | case TYPE_LP3974: | ||
161 | ret = mfd_add_devices(max8998->dev, -1, | ||
162 | lp3974_devs, ARRAY_SIZE(lp3974_devs), | ||
163 | NULL, 0); | ||
164 | break; | ||
165 | case TYPE_MAX8998: | ||
166 | ret = mfd_add_devices(max8998->dev, -1, | ||
167 | max8998_devs, ARRAY_SIZE(max8998_devs), | ||
168 | NULL, 0); | ||
169 | break; | ||
170 | default: | ||
171 | ret = -EINVAL; | ||
172 | } | ||
173 | |||
154 | if (ret < 0) | 174 | if (ret < 0) |
155 | goto err; | 175 | goto err; |
156 | 176 | ||