diff options
-rw-r--r-- | drivers/regulator/Kconfig | 4 | ||||
-rw-r--r-- | drivers/regulator/rn5t618-regulator.c | 35 | ||||
-rw-r--r-- | include/linux/mfd/rn5t618.h | 6 |
3 files changed, 39 insertions, 6 deletions
diff --git a/drivers/regulator/Kconfig b/drivers/regulator/Kconfig index 99b9362331b5..a847f8231337 100644 --- a/drivers/regulator/Kconfig +++ b/drivers/regulator/Kconfig | |||
@@ -700,8 +700,8 @@ config REGULATOR_RN5T618 | |||
700 | tristate "Ricoh RN5T567/618 voltage regulators" | 700 | tristate "Ricoh RN5T567/618 voltage regulators" |
701 | depends on MFD_RN5T618 | 701 | depends on MFD_RN5T618 |
702 | help | 702 | help |
703 | Say y here to support the regulators found on Ricoh RN5T567 or | 703 | Say y here to support the regulators found on Ricoh RN5T567, |
704 | RN5T618 PMIC. | 704 | RN5T618 or RC5T619 PMIC. |
705 | 705 | ||
706 | config REGULATOR_RT5033 | 706 | config REGULATOR_RT5033 |
707 | tristate "Richtek RT5033 Regulators" | 707 | tristate "Richtek RT5033 Regulators" |
diff --git a/drivers/regulator/rn5t618-regulator.c b/drivers/regulator/rn5t618-regulator.c index 8d2819e36654..ef2be56460fe 100644 --- a/drivers/regulator/rn5t618-regulator.c +++ b/drivers/regulator/rn5t618-regulator.c | |||
@@ -79,6 +79,29 @@ static struct regulator_desc rn5t618_regulators[] = { | |||
79 | REG(LDORTC2, LDOEN2, BIT(5), LDORTC2DAC, 0x7f, 900000, 3500000, 25000), | 79 | REG(LDORTC2, LDOEN2, BIT(5), LDORTC2DAC, 0x7f, 900000, 3500000, 25000), |
80 | }; | 80 | }; |
81 | 81 | ||
82 | static struct regulator_desc rc5t619_regulators[] = { | ||
83 | /* DCDC */ | ||
84 | REG(DCDC1, DC1CTL, BIT(0), DC1DAC, 0xff, 600000, 3500000, 12500), | ||
85 | REG(DCDC2, DC2CTL, BIT(0), DC2DAC, 0xff, 600000, 3500000, 12500), | ||
86 | REG(DCDC3, DC3CTL, BIT(0), DC3DAC, 0xff, 600000, 3500000, 12500), | ||
87 | REG(DCDC4, DC4CTL, BIT(0), DC4DAC, 0xff, 600000, 3500000, 12500), | ||
88 | REG(DCDC5, DC5CTL, BIT(0), DC5DAC, 0xff, 600000, 3500000, 12500), | ||
89 | /* LDO */ | ||
90 | REG(LDO1, LDOEN1, BIT(0), LDO1DAC, 0x7f, 900000, 3500000, 25000), | ||
91 | REG(LDO2, LDOEN1, BIT(1), LDO2DAC, 0x7f, 900000, 3500000, 25000), | ||
92 | REG(LDO3, LDOEN1, BIT(2), LDO3DAC, 0x7f, 900000, 3500000, 25000), | ||
93 | REG(LDO4, LDOEN1, BIT(3), LDO4DAC, 0x7f, 900000, 3500000, 25000), | ||
94 | REG(LDO5, LDOEN1, BIT(4), LDO5DAC, 0x7f, 600000, 3500000, 25000), | ||
95 | REG(LDO6, LDOEN1, BIT(5), LDO6DAC, 0x7f, 600000, 3500000, 25000), | ||
96 | REG(LDO7, LDOEN1, BIT(6), LDO7DAC, 0x7f, 900000, 3500000, 25000), | ||
97 | REG(LDO8, LDOEN1, BIT(7), LDO8DAC, 0x7f, 900000, 3500000, 25000), | ||
98 | REG(LDO9, LDOEN2, BIT(0), LDO9DAC, 0x7f, 900000, 3500000, 25000), | ||
99 | REG(LDO10, LDOEN2, BIT(0), LDO10DAC, 0x7f, 900000, 3500000, 25000), | ||
100 | /* LDO RTC */ | ||
101 | REG(LDORTC1, LDOEN2, BIT(4), LDORTCDAC, 0x7f, 1700000, 3500000, 25000), | ||
102 | REG(LDORTC2, LDOEN2, BIT(5), LDORTC2DAC, 0x7f, 900000, 3500000, 25000), | ||
103 | }; | ||
104 | |||
82 | static int rn5t618_regulator_probe(struct platform_device *pdev) | 105 | static int rn5t618_regulator_probe(struct platform_device *pdev) |
83 | { | 106 | { |
84 | struct rn5t618 *rn5t618 = dev_get_drvdata(pdev->dev.parent); | 107 | struct rn5t618 *rn5t618 = dev_get_drvdata(pdev->dev.parent); |
@@ -86,13 +109,20 @@ static int rn5t618_regulator_probe(struct platform_device *pdev) | |||
86 | struct regulator_dev *rdev; | 109 | struct regulator_dev *rdev; |
87 | struct regulator_desc *regulators; | 110 | struct regulator_desc *regulators; |
88 | int i; | 111 | int i; |
112 | int num_regulators = 0; | ||
89 | 113 | ||
90 | switch (rn5t618->variant) { | 114 | switch (rn5t618->variant) { |
91 | case RN5T567: | 115 | case RN5T567: |
92 | regulators = rn5t567_regulators; | 116 | regulators = rn5t567_regulators; |
117 | num_regulators = ARRAY_SIZE(rn5t567_regulators); | ||
93 | break; | 118 | break; |
94 | case RN5T618: | 119 | case RN5T618: |
95 | regulators = rn5t618_regulators; | 120 | regulators = rn5t618_regulators; |
121 | num_regulators = ARRAY_SIZE(rn5t618_regulators); | ||
122 | break; | ||
123 | case RC5T619: | ||
124 | regulators = rc5t619_regulators; | ||
125 | num_regulators = ARRAY_SIZE(rc5t619_regulators); | ||
96 | break; | 126 | break; |
97 | default: | 127 | default: |
98 | return -EINVAL; | 128 | return -EINVAL; |
@@ -101,10 +131,7 @@ static int rn5t618_regulator_probe(struct platform_device *pdev) | |||
101 | config.dev = pdev->dev.parent; | 131 | config.dev = pdev->dev.parent; |
102 | config.regmap = rn5t618->regmap; | 132 | config.regmap = rn5t618->regmap; |
103 | 133 | ||
104 | for (i = 0; i < RN5T618_REG_NUM; i++) { | 134 | for (i = 0; i < num_regulators; i++) { |
105 | if (!regulators[i].name) | ||
106 | continue; | ||
107 | |||
108 | rdev = devm_regulator_register(&pdev->dev, | 135 | rdev = devm_regulator_register(&pdev->dev, |
109 | ®ulators[i], | 136 | ®ulators[i], |
110 | &config); | 137 | &config); |
diff --git a/include/linux/mfd/rn5t618.h b/include/linux/mfd/rn5t618.h index e5a6cdeb77db..d61bc58aba8a 100644 --- a/include/linux/mfd/rn5t618.h +++ b/include/linux/mfd/rn5t618.h | |||
@@ -226,11 +226,17 @@ enum { | |||
226 | RN5T618_DCDC2, | 226 | RN5T618_DCDC2, |
227 | RN5T618_DCDC3, | 227 | RN5T618_DCDC3, |
228 | RN5T618_DCDC4, | 228 | RN5T618_DCDC4, |
229 | RN5T618_DCDC5, | ||
229 | RN5T618_LDO1, | 230 | RN5T618_LDO1, |
230 | RN5T618_LDO2, | 231 | RN5T618_LDO2, |
231 | RN5T618_LDO3, | 232 | RN5T618_LDO3, |
232 | RN5T618_LDO4, | 233 | RN5T618_LDO4, |
233 | RN5T618_LDO5, | 234 | RN5T618_LDO5, |
235 | RN5T618_LDO6, | ||
236 | RN5T618_LDO7, | ||
237 | RN5T618_LDO8, | ||
238 | RN5T618_LDO9, | ||
239 | RN5T618_LDO10, | ||
234 | RN5T618_LDORTC1, | 240 | RN5T618_LDORTC1, |
235 | RN5T618_LDORTC2, | 241 | RN5T618_LDORTC2, |
236 | RN5T618_REG_NUM, | 242 | RN5T618_REG_NUM, |