diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2016-07-02 12:39:03 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2016-07-02 12:39:03 -0400 |
commit | a2b0db5b55d5d70d6cdc380af287145418cb9c15 (patch) | |
tree | dfcc8bdcefb19253cda3329b6a498df22eb2bb4d | |
parent | 443851200542932414ee63ad774750633a880b4f (diff) | |
parent | a29a36f2650dbaa54c8aed8cc9af909113c19ad3 (diff) |
Merge tag 'regulator-fix-v4.7-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/regulator
Pull regulator fixes from Mark Brown:
"Two small fixes for the regulator subsystem - one fixing a crash with
one of the devices supported by the max77620 driver, another fixing
startup for the anatop regulator when it starts up with the regulator
in bypass mode"
* tag 'regulator-fix-v4.7-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/regulator:
regulator: max77620: check for valid regulator info
regulator: anatop: allow regulator to be in bypass mode
-rw-r--r-- | drivers/regulator/anatop-regulator.c | 2 | ||||
-rw-r--r-- | drivers/regulator/max77620-regulator.c | 7 |
2 files changed, 7 insertions, 2 deletions
diff --git a/drivers/regulator/anatop-regulator.c b/drivers/regulator/anatop-regulator.c index 63cd5e68c864..3a6d0290c54c 100644 --- a/drivers/regulator/anatop-regulator.c +++ b/drivers/regulator/anatop-regulator.c | |||
@@ -296,7 +296,7 @@ static int anatop_regulator_probe(struct platform_device *pdev) | |||
296 | if (!sreg->sel && !strcmp(sreg->name, "vddpu")) | 296 | if (!sreg->sel && !strcmp(sreg->name, "vddpu")) |
297 | sreg->sel = 22; | 297 | sreg->sel = 22; |
298 | 298 | ||
299 | if (!sreg->sel) { | 299 | if (!sreg->bypass && !sreg->sel) { |
300 | dev_err(&pdev->dev, "Failed to read a valid default voltage selector.\n"); | 300 | dev_err(&pdev->dev, "Failed to read a valid default voltage selector.\n"); |
301 | return -EINVAL; | 301 | return -EINVAL; |
302 | } | 302 | } |
diff --git a/drivers/regulator/max77620-regulator.c b/drivers/regulator/max77620-regulator.c index 321e804aeab0..a1b49a6d538f 100644 --- a/drivers/regulator/max77620-regulator.c +++ b/drivers/regulator/max77620-regulator.c | |||
@@ -123,6 +123,9 @@ static int max77620_regulator_set_fps_src(struct max77620_regulator *pmic, | |||
123 | unsigned int val; | 123 | unsigned int val; |
124 | int ret; | 124 | int ret; |
125 | 125 | ||
126 | if (!rinfo) | ||
127 | return 0; | ||
128 | |||
126 | switch (fps_src) { | 129 | switch (fps_src) { |
127 | case MAX77620_FPS_SRC_0: | 130 | case MAX77620_FPS_SRC_0: |
128 | case MAX77620_FPS_SRC_1: | 131 | case MAX77620_FPS_SRC_1: |
@@ -171,6 +174,9 @@ static int max77620_regulator_set_fps_slots(struct max77620_regulator *pmic, | |||
171 | int pd = rpdata->active_fps_pd_slot; | 174 | int pd = rpdata->active_fps_pd_slot; |
172 | int ret = 0; | 175 | int ret = 0; |
173 | 176 | ||
177 | if (!rinfo) | ||
178 | return 0; | ||
179 | |||
174 | if (is_suspend) { | 180 | if (is_suspend) { |
175 | pu = rpdata->suspend_fps_pu_slot; | 181 | pu = rpdata->suspend_fps_pu_slot; |
176 | pd = rpdata->suspend_fps_pd_slot; | 182 | pd = rpdata->suspend_fps_pd_slot; |
@@ -680,7 +686,6 @@ static struct max77620_regulator_info max77620_regs_info[MAX77620_NUM_REGS] = { | |||
680 | RAIL_SD(SD1, sd1, "in-sd1", SD1, 600000, 1550000, 12500, 0x22, SD1), | 686 | RAIL_SD(SD1, sd1, "in-sd1", SD1, 600000, 1550000, 12500, 0x22, SD1), |
681 | RAIL_SD(SD2, sd2, "in-sd2", SDX, 600000, 3787500, 12500, 0xFF, NONE), | 687 | RAIL_SD(SD2, sd2, "in-sd2", SDX, 600000, 3787500, 12500, 0xFF, NONE), |
682 | RAIL_SD(SD3, sd3, "in-sd3", SDX, 600000, 3787500, 12500, 0xFF, NONE), | 688 | RAIL_SD(SD3, sd3, "in-sd3", SDX, 600000, 3787500, 12500, 0xFF, NONE), |
683 | RAIL_SD(SD4, sd4, "in-sd4", SDX, 600000, 3787500, 12500, 0xFF, NONE), | ||
684 | 689 | ||
685 | RAIL_LDO(LDO0, ldo0, "in-ldo0-1", N, 800000, 2375000, 25000), | 690 | RAIL_LDO(LDO0, ldo0, "in-ldo0-1", N, 800000, 2375000, 25000), |
686 | RAIL_LDO(LDO1, ldo1, "in-ldo0-1", N, 800000, 2375000, 25000), | 691 | RAIL_LDO(LDO1, ldo1, "in-ldo0-1", N, 800000, 2375000, 25000), |