Skip to content

Commit 3bc2ee9

Browse files
chanwoochoiLee Jones
authored andcommitted
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: Chanwoo Choi <cw00.choi@samsung.com> Acked-by: Sangbeom Kim <sbkim73@samsung.com> Signed-off-by: Lee Jones <lee.jones@linaro.org>
1 parent f114040 commit 3bc2ee9

File tree

3 files changed

+34
-6
lines changed

3 files changed

+34
-6
lines changed

drivers/mfd/sec-core.c

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,15 @@ static const struct mfd_cell s2mps11_devs[] = {
7474
}
7575
};
7676

77+
static const struct mfd_cell s2mps13_devs[] = {
78+
{ .name = "s2mps13-pmic", },
79+
{ .name = "s2mps13-rtc", },
80+
{
81+
.name = "s2mps13-clk",
82+
.of_compatible = "samsung,s2mps13-clk",
83+
},
84+
};
85+
7786
static const struct mfd_cell s2mps14_devs[] = {
7887
{
7988
.name = "s2mps14-pmic",
@@ -107,6 +116,9 @@ static const struct of_device_id sec_dt_match[] = {
107116
}, {
108117
.compatible = "samsung,s2mps11-pmic",
109118
.data = (void *)S2MPS11X,
119+
}, {
120+
.compatible = "samsung,s2mps13-pmic",
121+
.data = (void *)S2MPS13X,
110122
}, {
111123
.compatible = "samsung,s2mps14-pmic",
112124
.data = (void *)S2MPS14X,
@@ -378,6 +390,10 @@ static int sec_pmic_probe(struct i2c_client *i2c,
378390
sec_devs = s2mps11_devs;
379391
num_sec_devs = ARRAY_SIZE(s2mps11_devs);
380392
break;
393+
case S2MPS13X:
394+
sec_devs = s2mps13_devs;
395+
num_sec_devs = ARRAY_SIZE(s2mps13_devs);
396+
break;
381397
case S2MPS14X:
382398
sec_devs = s2mps14_devs;
383399
num_sec_devs = ARRAY_SIZE(s2mps14_devs);

drivers/mfd/sec-irq.c

Lines changed: 17 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -389,14 +389,22 @@ static const struct regmap_irq_chip s2mps11_irq_chip = {
389389
.ack_base = S2MPS11_REG_INT1,
390390
};
391391

392+
#define S2MPS1X_IRQ_CHIP_COMMON_DATA \
393+
.irqs = s2mps14_irqs, \
394+
.num_irqs = ARRAY_SIZE(s2mps14_irqs), \
395+
.num_regs = 3, \
396+
.status_base = S2MPS14_REG_INT1, \
397+
.mask_base = S2MPS14_REG_INT1M, \
398+
.ack_base = S2MPS14_REG_INT1 \
399+
400+
static const struct regmap_irq_chip s2mps13_irq_chip = {
401+
.name = "s2mps13",
402+
S2MPS1X_IRQ_CHIP_COMMON_DATA,
403+
};
404+
392405
static const struct regmap_irq_chip s2mps14_irq_chip = {
393406
.name = "s2mps14",
394-
.irqs = s2mps14_irqs,
395-
.num_irqs = ARRAY_SIZE(s2mps14_irqs),
396-
.num_regs = 3,
397-
.status_base = S2MPS14_REG_INT1,
398-
.mask_base = S2MPS14_REG_INT1M,
399-
.ack_base = S2MPS14_REG_INT1,
407+
S2MPS1X_IRQ_CHIP_COMMON_DATA,
400408
};
401409

402410
static const struct regmap_irq_chip s2mpu02_irq_chip = {
@@ -452,6 +460,9 @@ int sec_irq_init(struct sec_pmic_dev *sec_pmic)
452460
case S2MPS11X:
453461
sec_irq_chip = &s2mps11_irq_chip;
454462
break;
463+
case S2MPS13X:
464+
sec_irq_chip = &s2mps13_irq_chip;
465+
break;
455466
case S2MPS14X:
456467
sec_irq_chip = &s2mps14_irq_chip;
457468
break;

include/linux/mfd/samsung/core.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ enum sec_device_type {
4141
S5M8767X,
4242
S2MPA01,
4343
S2MPS11X,
44+
S2MPS13X,
4445
S2MPS14X,
4546
S2MPU02,
4647
};

0 commit comments

Comments
 (0)