1. 02 4月, 2015 1 次提交
  2. 09 1月, 2015 1 次提交
  3. 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
  4. 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
  5. 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
  6. 28 8月, 2014 1 次提交
  7. 21 8月, 2014 1 次提交
  8. 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
  9. 17 8月, 2014 2 次提交
  10. 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
  11. 11 10月, 2013 2 次提交
  12. 17 9月, 2013 2 次提交
  13. 11 9月, 2013 1 次提交
  14. 15 7月, 2013 1 次提交
    • M
      regulator: core: Add helpers for multiple linear ranges · 94d33c02
      Mark Brown 提交于
      Many regulators have several linear ranges of selector with different
      step sizes, for example offering better resolution at lower voltages.
      Provide regulator_{map,list}_voltage_linear_range() allowing these
      regulators to use generic code. To do so a table of regulator_linear_range
      structs needs to be pointed to from the descriptor.
      
      This was inspired by similar code included in a driver submission from
      Chao Xie and Yi Zhang at Marvell.
      Signed-off-by: NMark Brown <broonie@linaro.org>
      94d33c02
  15. 18 4月, 2013 1 次提交
  16. 05 3月, 2013 1 次提交
  17. 04 3月, 2013 2 次提交
    • K
      regulator: core: use regulator_ena_pin member · 7b74d149
      Kim, Milo 提交于
       The regulator_dev has regulator_enable_gpio structure.
       'ena_gpio' and 'ena_gpio_invert' were moved to in regulator_enable_gpio.
      
        regulator_dev   --->   regulator_enable_gpio
        .ena_gpio              .gpio
        .ena_gpio_invert       .ena_gpio_invert
      
        Pointer, 'ena_pin' is used for checking valid enable GPIO pin.
      Signed-off-by: NMilo(Woogyom) Kim <milo.kim@ti.com>
      Reviewed-by: NAxel Lin <axel.lin@ingics.com>
      Signed-off-by: NMark Brown <broonie@opensource.wolfsonmicro.com>
      7b74d149
    • K
      regulator: core: support shared enable GPIO concept · f19b00da
      Kim, Milo 提交于
       A Regulator can be enabled by external GPIO pin.
       This is configurable in the regulator_config.
       At this moment, the GPIO can be owned by only one regulator device.
       In some devices, multiple regulators are enabled by shared one GPIO pin.
       This patch extends this limitation, enabling shared enable GPIO of regulators.
      
       New list for enable GPIO: 'regulator_ena_gpio_list'
         This manages enable GPIO list.
      
       New structure for supporting shared enable GPIO: 'regulator_enable_gpio'
         The enable count is used for balancing GPIO control count.
         This count is incremented when GPIO is enabled.
         On the other hand, it's decremented when GPIO is disabled.
      
       Reference count: 'request_count'
         The reference count, 'request_count' is incremented/decremented on
         requesting/freeing the GPIO. This count makes sure only free the GPIO
         when it has no users.
      
       How it works
         If the GPIO is already used, skip requesting new GPIO usage.
         The GPIO is new one, request GPIO function and add it to the list of
         enable GPIO.
         This list is used for balancing enable GPIO count and pin control.
      
       Updating a GPIO and invert code moved
         'ena_gpio' and 'ena_gpio_invert' of the regulator_config were moved to
          new function, regulator_ena_gpio_request().
          Use regulator_enable_pin structure rather than regulator_dev.
      Signed-off-by: NMilo(Woogyom) Kim <milo.kim@ti.com>
      Reviewed-by: NAxel Lin <axel.lin@ingics.com>
      Signed-off-by: NMark Brown <broonie@opensource.wolfsonmicro.com>
      f19b00da
  18. 01 3月, 2013 1 次提交
    • N
      regulator: core: update kernel documentation for regulator_desc · 5838b032
      Nishanth Menon 提交于
      commit df367931 (regulator: core: Provide regmap get/set bypass
      operations) introduced regulator_[gs]et_bypass_regmap
      
      However structure documentation for regulator_desc needs an update.
      ./scripts/kernel-doc include/linux/regulator/driver.h >/dev/null
      generates:
      Warning(include/linux/regulator/driver.h:233): No description found for parameter 'bypass_reg'
      Warning(include/linux/regulator/driver.h:233): No description found for parameter 'bypass_mask'
      
      Cc: Liam Girdwood <lgirdwood@gmail.com>
      Cc: Mark Brown <broonie@opensource.wolfsonmicro.com>
      Cc: linux-kernel@vger.kernel.org
      Signed-off-by: NNishanth Menon <nm@ti.com>
      Signed-off-by: NMark Brown <broonie@opensource.wolfsonmicro.com>
      5838b032
  19. 25 12月, 2012 1 次提交
  20. 28 11月, 2012 1 次提交
    • A
      regulator: core: Allow specific minimal selector for starting linear mapping · 33234e79
      Axel Lin 提交于
      Some drivers (at least 3 drivers) have such variant of linear mapping that
      the first few selectors are invalid and the reset are linear mapping.
      Let's support this case in core.
      
      This patch adds linear_min_sel in struct regulator_desc,
      so we can allow specific minimal selector for starting linear mapping.
      Then extends regulator_[map|list]_voltage_linear() to support this feature.
      
      Note that for selectors less than min_linear_index, we need count them to
      n_voltages so regulator_list_voltage() won't fail while checking the boundary
      for selector before calling list_voltage callback.
      Signed-off-by: NAxel Lin <axel.lin@ingics.com>
      Signed-off-by: NMark Brown <broonie@opensource.wolfsonmicro.com>
      33234e79
  21. 15 10月, 2012 1 次提交
  22. 10 9月, 2012 2 次提交
  23. 01 9月, 2012 1 次提交
  24. 29 8月, 2012 1 次提交
  25. 13 7月, 2012 1 次提交
  26. 04 7月, 2012 2 次提交
    • M
      regulator: core: Add core support for GPIO controlled enable lines · 65f73508
      Mark Brown 提交于
      It is very common for regulators to support having their enable signal
      controlled by a GPIO. Since there are a bunch of fiddly things to get
      right like handling the operations when the enable signal is tied to
      a rail and it's just replicated code add support for this to the core.
      
      Drivers should set ena_gpio in their config if they have a GPIO control,
      using ena_gpio_flags to specify any flags (including GPIOF_OUT_INIT_ for
      the initial state) and ena_gpio_invert if the GPIO is active low. The
      core will then override any enable and disable operations the driver has
      and instead control the specified GPIO.
      
      This will in the future also allow us to further extend the core by
      identifying when several enable signals have been tied together and
      handling this properly.
      Signed-off-by: NMark Brown <broonie@opensource.wolfsonmicro.com>
      65f73508
    • M
      regulator: core: Allow fixed enable_time to be set in the regulator_desc · 79511ed3
      Mark Brown 提交于
      Many regulators have a fixed specification for their enable time. Allow
      this to be set in the regulator_desc as a number to save them having to
      implement an explicit operation.
      Signed-off-by: NMark Brown <broonie@opensource.wolfsonmicro.com>
      79511ed3
  27. 18 6月, 2012 2 次提交
    • A
      regulator: core: Change the unit of ramp_delay from mV/uS to uV/uS · ea38d13f
      Axel Lin 提交于
      This change makes it possible to set ramp_delay with 0.xxx mV/uS without
      truncation issue.
      Signed-off-by: NAxel Lin <axel.lin@gmail.com>
      Signed-off-by: NMark Brown <broonie@opensource.wolfsonmicro.com>
      ea38d13f
    • Y
      regulator: Add ramp_delay configuration to constraints · 6f0b2c69
      Yadwinder Singh Brar 提交于
      For some hardwares ramp_delay for BUCKs is a configurable parameter which can
      be configured through DT or board file.This patch adds ramp_delay to regulator
      constraints and allow user to configure it for regulators which supports this
      feature, through DT or board file. It will provide two ways of setting the
      ramp_delay for a regulator:
      	First, by setting it as constraints in board file(for configurable
      regulators) and set_machine_constraints() will take care of setting it on
      hardware by calling(the provided) .set_ramp_delay() operation(callback).
      	Second, by setting it as data in regulator_desc(as fixed/default
      ramp_delay rate) for a regulator in driver.
      
      regulator_set_voltage_time_sel() will give preference to
      constraints->ramp_delay while reading ramp_delay rate for regulator. Similarly
      users should also take care accordingly while refering ramp_delay rate(in case
      of implementing their private .set_voltage_time_sel() callbacks for different
      regulators).
      
      [Rewrote subject for 80 columns -- broonie]
      Signed-off-by: NYadwinder Singh Brar <yadi.brar@samsung.com>
      Signed-off-by: NMark Brown <broonie@opensource.wolfsonmicro.com>
      6f0b2c69
  28. 11 6月, 2012 1 次提交
  29. 03 6月, 2012 1 次提交
  30. 12 5月, 2012 2 次提交
  31. 17 4月, 2012 2 次提交
    • M
      regulator: core: Provide standard enable operations for regmap users · cd6dffb4
      Mark Brown 提交于
      Since the enable(), disable() and is_enabled() operations for most regmap
      based regulators come down to reading and updating a single register bit
      we can factor out the code and allow these drivers to just define which
      bit to update using the enable_reg and enable_mask fields in their desc
      and then use operations provided by the core.
      
      As well as the code saving this opens the door to future optimisation of
      the bulk operations - if the core can realise that we are updating a
      single register for multiple regulators then it should be able to combine
      these updates into a single physical operation.
      Signed-off-by: NMark Brown <broonie@opensource.wolfsonmicro.com>
      Acked-by: NLiam Girdwood <lrg@ti.com>
      cd6dffb4
    • M
      regulator: core: Provide regmap based voltage_sel operations · 4ab5b3d9
      Mark Brown 提交于
      Since the voltage selector operations are intended to directly map a
      bitfield in the device register map into regulator API operations the
      code for implementing them is usually very standard we can save some
      code by providing standard implementations for devices using the regmap
      API.
      
      Drivers using regmap can pass their regmap in in the regmap_config
      struct, set vsel_reg and vsel_mask in their regulator_desc and then
      use regulator_{get,set}_voltage_sel_regmap in their ops. This saves
      a small amount of code from each driver.
      Signed-off-by: NMark Brown <broonie@opensource.wolfsonmicro.com>
      Acked-by: NLiam Girdwood <lrg@ti.com>
      4ab5b3d9