Commit 3bc2ee91 authored by Chanwoo Choi's avatar Chanwoo Choi Committed by Lee Jones

mfd: sec-core: Add support for S2MPS13 device

This patch adds the support for Samsung S2MPS13 PMIC device to the sec-core MFD
driver. The S2MPS13 is very similar with existing S2MPS14 and includes PMIC/
RTC/CLOCK devices.
Signed-off-by: default avatarChanwoo Choi <cw00.choi@samsung.com>
Acked-by: default avatarSangbeom Kim <sbkim73@samsung.com>
Signed-off-by: default avatarLee Jones <lee.jones@linaro.org>
parent f114040e
...@@ -74,6 +74,15 @@ static const struct mfd_cell s2mps11_devs[] = { ...@@ -74,6 +74,15 @@ static const struct mfd_cell s2mps11_devs[] = {
} }
}; };
static const struct mfd_cell s2mps13_devs[] = {
{ .name = "s2mps13-pmic", },
{ .name = "s2mps13-rtc", },
{
.name = "s2mps13-clk",
.of_compatible = "samsung,s2mps13-clk",
},
};
static const struct mfd_cell s2mps14_devs[] = { static const struct mfd_cell s2mps14_devs[] = {
{ {
.name = "s2mps14-pmic", .name = "s2mps14-pmic",
...@@ -107,6 +116,9 @@ static const struct of_device_id sec_dt_match[] = { ...@@ -107,6 +116,9 @@ static const struct of_device_id sec_dt_match[] = {
}, { }, {
.compatible = "samsung,s2mps11-pmic", .compatible = "samsung,s2mps11-pmic",
.data = (void *)S2MPS11X, .data = (void *)S2MPS11X,
}, {
.compatible = "samsung,s2mps13-pmic",
.data = (void *)S2MPS13X,
}, { }, {
.compatible = "samsung,s2mps14-pmic", .compatible = "samsung,s2mps14-pmic",
.data = (void *)S2MPS14X, .data = (void *)S2MPS14X,
...@@ -378,6 +390,10 @@ static int sec_pmic_probe(struct i2c_client *i2c, ...@@ -378,6 +390,10 @@ static int sec_pmic_probe(struct i2c_client *i2c,
sec_devs = s2mps11_devs; sec_devs = s2mps11_devs;
num_sec_devs = ARRAY_SIZE(s2mps11_devs); num_sec_devs = ARRAY_SIZE(s2mps11_devs);
break; break;
case S2MPS13X:
sec_devs = s2mps13_devs;
num_sec_devs = ARRAY_SIZE(s2mps13_devs);
break;
case S2MPS14X: case S2MPS14X:
sec_devs = s2mps14_devs; sec_devs = s2mps14_devs;
num_sec_devs = ARRAY_SIZE(s2mps14_devs); num_sec_devs = ARRAY_SIZE(s2mps14_devs);
......
...@@ -389,14 +389,22 @@ static const struct regmap_irq_chip s2mps11_irq_chip = { ...@@ -389,14 +389,22 @@ static const struct regmap_irq_chip s2mps11_irq_chip = {
.ack_base = S2MPS11_REG_INT1, .ack_base = S2MPS11_REG_INT1,
}; };
#define S2MPS1X_IRQ_CHIP_COMMON_DATA \
.irqs = s2mps14_irqs, \
.num_irqs = ARRAY_SIZE(s2mps14_irqs), \
.num_regs = 3, \
.status_base = S2MPS14_REG_INT1, \
.mask_base = S2MPS14_REG_INT1M, \
.ack_base = S2MPS14_REG_INT1 \
static const struct regmap_irq_chip s2mps13_irq_chip = {
.name = "s2mps13",
S2MPS1X_IRQ_CHIP_COMMON_DATA,
};
static const struct regmap_irq_chip s2mps14_irq_chip = { static const struct regmap_irq_chip s2mps14_irq_chip = {
.name = "s2mps14", .name = "s2mps14",
.irqs = s2mps14_irqs, S2MPS1X_IRQ_CHIP_COMMON_DATA,
.num_irqs = ARRAY_SIZE(s2mps14_irqs),
.num_regs = 3,
.status_base = S2MPS14_REG_INT1,
.mask_base = S2MPS14_REG_INT1M,
.ack_base = S2MPS14_REG_INT1,
}; };
static const struct regmap_irq_chip s2mpu02_irq_chip = { static const struct regmap_irq_chip s2mpu02_irq_chip = {
...@@ -452,6 +460,9 @@ int sec_irq_init(struct sec_pmic_dev *sec_pmic) ...@@ -452,6 +460,9 @@ int sec_irq_init(struct sec_pmic_dev *sec_pmic)
case S2MPS11X: case S2MPS11X:
sec_irq_chip = &s2mps11_irq_chip; sec_irq_chip = &s2mps11_irq_chip;
break; break;
case S2MPS13X:
sec_irq_chip = &s2mps13_irq_chip;
break;
case S2MPS14X: case S2MPS14X:
sec_irq_chip = &s2mps14_irq_chip; sec_irq_chip = &s2mps14_irq_chip;
break; break;
......
...@@ -41,6 +41,7 @@ enum sec_device_type { ...@@ -41,6 +41,7 @@ enum sec_device_type {
S5M8767X, S5M8767X,
S2MPA01, S2MPA01,
S2MPS11X, S2MPS11X,
S2MPS13X,
S2MPS14X, S2MPS14X,
S2MPU02, S2MPU02,
}; };
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment