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
171 struct max8998_dev *max8998;
174 max8998 = devm_kzalloc(&i2c->dev, sizeof(struct max8998_dev),
176 if (max8998 == NULL)
185 i2c_set_clientdata(i2c, max8998);
186 max8998->dev = &i2c->dev;
187 max8998->i2c = i2c;
188 max8998->irq = i2c->irq;
189 max8998->type = max8998_i2c_get_driver_data(i2c, id);
190 max8998->pdata = pdata;
192 max8998->ono = pdata->ono;
193 max8998->irq_base = pdata->irq_base;
194 max8998->wakeup = pdata->wakeup;
196 mutex_init(&max8998->iolock);
198 max8998->rtc = i2c_new_dummy_device(i2c->adapter, RTC_I2C_ADDR);
199 if (IS_ERR(max8998->rtc)) {
201 return PTR_ERR(max8998->rtc);
203 i2c_set_clientdata(max8998->rtc, max8998);
205 max8998_irq_init(max8998);
207 pm_runtime_set_active(max8998->dev);
209 switch (max8998->type) {
211 ret = mfd_add_devices(max8998->dev, -1,
216 ret = mfd_add_devices(max8998->dev, -1,
227 device_init_wakeup(max8998->dev, max8998->wakeup);
232 mfd_remove_devices(max8998->dev);
233 max8998_irq_exit(max8998);
234 i2c_unregister_device(max8998->rtc);
239 { "max8998", TYPE_MAX8998 },
247 struct max8998_dev *max8998 = i2c_get_clientdata(i2c);
250 irq_set_irq_wake(max8998->irq, 1);
257 struct max8998_dev *max8998 = i2c_get_clientdata(i2c);
260 irq_set_irq_wake(max8998->irq, 0);
348 .name = "max8998",