10 Jun, 2011

1 commit

  • Currently the regulator supply implementation is somewhat complex and
    fragile as it doesn't look like standard consumers but is instead a
    parallel implementation. This causes issues with locking and reference
    counting.

    Move the implementation over to using standard consumers to address this.
    Rather than only notifying the supply on the first enable/disable we do so
    every time the regulator is enabled or disabled, simplifying locking as we
    don't need to hold a lock on the consumer we are about to enable.

    Signed-off-by: Mark Brown
    Signed-off-by: Liam Girdwood

    Mark Brown
     

30 May, 2011

1 commit

  • In order to reduce the impact of ramp times rather than enabling the
    regulators for a device in series use async tasks to run the actual
    enables. This means that the delays which the enables implement can all
    run in parallel, though it does mean that the order in which the
    supplies come on may be unstable.

    For super bonus fun points if any of the regulators are shared between
    multiple supplies on the same device (as is rather likely) then this
    will test our locking. Note that in this case we only delay once for
    each physical regulator so the threads shouldn't block each other while
    delaying.

    It'd be even nicer if we could coalesce writes to a shared enable registers
    in PMICs but that's definitely future work, and it may also be useful
    and is certainly more achievable to optimise out the parallelism if none
    of the regulators implement ramp delays.

    Signed-off-by: Mark Brown
    Signed-off-by: Liam Girdwood

    Mark Brown
     

27 May, 2011

2 commits

  • 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
    Signed-off-by: Liam Girdwood

    Mark Brown
     
  • 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
    Signed-off-by: Liam Girdwood

    Mark Brown
     

25 May, 2011

1 commit

  • The DB8500 has ePOD:s (electronic power domains) which are possible
    to switch on/off to deactivate silicon blocks on the DB8500 SoC
    by cutting their power without retention. We model these as simple
    regulators with one bit on/off settings.

    Acked-by: Liam Girdwood
    Acked-by: Mark Brown
    Signed-off-by: Bengt Jonsson
    Signed-off-by: Sundar Iyer
    Signed-off-by: Jonas Aberg
    Signed-off-by: Virupax Sadashivpetimath
    Signed-off-by: Martin Persson
    Signed-off-by: Linus Walleij

    Bengt Jonsson
     

26 Mar, 2011

5 commits

  • This exposes the functionality for rise/fall fime when setting
    voltage to the consumers.

    Cc: Bengt Jonsson
    Signed-off-by: Linus Walleij
    Acked-by: Mark Brown
    Signed-off-by: Liam Girdwood

    Linus Walleij
     
  • 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
    Signed-off-by: Linus Walleij
    Acked-by: Mark Brown
    Signed-off-by: Liam Girdwood

    Linus Walleij
     
  • The regulators on the AB8500 have a lot of custom
    hardware control settings pertaining to 8 external
    signals, settings which are board-specific and need
    be provided from the platform at startup.

    Initialization added for regulators Vana, VextSupply1,
    VextSupply2, VextSupply3, Vaux1, Vaux2, Vaux3, VTVout,
    Vintcore12, Vaudio, Vdmic, Vamic1, Vamic2, VrefDDR.

    Signed-off-by: Bengt Jonsson
    Reviewed-by: Rickard Andersson
    Reviewed-by: Jonas Aberg
    Signed-off-by: Linus Walleij
    Acked-by: Mark Brown
    Signed-off-by: Liam Girdwood

    Bengt Jonsson
     
  • Signed-off-by: Bengt Jonsson
    Signed-off-by: Linus Walleij
    Acked-by: Mark Brown
    Signed-off-by: Liam Girdwood

    Bengt Jonsson
     
  • 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
    Signed-off-by: Kyungmin Park
    Acked-by: Mark Brown
    --
    Updates
    v3
    comments corrected (Thanks to Igor)
    v2
    disable unnecessary regulators (Thanks to Mark)
    Signed-off-by: Liam Girdwood

    MyungJoo Ham
     

12 Jan, 2011

7 commits

  • 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
    Signed-off-by: Liam Girdwood

    Mark Brown
     
  • 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
    Signed-off-by: Liam Girdwood

    Mark Brown
     
  • 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
    Signed-off-by: Liam Girdwood

    Mark Brown
     
  • The define for number of regulators is moved from ab8500-core to
    ab8500-regulator so that the regulator driver can be updated
    independently of ab8500-core. This also changes the platform
    configuration structure of ab8500-core so that it contains a
    pointer to the regulator_init_data array plus number of
    regulators instead of an fixed size array of pointers to
    regulator_init_data.

    Signed-off-by: Bengt Jonsson
    Acked-by: Linus Walleij
    Acked-by: Mark Brown
    Signed-off-by: Liam Girdwood

    Bengt Jonsson
     
  • 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
    Signed-off-by: Liam Girdwood

    Mark Brown
     
  • 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
    Signed-off-by: Liam Girdwood

    Mark Brown
     
  • 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
    Signed-off-by: Liam Girdwood

    Mark Brown
     

29 Oct, 2010

3 commits

  • 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
    Signed-off-by: Liam Girdwood

    Mark Brown
     
  • This patch adds regulator drivers for National Semiconductors LP3972 PMIC.
    This LP3972 PMIC controller has 3 DC/DC voltage converters and 5 low drop-out
    (LDO) regulators. LP3972 PMIC controller uses I2C interface.

    Signed-off-by: Axel Lin
    Acked-by: Mark Brown
    Signed-off-by: Liam Girdwood

    Axel Lin
     
  • MAX8952 PMIC is used to provide voltage output between 770mV - 1400mV
    with DVS support. In this initial release, users can set voltages for
    four DVS modes, RAMP delay values, and SYNC frequency.
    Controlling FPWM/SYNC_MODE/Pull-Down/Ramp Modes and reading CHIP_ID
    is not supported in this release.

    If GPIO of EN is not valid in platform data, the driver assumes that it
    is always-on. If GPIO of VID0 or VID1 is invalid, the driver pulls down
    VID0 and VID1 to fix DVS mode as 0 and disables DVS support.

    We assume that V_OUT is capable to provide every voltage from 770mV to
    1.40V in 10mV steps although the data sheet has some ambiguity on it.

    Signed-off-by: MyungJoo Ham
    Signed-off-by: Kyungmin Park
    Acked-by: Mark Brown
    --
    v2:
    - Style correction
    - Can accept platform_data with invalid GPIOs
    - Removed unnecessary features
    - Improved error handling
    Signed-off-by: Liam Girdwood

    MyungJoo Ham
     

11 Aug, 2010

1 commit


28 Jul, 2010

1 commit

  • Acked-by: Mark Brown

    In TPS6507x, depending on the status of DEFDCDC{2,3} pin either
    DEFDCDC{2,3}_LOW or DEFDCDC{2,3}_HIGH register needs to be read or
    programmed to change the output voltage.

    The current driver assumes DEFDCDC{2,3} pins are always tied low
    and thus operates only on DEFDCDC{2,3}_LOW register. This need
    not always be the case (as is found on OMAP-L138 EVM).

    Unfortunately, software cannot read the status of DEFDCDC{2,3} pins.
    So, this information is passed through platform data depending on
    how the board is wired.

    Signed-off-by: Anuj Aggarwal
    Signed-off-by: Sekhar Nori
    Signed-off-by: Liam Girdwood

    Anuj Aggarwal
     

25 May, 2010

1 commit

  • When one regulator supplies another allow the relationship to be specified
    using names rather than struct regulators, in a similar manner to that
    allowed for consumer supplies. This allows static configuration at compile
    time, reducing the need for dynamic init code.

    Also change the references to LINE supply to be system supply since line
    is sometimes used for actual supplies and therefore potentially confusing.

    Signed-off-by: Mark Brown
    Signed-off-by: Liam Girdwood

    Mark Brown
     

19 Apr, 2010

1 commit


03 Mar, 2010

4 commits

  • Signed-off-by: Haojian Zhuang
    Acked-by: Mark Brown
    Signed-off-by: Liam Girdwood

    Haojian Zhuang
     
  • Add a field to specify a delay for the start-up time of
    a fixed voltage regulator.

    Signed-off-by: Adrian Hunter
    Acked-by: Mark Brown
    Signed-off-by: Liam Girdwood

    Adrian Hunter
     
  • Regulators may sometimes take longer to enable than the control operation
    used to do so, either because the regulator has ramp rate control used to
    limit inrush current or because the control operation is very fast (GPIO
    being the most common example of this). In order to ensure that consumers
    do not rely on the regulator before it is enabled provide an enable_time()
    operation and have the core delay for that time before returning to the
    caller.

    This is implemented as a function since the ramp rate may be specified in
    voltage per unit time and therefore the time depend on the configuration.
    In future it would be desirable to allow the bulk operations to run the
    delays for multiple enables in parallel but this is not currently supported.

    Signed-off-by: Mark Brown

    Mark Brown
     
  • The intended use case is for drivers which disable regulators to save
    power but need to do some work to restore the hardware state when
    restarting. If the supplies are not actually disabled due to board
    limits or sharing with other active devices this notifier allows the
    driver to avoid unneeded reinitialisation, particularly when used with
    runtime PM.

    Signed-off-by: Mark Brown

    Mark Brown
     

17 Dec, 2009

3 commits


22 Sep, 2009

8 commits

  • Document the possibility that is_enabled may also return with negative
    errorcodes.

    Signed-off-by: Wolfram Sang
    Acked-by: Mark Brown
    Signed-off-by: Liam Girdwood

    Wolfram Sang
     
  • Fix a couple of typos I found while working with this subsystem.

    Signed-off-by: Wolfram Sang
    Acked-by: Mark Brown
    Signed-off-by: Liam Girdwood

    Wolfram Sang
     
  • Now fixed regulators that have their enable pin connected to a GPIO line
    can use the fixed regulator driver for regulator enable/disable control.
    The GPIO number and polarity information is passed through platform data.
    GPIO enable control is achieved using gpiolib.

    Signed-off-by: Roger Quadros
    Reviewed-by: Philipp Zabel
    Reviewed-by: Felipe Balbi
    Acked-by: Mark Brown
    Signed-off-by: Liam Girdwood

    Roger Quadros
     
  • Simplify checking of support for voltage ranges by providing an API which
    wraps the existing count and list operations.

    Signed-off-by: Mark Brown
    Signed-off-by: Liam Girdwood

    Mark Brown
     
  • Some consumers require complete control of the regulator and can't
    tolerate sharing it with other consumers, most commonly because they need
    to have the regulator actually disabled so can't have other consumers
    forcing it on. This new regulator_get_exclusive() API call allows these
    consumers to explicitly request this, documenting the assumptions that
    they are making.

    In order to simplify coding of such consumers the use count for regulators
    they request is forced to match the enabled state of the regulator when
    it is requested. This is not possible for consumers which can share
    regulators due to the need to keep track of the ownership of use counts.

    A new API call is used rather than an additional argument to the existing
    regulator_get() in order to avoid merge headaches with driver code in
    other trees.

    Signed-off-by: Mark Brown
    Signed-off-by: Liam Girdwood

    Mark Brown
     
  • Signed-off-by: Haojian Zhuang
    Acked-by: Mark Brown
    Signed-off-by: Liam Girdwood

    roald
     
  • This allows machine drivers to build without ifdefs if they have
    full constraints. Suggested by machine drivers contributed by
    Haojian Zhuang .

    Signed-off-by: Mark Brown
    Signed-off-by: Liam Girdwood

    Mark Brown
     
  • Follow the approach suggested by Russell King and implemented by him in
    the clkdev API and allow consumer device supply mapings to be set up
    using the dev_name() for the consumer instead of the struct device.
    In order to avoid making existing machines instabuggy and creating merge
    issues the use of struct device is still supported for the time being.

    This resolves problems working with buses such as I2C which make the
    struct device available late providing that the final device name is
    known, which is the case for most embedded systems with fixed setups.

    Consumers must still use the struct device when calling regulator_get().

    Signed-off-by: Mark Brown
    Signed-off-by: Liam Girdwood

    Mark Brown
     

17 Sep, 2009

1 commit