04 Mar, 2019

1 commit


26 Jan, 2019

1 commit

  • Since c32569e358ad ("regulator: Use of_node_name_eq for node name
    comparisons") Vivien reported the mc13892-regulator complaining about
    not being able to find regulators.

    This is because prior to that commit we used of_node_cmp() to compare
    the regulator array passed from mc13892_regulators down to
    mc13xxx_parse_regulators_dt() and they are all defined in uppercase
    letters by the MC13892_*_DEFINE* macros, whereas they are defined as
    lowercase in the DTS.

    Fix this by using a lowercase regulator name to match the DT node name.

    Fixes: c32569e358ad ("regulator: Use of_node_name_eq for node name comparisons")
    Reported-by: Vivien Didelot
    Reported-by: Florian Fainelli
    Cc: Liam Girdwood
    Cc: Mark Brown
    Signed-off-by: Rob Herring
    Tested-by: Vivien Didelot
    Signed-off-by: Mark Brown

    Rob Herring
     

09 Jun, 2018

1 commit

  • Pull regulator updates from Mark Brown:
    "Quite a lot of core work this time around, though not 100% successful.

    We gained support for runtime mode changes thanks to David Collins and
    improved support for write only regulators (ones where we can't read
    back the configuration) from Douglas Anderson.

    There's been quite a bit of work from Linus Walleij on converting from
    specfying GPIOs by numbers to descriptors. Sadly the testing turned
    out to be less good than we had hoped and so a lot of this had to be
    reverted.

    We also have the start of updates to use coupled regulators from
    Maciej Purski, unfortunately there are further problems there so the
    last couple of patches have been reverted.

    We also have new drivers for BD71837 and SY8106A devices, SAW
    regulators on Qualcomm SPMI and dropped support for some preproduction
    chips that never made it to market from the AB8500 driver"

    * tag 'regulator-v4.18' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/regulator: (57 commits)
    regulator: gpio: Revert
    ARM: pxa, regulator: fix building ezx e680
    regulator: Revert coupled regulator support again
    regulator: wm8994: Fix shared GPIOs
    regulator: max77686: Fix shared GPIOs
    regulator: bd71837: BD71837 PMIC regulator driver
    regulator: bd71837: Devicetree bindings for BD71837 regulators
    regulator: gpio: Get enable GPIO using GPIO descriptor
    regulator: fixed: Convert to use GPIO descriptor only
    regulator: s2mps11: Fix boot on Odroid XU3
    dt-bindings: qcom_spmi: Document SAW support
    regulator: qcom_spmi: Add support for SAW
    regulator: tps65090: Pass descriptor instead of GPIO number
    regulator: s5m8767: Pass descriptor instead of GPIO number
    regulator: pfuze100: Delete reference to ena_gpio
    regulator: max8952: Pass descriptor instead of GPIO number
    regulator: lp8788-ldo: Pass descriptor instead of GPIO number
    regulator: lm363x: Pass descriptor instead of GPIO number
    regulator: max8973: Pass descriptor instead of GPIO number
    regulator: mc13xxx-core: Switch to SPDX identifier
    ...

    Linus Torvalds
     

07 Jun, 2018

1 commit

  • Replaces open-coded struct size calculations with struct_size() for
    devm_*, f2fs_*, and sock_* allocations. Automatically generated (and
    manually adjusted) from the following Coccinelle script:

    // Direct reference to struct field.
    @@
    identifier alloc =~ "devm_kmalloc|devm_kzalloc|sock_kmalloc|f2fs_kmalloc|f2fs_kzalloc";
    expression HANDLE;
    expression GFP;
    identifier VAR, ELEMENT;
    expression COUNT;
    @@

    - alloc(HANDLE, sizeof(*VAR) + COUNT * sizeof(*VAR->ELEMENT), GFP)
    + alloc(HANDLE, struct_size(VAR, ELEMENT, COUNT), GFP)

    // mr = kzalloc(sizeof(*mr) + m * sizeof(mr->map[0]), GFP_KERNEL);
    @@
    identifier alloc =~ "devm_kmalloc|devm_kzalloc|sock_kmalloc|f2fs_kmalloc|f2fs_kzalloc";
    expression HANDLE;
    expression GFP;
    identifier VAR, ELEMENT;
    expression COUNT;
    @@

    - alloc(HANDLE, sizeof(*VAR) + COUNT * sizeof(VAR->ELEMENT[0]), GFP)
    + alloc(HANDLE, struct_size(VAR, ELEMENT, COUNT), GFP)

    // Same pattern, but can't trivially locate the trailing element name,
    // or variable name.
    @@
    identifier alloc =~ "devm_kmalloc|devm_kzalloc|sock_kmalloc|f2fs_kmalloc|f2fs_kzalloc";
    expression HANDLE;
    expression GFP;
    expression SOMETHING, COUNT, ELEMENT;
    @@

    - alloc(HANDLE, sizeof(SOMETHING) + COUNT * sizeof(ELEMENT), GFP)
    + alloc(HANDLE, CHECKME_struct_size(&SOMETHING, ELEMENT, COUNT), GFP)

    Signed-off-by: Kees Cook

    Kees Cook
     

24 May, 2018

1 commit


20 Oct, 2014

1 commit


19 Aug, 2014

1 commit

  • Commit 272e2315fac3 ("regulator: core: add const qualifier to ops in
    struct regulator_desc") introduced const qualifier to ops in regulator_desc.

    This patch adds 'const' to regulator_ops vars in newly added core APIs
    for v3.17-rc1:
    - regulator_get_hardware_vsel_register()
    - regulator_list_hardware_vsel()

    This patch also fix a build error in mc13892-regulator.c due to const
    regulator_desc.ops. Modification of regulator_desc.ops' member fields is not
    allowed.

    Signed-off-by: Guodong Xu
    Signed-off-by: Mark Brown

    Guodong Xu
     

23 Jan, 2014

1 commit


15 Oct, 2013

1 commit


17 Sep, 2013

1 commit


12 May, 2013

1 commit


28 Apr, 2013

3 commits


25 Apr, 2013

1 commit


27 Jan, 2013

2 commits

  • Imagine a situation where a device tree has a few regulators in an
    appropriate node:

    regulators {
    sw1 {
    ..
    };

    vvideo {
    ..
    };

    :

    vfake {
    ..
    };

    vtypo {
    ..
    };
    };

    In the above example, the node name "vfake" is an attempt to match a
    regulator name inside the driver which just so happens to not exist. The
    node name "vtypo" represents an accidental typographical error in a
    regulator name which may have been introduced to a device tree.

    In these cases, the number of regulators the mc13892 driver thinks it has
    does not match the number of regulators it parsed and registered. Since
    it will go over this array based on this number, it will actually
    re-register regulator "0" (which happens to be SW1) over and over
    again until it reaches the number, resulting in messages on the kernel
    log such as these:

    SW1: at 1100 mV
    VVIDEO: at 2775mV
    :
    SW1: at 1100 mV
    SW1: at 1100 mV

    .. up to that number of "mismatched" regulators. Nobody using DT can/will
    consume these regulators, so it should not be possible for it to cause any
    real regulator problems or driver breakages, but it is an easy thing to
    miss in a kernel log and is an immediate indication of a problem with the
    device tree authoring.

    This patch effectively sanity checks the number of counted children of
    the regulators node vs. the number that actually matched driver names,
    and sets the appropriate num_regulators value. It also gives a little
    warning for device tree authors that they MAY have screwed something up,
    such that this patch does not hide the device tree authoring problem.

    Signed-off-by: Matt Sealey
    Tested-by: Steev Klimaszewski
    Signed-off-by: Mark Brown

    Matt Sealey
     
  • MC13892 PMIC supports a "HI" bit for 3 of it's 4 buck switcher outputs,
    which enables a higher set of voltage ranges.

    Despite a comment in the code ('sw regulators need special care due to the
    "hi" bit'), it actually does not take special care since it does not modify
    it's use of the selector table index when this bit is set, giving us very
    odd behavior when setting a high voltage on supported switchers or listing
    current voltages. Net effect is in best case the kernel and sysfs report
    lower voltages than are actually set in hardware (1300mV instead of 1800mV
    for example) and in the worst case setting a voltage (e.g. 1800mV) will cause
    an undervoltage condition (e.g. 1300mV).

    Correct the behavior, taking into account SW1 doesn't support the HI bit,
    and as such we need to ignore it.

    While we are modifying these functions, fix and optimize the following;

    * set_voltage_sel callback was using .reg instead of .vsel_reg - since
    they were set to the same value it actually didn't break anything but
    it would be semantically incorrect to use .reg in this case. We now use
    .vsel_reg and be consistent.
    * vsel_shift is always 0 for every SWx regulator, and constantly shifting
    and masking off the bottom few bits is time consuming and makes the
    code very hard to read - optimize this out.
    * get_voltage_sel uses the variable "val" and set_voltage_sel uses the
    variable "selector" (and reg_value). Introduce the variable "selector"
    to get_voltage_sel such that it makes more sense and allow some leaner
    code in light of the modifications in this patch. Add better exposure
    to the debug print so the register value AND the selector are printed as
    this will adequately show the HI bit in the register.
    * correct a comment in probe which is doing a version check. Magic
    values are awful but for once instance, a comment does just as
    good a job as something symbolic.

    Signed-off-by: Matt Sealey
    Tested-by: Steev Klimaszewski
    Signed-off-by: Mark Brown

    Matt Sealey
     

20 Nov, 2012

3 commits


29 Aug, 2012

4 commits


19 Jun, 2012

1 commit


18 Jun, 2012

1 commit


10 Apr, 2012

2 commits


03 Apr, 2012

1 commit


27 Mar, 2012

1 commit


30 Dec, 2011

1 commit


22 Dec, 2011

1 commit


24 Nov, 2011

1 commit

  • With device tree support for regulators, its needed that the
    regulator_dev->dev device has the right of_node attached.
    To be able to do this add an additional parameter to the
    regulator_register() api, wherein the dt-adapted driver can
    then pass this additional info onto the regulator core.

    Signed-off-by: Rajendra Nayak
    Signed-off-by: Mark Brown

    Rajendra Nayak
     

01 Nov, 2011

1 commit


27 May, 2011

5 commits


23 Mar, 2011

1 commit

  • The cell's platform_data is now accessed with a helper function;
    change clients to use that, and remove the now-unused data_size.

    Note that mfd-core no longer makes a copy of platform_data, but the
    mc13xxx-core driver creates the pdata structures on the stack. In
    order to get around that, the various ARM mach types that set the
    pdata have been changed to hold the variable in static (global) memory.
    Also note that __initdata references in aforementioned pdata structs
    have been dropped.

    Signed-off-by: Andres Salomon
    Signed-off-by: Samuel Ortiz

    Andres Salomon