04 Oct, 2017

1 commit

  • The bit offset used to check if DCDC5 and DCDC6 are tied together in
    poly-phase output is wrong. It was checking against a reserved bit,
    which is always false.

    In reality, neither the reference design layout nor actually produced
    boards tie these two buck regulators together. But we should still
    fix it, just in case.

    Fixes: 1dbe0ccb0631 ("regulator: axp20x-regulator: add support for AXP803")
    Signed-off-by: Chen-Yu Tsai
    Tested-by: Maxime Ripard
    Acked-by: Maxime Ripard
    Signed-off-by: Mark Brown

    Chen-Yu Tsai
     

07 Jul, 2017

1 commit


20 May, 2017

1 commit


20 Feb, 2017

1 commit


01 Feb, 2017

1 commit

  • Declare regulator_ops structure as const as it is only stored in the ops
    field of a regulator_desc structure. This field is of type const, so
    regulator_ops structures having this property can be made const too.

    File size before: drivers/regulator/axp20x-regulator.o
    text data bss dec hex filename
    16848 1232 0 18080 46a0 regulator/axp20x-regulator.o

    File size after: drivers/regulator/axp20x-regulator.o
    text data bss dec hex filename
    17888 192 0 18080 46a0 regulator/axp20x-regulator.o

    Signed-off-by: Bhumika Goyal
    Signed-off-by: Mark Brown

    Bhumika Goyal
     

24 Jan, 2017

1 commit


11 Nov, 2016

1 commit

  • The maximum supported voltage for ldo_io# is 3.3V, but on cold boot
    the selector comes up at 0x1f, which maps to 3.8V. This was previously
    corrected by Allwinner's U-boot, which set all regulators on the PMICs
    to some pre-configured voltage. With recent progress in U-boot SPL
    support, this is no longer the case. In any case we should handle
    this quirk in the kernel driver as well.

    This invalid setting causes _regulator_get_voltage() to fail with -EINVAL
    which causes regulator registration to fail when constrains are used:

    [ 1.054181] vcc-pg: failed to get the current voltage(-22)
    [ 1.059670] axp20x-regulator axp20x-regulator.0: Failed to register ldo_io0
    [ 1.069749] axp20x-regulator: probe of axp20x-regulator.0 failed with error -22

    This commits makes the axp20x regulator driver accept the 0x1f register
    value, fixing this.

    The datasheet does not guarantee reliable operation above 3.3V, so on
    boards where this regulator is used the regulator-max-microvolt setting
    must be 3.3V or less.

    This is essentially the same as the commit f40d4896bf32 ("regulator:
    axp20x: Fix axp22x ldo_io registration error on cold boot") for AXP22x
    PMICs.

    Fixes: a51f9f4622a3 ("regulator: axp20x: support AXP809 variant")
    Signed-off-by: Chen-Yu Tsai
    Signed-off-by: Mark Brown

    Chen-Yu Tsai
     

13 Sep, 2016

1 commit

  • The X-Powers AXP806 PMIC has a new set of buck and LDO regulators, and
    also a switch. The buck regulators support teaming into multi-phase
    groups, with A+B, A+B+C, D+E groupings.

    Some registers controlling DCDC converter work settings are at different
    offsets. Deal with them as well.

    Add support for this new variant.

    Signed-off-by: Chen-Yu Tsai
    Acked-by: Mark Brown
    Signed-off-by: Lee Jones

    Chen-Yu Tsai
     

07 Jun, 2016

1 commit

  • The axp20x pmics have 2 power inputs, one called ACIN which is intended
    for to be supplied via a powerbarrel on the board and one called VBUS
    which is intended to be supplied via an otg connector.

    In the VBUS case the pmic needs to know if the board is supplying power
    to the otg connector, because then it should not take any power from
    its VBUS pin. The axp209 pmic has a N_VBUSEN input pin via which the
    board can signal to the pmic whether the board is supplying power to the
    otg connector or not.

    On the axp221/axp223 this pin can alternatively be used as an output
    which controls an external regulator which (optionally) supplies
    power to the otg connector from the board. When the pin is used as
    output it is called DRIVEVBUS in the datasheet.

    This commit adds support for the DRIVEVBUS pin as an extra pmic
    controlled regulator. Since this is optional a new x-powers,drivebus dt
    property is added. When this is present the misc-control register is
    written to change the N_VBUSEN input pin to DRIVEVBUS output pin mode and
    the extra drivebus regulator is registered with the regulator subsystem.

    Signed-off-by: Hans de Goede
    Acked-by: Chen-Yu Tsai
    Signed-off-by: Mark Brown

    Hans de Goede
     

01 Jun, 2016

1 commit

  • The X-Powers AXP809 PMIC has a similar set of regulators as the AXP221,
    though a few LDOs were removed, and a new switch output added. Like the
    AXP221, AXP809 also has DC1SW and DC5LDO, which are internally chained
    to DCDC1 and DCDC5, respectively.

    Add support for this new variant. Also remove the "axp22x_" prefix from
    DC1SW/DC5LDO supply handling code, as the AXP809 uses it as well.

    Signed-off-by: Chen-Yu Tsai
    Signed-off-by: Mark Brown

    Chen-Yu Tsai
     

29 Apr, 2016

1 commit

  • The maximum supported voltage for ldo_io# is 3.3V, but on cold
    boot the selector comes up at 0x1f, which maps to 3.8V.

    This causes _regulator_get_voltage() to fail with -EINVAL which
    causes regulator registration to fail when constrains are used:

    [ 1.467788] vcc-touchscreen: failed to get the current voltage(-22)
    [ 1.474209] axp20x-regulator axp20x-regulator: Failed to register ldo_io1
    [ 1.483363] axp20x-regulator: probe of axp20x-regulator failed with error -22

    This commits makes the axp20x regulator driver accept the 0x1f register
    value, fixing this.

    The datasheet does not guarantee reliable operation above 3.3V, so on
    boards where this regulator is used the regulator-max-microvolt setting
    must be 3.3V or less.

    Signed-off-by: Hans de Goede
    Signed-off-by: Mark Brown

    Hans de Goede
     

27 Apr, 2016

1 commit

  • The minium voltage of 1800mV is a copy and paste error from the axp20x
    regulator info. The correct minimum voltage for the ldo_io regulators
    on the axp22x is 700mV.

    Fixes: 1b82b4e4f954 ("regulator: axp20x: Add support for AXP22X regulators")
    Signed-off-by: Hans de Goede
    Acked-by: Chen-Yu Tsai
    Signed-off-by: Mark Brown

    Hans de Goede
     

26 Apr, 2016

1 commit

  • The current linear voltage range for the LDO4 regulator found in the APX20X
    PMICs assumes that the voltage is linear between 2.5 and 3.1V.

    However, the PMIC can output up to 3.3V on that regulator by skipping the
    2.6V and 2.9V steps.

    Fix the ranges to read and set the proper voltages.

    Fixes: 13d57e64352a ("regulator: axp20x: Use linear voltage ranges for AXP20X LDO4")
    Signed-off-by: Maxime Ripard
    Acked-by: Chen-Yu Tsai
    Signed-off-by: Mark Brown

    Maxime Ripard
     

19 Mar, 2016

1 commit

  • Pull MFD updates from Lee Jones:
    "New Drivers:
    - Freescale Touch Screen ADC
    - X-Powers AXP PMIC with RSB
    - TI TPS65086 Power Management IC (PMIC)

    New Device Support:
    - Supply device PCI IDs for Intel Broxton

    Fix-ups:
    - Move to clkdev_create() API; intel_quark_i2c_gpio
    - Complete re-write of TI's TPS65912 Power Management IC (PMIC)
    - Remove unnecessary function argument; axp20x
    - Separate out bus related code; axp20x
    - Coding Style changes; axp20x
    - Allow more drivers to be compiled as modules
    - Work around false positive 'used uninitialised' warning; db8500-prcmu

    Bug Fixes:
    - Remove do_div(); fsl-imx25-gcq
    - Fix driver init when built-in; tps65010
    - Fix clock-unregister leak; intel-lpss"

    * tag 'mfd-for-linus-4.6' of git://git.kernel.org/pub/scm/linux/kernel/git/lee/mfd: (53 commits)
    mfd: intel-lpss: Pass I2C configuration via properties on BXT
    mfd: imx6sx: Add PCIe register definitions for iomuxc gpr
    mfd: ipaq-micro: Use __maybe_unused to hide pm functions
    mfd: max77686: Add max77802 to I2C device ID table
    mfd: max77686: Export OF module alias information
    mfd: max77686: Allow driver to be built as a module
    mfd: stmpe: Add the proper PWM resources
    mfd: tps65090: Set regmap config reg counts properly
    mfd: syscon: Return ENOTSUPP instead of ENOSYS when disabled
    mfd: as3711: Set regmap config reg counts properly
    mfd: rc5t583: Set regmap config reg counts properly
    gpio: tps65086: Add GPO driver for the TPS65086 PMIC
    mfd: mt6397: Add platform device ID table
    mfd: da9063: Fix missing volatile registers in the core regmap_range volatile lists
    mfd: mt6397: Add MT6323 support to MT6397 driver
    mfd: mt6397: Add support for different Slave types
    mfd: mt6397: int_con and int_status may vary in location
    dt-bindings: mfd: Add bindings for the MediaTek MT6323 PMIC
    mfd: da9062: Fix missing volatile registers in the core regmap_range volatile lists
    mfd: Add documentation for ACT8945A DT bindings
    ...

    Linus Torvalds
     

16 Feb, 2016

1 commit


12 Feb, 2016

1 commit

  • The AXP223 is a new PMIC commonly paired with Allwinner A23/A33 SoCs.
    It is functionally identical to AXP221; only the regulator default
    voltage/status and the external host interface are different.

    Signed-off-by: Chen-Yu Tsai
    Reviewed-by: Mark Brown
    Signed-off-by: Lee Jones

    Chen-Yu Tsai
     

04 Feb, 2016

2 commits

  • AXP20X datasheet lists the possible voltage settings for LDO4, so
    it was implemented using a voltage table. Upon closer examination,
    the valid voltages can be mapped into 3 linear ranges.

    Move AXP20X LDO4 to use linear ranges. The supporting code can be
    reused with later AXP8xx PMICs, which have a number of regulators
    that have 2 linear ranges.

    Signed-off-by: Chen-Yu Tsai
    Signed-off-by: Mark Brown

    Chen-Yu Tsai
     
  • Switch-type regulators, such as DC1SW on AXP22X, are a secondary output
    from DCDC1. They are just an on/off switch, and the driver should not
    try to read its voltage directly from the DCDC1 control registers.

    Instead, the core will pass down the voltage from the regulator supply
    chain.

    Signed-off-by: Chen-Yu Tsai
    Signed-off-by: Mark Brown

    Chen-Yu Tsai
     

23 Dec, 2015

1 commit

  • The enable/disable values for GPIO LDOs are reversed. It seems no one
    noticed as AXP22x support was introduced recently, and no one was using
    the GPIO LDOs, either because no designs actually use them or board
    support hasn't caught up.

    Fixes: 1b82b4e4f954 ("regulator: axp20x: Add support for AXP22X regulators")
    Signed-off-by: Chen-Yu Tsai
    Signed-off-by: Mark Brown
    Cc: stable@vger.kernel.org

    Chen-Yu Tsai
     

04 Nov, 2015

1 commit


05 Oct, 2015

1 commit

  • The DC1SW and DC5LDO regulators in the AXP22X are internally chained
    to DCDC1 and DCDC5, hence the names. The original bindings used the
    parent regulator names for the supply regulator property.

    Since they are internally connected, the relationship should not be
    represented in the device tree, but handled internally by the driver.

    This patch has the driver remember the regulator names for the parent
    DCDC1/DCDC5, and use them as supply names for DC1SW/DC5LDO.

    Signed-off-by: Chen-Yu Tsai
    Signed-off-by: Mark Brown

    Chen-Yu Tsai
     

30 Sep, 2015

1 commit

  • The enable bit indexes for DCDC4 and DCDC5 regulators are off by 1.

    We haven't run into any problems with this since either the regulators
    aren't defined in the DT and aren't used, or all the DCDC regulators
    have the "always-on" property set, as they are almost always used
    for system critical loads.

    Signed-off-by: Chen-Yu Tsai
    Signed-off-by: Mark Brown
    Cc: stable@vger.kernel.org

    Chen-Yu Tsai
     

05 Aug, 2015

1 commit

  • This allows the module to be autoloaded.

    Together with 07949bf9c63c ("cpufreq: dt: allow driver to boot
    automatically") this is sufficient to allow a modular kernel (such
    as Debian's) to enable cpufreq on a Cubietruck.

    Signed-off-by: Ian Campbell
    Signed-off-by: Mark Brown

    Ian Campbell
     

13 May, 2015

2 commits

  • Add AXP22X regulator definitions and variant id associations.
    This introduces a new "switch" type output for one of the regulators.
    It is a switchable secondary output of one regulator, with the same
    voltage level as the primary output.

    Signed-off-by: Boris BREZILLON
    [wens@csie.org: Moved variant choosing to multi family support patch]
    [wens@csie.org: Add dc-dc work frequency range]
    [wens@csie.org: Add "switch" type output regulator DC1SW]
    Signed-off-by: Chen-Yu Tsai
    Reviewed-by: Mark Brown
    Signed-off-by: Lee Jones

    Boris BREZILLON
     
  • Rework the AXP20X_ macros and probe function to support the several chip
    families, so that each family can define it's own set of regulators.

    Signed-off-by: Boris BREZILLON
    [wens@csie.org: Support different DC-DC work frequency ranges]
    Signed-off-by: Chen-Yu Tsai
    Reviewed-by: Mark Brown
    Signed-off-by: Lee Jones

    Boris BREZILLON
     

10 Jan, 2015

2 commits


20 Oct, 2014

1 commit


23 Sep, 2014

1 commit

  • The current device used for the regulator configuration is the child device
    created by the MFD driver. This means that it doesn't have any of_node pointing
    to it, and whenever we register the regulators, it will not look into the
    regulator supply in the DT, hence requiring to provide regulator aliases in the
    MFD driver.

    We can easily fix that by using the parent device in our configuration, which
    has a DT node associated to it, and will allow a DT lookup. Eventually, we will
    be able to remove the aliases in the MFD driver.

    Signed-off-by: Maxime Ripard
    Signed-off-by: Mark Brown

    Maxime Ripard
     

01 Jun, 2014

1 commit


20 May, 2014

1 commit

  • The of_find_node_by_name function will search for a DT node named
    "regulators" after the provided np node, but will not ensure that this node
    is a child of np.
    This might result in retrieving a "regulators" node that is not related to
    the axp20x PMIC.

    Signed-off-by: Boris BREZILLON
    Acked-by: Carlo Caione
    Signed-off-by: Mark Brown

    Boris BREZILLON
     

15 Apr, 2014

1 commit