Lines Matching defs:max8998
3 // max8998.c - mfd core driver for the Maxim 8998
19 #include <linux/mfd/max8998.h>
20 #include <linux/mfd/max8998-private.h>
26 .name = "max8998-pmic",
28 .name = "max8998-rtc",
30 .name = "max8998-battery",
44 struct max8998_dev *max8998 = i2c_get_clientdata(i2c);
47 mutex_lock(&max8998->iolock);
49 mutex_unlock(&max8998->iolock);
61 struct max8998_dev *max8998 = i2c_get_clientdata(i2c);
64 mutex_lock(&max8998->iolock);
66 mutex_unlock(&max8998->iolock);
76 struct max8998_dev *max8998 = i2c_get_clientdata(i2c);
79 mutex_lock(&max8998->iolock);
81 mutex_unlock(&max8998->iolock);
88 struct max8998_dev *max8998 = i2c_get_clientdata(i2c);
91 mutex_lock(&max8998->iolock);
93 mutex_unlock(&max8998->iolock);
103 struct max8998_dev *max8998 = i2c_get_clientdata(i2c);
106 mutex_lock(&max8998->iolock);
113 mutex_unlock(&max8998->iolock);
120 { .compatible = "maxim,max8998", .data = (void *)TYPE_MAX8998 },
128 * Only the common platform data elements for max8998 are parsed here from the
129 * device tree. Other sub-modules of max8998 such as pmic, rtc and others have
132 * The max8998 platform data structure is instantiated here and the drivers for
168 struct max8998_dev *max8998;
171 max8998 = devm_kzalloc(&i2c->dev, sizeof(struct max8998_dev),
173 if (max8998 == NULL)
182 i2c_set_clientdata(i2c, max8998);
183 max8998->dev = &i2c->dev;
184 max8998->i2c = i2c;
185 max8998->irq = i2c->irq;
186 max8998->type = max8998_i2c_get_driver_data(i2c, id);
187 max8998->pdata = pdata;
189 max8998->ono = pdata->ono;
190 max8998->irq_base = pdata->irq_base;
191 max8998->wakeup = pdata->wakeup;
193 mutex_init(&max8998->iolock);
195 max8998->rtc = i2c_new_dummy_device(i2c->adapter, RTC_I2C_ADDR);
196 if (IS_ERR(max8998->rtc)) {
198 return PTR_ERR(max8998->rtc);
200 i2c_set_clientdata(max8998->rtc, max8998);
202 max8998_irq_init(max8998);
204 pm_runtime_set_active(max8998->dev);
206 switch (max8998->type) {
208 ret = mfd_add_devices(max8998->dev, -1,
213 ret = mfd_add_devices(max8998->dev, -1,
224 device_init_wakeup(max8998->dev, max8998->wakeup);
229 mfd_remove_devices(max8998->dev);
230 max8998_irq_exit(max8998);
231 i2c_unregister_device(max8998->rtc);
236 { "max8998", TYPE_MAX8998 },
244 struct max8998_dev *max8998 = i2c_get_clientdata(i2c);
247 irq_set_irq_wake(max8998->irq, 1);
254 struct max8998_dev *max8998 = i2c_get_clientdata(i2c);
257 irq_set_irq_wake(max8998->irq, 0);
345 .name = "max8998",