15 Nov, 2014

1 commit

  • commit ca0c37a0b489bb14bf3e1549e7a8d0c9a17f4919 upstream.

    Driver allocated on stack struct regulator_config but didn't initialize
    it fully. Few fields (driver_data, ena_gpio) were left untouched. This
    lead to using random ena_gpio values as GPIOs for max77693 regulators.

    On occasion these values could match real GPIO numbers leading to
    interfering with other drivers and to unsuccessful enable/disable of
    regulator.

    Signed-off-by: Krzysztof Kozlowski
    Fixes: 80b022e29bfd ("regulator: max77693: Add max77693 regualtor driver.")
    Signed-off-by: Mark Brown
    Signed-off-by: Greg Kroah-Hartman

    Krzysztof Kozlowski
     

18 Sep, 2014

1 commit


06 May, 2014

1 commit

  • commit a35ff2861690eaf9dbb38fa744a8a9e6f4ebfd61 upstream.

    Both 5102 and 8997 have the regulator capable of supplying 1.8V, and the
    voltage step from the 5110 regulator is different from what is specified
    in the default description. This patch updates the default regulator
    description to match 5110 and selects the 1.8V capable description for
    8997.

    Signed-off-by: Charles Keepax
    Signed-off-by: Mark Brown
    Signed-off-by: Greg Kroah-Hartman

    Charles Keepax
     

05 Mar, 2014

1 commit


25 Feb, 2014

2 commits

  • There are many places where ops->disable is called directly. Instead we
    should use _regulator_do_disable() which also handles gpio regulators.

    To be able to use the wrapper function from _regulator_force_disable(),
    I moved the _notifier_call_chain() call from _regulator_do_disable() to
    _regulator_disable(). This way, _regulator_force_disable() can use
    different flags for _notifier_call_chain() without calling it twice.

    Cc: # 3.10+
    Signed-off-by: Markus Pargmann
    Signed-off-by: Mark Brown

    Markus Pargmann
     
  • There are some direct ops->enable in the regulator core driver. This is
    a potential issue as the function _regulator_do_enable() handles gpio
    regulators and the normal ops->enable calls. These gpio regulators are
    simply ignored when ops->enable is called directly.

    One possible bug is that boot-on and always-on gpio regulators are not
    enabled on registration.

    This patch replaces all ops->enable calls by _regulator_do_enable.

    [Handle missing enable operations -- broonie]

    Cc: # 3.10+
    Signed-off-by: Markus Pargmann
    Signed-off-by: Mark Brown

    regulator: Handle invalid enable operation for always/boot on regulators

    Signed-off-by: Mark Brown

    Markus Pargmann
     

23 Feb, 2014

2 commits


22 Feb, 2014

1 commit

  • This fixes bug introduced in 667a6b7a (regulator: max14577: Add missing
    of_node_put). The DTS parsing function returned number of matched
    regulators as success status which then was compared against 0 in probe.

    Result was a probe fail after successful parsing the DTS:
    max14577-regulator: probe of max14577-regulator failed with error 2

    Signed-off-by: Krzysztof Kozlowski
    Reviwed-by: Sachin Kamat
    Signed-off-by: Mark Brown

    Krzysztof Kozlowski
     

21 Feb, 2014

1 commit

  • Change "dummy supplies not allowed" error message to warning instead, as this
    is a just warning message with no change to the behavior.

    [Added a CC to stable since some other bug fixes cause this to come up
    more frequently on PCs which is how it was noticed -- broonie]

    Signed-off-by: Shuah Khan
    Signed-off-by: Mark Brown
    Cc: stable@vger.kernel.org

    Shuah Khan
     

14 Feb, 2014

2 commits


12 Feb, 2014

2 commits

  • Bug fix to allow the setting of maximum voltage for certain LDOs.

    What the bug is:

    There is a problem caused by an invalid calculation of n_voltages
    in the driver. This n_voltages value has the potential to be
    different for each regulator.

    The value for linear_min_sel is set as DA9063_V##regl_name#
    which can be different depending upon the regulator. This is
    chosen according to the following definitions in the DA9063
    registers.h file:

    DA9063_VLDO1_BIAS 0
    DA9063_VLDO2_BIAS 0
    DA9063_VLDO3_BIAS 0
    DA9063_VLDO4_BIAS 0
    DA9063_VLDO5_BIAS 2
    DA9063_VLDO6_BIAS 2
    DA9063_VLDO7_BIAS 2
    DA9063_VLDO8_BIAS 2
    DA9063_VLDO9_BIAS 3
    DA9063_VLDO10_BIAS 2
    DA9063_VLDO11_BIAS 2

    The calculation for n_voltages is valid for LDOs whose BIAS value
    is zero but this is not correct for those LDOs which have a
    non-zero value.

    What the fix is:

    In order to take into account the non-zero linear_min_sel value which
    is set for the regulators LDO5, LDO6, LDO7, LDO8, LDO9, LDO10 and
    LDO11, the calculation for n_voltages should take into account the
    missing term defined by DA9063_V##regl_name#.

    This will in turn allow the core constraints calculation to set the
    maximum voltage limits correctly and therefore allow users to apply
    the maximum expected voltage to all of the LDOs.

    Signed-off-by: Steve Twiss
    Signed-off-by: Mark Brown
    Cc: stable@vger.kernel.org

    Steve Twiss
     
  • …7' into regulator-linus

    Mark Brown
     

08 Feb, 2014

1 commit


06 Feb, 2014

1 commit


04 Feb, 2014

2 commits


01 Feb, 2014

1 commit

  • When platform_data is used for regulator (of_node of sec-core MFD device
    is NULL) the config.of_node for regulator is not initialized. This NULL
    value of config.of_node is later stored during regulator_register().
    Thus any call by regulator consumers to of_get_regulator() will fail on
    of_parse_phandle() returning NULL.

    In this case (using platform_data and parent's driver of_node is NULL)
    set the config.of_node to reg_node from platform_data.

    Signed-off-by: Krzysztof Kozlowski
    Signed-off-by: Mark Brown

    Krzysztof Kozlowski
     

28 Jan, 2014

1 commit

  • Once we have full constraints then all supply mappings should be known to
    the regulator API. This means that we should treat failed lookups as fatal
    rather than deferring in the hope of further registrations but this was
    broken by commit 9b92da1f1205bd25 "regulator: core: Fix default return
    value for _get()" which was targeted at DT systems but unintentionally
    broke non-DT systems by changing the default return value.

    Fix this by explicitly returning -EPROBE_DEFER from the DT lookup if we
    find a property but no corresponding regulator and by having the non-DT
    case default to -ENODEV when we have full constraints.

    Fixes: 9b92da1f1205bd25 "regulator: core: Fix default return value for _get()"
    Signed-off-by: Mark Brown
    Tested-by: Guenter Roeck
    Cc: stable@vger.kernel.org

    Mark Brown
     

26 Jan, 2014

1 commit

  • Pull regulator updates from Mark Brown:
    "A respin of the merges in the previous pull request with one extra
    fix.

    A quiet release for the regulator API, quite a large number of small
    improvements all over but other than the addition of new drivers for
    the AS3722 and MAX14577 there is nothing of substantial non-local
    impact"

    * tag 'regulator-v3.14-2' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/regulator: (47 commits)
    regulator: pfuze100-regulator: Improve dev_info() message
    regulator: pfuze100-regulator: Fix some checkpatch complaints
    regulator: twl: Fix checkpatch issue
    regulator: core: Fix checkpatch issue
    regulator: anatop-regulator: Remove unneeded memset()
    regulator: s5m8767: Update LDO index in s5m8767-regulator.txt
    regulator: as3722: set enable time for SD0/1/6
    regulator: as3722: detect SD0 low-voltage mode
    regulator: tps62360: Fix up a pointer-integer size mismatch warning
    regulator: anatop-regulator: Remove unneeded kstrdup()
    regulator: act8865: Fix build error when !OF
    regulator: act8865: register all regulators regardless of how many are used
    regulator: wm831x-dcdc: Remove unneeded 'err' label
    regulator: anatop-regulator: Add MODULE_ALIAS()
    regulator: act8865: fix incorrect devm_kzalloc for act8865
    regulator: act8865: Remove set_suspend_[en|dis]able implementation
    regulator: act8865: Remove unneeded regulator_unregister() calls
    regulator: s2mps11: Clean up redundant code
    regulator: tps65910: Simplify setting enable_mask for regulators
    regulator: act8865: add device tree binding doc
    ...

    Linus Torvalds
     

24 Jan, 2014

1 commit

  • The AB3100 regulator driver emits a warning when compiled on 64bit
    systems like this:

    drivers/regulator/ab3100.c:
    In function ‘ab3100_regulator_of_probe’:
    srivers/regulator/ab3100.c:649:4:
    warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]

    As the int is a different size than the 64bit pointer used to
    pass regulator data. Switch to using an unsigned long as ID
    passed for the regulator to get rid of the warning.

    Reported-by: Lee Jones
    Signed-off-by: Linus Walleij
    Signed-off-by: Mark Brown

    Linus Walleij
     

23 Jan, 2014

5 commits


21 Jan, 2014

2 commits

  • Symbol MFD_MC13783 always selected by MFD_MC13XXX, so no need
    to keep additional symbol.

    Signed-off-by: Alexander Shiyan
    Signed-off-by: Lee Jones

    Alexander Shiyan
     
  • Depending on the regulator version, the voltage table might be
    different. Use version specific regulator tables in order to select
    correct voltage table. For the following regulator versions different
    voltage tables are now used:

    * TPS658623: Use correct voltage table for SM2
    * TPS658643: New voltage table for SM2

    Both versions are in use on the Colibri T20 module. Make use of the
    correct tables by requesting the correct SM2 voltage of 1.8V.

    This change is not backward compatible since an old driver is not able
    to correctly set that value. The value 1.8V is out of range for the old
    driver and will refuse to probe the device. The regulator starts with
    default settings and the driver shows appropriate error messages.

    On Colibri T20, the old value used to work with TPS658623 since the
    driver applied a wrong voltage table too. However, the TPS658643 used
    on V1.2 devices uses yet another voltage table and those broke that
    pseudo-compatibility. The regulator driver now has the correct voltage
    table for both regulator versions and those the correct voltage can be
    used in the device tree.

    Signed-off-by: Stefan Agner
    Reviewed-by: Thierry Reding
    Acked-by: Mark Brown
    Acked-by: Stephen Warren
    Signed-off-by: Lee Jones

    Stefan Agner
     

15 Jan, 2014

2 commits


09 Jan, 2014

2 commits

  • Fix the following checkpatch warnings.

    WARNING: please, no space before tabs
    WARNING: space prohibited between function name and open parenthesis '('

    Signed-off-by: Jingoo Han
    Acked-by: Nishanth Menon
    Signed-off-by: Mark Brown

    Jingoo Han
     
  • Fix the following checkpatch errors and warnings.

    ERROR: trailing whitespace
    ERROR: return is not a function, parentheses are not required
    WARNING: braces {} are not necessary for single statement blocks

    Signed-off-by: Jingoo Han
    Signed-off-by: Mark Brown

    Jingoo Han
     

08 Jan, 2014

1 commit


07 Jan, 2014

2 commits


06 Jan, 2014

3 commits

  • Fix up the following pointer-integer size mismatch warning in tps62360_probe():

    drivers/regulator/tps62360-regulator.c: In function 'tps62360_probe':
    drivers/regulator/tps62360-regulator.c:363:13: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
    chip_id = (int)match->data;
    ^

    Signed-off-by: David Howells
    Signed-off-by: Mark Brown

    David Howells
     
  • We can simply pass the regulator name via of_get_property() instead of making
    a copy via kstrdup().

    This leads to some code simplification.

    Suggested-by: Dmitry Torokhov
    Signed-off-by: Fabio Estevam
    Signed-off-by: Mark Brown

    Fabio Estevam
     
  • Fix below build error when !OF:
    CC [M] drivers/regulator/act8865-regulator.o
    drivers/regulator/act8865-regulator.c: In function 'act8865_pmic_probe':
    drivers/regulator/act8865-regulator.c:306:18: error: 'act8865_matches' undeclared (first use in this function)
    drivers/regulator/act8865-regulator.c:306:18: note: each undeclared identifier is reported only once for each function it appears in
    drivers/regulator/act8865-regulator.c:306:18: error: negative width in bit-field ''
    make[2]: *** [drivers/regulator/act8865-regulator.o] Error 1
    make[1]: *** [drivers/regulator] Error 2
    make: *** [drivers] Error 2

    Reported-by: Stephen Rothwell
    Signed-off-by: Axel Lin
    Signed-off-by: Mark Brown

    Axel Lin
     

31 Dec, 2013

1 commit