diff options
| -rw-r--r-- | drivers/mfd/sec-core.c | 48 | ||||
| -rw-r--r-- | drivers/mfd/sec-irq.c | 89 | ||||
| -rw-r--r-- | include/linux/mfd/samsung/core.h | 1 | ||||
| -rw-r--r-- | include/linux/mfd/samsung/irq.h | 27 | ||||
| -rw-r--r-- | include/linux/mfd/samsung/rtc.h | 55 | ||||
| -rw-r--r-- | include/linux/mfd/samsung/s2mps14.h | 152 |
6 files changed, 360 insertions, 12 deletions
diff --git a/drivers/mfd/sec-core.c b/drivers/mfd/sec-core.c index 9623899e6f7c..a4df76c160f8 100644 --- a/drivers/mfd/sec-core.c +++ b/drivers/mfd/sec-core.c | |||
| @@ -27,6 +27,7 @@ | |||
| 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/s2mps11.h> | 29 | #include <linux/mfd/samsung/s2mps11.h> |
| 30 | #include <linux/mfd/samsung/s2mps14.h> | ||
| 30 | #include <linux/mfd/samsung/s5m8763.h> | 31 | #include <linux/mfd/samsung/s5m8763.h> |
| 31 | #include <linux/mfd/samsung/s5m8767.h> | 32 | #include <linux/mfd/samsung/s5m8767.h> |
| 32 | #include <linux/regmap.h> | 33 | #include <linux/regmap.h> |
| @@ -69,6 +70,16 @@ static const struct mfd_cell s2mps11_devs[] = { | |||
| 69 | } | 70 | } |
| 70 | }; | 71 | }; |
| 71 | 72 | ||
| 73 | static const struct mfd_cell s2mps14_devs[] = { | ||
| 74 | { | ||
| 75 | .name = "s2mps14-pmic", | ||
| 76 | }, { | ||
| 77 | .name = "s2mps14-rtc", | ||
| 78 | }, { | ||
| 79 | .name = "s2mps14-clk", | ||
| 80 | } | ||
| 81 | }; | ||
| 82 | |||
| 72 | #ifdef CONFIG_OF | 83 | #ifdef CONFIG_OF |
| 73 | static struct of_device_id sec_dt_match[] = { | 84 | static struct of_device_id sec_dt_match[] = { |
| 74 | { .compatible = "samsung,s5m8767-pmic", | 85 | { .compatible = "samsung,s5m8767-pmic", |
| @@ -77,6 +88,9 @@ static struct of_device_id sec_dt_match[] = { | |||
| 77 | { .compatible = "samsung,s2mps11-pmic", | 88 | { .compatible = "samsung,s2mps11-pmic", |
| 78 | .data = (void *)S2MPS11X, | 89 | .data = (void *)S2MPS11X, |
| 79 | }, | 90 | }, |
| 91 | { .compatible = "samsung,s2mps14-pmic", | ||
| 92 | .data = (void *)S2MPS14X, | ||
| 93 | }, | ||
| 80 | {}, | 94 | {}, |
| 81 | }; | 95 | }; |
| 82 | #endif | 96 | #endif |
| @@ -120,6 +134,15 @@ static const struct regmap_config s2mps11_regmap_config = { | |||
| 120 | .cache_type = REGCACHE_FLAT, | 134 | .cache_type = REGCACHE_FLAT, |
| 121 | }; | 135 | }; |
| 122 | 136 | ||
| 137 | static const struct regmap_config s2mps14_regmap_config = { | ||
| 138 | .reg_bits = 8, | ||
| 139 | .val_bits = 8, | ||
| 140 | |||
| 141 | .max_register = S2MPS14_REG_LDODSCH3, | ||
| 142 | .volatile_reg = s2mps11_volatile, | ||
| 143 | .cache_type = REGCACHE_FLAT, | ||
| 144 | }; | ||
| 145 | |||
| 123 | static const struct regmap_config s5m8763_regmap_config = { | 146 | static const struct regmap_config s5m8763_regmap_config = { |
| 124 | .reg_bits = 8, | 147 | .reg_bits = 8, |
| 125 | .val_bits = 8, | 148 | .val_bits = 8, |
| @@ -138,13 +161,20 @@ static const struct regmap_config s5m8767_regmap_config = { | |||
| 138 | .cache_type = REGCACHE_FLAT, | 161 | .cache_type = REGCACHE_FLAT, |
| 139 | }; | 162 | }; |
| 140 | 163 | ||
| 141 | static const struct regmap_config sec_rtc_regmap_config = { | 164 | static const struct regmap_config s5m_rtc_regmap_config = { |
| 142 | .reg_bits = 8, | 165 | .reg_bits = 8, |
| 143 | .val_bits = 8, | 166 | .val_bits = 8, |
| 144 | 167 | ||
| 145 | .max_register = SEC_RTC_REG_MAX, | 168 | .max_register = SEC_RTC_REG_MAX, |
| 146 | }; | 169 | }; |
| 147 | 170 | ||
| 171 | static const struct regmap_config s2mps14_rtc_regmap_config = { | ||
| 172 | .reg_bits = 8, | ||
| 173 | .val_bits = 8, | ||
| 174 | |||
| 175 | .max_register = S2MPS_RTC_REG_MAX, | ||
| 176 | }; | ||
| 177 | |||
| 148 | #ifdef CONFIG_OF | 178 | #ifdef CONFIG_OF |
| 149 | /* | 179 | /* |
| 150 | * Only the common platform data elements for s5m8767 are parsed here from the | 180 | * Only the common platform data elements for s5m8767 are parsed here from the |
| @@ -239,19 +269,23 @@ static int sec_pmic_probe(struct i2c_client *i2c, | |||
| 239 | * However we must pass something to devm_regmap_init_i2c() | 269 | * However we must pass something to devm_regmap_init_i2c() |
| 240 | * so use S5M-like regmap config even though it wouldn't work. | 270 | * so use S5M-like regmap config even though it wouldn't work. |
| 241 | */ | 271 | */ |
| 242 | regmap_rtc = &sec_rtc_regmap_config; | 272 | regmap_rtc = &s5m_rtc_regmap_config; |
| 273 | break; | ||
| 274 | case S2MPS14X: | ||
| 275 | regmap = &s2mps14_regmap_config; | ||
| 276 | regmap_rtc = &s2mps14_rtc_regmap_config; | ||
| 243 | break; | 277 | break; |
| 244 | case S5M8763X: | 278 | case S5M8763X: |
| 245 | regmap = &s5m8763_regmap_config; | 279 | regmap = &s5m8763_regmap_config; |
| 246 | regmap_rtc = &sec_rtc_regmap_config; | 280 | regmap_rtc = &s5m_rtc_regmap_config; |
| 247 | break; | 281 | break; |
| 248 | case S5M8767X: | 282 | case S5M8767X: |
| 249 | regmap = &s5m8767_regmap_config; | 283 | regmap = &s5m8767_regmap_config; |
| 250 | regmap_rtc = &sec_rtc_regmap_config; | 284 | regmap_rtc = &s5m_rtc_regmap_config; |
| 251 | break; | 285 | break; |
| 252 | default: | 286 | default: |
| 253 | regmap = &sec_regmap_config; | 287 | regmap = &sec_regmap_config; |
| 254 | regmap_rtc = &sec_rtc_regmap_config; | 288 | regmap_rtc = &s5m_rtc_regmap_config; |
| 255 | break; | 289 | break; |
| 256 | } | 290 | } |
| 257 | 291 | ||
| @@ -298,6 +332,10 @@ static int sec_pmic_probe(struct i2c_client *i2c, | |||
| 298 | ret = mfd_add_devices(sec_pmic->dev, -1, s2mps11_devs, | 332 | ret = mfd_add_devices(sec_pmic->dev, -1, s2mps11_devs, |
| 299 | ARRAY_SIZE(s2mps11_devs), NULL, 0, NULL); | 333 | ARRAY_SIZE(s2mps11_devs), NULL, 0, NULL); |
| 300 | break; | 334 | break; |
| 335 | case S2MPS14X: | ||
| 336 | ret = mfd_add_devices(sec_pmic->dev, -1, s2mps14_devs, | ||
| 337 | ARRAY_SIZE(s2mps14_devs), NULL, 0, NULL); | ||
| 338 | break; | ||
| 301 | default: | 339 | default: |
| 302 | /* If this happens the probe function is problem */ | 340 | /* If this happens the probe function is problem */ |
| 303 | BUG(); | 341 | BUG(); |
diff --git a/drivers/mfd/sec-irq.c b/drivers/mfd/sec-irq.c index e403c293b437..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 | ||
| @@ -89,6 +90,76 @@ static const struct regmap_irq s2mps11_irqs[] = { | |||
| 89 | }, | 90 | }, |
| 90 | }; | 91 | }; |
| 91 | 92 | ||
| 93 | static 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 | |||
