aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/mfd
diff options
context:
space:
mode:
authorThomas Abraham <thomas.ab@samsung.com>2015-11-20 05:37:51 -0500
committerLee Jones <lee.jones@linaro.org>2015-11-23 05:33:16 -0500
commit9e4808d2c6a6660d5d2cd572e689570df14a8472 (patch)
tree4f67d44a6244c675ab8531d1ef46d3516faab758 /drivers/mfd
parent1ec218373b8ebda821aec00bb156a9c94fad9cd4 (diff)
mfd: sec: Add support for S2MPS15 PMIC
Add support for S2MPS15 PMIC which is similar to S2MPS11 PMIC. The S2MPS15 PMIC supports 27 LDO regulators, 10 buck regulators, RTC, three 32.768KHz clock outputs and battery charger. This patch adds initial support for LDO and buck regulators of S2MPS15 device. Signed-off-by: Thomas Abraham <thomas.ab@samsung.com> Signed-off-by: Alim Akhtar <alim.akhtar@samsung.com> Reviewed-by: Krzysztof Kozlowski <k.kozlowski@samsung.com> [Alim: Added s2mps15_devs like rtc and clk and related changes] Signed-off-by: Lee Jones <lee.jones@linaro.org>
Diffstat (limited to 'drivers/mfd')
-rw-r--r--drivers/mfd/sec-core.c31
-rw-r--r--drivers/mfd/sec-irq.c8
2 files changed, 39 insertions, 0 deletions
diff --git a/drivers/mfd/sec-core.c b/drivers/mfd/sec-core.c
index 989076d6cb83..7c4e7be17f1e 100644
--- a/drivers/mfd/sec-core.c
+++ b/drivers/mfd/sec-core.c
@@ -29,6 +29,7 @@
29#include <linux/mfd/samsung/s2mps11.h> 29#include <linux/mfd/samsung/s2mps11.h>
30#include <linux/mfd/samsung/s2mps13.h> 30#include <linux/mfd/samsung/s2mps13.h>
31#include <linux/mfd/samsung/s2mps14.h> 31#include <linux/mfd/samsung/s2mps14.h>
32#include <linux/mfd/samsung/s2mps15.h>
32#include <linux/mfd/samsung/s2mpu02.h> 33#include <linux/mfd/samsung/s2mpu02.h>
33#include <linux/mfd/samsung/s5m8763.h> 34#include <linux/mfd/samsung/s5m8763.h>
34#include <linux/mfd/samsung/s5m8767.h> 35#include <linux/mfd/samsung/s5m8767.h>
@@ -96,6 +97,17 @@ static const struct mfd_cell s2mps14_devs[] = {
96 } 97 }
97}; 98};
98 99
100static const struct mfd_cell s2mps15_devs[] = {
101 {
102 .name = "s2mps15-regulator",
103 }, {
104 .name = "s2mps15-rtc",
105 }, {
106 .name = "s2mps13-clk",
107 .of_compatible = "samsung,s2mps13-clk",
108 },
109};
110
99static const struct mfd_cell s2mpa01_devs[] = { 111static const struct mfd_cell s2mpa01_devs[] = {
100 { 112 {
101 .name = "s2mpa01-pmic", 113 .name = "s2mpa01-pmic",
@@ -122,6 +134,9 @@ static const struct of_device_id sec_dt_match[] = {
122 .compatible = "samsung,s2mps14-pmic", 134 .compatible = "samsung,s2mps14-pmic",
123 .data = (void *)S2MPS14X, 135 .data = (void *)S2MPS14X,
124 }, { 136 }, {
137 .compatible = "samsung,s2mps15-pmic",
138 .data = (void *)S2MPS15X,
139 }, {
125 .compatible = "samsung,s2mpa01-pmic", 140 .compatible = "samsung,s2mpa01-pmic",
126 .data = (void *)S2MPA01, 141 .data = (void *)S2MPA01,
127 }, { 142 }, {
@@ -223,6 +238,15 @@ static const struct regmap_config s2mps14_regmap_config = {
223 .cache_type = REGCACHE_FLAT, 238 .cache_type = REGCACHE_FLAT,
224}; 239};
225 240
241static const struct regmap_config s2mps15_regmap_config = {
242 .reg_bits = 8,
243 .val_bits = 8,
244
245 .max_register = S2MPS15_REG_LDODSCH4,
246 .volatile_reg = s2mps11_volatile,
247 .cache_type = REGCACHE_FLAT,
248};
249
226static const struct regmap_config s2mpu02_regmap_config = { 250static const struct regmap_config s2mpu02_regmap_config = {
227 .reg_bits = 8, 251 .reg_bits = 8,
228 .val_bits = 8, 252 .val_bits = 8,
@@ -384,6 +408,9 @@ static int sec_pmic_probe(struct i2c_client *i2c,
384 case S2MPS14X: 408 case S2MPS14X:
385 regmap = &s2mps14_regmap_config; 409 regmap = &s2mps14_regmap_config;
386 break; 410 break;
411 case S2MPS15X:
412 regmap = &s2mps15_regmap_config;
413 break;
387 case S5M8763X: 414 case S5M8763X:
388 regmap = &s5m8763_regmap_config; 415 regmap = &s5m8763_regmap_config;
389 break; 416 break;
@@ -442,6 +469,10 @@ static int sec_pmic_probe(struct i2c_client *i2c,
442 sec_devs = s2mps14_devs; 469 sec_devs = s2mps14_devs;
443 num_sec_devs = ARRAY_SIZE(s2mps14_devs); 470 num_sec_devs = ARRAY_SIZE(s2mps14_devs);
444 break; 471 break;
472 case S2MPS15X:
473 sec_devs = s2mps15_devs;
474 num_sec_devs = ARRAY_SIZE(s2mps15_devs);
475 break;
445 case S2MPU02: 476 case S2MPU02:
446 sec_devs = s2mpu02_devs; 477 sec_devs = s2mpu02_devs;
447 num_sec_devs = ARRAY_SIZE(s2mpu02_devs); 478 num_sec_devs = ARRAY_SIZE(s2mpu02_devs);
diff --git a/drivers/mfd/sec-irq.c b/drivers/mfd/sec-irq.c
index 806fa8dbb22d..d77de431cc50 100644
--- a/drivers/mfd/sec-irq.c
+++ b/drivers/mfd/sec-irq.c
@@ -407,6 +407,11 @@ static const struct regmap_irq_chip s2mps14_irq_chip = {
407 S2MPS1X_IRQ_CHIP_COMMON_DATA, 407 S2MPS1X_IRQ_CHIP_COMMON_DATA,
408}; 408};
409 409
410static const struct regmap_irq_chip s2mps15_irq_chip = {
411 .name = "s2mps15",
412 S2MPS1X_IRQ_CHIP_COMMON_DATA,
413};
414
410static const struct regmap_irq_chip s2mpu02_irq_chip = { 415static const struct regmap_irq_chip s2mpu02_irq_chip = {
411 .name = "s2mpu02", 416 .name = "s2mpu02",
412 .irqs = s2mpu02_irqs, 417 .irqs = s2mpu02_irqs,
@@ -466,6 +471,9 @@ int sec_irq_init(struct sec_pmic_dev *sec_pmic)
466 case S2MPS14X: 471 case S2MPS14X:
467 sec_irq_chip = &s2mps14_irq_chip; 472 sec_irq_chip = &s2mps14_irq_chip;
468 break; 473 break;
474 case S2MPS15X:
475 sec_irq_chip = &s2mps15_irq_chip;
476 break;
469 case S2MPU02: 477 case S2MPU02:
470 sec_irq_chip = &s2mpu02_irq_chip; 478 sec_irq_chip = &s2mpu02_irq_chip;
471 break; 479 break;