Lines Matching +full:max8997 +full:- +full:pmic
1 // SPDX-License-Identifier: GPL-2.0+
3 // max77686.c - mfd core driver for the Maxim 77686/802
9 //This driver is based on max8997.c
20 #include <linux/mfd/max77686-private.h>
25 { .name = "max77686-pmic", },
26 { .name = "max77686-rtc", },
27 { .name = "max77686-clk", },
31 { .name = "max77802-pmic", },
32 { .name = "max77802-clk", },
33 { .name = "max77802-rtc", },
110 .name = "max77802-pmic",
130 .name = "max77686-pmic",
139 .name = "max77802-pmic",
170 max77686 = devm_kzalloc(&i2c->dev, in max77686_i2c_probe()
173 return -ENOMEM; in max77686_i2c_probe()
176 max77686->type = (unsigned long)of_device_get_match_data(&i2c->dev); in max77686_i2c_probe()
177 max77686->dev = &i2c->dev; in max77686_i2c_probe()
178 max77686->i2c = i2c; in max77686_i2c_probe()
180 max77686->irq = i2c->irq; in max77686_i2c_probe()
182 if (max77686->type == TYPE_MAX77686) { in max77686_i2c_probe()
194 max77686->regmap = devm_regmap_init_i2c(i2c, config); in max77686_i2c_probe()
195 if (IS_ERR(max77686->regmap)) { in max77686_i2c_probe()
196 ret = PTR_ERR(max77686->regmap); in max77686_i2c_probe()
197 dev_err(max77686->dev, "Failed to allocate register map: %d\n", in max77686_i2c_probe()
202 ret = regmap_read(max77686->regmap, MAX77686_REG_DEVICE_ID, &data); in max77686_i2c_probe()
204 dev_err(max77686->dev, in max77686_i2c_probe()
206 return -ENODEV; in max77686_i2c_probe()
209 ret = devm_regmap_add_irq_chip(&i2c->dev, max77686->regmap, in max77686_i2c_probe()
210 max77686->irq, in max77686_i2c_probe()
212 &max77686->irq_data); in max77686_i2c_probe()
214 dev_err(&i2c->dev, "failed to add PMIC irq chip: %d\n", ret); in max77686_i2c_probe()
218 ret = devm_mfd_add_devices(max77686->dev, -1, cells, n_devs, NULL, in max77686_i2c_probe()
221 dev_err(&i2c->dev, "failed to add MFD devices: %d\n", ret); in max77686_i2c_probe()
234 enable_irq_wake(max77686->irq); in max77686_suspend()
245 disable_irq(max77686->irq); in max77686_suspend()
256 disable_irq_wake(max77686->irq); in max77686_resume()
258 enable_irq(max77686->irq); in max77686_resume()
276 MODULE_DESCRIPTION("MAXIM 77686/802 multi-function core driver");