Lines Matching refs:max8907
176 static struct max8907 *max8907_pm_off;
185 struct max8907 *max8907; in max8907_i2c_probe() local
196 max8907 = devm_kzalloc(&i2c->dev, sizeof(struct max8907), GFP_KERNEL); in max8907_i2c_probe()
197 if (!max8907) { in max8907_i2c_probe()
202 max8907->dev = &i2c->dev; in max8907_i2c_probe()
203 max8907->i2c_gen = i2c; in max8907_i2c_probe()
204 i2c_set_clientdata(i2c, max8907); in max8907_i2c_probe()
205 max8907->regmap_gen = devm_regmap_init_i2c(i2c, in max8907_i2c_probe()
207 if (IS_ERR(max8907->regmap_gen)) { in max8907_i2c_probe()
208 ret = PTR_ERR(max8907->regmap_gen); in max8907_i2c_probe()
213 max8907->i2c_rtc = i2c_new_dummy_device(i2c->adapter, MAX8907_RTC_I2C_ADDR); in max8907_i2c_probe()
214 if (IS_ERR(max8907->i2c_rtc)) { in max8907_i2c_probe()
215 ret = PTR_ERR(max8907->i2c_rtc); in max8907_i2c_probe()
218 i2c_set_clientdata(max8907->i2c_rtc, max8907); in max8907_i2c_probe()
219 max8907->regmap_rtc = devm_regmap_init_i2c(max8907->i2c_rtc, in max8907_i2c_probe()
221 if (IS_ERR(max8907->regmap_rtc)) { in max8907_i2c_probe()
222 ret = PTR_ERR(max8907->regmap_rtc); in max8907_i2c_probe()
227 ret = regmap_add_irq_chip(max8907->regmap_gen, max8907->i2c_gen->irq, in max8907_i2c_probe()
230 &max8907->irqc_chg); in max8907_i2c_probe()
235 ret = regmap_add_irq_chip(max8907->regmap_gen, max8907->i2c_gen->irq, in max8907_i2c_probe()
238 &max8907->irqc_on_off); in max8907_i2c_probe()
243 ret = regmap_add_irq_chip(max8907->regmap_rtc, max8907->i2c_gen->irq, in max8907_i2c_probe()
246 &max8907->irqc_rtc); in max8907_i2c_probe()
252 ret = mfd_add_devices(max8907->dev, -1, max8907_cells, in max8907_i2c_probe()
260 max8907_pm_off = max8907; in max8907_i2c_probe()
267 regmap_del_irq_chip(max8907->i2c_gen->irq, max8907->irqc_rtc); in max8907_i2c_probe()
269 regmap_del_irq_chip(max8907->i2c_gen->irq, max8907->irqc_on_off); in max8907_i2c_probe()
271 regmap_del_irq_chip(max8907->i2c_gen->irq, max8907->irqc_chg); in max8907_i2c_probe()
274 i2c_unregister_device(max8907->i2c_rtc); in max8907_i2c_probe()
283 struct max8907 *max8907 = i2c_get_clientdata(i2c); in max8907_i2c_remove() local
285 mfd_remove_devices(max8907->dev); in max8907_i2c_remove()
287 regmap_del_irq_chip(max8907->i2c_gen->irq, max8907->irqc_rtc); in max8907_i2c_remove()
288 regmap_del_irq_chip(max8907->i2c_gen->irq, max8907->irqc_on_off); in max8907_i2c_remove()
289 regmap_del_irq_chip(max8907->i2c_gen->irq, max8907->irqc_chg); in max8907_i2c_remove()
291 i2c_unregister_device(max8907->i2c_rtc); in max8907_i2c_remove()