From: Mark Brown Date: Fri, 10 Apr 2015 18:16:02 +0000 (+0100) Subject: Merge remote-tracking branches 'regulator/topic/dbx500', 'regulator/topic/load-op... X-Git-Tag: v4.9.8~4493^2~2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=3984c9da458dbdc352a82909a51c42cf2860a4a5;p=platform%2Fkernel%2Flinux-rpi3.git Merge remote-tracking branches 'regulator/topic/dbx500', 'regulator/topic/load-op', 'regulator/topic/max77693' and 'regulator/topic/max8660' into regulator-next --- 3984c9da458dbdc352a82909a51c42cf2860a4a5 diff --cc drivers/regulator/core.c index 669418b,b899947,f245214,b899947,b899947..e23fd00 --- a/drivers/regulator/core.c +++ b/drivers/regulator/core.c @@@@@@ -676,22 -676,22 -678,29 -676,22 -676,22 +678,29 @@@@@@ static int drms_uA_update(struct regula list_for_each_entry(sibling, &rdev->consumer_list, list) current_uA += sibling->uA_load; -- -- /* now get the optimum mode for our new total regulator load */ -- -- mode = rdev->desc->ops->get_optimum_mode(rdev, input_uV, -- -- output_uV, current_uA); - - /* check the new mode is allowed */ - err = regulator_mode_constrain(rdev, &mode); - if (err < 0) { - rdev_err(rdev, "failed to get optimum mode @ %d uA %d -> %d uV\n", - current_uA, input_uV, output_uV); - return err; ++ ++ if (rdev->desc->ops->set_load) { ++ ++ /* set the optimum mode for our new total regulator load */ ++ ++ err = rdev->desc->ops->set_load(rdev, current_uA); ++ ++ if (err < 0) ++ ++ rdev_err(rdev, "failed to set load %d\n", current_uA); ++ ++ } else { ++ ++ /* now get the optimum mode for our new total regulator load */ ++ ++ mode = rdev->desc->ops->get_optimum_mode(rdev, input_uV, ++ ++ output_uV, current_uA); ++ ++ ++ ++ /* check the new mode is allowed */ ++ ++ err = regulator_mode_constrain(rdev, &mode); ++ ++ if (err < 0) { ++ ++ rdev_err(rdev, "failed to get optimum mode @ %d uA %d -> %d uV\n", ++ ++ current_uA, input_uV, output_uV); ++ ++ return err; ++ ++ } + - -- /* check the new mode is allowed */ - -- err = regulator_mode_constrain(rdev, &mode); - -- if (err < 0) { - -- rdev_err(rdev, "failed to get optimum mode @ %d uA %d -> %d uV\n", - -- current_uA, input_uV, output_uV); - -- return err; ++ ++ err = rdev->desc->ops->set_mode(rdev, mode); ++ ++ if (err < 0) ++ ++ rdev_err(rdev, "failed to set optimum mode %x\n", mode); } -- -- err = rdev->desc->ops->set_mode(rdev, mode); -- -- if (err < 0) -- -- rdev_err(rdev, "failed to set optimum mode %x\n", mode); -- -- return err; } @@@@@@ -3705,10 -3650,41 -3659,41 -3650,41 -3650,41 +3714,10 @@@@@@ regulator_register(const struct regulat goto scrub; if (init_data && init_data->supply_regulator) ---- supply = init_data->supply_regulator; ++++ rdev->supply_name = init_data->supply_regulator; else if (regulator_desc->supply_name) ---- supply = regulator_desc->supply_name; ---- ---- if (supply) { ---- struct regulator_dev *r; - - r = regulator_dev_lookup(dev, supply, &ret); - - if (ret == -ENODEV) { - /* - * No supply was specified for this regulator and - * there will never be one. - */ - ret = 0; - goto add_dev; - } else if (!r) { - dev_err(dev, "Failed to find supply %s\n", supply); - ret = -EPROBE_DEFER; - goto scrub; - } ++++ rdev->supply_name = regulator_desc->supply_name; - -- r = regulator_dev_lookup(dev, supply, &ret); - -- - -- if (ret == -ENODEV) { - -- /* - -- * No supply was specified for this regulator and - -- * there will never be one. - -- */ - -- ret = 0; - -- goto add_dev; - -- } else if (!r) { - -- dev_err(dev, "Failed to find supply %s\n", supply); - -- ret = -EPROBE_DEFER; - -- goto scrub; - -- } - -- ---- ret = set_supply(rdev, r); ---- if (ret < 0) ---- goto scrub; ---- ---- /* Enable supply if rail is enabled */ ---- if (_regulator_is_enabled(rdev)) { ---- ret = regulator_enable(rdev->supply); ---- if (ret < 0) ---- goto scrub; ---- } ---- } ---- ----add_dev: /* add consumers devices */ if (init_data) { for (i = 0; i < init_data->num_consumer_supplies; i++) {