summaryrefslogtreecommitdiffstats
path: root/drivers/mfd/max77843.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/mfd/max77843.c')
-rw-r--r--drivers/mfd/max77843.c20
1 files changed, 11 insertions, 9 deletions
diff --git a/drivers/mfd/max77843.c b/drivers/mfd/max77843.c
index a354ac677ec7..c52162ea3d0a 100644
--- a/drivers/mfd/max77843.c
+++ b/drivers/mfd/max77843.c
@@ -17,6 +17,7 @@
17#include <linux/interrupt.h> 17#include <linux/interrupt.h>
18#include <linux/module.h> 18#include <linux/module.h>
19#include <linux/mfd/core.h> 19#include <linux/mfd/core.h>
20#include <linux/mfd/max77693-common.h>
20#include <linux/mfd/max77843-private.h> 21#include <linux/mfd/max77843-private.h>
21#include <linux/of_device.h> 22#include <linux/of_device.h>
22#include <linux/platform_device.h> 23#include <linux/platform_device.h>
@@ -71,7 +72,7 @@ static const struct regmap_irq_chip max77843_irq_chip = {
71}; 72};
72 73
73/* Charger and Charger regulator use same regmap. */ 74/* Charger and Charger regulator use same regmap. */
74static int max77843_chg_init(struct max77843 *max77843) 75static int max77843_chg_init(struct max77693_dev *max77843)
75{ 76{
76 int ret; 77 int ret;
77 78
@@ -101,7 +102,7 @@ err_chg_i2c:
101static int max77843_probe(struct i2c_client *i2c, 102static int max77843_probe(struct i2c_client *i2c,
102 const struct i2c_device_id *id) 103 const struct i2c_device_id *id)
103{ 104{
104 struct max77843 *max77843; 105 struct max77693_dev *max77843;
105 unsigned int reg_data; 106 unsigned int reg_data;
106 int ret; 107 int ret;
107 108
@@ -113,6 +114,7 @@ static int max77843_probe(struct i2c_client *i2c,
113 max77843->dev = &i2c->dev; 114 max77843->dev = &i2c->dev;
114 max77843->i2c = i2c; 115 max77843->i2c = i2c;
115 max77843->irq = i2c->irq; 116 max77843->irq = i2c->irq;
117 max77843->type = id->driver_data;
116 118
117 max77843->regmap = devm_regmap_init_i2c(i2c, 119 max77843->regmap = devm_regmap_init_i2c(i2c,
118 &max77843_regmap_config); 120 &max77843_regmap_config);
@@ -123,7 +125,7 @@ static int max77843_probe(struct i2c_client *i2c,
123 125
124 ret = regmap_add_irq_chip(max77843->regmap, max77843->irq, 126 ret = regmap_add_irq_chip(max77843->regmap, max77843->irq,
125 IRQF_TRIGGER_LOW | IRQF_ONESHOT | IRQF_SHARED, 127 IRQF_TRIGGER_LOW | IRQF_ONESHOT | IRQF_SHARED,
126 0, &max77843_irq_chip, &max77843->irq_data); 128 0, &max77843_irq_chip, &max77843->irq_data_topsys);
127 if (ret) { 129 if (ret) {
128 dev_err(&i2c->dev, "Failed to add TOPSYS IRQ chip\n"); 130 dev_err(&i2c->dev, "Failed to add TOPSYS IRQ chip\n");
129 return ret; 131 return ret;
@@ -164,18 +166,18 @@ static int max77843_probe(struct i2c_client *i2c,
164 return 0; 166 return 0;
165 167
166err_pmic_id: 168err_pmic_id:
167 regmap_del_irq_chip(max77843->irq, max77843->irq_data); 169 regmap_del_irq_chip(max77843->irq, max77843->irq_data_topsys);
168 170
169 return ret; 171 return ret;
170} 172}
171 173
172static int max77843_remove(struct i2c_client *i2c) 174static int max77843_remove(struct i2c_client *i2c)
173{ 175{
174 struct max77843 *max77843 = i2c_get_clientdata(i2c); 176 struct max77693_dev *max77843 = i2c_get_clientdata(i2c);
175 177
176 mfd_remove_devices(max77843->dev); 178 mfd_remove_devices(max77843->dev);
177 179
178 regmap_del_irq_chip(max77843->irq, max77843->irq_data); 180 regmap_del_irq_chip(max77843->irq, max77843->irq_data_topsys);
179 181
180 i2c_unregister_device(max77843->i2c_chg); 182 i2c_unregister_device(max77843->i2c_chg);
181 183
@@ -188,7 +190,7 @@ static const struct of_device_id max77843_dt_match[] = {
188}; 190};
189 191
190static const struct i2c_device_id max77843_id[] = { 192static const struct i2c_device_id max77843_id[] = {
191 { "max77843", }, 193 { "max77843", TYPE_MAX77843, },
192 { }, 194 { },
193}; 195};
194MODULE_DEVICE_TABLE(i2c, max77843_id); 196MODULE_DEVICE_TABLE(i2c, max77843_id);
@@ -196,7 +198,7 @@ MODULE_DEVICE_TABLE(i2c, max77843_id);
196static int __maybe_unused max77843_suspend(struct device *dev) 198static int __maybe_unused max77843_suspend(struct device *dev)
197{ 199{
198 struct i2c_client *i2c = container_of(dev, struct i2c_client, dev); 200 struct i2c_client *i2c = container_of(dev, struct i2c_client, dev);
199 struct max77843 *max77843 = i2c_get_clientdata(i2c); 201 struct max77693_dev *max77843 = i2c_get_clientdata(i2c);
200 202
201 disable_irq(max77843->irq); 203 disable_irq(max77843->irq);
202 if (device_may_wakeup(dev)) 204 if (device_may_wakeup(dev))
@@ -208,7 +210,7 @@ static int __maybe_unused max77843_suspend(struct device *dev)
208static int __maybe_unused max77843_resume(struct device *dev) 210static int __maybe_unused max77843_resume(struct device *dev)
209{ 211{
210 struct i2c_client *i2c = container_of(dev, struct i2c_client, dev); 212 struct i2c_client *i2c = container_of(dev, struct i2c_client, dev);
211 struct max77843 *max77843 = i2c_get_clientdata(i2c); 213 struct max77693_dev *max77843 = i2c_get_clientdata(i2c);
212 214
213 if (device_may_wakeup(dev)) 215 if (device_may_wakeup(dev))
214 disable_irq_wake(max77843->irq); 216 disable_irq_wake(max77843->irq);