Lines Matching defs:max8998
30 #include <linux/mfd/max8998.h>
31 #include <linux/mfd/max8998-private.h>
35 .name = "max8998-pmic",
39 static int max8998_i2c_device_read(struct max8998_dev *max8998, u8 reg, u8 *dest)
41 struct i2c_client *client = max8998->i2c_client;
44 mutex_lock(&max8998->iolock);
46 mutex_unlock(&max8998->iolock);
55 static int max8998_i2c_device_write(struct max8998_dev *max8998, u8 reg, u8 value)
57 struct i2c_client *client = max8998->i2c_client;
60 mutex_lock(&max8998->iolock);
62 mutex_unlock(&max8998->iolock);
66 static int max8998_i2c_device_update(struct max8998_dev *max8998, u8 reg,
69 struct i2c_client *client = max8998->i2c_client;
72 mutex_lock(&max8998->iolock);
81 mutex_unlock(&max8998->iolock);
88 struct max8998_dev *max8998;
91 max8998 = kzalloc(sizeof(struct max8998_dev), GFP_KERNEL);
92 if (max8998 == NULL)
95 i2c_set_clientdata(i2c, max8998);
96 max8998->dev = &i2c->dev;
97 max8998->i2c_client = i2c;
98 max8998->dev_read = max8998_i2c_device_read;
99 max8998->dev_write = max8998_i2c_device_write;
100 max8998->dev_update = max8998_i2c_device_update;
101 mutex_init(&max8998->iolock);
103 ret = mfd_add_devices(max8998->dev, -1,
112 mfd_remove_devices(max8998->dev);
113 kfree(max8998);
119 struct max8998_dev *max8998 = i2c_get_clientdata(i2c);
121 mfd_remove_devices(max8998->dev);
122 kfree(max8998);
128 { "max8998", 0 },
135 .name = "max8998",