aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/mfd
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/mfd')
-rw-r--r--drivers/mfd/da9055-i2c.c12
-rw-r--r--drivers/mfd/max14577.c2
-rw-r--r--drivers/mfd/max8997.c6
-rw-r--r--drivers/mfd/max8998.c6
-rw-r--r--drivers/mfd/sec-core.c114
-rw-r--r--drivers/mfd/sec-irq.c97
-rw-r--r--drivers/mfd/tps65217.c4
-rw-r--r--drivers/mfd/wm8994-core.c2
8 files changed, 217 insertions, 26 deletions
diff --git a/drivers/mfd/da9055-i2c.c b/drivers/mfd/da9055-i2c.c
index 13af7e50021e..8103e4362132 100644
--- a/drivers/mfd/da9055-i2c.c
+++ b/drivers/mfd/da9055-i2c.c
@@ -53,17 +53,25 @@ static int da9055_i2c_remove(struct i2c_client *i2c)
53 return 0; 53 return 0;
54} 54}
55 55
56/*
57 * DO NOT change the device Ids. The naming is intentionally specific as both
58 * the PMIC and CODEC parts of this chip are instantiated separately as I2C
59 * devices (both have configurable I2C addresses, and are to all intents and
60 * purposes separate). As a result there are specific DA9055 ids for PMIC
61 * and CODEC, which must be different to operate together.
62 */
56static struct i2c_device_id da9055_i2c_id[] = { 63static struct i2c_device_id da9055_i2c_id[] = {
57 {"da9055", 0}, 64 {"da9055-pmic", 0},
58 { } 65 { }
59}; 66};
67MODULE_DEVICE_TABLE(i2c, da9055_i2c_id);
60 68
61static struct i2c_driver da9055_i2c_driver = { 69static struct i2c_driver da9055_i2c_driver = {
62 .probe = da9055_i2c_probe, 70 .probe = da9055_i2c_probe,
63 .remove = da9055_i2c_remove, 71 .remove = da9055_i2c_remove,
64 .id_table = da9055_i2c_id, 72 .id_table = da9055_i2c_id,
65 .driver = { 73 .driver = {
66 .name = "da9055", 74 .name = "da9055-pmic",
67 .owner = THIS_MODULE, 75 .owner = THIS_MODULE,
68 }, 76 },
69}; 77};
diff --git a/drivers/mfd/max14577.c b/drivers/mfd/max14577.c
index ac514fb2b877..71aa14a6bfbb 100644
--- a/drivers/mfd/max14577.c
+++ b/drivers/mfd/max14577.c
@@ -173,6 +173,7 @@ static const struct i2c_device_id max14577_i2c_id[] = {
173}; 173};
174MODULE_DEVICE_TABLE(i2c, max14577_i2c_id); 174MODULE_DEVICE_TABLE(i2c, max14577_i2c_id);
175 175
176#ifdef CONFIG_PM_SLEEP
176static int max14577_suspend(struct device *dev) 177static int max14577_suspend(struct device *dev)
177{ 178{
178 struct i2c_client *i2c = container_of(dev, struct i2c_client, dev); 179 struct i2c_client *i2c = container_of(dev, struct i2c_client, dev);
@@ -208,6 +209,7 @@ static int max14577_resume(struct device *dev)
208 209
209 return 0; 210 return 0;
210} 211}
212#endif /* CONFIG_PM_SLEEP */
211 213
212static struct of_device_id max14577_dt_match[] = { 214static struct of_device_id max14577_dt_match[] = {
213 { .compatible = "maxim,max14577", }, 215 { .compatible = "maxim,max14577", },
diff --git a/drivers/mfd/max8997.c b/drivers/mfd/max8997.c
index be88a3bf7b85..5adede0fb04c 100644
--- a/drivers/mfd/max8997.c
+++ b/drivers/mfd/max8997.c
@@ -164,15 +164,15 @@ static struct max8997_platform_data *max8997_i2c_parse_dt_pdata(
164 return pd; 164 return pd;
165} 165}
166 166
167static inline int max8997_i2c_get_driver_data(struct i2c_client *i2c, 167static inline unsigned long max8997_i2c_get_driver_data(struct i2c_client *i2c,
168 const struct i2c_device_id *id) 168 const struct i2c_device_id *id)
169{ 169{
170 if (IS_ENABLED(CONFIG_OF) && i2c->dev.of_node) { 170 if (IS_ENABLED(CONFIG_OF) && i2c->dev.of_node) {
171 const struct of_device_id *match; 171 const struct of_device_id *match;
172 match = of_match_node(max8997_pmic_dt_match, i2c->dev.of_node); 172 match = of_match_node(max8997_pmic_dt_match, i2c->dev.of_node);
173 return (int)match->data; 173 return (unsigned long)match->data;
174 } 174 }
175 return (int)id->driver_data; 175 return id->driver_data;
176} 176}
177 177
178static int max8997_i2c_probe(struct i2c_client *i2c, 178static int max8997_i2c_probe(struct i2c_client *i2c,
diff --git a/drivers/mfd/max8998.c b/drivers/mfd/max8998.c
index 612ca404e150..5d5e186b5d8b 100644
--- a/drivers/mfd/max8998.c
+++ b/drivers/mfd/max8998.c
@@ -169,16 +169,16 @@ static struct max8998_platform_data *max8998_i2c_parse_dt_pdata(
169 return pd; 169 return pd;
170} 170}
171 171
172static inline int max8998_i2c_get_driver_data(struct i2c_client *i2c, 172static inline unsigned long max8998_i2c_get_driver_data(struct i2c_client *i2c,
173 const struct i2c_device_id *id) 173 const struct i2c_device_id *id)
174{ 174{
175 if (IS_ENABLED(CONFIG_OF) && i2c->dev.of_node) { 175 if (IS_ENABLED(CONFIG_OF) && i2c->dev.of_node) {
176 const struct of_device_id *match; 176 const struct of_device_id *match;
177 match = of_match_node(max8998_dt_match, i2c->dev.of_node); 177 match = of_match_node(max8998_dt_match, i2c->dev.of_node);
178 return (int)(long)match->data; 178 return (unsigned long)match->data;
179 } 179 }
180 180
181 return (int)id->driver_data; 181 return id->driver_data;
182} 182}
183 183
184static int max8998_i2c_probe(struct i2c_client *i2c, 184static int max8998_i2c_probe(struct i2c_client *i2c,
diff --git a/drivers/mfd/sec-core.c b/drivers/mfd/sec-core.c
index a139798b8065..281a82747275 100644
--- a/drivers/mfd/sec-core.c
+++ b/drivers/mfd/sec-core.c
@@ -26,7 +26,9 @@
26#include <linux/mfd/samsung/core.h> 26#include <linux/mfd/samsung/core.h>
27#include <linux/mfd/samsung/irq.h> 27#include <linux/mfd/samsung/irq.h>
28#include <linux/mfd/samsung/rtc.h> 28#include <linux/mfd/samsung/rtc.h>
29#include <linux/mfd/samsung/s2mpa01.h>
29#include <linux/mfd/samsung/s2mps11.h> 30#include <linux/mfd/samsung/s2mps11.h>
31#include <linux/mfd/samsung/s2mps14.h>
30#include <linux/mfd/samsung/s5m8763.h> 32#include <linux/mfd/samsung/s5m8763.h>
31#include <linux/mfd/samsung/s5m8767.h> 33#include <linux/mfd/samsung/s5m8767.h>
32#include <linux/regmap.h> 34#include <linux/regmap.h>
@@ -69,18 +71,53 @@ static const struct mfd_cell s2mps11_devs[] = {
69 } 71 }
70}; 72};
71 73
74static const struct mfd_cell s2mps14_devs[] = {
75 {
76 .name = "s2mps14-pmic",
77 }, {
78 .name = "s2mps14-rtc",
79 }, {
80 .name = "s2mps14-clk",
81 }
82};
83
84static const struct mfd_cell s2mpa01_devs[] = {
85 {
86 .name = "s2mpa01-pmic",
87 },
88};
89
72#ifdef CONFIG_OF 90#ifdef CONFIG_OF
73static struct of_device_id sec_dt_match[] = { 91static struct of_device_id sec_dt_match[] = {
74 { .compatible = "samsung,s5m8767-pmic", 92 { .compatible = "samsung,s5m8767-pmic",
75 .data = (void *)S5M8767X, 93 .data = (void *)S5M8767X,
76 }, 94 }, {
77 { .compatible = "samsung,s2mps11-pmic", 95 .compatible = "samsung,s2mps11-pmic",
78 .data = (void *)S2MPS11X, 96 .data = (void *)S2MPS11X,
97 }, {
98 .compatible = "samsung,s2mps14-pmic",
99 .data = (void *)S2MPS14X,
100 }, {
101 .compatible = "samsung,s2mpa01-pmic",
102 .data = (void *)S2MPA01,
103 }, {
104 /* Sentinel */
79 }, 105 },
80 {},
81}; 106};
82#endif 107#endif
83 108
109static bool s2mpa01_volatile(struct device *dev, unsigned int reg)
110{
111 switch (reg) {
112 case S2MPA01_REG_INT1M:
113 case S2MPA01_REG_INT2M:
114 case S2MPA01_REG_INT3M:
115 return false;
116 default:
117 return true;
118 }
119}
120
84static bool s2mps11_volatile(struct device *dev, unsigned int reg) 121static bool s2mps11_volatile(struct device *dev, unsigned int reg)
85{ 122{
86 switch (reg) { 123 switch (reg) {
@@ -111,6 +148,15 @@ static const struct regmap_config sec_regmap_config = {
111 .val_bits = 8, 148 .val_bits = 8,
112}; 149};
113 150
151static const struct regmap_config s2mpa01_regmap_config = {
152 .reg_bits = 8,
153 .val_bits = 8,
154
155 .max_register = S2MPA01_REG_LDO_OVCB4,
156 .volatile_reg = s2mpa01_volatile,
157 .cache_type = REGCACHE_FLAT,
158};
159
114static const struct regmap_config s2mps11_regmap_config = { 160static const struct regmap_config s2mps11_regmap_config = {
115 .reg_bits = 8, 161 .reg_bits = 8,
116 .val_bits = 8, 162 .val_bits = 8,
@@ -120,6 +166,15 @@ static const struct regmap_config s2mps11_regmap_config = {
120 .cache_type = REGCACHE_FLAT, 166 .cache_type = REGCACHE_FLAT,
121}; 167};
122 168
169static const struct regmap_config s2mps14_regmap_config = {
170 .reg_bits = 8,
171 .val_bits = 8,
172
173 .max_register = S2MPS14_REG_LDODSCH3,
174 .volatile_reg = s2mps11_volatile,
175 .cache_type = REGCACHE_FLAT,
176};
177
123static const struct regmap_config s5m8763_regmap_config = { 178static const struct regmap_config s5m8763_regmap_config = {
124 .reg_bits = 8, 179 .reg_bits = 8,
125 .val_bits = 8, 180 .val_bits = 8,
@@ -138,9 +193,18 @@ static const struct regmap_config s5m8767_regmap_config = {
138 .cache_type = REGCACHE_FLAT, 193 .cache_type = REGCACHE_FLAT,
139}; 194};
140 195
141static const struct regmap_config sec_rtc_regmap_config = { 196static const struct regmap_config s5m_rtc_regmap_config = {
197 .reg_bits = 8,
198 .val_bits = 8,
199
200 .max_register = SEC_RTC_REG_MAX,
201};
202
203static const struct regmap_config s2mps14_rtc_regmap_config = {
142 .reg_bits = 8, 204 .reg_bits = 8,
143 .val_bits = 8, 205 .val_bits = 8,
206
207 .max_register = S2MPS_RTC_REG_MAX,
144}; 208};
145 209
146#ifdef CONFIG_OF 210#ifdef CONFIG_OF
@@ -180,24 +244,24 @@ static struct sec_platform_data *sec_pmic_i2c_parse_dt_pdata(
180} 244}
181#endif 245#endif
182 246
183static inline int sec_i2c_get_driver_data(struct i2c_client *i2c, 247static inline unsigned long sec_i2c_get_driver_data(struct i2c_client *i2c,
184 const struct i2c_device_id *id) 248 const struct i2c_device_id *id)
185{ 249{
186#ifdef CONFIG_OF 250#ifdef CONFIG_OF
187 if (i2c->dev.of_node) { 251 if (i2c->dev.of_node) {
188 const struct of_device_id *match; 252 const struct of_device_id *match;
189 match = of_match_node(sec_dt_match, i2c->dev.of_node); 253 match = of_match_node(sec_dt_match, i2c->dev.of_node);
190 return (int)match->data; 254 return (unsigned long)match->data;
191 } 255 }
192#endif 256#endif
193 return (int)id->driver_data; 257 return id->driver_data;
194} 258}
195 259
196static int sec_pmic_probe(struct i2c_client *i2c, 260static int sec_pmic_probe(struct i2c_client *i2c,
197 const struct i2c_device_id *id) 261 const struct i2c_device_id *id)
198{ 262{
199 struct sec_platform_data *pdata = dev_get_platdata(&i2c->dev); 263 struct sec_platform_data *pdata = dev_get_platdata(&i2c->dev);
200 const struct regmap_config *regmap; 264 const struct regmap_config *regmap, *regmap_rtc;
201 struct sec_pmic_dev *sec_pmic; 265 struct sec_pmic_dev *sec_pmic;
202 int ret; 266 int ret;
203 267
@@ -229,17 +293,34 @@ static int sec_pmic_probe(struct i2c_client *i2c,
229 } 293 }
230 294
231 switch (sec_pmic->device_type) { 295 switch (sec_pmic->device_type) {
296 case S2MPA01:
297 regmap = &s2mpa01_regmap_config;
298 break;
232 case S2MPS11X: 299 case S2MPS11X:
233 regmap = &s2mps11_regmap_config; 300 regmap = &s2mps11_regmap_config;
301 /*
302 * The rtc-s5m driver does not support S2MPS11 and there
303 * is no mfd_cell for S2MPS11 RTC device.
304 * However we must pass something to devm_regmap_init_i2c()
305 * so use S5M-like regmap config even though it wouldn't work.
306 */
307 regmap_rtc = &s5m_rtc_regmap_config;
308 break;
309 case S2MPS14X:
310 regmap = &s2mps14_regmap_config;
311 regmap_rtc = &s2mps14_rtc_regmap_config;
234 break; 312 break;
235 case S5M8763X: 313 case S5M8763X:
236 regmap = &s5m8763_regmap_config; 314 regmap = &s5m8763_regmap_config;
315 regmap_rtc = &s5m_rtc_regmap_config;
237 break; 316 break;
238 case S5M8767X: 317 case S5M8767X:
239 regmap = &s5m8767_regmap_config; 318 regmap = &s5m8767_regmap_config;
319 regmap_rtc = &s5m_rtc_regmap_config;
240 break; 320 break;
241 default: 321 default:
242 regmap = &sec_regmap_config; 322 regmap = &sec_regmap_config;
323 regmap_rtc = &s5m_rtc_regmap_config;
243 break; 324 break;
244 } 325 }
245 326
@@ -252,10 +333,13 @@ static int sec_pmic_probe(struct i2c_client *i2c,
252 } 333 }
253 334
254 sec_pmic->rtc = i2c_new_dummy(i2c->adapter, RTC_I2C_ADDR); 335 sec_pmic->rtc = i2c_new_dummy(i2c->adapter, RTC_I2C_ADDR);
336 if (!sec_pmic->rtc) {
337 dev_err(&i2c->dev, "Failed to allocate I2C for RTC\n");
338 return -ENODEV;
339 }
255 i2c_set_clientdata(sec_pmic->rtc, sec_pmic); 340 i2c_set_clientdata(sec_pmic->rtc, sec_pmic);
256 341
257 sec_pmic->regmap_rtc = devm_regmap_init_i2c(sec_pmic->rtc, 342 sec_pmic->regmap_rtc = devm_regmap_init_i2c(sec_pmic->rtc, regmap_rtc);
258 &sec_rtc_regmap_config);
259 if (IS_ERR(sec_pmic->regmap_rtc)) { 343 if (IS_ERR(sec_pmic->regmap_rtc)) {
260 ret = PTR_ERR(sec_pmic->regmap_rtc); 344 ret = PTR_ERR(sec_pmic->regmap_rtc);
261 dev_err(&i2c->dev, "Failed to allocate RTC register map: %d\n", 345 dev_err(&i2c->dev, "Failed to allocate RTC register map: %d\n",
@@ -283,10 +367,18 @@ static int sec_pmic_probe(struct i2c_client *i2c,
283 ret = mfd_add_devices(sec_pmic->dev, -1, s5m8767_devs, 367 ret = mfd_add_devices(sec_pmic->dev, -1, s5m8767_devs,
284 ARRAY_SIZE(s5m8767_devs), NULL, 0, NULL); 368 ARRAY_SIZE(s5m8767_devs), NULL, 0, NULL);
285 break; 369 break;
370 case S2MPA01:
371 ret = mfd_add_devices(sec_pmic->dev, -1, s2mpa01_devs,
372 ARRAY_SIZE(s2mpa01_devs), NULL, 0, NULL);
373 break;
286 case S2MPS11X: 374 case S2MPS11X:
287 ret = mfd_add_devices(sec_pmic->dev, -1, s2mps11_devs, 375 ret = mfd_add_devices(sec_pmic->dev, -1, s2mps11_devs,
288 ARRAY_SIZE(s2mps11_devs), NULL, 0, NULL); 376 ARRAY_SIZE(s2mps11_devs), NULL, 0, NULL);
289 break; 377 break;
378 case S2MPS14X:
379 ret = mfd_add_devices(sec_pmic->dev, -1, s2mps14_devs,
380 ARRAY_SIZE(s2mps14_devs), NULL, 0, NULL);
381 break;
290 default: 382 default:
291 /* If this happens the probe function is problem */ 383 /* If this happens the probe function is problem */
292 BUG(); 384 BUG();
@@ -315,6 +407,7 @@ static int sec_pmic_remove(struct i2c_client *i2c)
315 return 0; 407 return 0;
316} 408}
317 409
410#ifdef CONFIG_PM_SLEEP
318static int sec_pmic_suspend(struct device *dev) 411static int sec_pmic_suspend(struct device *dev)
319{ 412{
320 struct i2c_client *i2c = container_of(dev, struct i2c_client, dev); 413 struct i2c_client *i2c = container_of(dev, struct i2c_client, dev);
@@ -349,6 +442,7 @@ static int sec_pmic_resume(struct device *dev)
349 442
350 return 0; 443 return 0;
351} 444}
445#endif /* CONFIG_PM_SLEEP */
352 446
353static SIMPLE_DEV_PM_OPS(sec_pmic_pm_ops, sec_pmic_suspend, sec_pmic_resume); 447static SIMPLE_DEV_PM_OPS(sec_pmic_pm_ops, sec_pmic_suspend, sec_pmic_resume);
354 448
diff --git a/drivers/mfd/sec-irq.c b/drivers/mfd/sec-irq.c
index 4de494f51d40..64e7913aadc6 100644
--- a/drivers/mfd/sec-irq.c
+++ b/drivers/mfd/sec-irq.c
@@ -1,7 +1,7 @@
1/* 1/*
2 * sec-irq.c 2 * sec-irq.c
3 * 3 *
4 * Copyright (c) 2011 Samsung Electronics Co., Ltd 4 * Copyright (c) 2011-2014 Samsung Electronics Co., Ltd
5 * http://www.samsung.com 5 * http://www.samsung.com
6 * 6 *
7 * This program is free software; you can redistribute it and/or modify it 7 * This program is free software; you can redistribute it and/or modify it
@@ -19,6 +19,7 @@
19#include <linux/mfd/samsung/core.h> 19#include <linux/mfd/samsung/core.h>
20#include <linux/mfd/samsung/irq.h> 20#include <linux/mfd/samsung/irq.h>
21#include <linux/mfd/samsung/s2mps11.h> 21#include <linux/mfd/samsung/s2mps11.h>
22#include <linux/mfd/samsung/s2mps14.h>
22#include <linux/mfd/samsung/s5m8763.h> 23#include <linux/mfd/samsung/s5m8763.h>
23#include <linux/mfd/samsung/s5m8767.h> 24#include <linux/mfd/samsung/s5m8767.h>
24 25
@@ -59,13 +60,13 @@ static const struct regmap_irq s2mps11_irqs[] = {
59 .reg_offset = 1, 60 .reg_offset = 1,
60 .mask = S2MPS11_IRQ_RTC60S_MASK, 61 .mask = S2MPS11_IRQ_RTC60S_MASK,
61 }, 62 },
62 [S2MPS11_IRQ_RTCA1] = { 63 [S2MPS11_IRQ_RTCA0] = {
63 .reg_offset = 1, 64 .reg_offset = 1,
64 .mask = S2MPS11_IRQ_RTCA1_MASK, 65 .mask = S2MPS11_IRQ_RTCA0_MASK,
65 }, 66 },
66 [S2MPS11_IRQ_RTCA2] = { 67 [S2MPS11_IRQ_RTCA1] = {
67 .reg_offset = 1, 68 .reg_offset = 1,
68 .mask = S2MPS11_IRQ_RTCA2_MASK, 69 .mask = S2MPS11_IRQ_RTCA1_MASK,
69 }, 70 },
70 [S2MPS11_IRQ_SMPL] = { 71 [S2MPS11_IRQ_SMPL] = {
71 .reg_offset = 1, 72 .reg_offset = 1,
@@ -89,6 +90,76 @@ static const struct regmap_irq s2mps11_irqs[] = {
89 }, 90 },
90}; 91};
91 92
93static const struct regmap_irq s2mps14_irqs[] = {
94 [S2MPS14_IRQ_PWRONF] = {
95 .reg_offset = 0,
96 .mask = S2MPS11_IRQ_PWRONF_MASK,
97 },
98 [S2MPS14_IRQ_PWRONR] = {
99 .reg_offset = 0,
100 .mask = S2MPS11_IRQ_PWRONR_MASK,
101 },
102 [S2MPS14_IRQ_JIGONBF] = {
103 .reg_offset = 0,
104 .mask = S2MPS11_IRQ_JIGONBF_MASK,
105 },
106 [S2MPS14_IRQ_JIGONBR] = {
107 .reg_offset = 0,
108 .mask = S2MPS11_IRQ_JIGONBR_MASK,
109 },
110 [S2MPS14_IRQ_ACOKBF] = {
111 .reg_offset = 0,
112 .mask = S2MPS11_IRQ_ACOKBF_MASK,
113 },
114 [S2MPS14_IRQ_ACOKBR] = {
115 .reg_offset = 0,
116 .mask = S2MPS11_IRQ_ACOKBR_MASK,
117 },
118 [S2MPS14_IRQ_PWRON1S] = {
119 .reg_offset = 0,
120 .mask = S2MPS11_IRQ_PWRON1S_MASK,
121 },
122 [S2MPS14_IRQ_MRB] = {
123 .reg_offset = 0,
124 .mask = S2MPS11_IRQ_MRB_MASK,
125 },
126 [S2MPS14_IRQ_RTC60S] = {
127 .reg_offset = 1,
128 .mask = S2MPS11_IRQ_RTC60S_MASK,
129 },
130 [S2MPS14_IRQ_RTCA1] = {
131 .reg_offset = 1,
132 .mask = S2MPS11_IRQ_RTCA1_MASK,
133 },
134 [S2MPS14_IRQ_RTCA0] = {
135 .reg_offset = 1,
136 .mask = S2MPS11_IRQ_RTCA0_MASK,
137 },
138 [S2MPS14_IRQ_SMPL] = {
139 .reg_offset = 1,
140 .mask = S2MPS11_IRQ_SMPL_MASK,
141 },
142 [S2MPS14_IRQ_RTC1S] = {
143 .reg_offset = 1,
144 .mask = S2MPS11_IRQ_RTC1S_MASK,
145 },
146 [S2MPS14_IRQ_WTSR] = {
147 .reg_offset = 1,
148 .mask = S2MPS11_IRQ_WTSR_MASK,
149 },
150 [S2MPS14_IRQ_INT120C] = {
151 .reg_offset = 2,
152 .mask = S2MPS11_IRQ_INT120C_MASK,
153 },
154 [S2MPS14_IRQ_INT140C] = {
155 .reg_offset = 2,
156 .mask = S2MPS11_IRQ_INT140C_MASK,
157 },
158 [S2MPS14_IRQ_TSD] = {
159 .reg_offset = 2,
160 .mask = S2MPS14_IRQ_TSD_MASK,
161 },
162};
92 163
93static const struct regmap_irq s5m8767_irqs[] = { 164static const struct regmap_irq s5m8767_irqs[] = {
94 [S5M8767_IRQ_PWRR] = { 165 [S5M8767_IRQ_PWRR] = {
@@ -246,6 +317,16 @@ static const struct regmap_irq_chip s2mps11_irq_chip = {
246 .ack_base = S2MPS11_REG_INT1, 317 .ack_base = S2MPS11_REG_INT1,
247}; 318};
248 319
320static const struct regmap_irq_chip s2mps14_irq_chip = {
321 .name = "s2mps14",
322 .irqs = s2mps14_irqs,
323 .num_irqs = ARRAY_SIZE(s2mps14_irqs),
324 .num_regs = 3,
325 .status_base = S2MPS14_REG_INT1,
326 .mask_base = S2MPS14_REG_INT1M,
327 .ack_base = S2MPS14_REG_INT1,
328};
329
249static const struct regmap_irq_chip s5m8767_irq_chip = { 330static const struct regmap_irq_chip s5m8767_irq_chip = {
250 .name = "s5m8767", 331 .name = "s5m8767",
251 .irqs = s5m8767_irqs, 332 .irqs = s5m8767_irqs,
@@ -297,6 +378,12 @@ int sec_irq_init(struct sec_pmic_dev *sec_pmic)
297 sec_pmic->irq_base, &s2mps11_irq_chip, 378 sec_pmic->irq_base, &s2mps11_irq_chip,
298 &sec_pmic->irq_data); 379 &sec_pmic->irq_data);
299 break; 380 break;
381 case S2MPS14X:
382 ret = regmap_add_irq_chip(sec_pmic->regmap_pmic, sec_pmic->irq,
383 IRQF_TRIGGER_FALLING | IRQF_ONESHOT,
384 sec_pmic->irq_base, &s2mps14_irq_chip,
385 &sec_pmic->irq_data);
386 break;
300 default: 387 default:
301 dev_err(sec_pmic->dev, "Unknown device type %d\n", 388 dev_err(sec_pmic->dev, "Unknown device type %d\n",
302 sec_pmic->device_type); 389 sec_pmic->device_type);
diff --git a/drivers/mfd/tps65217.c b/drivers/mfd/tps65217.c
index 966cf65c5c36..3cc4c7084b92 100644
--- a/drivers/mfd/tps65217.c
+++ b/drivers/mfd/tps65217.c
@@ -158,7 +158,7 @@ static int tps65217_probe(struct i2c_client *client,
158{ 158{
159 struct tps65217 *tps; 159 struct tps65217 *tps;
160 unsigned int version; 160 unsigned int version;
161 unsigned int chip_id = ids->driver_data; 161 unsigned long chip_id = ids->driver_data;
162 const struct of_device_id *match; 162 const struct of_device_id *match;
163 bool status_off = false; 163 bool status_off = false;
164 int ret; 164 int ret;
@@ -170,7 +170,7 @@ static int tps65217_probe(struct i2c_client *client,
170 "Failed to find matching dt id\n"); 170 "Failed to find matching dt id\n");
171 return -EINVAL; 171 return -EINVAL;
172 } 172 }
173 chip_id = (unsigned int)(unsigned long)match->data; 173 chip_id = (unsigned long)match->data;
174 status_off = of_property_read_bool(client->dev.of_node, 174 status_off = of_property_read_bool(client->dev.of_node,
175 "ti,pmic-shutdown-controller"); 175 "ti,pmic-shutdown-controller");
176 } 176 }
diff --git a/drivers/mfd/wm8994-core.c b/drivers/mfd/wm8994-core.c
index ba04f1bc70eb..e6fab94e2c8a 100644
--- a/drivers/mfd/wm8994-core.c
+++ b/drivers/mfd/wm8994-core.c
@@ -636,7 +636,7 @@ static int wm8994_i2c_probe(struct i2c_client *i2c,
636 if (i2c->dev.of_node) { 636 if (i2c->dev.of_node) {
637 of_id = of_match_device(wm8994_of_match, &i2c->dev); 637 of_id = of_match_device(wm8994_of_match, &i2c->dev);
638 if (of_id) 638 if (of_id)
639 wm8994->type = (int)of_id->data; 639 wm8994->type = (enum wm8994_type)of_id->data;
640 } else { 640 } else {
641 wm8994->type = id->driver_data; 641 wm8994->type = id->driver_data;
642 } 642 }