1. 09 11月, 2018 1 次提交
  2. 28 9月, 2018 1 次提交
  3. 06 7月, 2018 1 次提交
  4. 18 6月, 2018 1 次提交
  5. 17 5月, 2018 3 次提交
    • M
      regulator: core: Parse coupled regulators properties · a085a31a
      Maciej Purski 提交于
      On Odroid XU3/4 and other Exynos5422 based boards there is a case, that
      different devices on the board are supplied by different regulators
      with non-fixed voltages. If one of these devices temporarily requires
      higher voltage, there might occur a situation that the spread between
      devices' voltages is so high, that there is a risk of changing
      'high' and 'low' states on the interconnection between devices powered
      by those regulators.
      
      Add new structure "coupling_desc" to regulator_dev, which contains
      pointers to all coupled regulators including the owner of the structure,
      number of coupled regulators and counter of currently resolved
      regulators.
      
      Add of_functions to parse all data needed in regulator coupling.
      Provide method to check DTS data consistency. Check if each coupled
      regulator's max_spread is equal and if their lists of regulators match.
      Signed-off-by: NMaciej Purski <m.purski@samsung.com>
      Signed-off-by: NMark Brown <broonie@kernel.org>
      a085a31a
    • M
      regulator: core: Make locks re-entrant · 66cf9a7e
      Maciej Purski 提交于
      Setting voltage, enabling/disabling regulators requires operations on
      all regulators related with the regulator being changed. Therefore,
      all of them should be locked for the whole operation. With the current
      locking implementation, adding additional dependency (regulators
      coupling) causes deadlocks in some cases.
      
      Introduce a possibility to attempt to lock a mutex multiple times
      by the same task without waiting on a mutex. This should handle all
      reasonable coupling-supplying combinations, especially when two coupled
      regulators share common supplies. The only situation that should be
      forbidden is simultaneous coupling and supplying between a pair of
      regulators.
      
      The idea is based on clk core.
      Signed-off-by: NMaciej Purski <m.purski@samsung.com>
      Signed-off-by: NMark Brown <broonie@kernel.org>
      66cf9a7e
    • D
      regulator: core: Allow for regulators that can't be read at bootup · 84b3a7c9
      Douglas Anderson 提交于
      Regulators attached via RPMh on Qualcomm sdm845 apparently are
      write-only.  Specifically you can send a request for a certain voltage
      but you can't read back to see what voltage you've requested.  What
      this means is that at bootup we have absolutely no idea what voltage
      we could be at.
      
      As discussed in the patches to try to support the RPMh regulators [1],
      the fact that regulators are write-only means that its driver's
      get_voltage_sel() should return an error code if it's called before
      any calls to set_voltage_sel().  This causes problems in
      machine_constraints_voltage() when trying to apply the constraints.
      
      A proposed fix was to come up with an error code that could be
      returned by get_voltage_sel() which would cause the regulator
      framework to simply try setting the voltage with the current
      constraints.
      
      In this patch I propose the error code -ENOTRECOVERABLE.  In errno.h
      this error is described as "State not recoverable".  Though the error
      code was originally intended "for robust mutexes", the description of
      the error code seems to apply here because we can't read the state of
      the regulator.  Also note that the only existing user of this error
      code in the regulator framework is tps65090-regulator.c which returns
      this error code from the enable() call (not get_voltage() or
      get_voltage_sel()), so there should be no existing regulators that
      might accidentally get the new behavior.  (Side note is that tps65090
      seems to interpret this error code to mean an error that you can't
      recover from rather than some data that can't be recovered).
      
      [1] https://patchwork.kernel.org/patch/10340897/Signed-off-by: NDouglas Anderson <dianders@chromium.org>
      Signed-off-by: NMark Brown <broonie@kernel.org>
      84b3a7c9
  6. 17 2月, 2018 1 次提交
    • L
      regulator: core: Support passing an initialized GPIO enable descriptor · e45e290a
      Linus Walleij 提交于
      We are currently passing a GPIO number from the global GPIO numberspace
      into the regulator core for handling enable GPIOs. This is not good
      since it ties into the global GPIO numberspace and uses gpio_to_desc()
      to overcome this.
      
      Start supporting passing an already initialized GPIO descriptor to the
      core instead: leaf drivers pick their descriptors, associated directly
      with the device node (or from ACPI or from a board descriptor table)
      and use that directly without any roundtrip over the global GPIO
      numberspace.
      
      This looks messy since it adds a bunch of extra code in the core, but
      at the end of the patch series we will delete the handling of the GPIO
      number and only deal with descriptors so things end up neat.
      Signed-off-by: NLinus Walleij <linus.walleij@linaro.org>
      Signed-off-by: NMark Brown <broonie@kernel.org>
      e45e290a
  7. 26 1月, 2018 1 次提交
    • C
      regulator: add PM suspend and resume hooks · f7efad10
      Chunyan Zhang 提交于
      In this patch, consumers are allowed to set suspend voltage, and this
      actually just set the "uV" in constraint::regulator_state, when the
      regulator_suspend_late() was called by PM core through callback when
      the system is entering into suspend, the regulator device would act
      suspend activity then.
      
      And it assumes that if any consumer set suspend voltage, the regulator
      device should be enabled in the suspend state.  And if the suspend
      voltage of a regulator device for all consumers was set zero, the
      regulator device would be off in the suspend state.
      
      This patch also provides a new function hook to regulator devices for
      resuming from suspend states.
      Signed-off-by: NChunyan Zhang <zhang.chunyan@linaro.org>
      Signed-off-by: NMark Brown <broonie@kernel.org>
      f7efad10
  8. 07 4月, 2017 2 次提交
  9. 29 3月, 2017 1 次提交
  10. 05 11月, 2016 1 次提交
  11. 17 9月, 2016 1 次提交
    • M
      regulator: core: Add set_voltage_time op · 73e705bf
      Matthias Kaehlcke 提交于
      The new op is analogous to set_voltage_time_sel. It can be used by
      regulators which don't have a table of discrete voltages. The function
      returns the time for the regulator output voltage to stabilize after
      being set to a new value, in microseconds. If the op is not set a
      default implementation is used to calculate the delay.
      
      This change also removes the ramp_delay calculation in the PWM
      regulator, since the driver now uses the core code for the calculation
      of the delay.
      Signed-off-by: NMatthias Kaehlcke <mka@chromium.org>
      Signed-off-by: NMark Brown <broonie@kernel.org>
      73e705bf
  12. 21 4月, 2016 1 次提交
  13. 23 3月, 2016 2 次提交
  14. 02 3月, 2016 2 次提交
  15. 25 11月, 2015 1 次提交
  16. 17 10月, 2015 1 次提交
  17. 25 7月, 2015 1 次提交
  18. 15 6月, 2015 1 次提交
  19. 12 6月, 2015 3 次提交
  20. 02 4月, 2015 1 次提交
  21. 18 3月, 2015 1 次提交
  22. 23 2月, 2015 1 次提交
  23. 09 1月, 2015 1 次提交
  24. 27 11月, 2014 1 次提交
    • J
      regulator: Add mode mapping function to struct regulator_desc · 87e1e0f2
      Javier Martinez Canillas 提交于
      The "regulator-initial-mode" and "regulator-mode" DT properties allows
      to configure the regulator operating modes at startup or when a system
      enters into a susend state.
      
      But these properties use as valid values the operating modes supported
      by each device while the core deals with the standard operating modes.
      So a mapping function is needed to translate from the hardware specific
      modes to the standard ones.
      
      This mapping is a non-varying configuration for each regulator, so add
      a function pointer to struct regulator_desc that will allow drivers to
      define their callback to do the modes translation.
      Signed-off-by: NJavier Martinez Canillas <javier.martinez@collabora.co.uk>
      Signed-off-by: NMark Brown <broonie@kernel.org>
      87e1e0f2
  25. 20 10月, 2014 1 次提交
    • M
      regulator: Add ena_gpio_initialized to regulator_config · 76f439df
      Markus Pargmann 提交于
      Most drivers do not set the ena_gpio field of struct regulator_config
      before passing it to the regulator core. This is fine as long as the
      gpio identifier that is passed is a positive integer. But the gpio
      identifier 0 is also valid. So we are not able to decide wether we got a
      real gpio identifier or not based on a 0 in ena_gpio.
      
      To be able to decide if it is a valid gpio that got passed, this patch
      adds a ena_gpio_initialized field that should be set if was initialized
      with a correct value, either a gpio >= 0 or a negative error number. The
      core then checks if ena_gpio or ena_gpio_initialized before handling it
      as a gpio. This way we maintain backwards compatibility and fix the
      behaviour for gpio number 0.
      Signed-off-by: NMarkus Pargmann <mpa@pengutronix.de>
      Signed-off-by: NMark Brown <broonie@kernel.org>
      76f439df
  26. 10 9月, 2014 1 次提交
    • M
      regulator: of: Provide simplified DT parsing method · a0c7b164
      Mark Brown 提交于
      Currently regulator drivers which support DT all repeat very similar code
      to supply a list of known regulator identifiers to be matched with DT,
      convert that to platform data which is then matched up with the regulators
      as they are registered. This is both fiddly to get right and for devices
      which can use the standard helpers to provide their operations is the main
      source of code in the driver.
      
      Since this code is essentially identical for most drivers we can factor it
      out into the core, moving the identifiers in the match table into the
      regulator descriptors and also allowing drivers to pass in the name of the
      subnode to search. When a driver provides an of_match string for the
      regulator the core will attempt to use that to obtain init_data, allowing
      the driver to remove all explicit code for DT parsing and simply provide
      data instead.
      
      The current code leaks the phandles for the child nodes, this will be
      addressed incrementally and makes no practical difference for FDT anyway
      as the DT data structures are never freed.
      Signed-off-by: NMark Brown <broonie@linaro.org>
      a0c7b164
  27. 28 8月, 2014 1 次提交
  28. 21 8月, 2014 1 次提交
  29. 18 8月, 2014 1 次提交
    • A
      regulator: core: Fix build error due to const qualifier for ops · 716845eb
      Axel Lin 提交于
      Drop const qualifier for ops of struct regulator_desc.
      Allow regulator drivers to update ops before registering regulator.
      
      Fix below build error:
        CC [M]  drivers/regulator/mc13892-regulator.o
      drivers/regulator/mc13892-regulator.c: In function 'mc13892_regulator_probe':
      drivers/regulator/mc13892-regulator.c:586:3: error: assignment of member 'set_mode' in read-only object
      drivers/regulator/mc13892-regulator.c:588:3: error: assignment of member 'get_mode' in read-only object
      make[2]: *** [drivers/regulator/mc13892-regulator.o] Error 1
      make[1]: *** [drivers/regulator] Error 2
      make: *** [drivers] Error 2
      Reported-by: NStephen Rothwell <sfr@canb.auug.org.au>
      Signed-off-by: NAxel Lin <axel.lin@ingics.com>
      Signed-off-by: NMark Brown <broonie@linaro.org>
      716845eb
  30. 17 8月, 2014 2 次提交
  31. 06 3月, 2014 1 次提交
    • C
      regulator: helpers: Modify helpers enabling multi-bit control · ca5d1b35
      Carlo Caione 提交于
      This patch extends the regulator helpers to account for device that use
      multiple bits for control when using regmap enable/disable/bypass ops.
      
      The actual regulator helpers wrongly assume that the regulator control
      is always performed using single bits, using in the regulator_desc
      struct only two parameters *_reg and *_mask defining register and mask
      for control.
      
      This patch extends this struct and introduces the helpers to take into
      account devices where control is performed using multiple bits and
      specific multi-bit values are used for enabling/disabling/bypassing the
      regulator.
      Signed-off-by: NCarlo Caione <carlo@caione.org>
      Signed-off-by: NMark Brown <broonie@linaro.org>
      ca5d1b35
  32. 11 10月, 2013 1 次提交