Lines Matching full: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); in max8998_read_reg() local
47 mutex_lock(&max8998->iolock); in max8998_read_reg()
49 mutex_unlock(&max8998->iolock); in max8998_read_reg()
61 struct max8998_dev *max8998 = i2c_get_clientdata(i2c); in max8998_bulk_read() local
64 mutex_lock(&max8998->iolock); in max8998_bulk_read()
66 mutex_unlock(&max8998->iolock); in max8998_bulk_read()
76 struct max8998_dev *max8998 = i2c_get_clientdata(i2c); in max8998_write_reg() local
79 mutex_lock(&max8998->iolock); in max8998_write_reg()
81 mutex_unlock(&max8998->iolock); in max8998_write_reg()
88 struct max8998_dev *max8998 = i2c_get_clientdata(i2c); in max8998_bulk_write() local
91 mutex_lock(&max8998->iolock); in max8998_bulk_write()
93 mutex_unlock(&max8998->iolock); in max8998_bulk_write()
103 struct max8998_dev *max8998 = i2c_get_clientdata(i2c); in max8998_update_reg() local
106 mutex_lock(&max8998->iolock); in max8998_update_reg()
113 mutex_unlock(&max8998->iolock); in max8998_update_reg()
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
158 struct max8998_dev *max8998; in max8998_i2c_probe() local
161 max8998 = devm_kzalloc(&i2c->dev, sizeof(struct max8998_dev), in max8998_i2c_probe()
163 if (max8998 == NULL) in max8998_i2c_probe()
172 i2c_set_clientdata(i2c, max8998); in max8998_i2c_probe()
173 max8998->dev = &i2c->dev; in max8998_i2c_probe()
174 max8998->i2c = i2c; in max8998_i2c_probe()
175 max8998->irq = i2c->irq; in max8998_i2c_probe()
176 max8998->type = (uintptr_t)i2c_get_match_data(i2c); in max8998_i2c_probe()
177 max8998->pdata = pdata; in max8998_i2c_probe()
179 max8998->ono = pdata->ono; in max8998_i2c_probe()
180 max8998->irq_base = pdata->irq_base; in max8998_i2c_probe()
181 max8998->wakeup = pdata->wakeup; in max8998_i2c_probe()
183 mutex_init(&max8998->iolock); in max8998_i2c_probe()
185 max8998->rtc = i2c_new_dummy_device(i2c->adapter, RTC_I2C_ADDR); in max8998_i2c_probe()
186 if (IS_ERR(max8998->rtc)) { in max8998_i2c_probe()
188 return PTR_ERR(max8998->rtc); in max8998_i2c_probe()
190 i2c_set_clientdata(max8998->rtc, max8998); in max8998_i2c_probe()
192 max8998_irq_init(max8998); in max8998_i2c_probe()
194 pm_runtime_set_active(max8998->dev); in max8998_i2c_probe()
196 switch (max8998->type) { in max8998_i2c_probe()
198 ret = mfd_add_devices(max8998->dev, -1, in max8998_i2c_probe()
203 ret = mfd_add_devices(max8998->dev, -1, in max8998_i2c_probe()
214 device_init_wakeup(max8998->dev, max8998->wakeup); in max8998_i2c_probe()
219 mfd_remove_devices(max8998->dev); in max8998_i2c_probe()
220 max8998_irq_exit(max8998); in max8998_i2c_probe()
221 i2c_unregister_device(max8998->rtc); in max8998_i2c_probe()
226 { "max8998", TYPE_MAX8998 },
234 struct max8998_dev *max8998 = i2c_get_clientdata(i2c); in max8998_suspend() local
237 irq_set_irq_wake(max8998->irq, 1); in max8998_suspend()
244 struct max8998_dev *max8998 = i2c_get_clientdata(i2c); in max8998_resume() local
247 irq_set_irq_wake(max8998->irq, 0); in max8998_resume()
335 .name = "max8998",