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
     

12 Jan, 2011

3 commits