aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/regulator/core.c
Commit message (Collapse)AuthorAgeFilesLines
* merge opensource jb u5codeworkx2012-09-221-1/+1
| | | | Change-Id: I1aaec157aa196f3448eff8636134fce89a814cf2
* regulator: Fix _regulator_get_voltage if get_voltage callback is NULLAxel Lin2011-05-271-3/+5
| | | | | | | | | | | In the case of get_voltage callback is NULL, current implementation in _regulator_get_voltage will return -EINVAL. Also returns proper error if ret is negative value. Signed-off-by: Axel Lin <axel.lin@gmail.com> Acked-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Signed-off-by: Liam Girdwood <lrg@slimlogic.co.uk>
* regulator: Only apply voltage constraints from consumers that set themMark Brown2011-05-271-0/+7
| | | | | | | | | When applying the set_voltage() requests from consumers skip over those consumers that haven't set anything, otherwise we'll come out with a maximum voltage of zero. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Signed-off-by: Liam Girdwood <lrg@slimlogic.co.uk>
* regulator: If we can't configure optimum mode we're always in the best oneMark Brown2011-05-271-3/+13
| | | | | | | | | | | | | | If either a regulator driver can't tell us what the optimum mode is (or doesn't have modes in the first place) or the system doesn't allow DRMS changes then it's more helpful for users to just say that we're in the optimal mode, even if it's from a selection of one. Still report errors if the process of picking and setting a mode changes as this may indicate that we're stuck in a low power mode and unable to deliver a higher current that the consumer just asked for. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Signed-off-by: Liam Girdwood <lrg@slimlogic.co.uk>
* regulator: Support voltage offsets to compensate for drops in systemMark Brown2011-05-271-3/+12
| | | | | | | | | | | | | | | | | | | Some systems, particularly physically large systems used for early prototyping, may experience substantial voltage drops between the regulator and the consumers as a result of long traces in the system. With these systems voltages may need to be set higher than requested in order to ensure reliable system operation. Allow systems to work around such hardware issues by allowing constraints to supply an offset to be applied to any requested and reported voltages. This is not ideal, especially since the voltage drop may be load dependant, but is sufficient for most affected systems, it is not expected to be used in production hardware. The offset is applied after all constraint processing so constraints should be specified in terms of consumer values not physically configured values. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Signed-off-by: Liam Girdwood <lrg@slimlogic.co.uk>
* regulator: Remove supply_regulator_dev from machine configurationMark Brown2011-05-271-16/+0
| | | | | | | | | | supply_regulator_dev (using a struct pointer) has been deprecated in favour of supply_regulator (using a regulator name) for quite a few releases now with a warning generated if it is used and there are no current in tree users so just remove the code. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Signed-off-by: Liam Girdwood <lrg@slimlogic.co.uk>
* regulator: Factor out references to rdev in regulator_force_disable()Mark Brown2011-05-271-3/+4
| | | | | | | | Don't go looking up the rdev pointer every time, just use a local variable like everything else. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Signed-off-by: Liam Girdwood <lrg@slimlogic.co.uk>
* regulator: Fix the argument of calling regulator_mode_constrainAxel Lin2011-05-271-1/+1
| | | | | | | | | | | | | The second parameter of regulator_mode_constrain takes a pointer. This patch fixes below warning: drivers/regulator/core.c: In function 'regulator_set_mode': drivers/regulator/core.c:2014: warning: passing argument 2 of 'regulator_mode_constrain' makes pointer from integer without a cast drivers/regulator/core.c:200: note: expected 'int *' but argument is of type 'unsigned int' Signed-off-by: Axel Lin <axel.lin@gmail.com> Acked-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Signed-off-by: Liam Girdwood <lrg@vega.(none)>
* regulator: When constraining modes fall back to higher power modesMark Brown2011-05-271-9/+15
| | | | | | | | | | | If a mode requested by a consumer is not allowed by constraints automatically fall back to a higher power mode if possible. This ensures that consumers get at least the output they requested while allowing machine drivers to transparently limit lower power modes if required. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Signed-off-by: Liam Girdwood <lrg@slimlogic.co.uk>
* Fix common misspellingsLucas De Marchi2011-03-311-1/+1
| | | | | | Fixes generated by 'codespell' and manually reviewed. Signed-off-by: Lucas De Marchi <lucas.demarchi@profusion.mobi>
* regulator: provide consumer interface for fall/rise timeLinus Walleij2011-03-261-0/+45
| | | | | | | | | | This exposes the functionality for rise/fall fime when setting voltage to the consumers. Cc: Bengt Jonsson <bengt.g.jonsson@stericsson.com> Signed-off-by: Linus Walleij <linus.walleij@linaro.org> Acked-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Signed-off-by: Liam Girdwood <lrg@slimlogic.co.uk>
* regulator: add set_voltage_time_sel infrastructureLinus Walleij2011-03-261-0/+25
| | | | | | | | | | | This makes it possible to set the stabilization time for voltage regulators in the same manner as enable_time(). The interface only supports regulators that implements fixed selectors. Cc: Bengt Jonsson <bengt.g.jonsson@stericsson.com> Signed-off-by: Linus Walleij <linus.walleij@linaro.org> Acked-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Signed-off-by: Liam Girdwood <lrg@slimlogic.co.uk>
* Regulator: add suspend-finish API for regulator core.MyungJoo Ham2011-03-261-0/+41
| | | | | | | | | | | | | | | | | | | | | | | | | | | | The regulator core had suspend-prepare that turns off the regulators when entering a system-wide suspend. However, it did not have suspend-finish that pairs with suspend-prepare and the regulator core has assumed that the regulator devices and their drivers support autonomous recover at resume. This patch adds regulator_suspend_finish that pairs with the previously-existed regulator_suspend_prepare. The function regulator_suspend_finish turns on the regulators that have always_on set or positive use_count so that we can reset the regulator states appropriately at resume. In regulator_suspend_finish, if has_full_constraints, it disables unnecessary regulators. Signed-off-by: MyungJoo Ham <myungjoo.ham@samsung.com> Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com> Acked-by: Mark Brown <broonie@opensource.wolfsonmicro.com> -- Updates v3 comments corrected (Thanks to Igor) v2 disable unnecessary regulators (Thanks to Mark) Signed-off-by: Liam Girdwood <lrg@slimlogic.co.uk>
* regulator: If we fail when setting up a supply say which supplyMark Brown2011-03-261-1/+4
| | | | | | | | Makes it a bit easier to identify if it's a problem with the supplies, the usual error would be omitting the supply name entirely. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Signed-off-by: Liam Girdwood <lrg@slimlogic.co.uk>
* regulator: Add initial per-regulator debugfs supportMark Brown2011-01-121-0/+35
| | | | | | | | We only expose the use and open counts to userspace, providing a tiny bit of insight into what the API is up to. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Signed-off-by: Liam Girdwood <lrg@slimlogic.co.uk>
* regulator: Make regulator_has_full_constraints a boolMark Brown2011-01-121-1/+1
| | | | | | | It's a boolean value so use the type. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Signed-off-by: Liam Girdwood <lrg@slimlogic.co.uk>
* regulator: Clean up logging a bitMark Brown2011-01-121-1/+1
| | | | | | | | | | The recent introduction of standard regulator API logging macros means that all our log messages have at least the function name in them and logging that the constraints are for the regulator API is probably a bit much. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Signed-off-by: Liam Girdwood <lrg@slimlogic.co.uk>
* regulator: Optimise out noop voltage changesMark Brown2011-01-121-1/+8
| | | | | | | | | | | If a consumer sets the same voltage range as is currently configured for that consumer there's no need to run through setting the voltage again. This pattern may occur with some CPUfreq implementations where the same voltage range is used for multiple frequencies. Reported-by: Saravana Kannan <skannan@codeaurora.org> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Signed-off-by: Liam Girdwood <lrg@slimlogic.co.uk>
* regulator: Add API to re-apply voltage to hardwareMark Brown2011-01-121-0/+47
| | | | | | | | | | | When cooperating with an external control source the regulator setup may be changed underneath the API. Currently consumers can just redo the regulator_set_voltage() to restore a previously set configuration but provide an explicit API for doing this as optimsations in the regulator_set_voltage() implementation will shortly prevent that. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Signed-off-by: Liam Girdwood <lrg@slimlogic.co.uk>
* regulator: Only notify voltage changes when they succeedMark Brown2011-01-121-1/+4
| | | | | | | | | | | | Currently we notify a voltage change whenever we exit set_voltage(), even if the change failed for some reason (eg, a constraints issue). This shouldn't cause any substantial ill effects but is wasteful as listeners get notified on noops. Fix this by moving the notification into _do_set_voltage() and only notifying if we don't return an error. Reported-by: Saravana Kannan <skannan@codeaurora.org> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Signed-off-by: Liam Girdwood <lrg@slimlogic.co.uk>
* regulator: Provide a selector based set_voltage_sel() operationMark Brown2011-01-121-2/+35
| | | | | | | | | | | | | | | | | | Many regulator drivers implement voltage setting by looping through a table of possible values, normally because the set of available voltages can't be mapped onto selectors with simple calcuation. Factor out these loops by providing a variant of set_voltage() which takes a selector rather than a voltage range as an argument and implementing a loop through the available selectors in the core. This is not going to be suitable for use with all devices as when the regulator voltage can be mapped onto selector values with a simple calculation the linear scan through the available values will be more expensive than just doing the calculation, especially for regulators that provide fine grained voltage control. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Signed-off-by: Liam Girdwood <lrg@slimlogic.co.uk>
* regulator: Factor out voltage set operation into a separate functionMark Brown2011-01-121-24/+39
| | | | | | | | Push all the callers of the chip set_voltage() operation out into a single function to facilitiate future refactoring. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Signed-off-by: Liam Girdwood <lrg@slimlogic.co.uk>
* regulator: Allow drivers to report voltages as selectorsMark Brown2011-01-121-3/+22
| | | | | | | | | | Since drivers already have to provide an API for translating selectors into voltages they may as well just report the selector values directly to the core API rather than implement the lookup themselves. The old interface is left in place for now, but may be removed in future. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Signed-off-by: Liam Girdwood <lrg@slimlogic.co.uk>
* regulator: Use _regulator_get_voltage() consistentlyMark Brown2011-01-121-8/+10
| | | | | | | | | Rather than referencing the get_voltage() operation directly in the ops struct use the internal _regulator_get_voltage() API call to do so, facilitating refactoring. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Signed-off-by: Liam Girdwood <lrg@slimlogic.co.uk>
* drivers/regulator: Update WARN usesJoe Perches2011-01-121-2/+1
| | | | | | | | Align arguments. Signed-off-by: Joe Perches <joe@perches.com> Acked-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Signed-off-by: Liam Girdwood <lrg@slimlogic.co.uk>
* regulator: Take into account the requirements of all consumersThomas Petazzoni2011-01-121-0/+25
| | | | | | | | | | | | | | | | | Extend the regulator_set_voltage() function to take into account the voltage requirements of all consumers of the regulator being changed, in order to set the voltage to the minimum voltage acceptable to all consumers. The existing behaviour was that the latest regulator_set_voltage() call would win over previous regulator_set_voltage() calls even if setting the voltage to a non-acceptable level from other consumers. Signed-off-by: Thomas Petazzoni <t-petazzoni@ti.com> Cc: Liam Girdwood <lrg@slimlogic.co.uk> Cc: Mark Brown <broonie@opensource.wolfsonmicro.com> Cc: Kevin Hilman <khilman@deeprootsystems.com> Acked-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Signed-off-by: Liam Girdwood <lrg@slimlogic.co.uk>
* regulator: Add and use rdev_<level> macrosJoe Perches2011-01-121-81/+65
| | | | | | | | | | | | | | | | | | | | | | | | | | On Tue, 2010-11-30 at 10:52 +0000, Mark Brown wrote: > On Mon, Nov 29, 2010 at 05:12:56PM -0800, Joe Perches wrote: > > Just to please broonie... > > Signed-off-by: Joe Perches <joe@perches.com> > As usual when fixing review issues please revise your original patch > rather than posting a fresh patch. Here's an earlier comment: On Thu, 2010-11-18 at 13:30 +0000, Mark Brown wrote: > This looks reasonable, please rebase on top of Daniel's patches and > submit it properly (with changelog and so on). Sometimes it's simpler for an upstream maintainer to do something like: git am -s <patch1.mbox> patch -p1 < patch2.mbox git commit --amend file instead of back and forthing. Signed-off-by: Liam Girdwood <lrg@slimlogic.co.uk>
* regulator: Copy constraints from regulators when initialising themMark Brown2011-01-121-7/+12
| | | | | | | | | | | | | | | Currently the regulator API uses the constraints structure passed in to the core throughout the lifetime of the object. This means that it is not possible to mark the constraints as __initdata so if the kernel supports many boards the constraints for all of them are kept around throughout the lifetime of the system, consuming memory needlessly. By copying constraints that are actually used we allow the use of __initdata, saving memory when multiple boards are supported. This also means the constraints can be const. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Signed-off-by: Liam Girdwood <lrg@slimlogic.co.uk>
* regulator: Remove regulator core version announcementMark Brown2011-01-121-4/+0
| | | | | | | | | The version hasn't been updated since the regulator API was merged in 2.6.27 so just remove it - now we're in mainline the kernel version is much more useful. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Signed-off-by: Liam Girdwood <lrg@slimlogic.co.uk>
* regulator: Fix obfuscated log messagesMark Brown2011-01-121-8/+6
| | | | | | | | | Don't use %s to format fixed static strings into log messages, it just makes searching for and reading the message in the kernel source needlessly hard. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Signed-off-by: Liam Girdwood <lrg@slimlogic.co.uk>
* drivers: regulator: core: convert to using pr_ macrosDaniel Walker2011-01-121-80/+57
| | | | | | | | | | | The regulator framework uses a lot of printks with a specific formatting using __func__. This converts them to use pr_ calls with a central format string. Cc: bleong@codeaurora.org Signed-off-by: Daniel Walker <dwalker@codeaurora.org> Acked-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Signed-off-by: Liam Girdwood <lrg@slimlogic.co.uk>
* drivers: regulator: core: use pr_fmtDaniel Walker2011-01-121-10/+12
| | | | | | | | | | This adds a pr_fmt line which uses the __func__ macro. I also convert the current pr_ lines to remove their __func__ usage. Cc: bleong@codeaurora.org Signed-off-by: Daniel Walker <dwalker@codeaurora.org> Acked-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Signed-off-by: Liam Girdwood <lrg@slimlogic.co.uk>
* regulator: enable supply regulator only when use count is zeroBengt Jonsson2011-01-121-9/+11
| | | | | | | | | | | | | | Supply regulators are disabled only when the last reference count is removed on the child regulator (the use count goes from 1 to 0). This patch changes the behaviour of enable so the supply regulator is enabled only when the use count of the child regulator goes from 0 to 1. Signed-off-by: Bengt Jonsson <bengt.g.jonsson@stericsson.com> Acked-by: Linus Walleij <linus.walleij@stericsson.com> Acked-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Signed-off-by: Liam Girdwood <lrg@slimlogic.co.uk>
* regulator: Add basic trace facilitiesMark Brown2011-01-121-0/+17
| | | | | | | | | | | | | | | | | | | | | | | | Provide some basic trace facilities to the regulator API. We generate events on regulator enable, disable and voltage setting over the actual hardware operations (which are assumed to be the expensive ones which require interaction with the actual device). This is intended to facilitate debug of the performance and behaviour with consumers allowing unified traces to be generated including the regulator operations within the context of the other components of the system. For enable we log the explicit delay for the voltage ramp separately to the interaction with the hardware to highlight the time consumed in I/O. We should add a similar delay for voltage changes, though there the relatively small magnitude of the changes in the context of the I/O costs makes it much less critical for most regulators. Only hardware interactions are currently traced as the primary focus is on the performance and synchronisation of actual hardware interactions. Additional tracepoints for debugging of the logical operations can be added later if required. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Signed-off-by: Liam Girdwood <lrg@slimlogic.co.uk>
* regulator: Report actual configured voltage to set_voltage()Mark Brown2011-01-121-2/+12
| | | | | | | | | | | Change the interface used by set_voltage() to report the selected value to the regulator core in terms of a selector used by list_voltage(). This allows the regulator core to know the voltage that was chosen without having to do an explict get_voltage(), which would be much more expensive as it will generally access hardware. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Signed-off-by: Liam Girdwood <lrg@slimlogic.co.uk>
* regulator: lock supply in regulator enableMattias Wallin2011-01-121-11/+9
| | | | | | | | This patch add locks around regulator supply enable. Signed-off-by: Mattias Wallin <mattias.wallin@stericsson.com> Acked-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Signed-off-by: Liam Girdwood <lrg@slimlogic.co.uk>
* regulator: fix kernel-doc for set_consumer_device_supplyRandy Dunlap2010-11-301-1/+1
| | | | | | | | | | | | | Fix kernel-doc warning for set_consumer_device_supply(): Warning(drivers/regulator/core.c:912): missing initial short description on line: * set_consumer_device_supply: Bind a regulator to a symbolic supply Signed-off-by: Randy Dunlap <randy.dunlap@oracle.com> Cc: Liam Girdwood <lrg@slimlogic.co.uk> Cc: Mark Brown <broonie@opensource.wolfsonmicro.com> Acked-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Signed-off-by: Liam Girdwood <lrg@slimlogic.co.uk>
* regulator: enable supply regulator only when use count is zeroBengt Jonsson2010-11-301-9/+11
| | | | | | | | | | | | | | Supply regulators are disabled only when the last reference count is removed on the child regulator (the use count goes from 1 to 0). This patch changes the behaviour of enable so the supply regulator is enabled only when the use count of the child regulator goes from 0 to 1. Signed-off-by: Bengt Jonsson <bengt.g.jonsson@stericsson.com> Acked-by: Linus Walleij <linus.walleij@stericsson.com> Acked-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Signed-off-by: Liam Girdwood <lrg@slimlogic.co.uk>
* regulator: lock supply in regulator enableMattias Wallin2010-11-301-0/+2
| | | | | | | | This patch add locks around regulator supply enable. Signed-off-by: Mattias Wallin <mattias.wallin@stericsson.com> Acked-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Signed-off-by: Liam Girdwood <lrg@slimlogic.co.uk>
* regulator: Return proper error for regulator_register()Axel Lin2010-11-301-0/+2
| | | | | | Signed-off-by: Axel Lin <axel.lin@gmail.com> Acked-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Signed-off-by: Liam Girdwood <lrg@slimlogic.co.uk>
* regulator: Ensure enough delay time for enabling regulatorAxel Lin2010-11-301-2/+4
| | | | | | | | | Integer division will truncate the result, this patch ensures we have enough delay time for enabling regulator. Signed-off-by: Axel Lin <axel.lin@gmail.com> Acked-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Signed-off-by: Liam Girdwood <lrg@slimlogic.co.uk>
* regulator: Remove a redundant device_remove_file call in create_regulatorAxel Lin2010-11-301-1/+0
| | | | | | | | | We already have device_remove_file() in error path, no need to call it before goto link_name_err. Signed-off-by: Axel Lin <axel.lin@gmail.com> Acked-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Signed-off-by: Liam Girdwood <lrg@slimlogic.co.uk>
* regulator: regulator disable supply fixMattias Wallin2010-11-301-0/+1
| | | | | | | | | | | | This patch fixes a disable failure when regulator supply is used. A while loop in regulator disable checks for supply pointer != NULL but the pointer is not always updated, resulting in the while loop running too many times causing a disable failure. Signed-off-by: Mattias Wallin <mattias.wallin@stericsson.com> Acked-by: Linus Walleij <linus.walleij@stericsson.com> Acked-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Signed-off-by: Liam Girdwood <lrg@slimlogic.co.uk>
* regulator: avoid deadlock when disabling regulator with supplyJeffrey Carlyle2010-10-281-9/+26
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | I have a regulator A that sets regulator B as its supply. When I call set_supply to add B as the supply for A, regulator A gets added to the supply_list for regulator B. When I call regulator_disable(A), I end up with a call chain like this: regulator_disable(A) > mutex_lock(A) > _regulator_disable(A) >> _regulator_disable(B) >>> _notifier_call_chain(B) >>>> mutex_lock(A) Which results in dead lock since we are trying to acquire the mutex lock for regulator A which we already hold. This patch addresses this issue by moving the call to disable regulator B outside of the lock aquired inside the initial call to regulator_disable. This change also addresses the issue of not acquiring the mutex for regulator B before calling _regulator_disable(B). Signed-off-by: Jeffrey Carlyle <jeff.carlyle@motorola.com> Acked-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Signed-off-by: Liam Girdwood <lrg@slimlogic.co.uk>
* regulator: Add option for machine drivers to enable the dummy regulatorMark Brown2010-10-281-0/+22
| | | | | | | | | | | | | Allow machine drivers to explicitly enable the use of the dummy regulator, enabling simpler support for systems with only a few specific supplies visible to software. It is strongly recommended that this is not used on systems with substantial software control over their PMICs, for maximum functionality constrints should be as fully specified as possible. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Signed-off-by: Liam Girdwood <lrg@slimlogic.co.uk>
* regulator: fix typo in current unitsCyril Chemparathy2010-10-021-1/+1
| | | | | | | | This patch fixes a typo that incorrectly reports mA numbers as uA. Signed-off-by: Cyril Chemparathy <cyril@ti.com> Acked-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Signed-off-by: Liam Girdwood <lrg@slimlogic.co.uk>
* regulator: fix device_register() error handlingVasiliy Kulikov2010-10-021-1/+3
| | | | | | | | | If device_register() fails then call put_device(). See comment to device_register. Signed-off-by: Vasiliy Kulikov <segooon@gmail.com> Acked-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Signed-off-by: Liam Girdwood <lrg@slimlogic.co.uk>
* regulator: Remove owner field from attribute initialization in regulator ↵Guenter Roeck2010-08-051-1/+0
| | | | | | | | | | core driver Signed-off-by: Guenter Roeck <guenter.roeck@ericsson.com> Acked-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Acked-by: Tejun Heo <tj@kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* regulator: return set_mode is same mode is requestedSundar R Iyer2010-05-251-0/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | On Mon, 2010-05-17 at 17:34 +0200, Mark Brown wrote: > This doesn't seem like the right error handling - if the driver has a > set_mode() you'd *expect* it to have a get_mode() but there's no need > for it to be a strict requirement. True. In such a case, even a valid request would be lost! So now in the updated patch: - check if get_mode is present to avoid oops; - if get_mode is not present, proceed anyways for the request. Here is the updated patch: >From bad0d5eb51ef84be5b100e3dd0f5a590ea0529b6 Mon Sep 17 00:00:00 2001 From: Sundar R Iyer <sundar.iyer@stericsson.com> Date: Fri, 14 May 2010 15:14:17 +0530 Subject: [PATCH 1/1] regulator: return set_mode when same mode is requested save I/O costs by returning when the same mode is requested for the regulator Cc: Liam Girdwood <lrg@slimlogic.co.uk> Cc: Mark Brown <broonie@opensource.wolfsonmicro.com> Acked-by: Linus Walleij <linus.walleij@stericsson.com> Signed-off-by: Sundar R Iyer <sundar.iyer@stericsson.com> Acked-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Signed-off-by: Liam Girdwood <lrg@slimlogic.co.uk>
* regulator: simplify regulator_register() error handlingJani Nikula2010-05-251-30/+5
| | | | | | | | | Simply remove all consumer supplies for the regulator on errors. Remove unset_consumer_device_supply() which is no longer used. Signed-off-by: Jani Nikula <ext-jani.1.nikula@nokia.com> Acked-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Signed-off-by: Liam Girdwood <lrg@slimlogic.co.uk>