12 Jul, 2016

1 commit


13 May, 2016

1 commit


19 Apr, 2016

1 commit

  • Driver did not provide default value for ramp delay for LDOs which lead
    to warning in dmesg, e.g. on Odroid XU4:

    [ 1.486076] vdd_ldo9: ramp_delay not set
    [ 1.506875] vddq_mmc2: ramp_delay not set
    [ 1.523766] vdd_ldo15: ramp_delay not set
    [ 1.544702] vdd_sd: ramp_delay not set

    The datasheet for all the S2MPS1x family is inconsistent here and does
    not specify unambiguously the value of ramp delay for LDO. It mentions
    30 mV/us in one timing diagram but then omits it completely in LDO
    regulator characteristics table (it is specified for bucks).

    However the vendor kernels for Galaxy S5 and Odroid XU3 use values of 12
    mV/us or 24 mV/us.

    Without the ramp delay value the consumers do not wait for voltage
    settle after changing it. Although the proper value of ramp delay for
    LDOs is unknown, it seems safer to use at least some value from
    reference kernel than to leave it unset.

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

    Krzysztof Kozlowski
     

07 Apr, 2016

1 commit

  • The driver's init and exit function don't do anything besides registering
    and unregistering the platform driver, so the module_platform_driver()
    macro could just be used instead of having separate functions.

    Currently the macro is not being used because the driver is initialized at
    subsys init call level but this isn't necessary since consumer devices are
    defined in the DT as dependencies so there's no need for init calls order.

    Signed-off-by: Javier Martinez Canillas
    Signed-off-by: Mark Brown

    Javier Martinez Canillas
     

28 Mar, 2016

1 commit

  • The buck9 regulator of S2MPS11 PMIC had incorrect vsel_mask (0xff
    instead of 0x1f) thus reading entire register as buck9's voltage. This
    effectively caused regulator core to interpret values as higher voltages
    than they were and then to set real voltage much lower than intended.

    The buck9 provides power to other regulators, including LDO13
    and LDO19 which supply the MMC2 (SD card). On Odroid XU3/XU4 the lower
    voltage caused SD card detection errors on Odroid XU3/XU4:
    mmc1: card never left busy state
    mmc1: error -110 whilst initialising SD card

    During driver probe the regulator core was checking whether initial
    voltage matches the constraints. With incorrect vsel_mask of 0xff and
    default value of 0x50, the core interpreted this as 5 V which is outside
    of constraints (3-3.775 V). Then the regulator core was adjusting the
    voltage to match the constraints. With incorrect vsel_mask this new
    voltage mapped to a vere low voltage in the driver.

    Signed-off-by: Krzysztof Kozlowski
    Reviewed-by: Javier Martinez Canillas
    Tested-by: Javier Martinez Canillas
    Signed-off-by: Mark Brown
    Cc:

    Krzysztof Kozlowski
     

20 Feb, 2016

1 commit


18 Feb, 2016

1 commit

  • Following BUILD_BUG_ON using a variable fails for some of the compilers
    and optimization levels (reported for gcc 4.9):
    var = ARRAY_SIZE(s2mps15_regulators);
    BUILD_BUG_ON(S2MPS_REGULATOR_MAX < var);
    Fix this by using ARRAY_SIZE directly.

    Additionally add missing BUILD_BUG_ON check for S2MPS15 device (the
    check ensures that internal arrays are big enough to hold data for all
    of regulators on all devices).

    Reported-by: Arnd Bergmann
    Signed-off-by: Krzysztof Kozlowski
    Tested-by: Arnd Bergmann
    Reviewed-by: Arnd Bergmann
    Signed-off-by: Mark Brown

    Krzysztof Kozlowski
     

24 Nov, 2015

1 commit

  • Currently S2MPSXX multifunction device is named as *-pmic,
    and these MFDs also supports regulator as a one of its MFD cell which
    has the same name, because current name is confusing and we want to
    sort it out.

    We did discussed different approaches about how the MFD and it
    cells need to be named here [1].
    Based in the discussion this patch rename MFD regulator name as
    *-regulator instead of current *-pmic.

    This patch also changes the corresponding entries in the regulator driver
    to keep git-bisect happy.

    [1]-> https://lkml.org/lkml/2015/10/28/417

    Suggested-by: Lee Jones
    Signed-off-by: Alim Akhtar
    Reviewed-by: Krzysztof Kozlowski
    Acked-by: Mark Brown
    Signed-off-by: Lee Jones

    Alim Akhtar
     

23 Nov, 2015

1 commit

  • The S2MPS15 PMIC is similar in functionality to S2MPS11/14 PMIC. It contains
    27 LDO and 10 Buck regulators and allows programming these regulators via a
    I2C interface. This patch adds initial support for LDO/Buck regulators of
    S2MPS15 PMIC.

    Signed-off-by: Thomas Abraham
    Signed-off-by: Alim Akhtar
    Reviewed-by: Krzysztof Kozlowski
    Acked-by: Mark Brown
    Signed-off-by: Lee Jones

    Thomas Abraham
     

24 Jun, 2015

1 commit

  • Status of enabling suspend mode for regulator was stored in bitmap-like
    long integer.

    However since adding support for S2MPU02 the number of regulators
    exceeded 32 so on devices with more than 32 regulators (S2MPU02 and
    S2MPS13) overflow happens when shifting the bit. This could lead to
    enabling suspend mode for completely different regulator than intended
    or to switching different regulator to other mode (e.g. from always
    enabled to controlled by PWRHOLD pin). Both cases could result in larger
    energy usage and issues when suspending to RAM.

    Fixes: 00e2573d2c10 ("regulator: s2mps11: Add support S2MPU02 regulator device")
    Reported-by: Dan Carpenter
    Signed-off-by: Krzysztof Kozlowski
    Signed-off-by: Mark Brown
    Cc:

    Krzysztof Kozlowski
     

28 Apr, 2015

1 commit


16 Jan, 2015

1 commit


09 Jan, 2015

1 commit

  • This patch adds missing registers('BUCK7_SW' & 'LDO29_CTRL'). Since BUCK7 has
    1 more register (BUCK7_SW) than others, register offset should
    be added one more for which has bigger address than BUCK7 registers.

    Fixes: 76b9840b24ae04(regulator: s2mps11: Add support S2MPS13 regulator device)
    Signed-off-by: Jonghwa Lee
    Signed-off-by: Chanwoo Choi
    Signed-off-by: Mark Brown
    Cc:

    Jonghwa Lee
     

30 Dec, 2014

1 commit


15 Dec, 2014

1 commit

  • Pull driver core update from Greg KH:
    "Here's the set of driver core patches for 3.19-rc1.

    They are dominated by the removal of the .owner field in platform
    drivers. They touch a lot of files, but they are "simple" changes,
    just removing a line in a structure.

    Other than that, a few minor driver core and debugfs changes. There
    are some ath9k patches coming in through this tree that have been
    acked by the wireless maintainers as they relied on the debugfs
    changes.

    Everything has been in linux-next for a while"

    * tag 'driver-core-3.19-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core: (324 commits)
    Revert "ath: ath9k: use debugfs_create_devm_seqfile() helper for seq_file entries"
    fs: debugfs: add forward declaration for struct device type
    firmware class: Deletion of an unnecessary check before the function call "vunmap"
    firmware loader: fix hung task warning dump
    devcoredump: provide a one-way disable function
    device: Add dev__once variants
    ath: ath9k: use debugfs_create_devm_seqfile() helper for seq_file entries
    ath: use seq_file api for ath9k debugfs files
    debugfs: add helper function to create device related seq_file
    drivers/base: cacheinfo: remove noisy error boot message
    Revert "core: platform: add warning if driver has no owner"
    drivers: base: support cpu cache information interface to userspace via sysfs
    drivers: base: add cpu_device_create to support per-cpu devices
    topology: replace custom attribute macros with standard DEVICE_ATTR*
    cpumask: factor out show_cpumap into separate helper function
    driver core: Fix unbalanced device reference in drivers_probe
    driver core: fix race with userland in device_add()
    sysfs/kernfs: make read requests on pre-alloc files use the buffer.
    sysfs/kernfs: allow attributes to request write buffer be pre-allocated.
    fs: sysfs: return EGBIG on write if offset is larger than file size
    ...

    Linus Torvalds
     

12 Dec, 2014

1 commit

  • Invalid buck4 configuration for linear mapping of voltage in S2MPS14
    regulators caused boot failure on Gear 2 (dw_mmc-exynos):

    [ 3.569137] EXT4-fs (mmcblk0p15): mounted filesystem with ordered data mode. Opts: (null)
    [ 3.571716] VFS: Mounted root (ext4 filesystem) readonly on device 179:15.
    [ 3.629842] mmcblk0: error -110 sending status command, retrying
    [ 3.630244] mmcblk0: error -110 sending status command, retrying
    [ 3.636292] mmcblk0: error -110 sending status command, aborting

    Buck4 voltage regulator has different minimal voltage value than other
    bucks. Commit merging multiple regulator description macros caused to
    use linear_min_sel from buck[1235] regulators as value for buck4. This
    lead to lower voltage of buck4 than required.

    Output of the buck4 is used internally as power source for
    LDO{3,4,7,11,19,20,21,23}. On Gear 2 board LDO11 is used as MMC
    regulator (V_EMMC_1.8V).

    Fixes: 5a867cf28893 ("regulator: s2mps11: Optimize the regulator description macro")
    Signed-off-by: Krzysztof Kozlowski
    Signed-off-by: Mark Brown
    Cc:

    Krzysztof Kozlowski
     

09 Dec, 2014

1 commit

  • Pull regulator updates from Mark Brown:
    "The main thing this time around is support for suspend mode
    configuration from DT which will enable some very useful power savings
    on systems where we can't rely on the bootloader configuration. We
    still don't really support dynamic configuration of this at runtime,
    that may come later if there is any demand.

    Summary:
    - Support for specifying the target regulation mode and voltage
    during system suspend via DT, enabling power savings in that mode.
    - Reduce the default verbosity of the logging on boot, improving boot
    times especially for systems with very large numbers of regulators.
    - Lots of cleanups and fixes for Maxim PMIC drivers.
    - New driver for Richtek RT5033"

    * tag 'regulator-v3.19' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/regulator: (62 commits)
    regulator: core: Fix regualtor_ena_gpio_free not to access pin after freeing
    regulator: sky81452: Modify Device Tree structure
    regulator: sky81452: Modify Device Tree structure
    dt-bindings: Update documentation for "system-power-controller" and fix misspellings
    of: Rename "poweroff-source" property to "system-power-controller"
    regulator: max77686: Remove support for board files
    regulator: max77802: Remove support for board files
    regulator: max77802: Fill regulator modes translation callback
    regulator: max77802: Document binding for regulator operating modes
    regulator: of: Add support for parsing initial and suspend modes
    regulator: of: Pass the regulator description in the match table
    regulator: of: Add regulator desc param to of_get_regulator_init_data()
    regulator: Add mode mapping function to struct regulator_desc
    regulator: Document binding for initial and suspend modes
    regulator: core: Add PRE_DISABLE notification
    regulator: gpio: fix parsing of gpio list
    regulator: rpm: add support for RPM-controller SMB208
    regulator: da9063: Do not transform local IRQ to virtual
    regulator: sky81452: Modify dependent Kconfig symbol
    regulator: rt5033: Add RT5033 Regulator device driver
    ...

    Linus Torvalds
     

05 Dec, 2014

1 commit


25 Nov, 2014

1 commit

  • This patch adds S2MPS13 regulator device to existing S2MPS11 device driver.
    The S2MPS13 has just different number of regulators from S2MPS14.
    The S2MPS13 regulator device includes LDO[1-40] and BUCK[1-10].

    Signed-off-by: Chanwoo Choi
    Acked-by: Sangbeom Kim
    Acked-by: Mark Brown
    Reviewed-by: Krzysztof Kozlowski
    Signed-off-by: Lee Jones

    Chanwoo Choi
     

07 Nov, 2014

1 commit


20 Oct, 2014

2 commits


17 Aug, 2014

2 commits

  • This patch makes the regulator description macro take minimum and
    steps voltage as parameter. In this way many repeated macros can be
    removed. Now these macros are repeated only if the the LDO/BUCK ctrl
    registers have non-linear positions. The good thing is these ctrl registers
    are mostly linear so they are not passed as parameters.

    This patch reduces the code size and also allow easy addition of more
    s2mpxxx PMIC drivers which differs a lot in minimum/step voltages.

    Reviewed-by: Krzysztof Kozlowski
    Signed-off-by: Amit Daniel Kachhap
    Signed-off-by: Mark Brown

    Amit Daniel Kachhap
     
  • This is a cleanup patch and moves min/step voltages in a common samsung
    header file so that they can be used by other s2mpxxx PMIC drivers. Only
    few required macros are added currently and others can be added if needed.

    Reviewed-by: Krzysztof Kozlowski
    Signed-off-by: Amit Daniel Kachhap
    Acked-by: Lee Jones
    Signed-off-by: Mark Brown

    Amit Daniel Kachhap
     

08 Aug, 2014

1 commit

  • Pull MFD update from Lee Jones:
    "Changes to existing drivers:
    - checkpatch fixes throughout the subsystem
    - use Regmap to handle IRQs in max77686, extcon-max77693 and
    mc13xxx-core
    - use DMA in rtsx_pcr
    - restrict building on unsupported architectures on timberdale,
    cs5535
    - SPI hardening in cros_ec_spi
    - more robust error handing in asic3, cros_ec, ab8500-debugfs,
    max77686 and pcf50633-core
    - reorder PM runtime and regulator handing during shutdown in arizona
    - enable wakeup in cros_ec_spi
    - unused variable/code clean-up in pm8921-core, cros_ec, htc-i2cpld,
    tps65912-spi, wm5110-tables and ab8500-debugfs
    - add regulator handing into suspend() in sec-core
    - remove pointless wrapper functions in extcon-max77693 and
    i2c-cros-ec-tunnel
    - use cross-architecture friendly data sizes in stmpe-i2c, arizona,
    max77686 and tps65910
    - devicetree documentation updates throughout
    - provide power management support in max77686
    - few OF clean-ups in max77686
    - use manged resources in tps6105x

    New drivers/supported devices:
    - add support for s2mpu02 to sec-core
    - add support for Allwinner A32 to sun6i-prcm
    - add support for Maxim 77802 in max77686
    - add support for DA9063 AD in da9063
    - new driver for Intel PMICs (generic) and specifically Crystal Cove

    (Re-)moved drivers ==
    - move out keyboard functionality cros_ec ==> input/keyboard/cros_ec_keyb"

    * tag 'mfd-for-linus-3.17' of git://git.kernel.org/pub/scm/linux/kernel/git/lee/mfd: (101 commits)
    MAINTAINERS: Update MFD repo location
    mfd: omap-usb-host: Fix improper mask use.
    mfd: arizona: Only free the CTRLIF_ERR IRQ if we requested it
    mfd: arizona: Add missing handling for ISRC3 under/overclocked
    mfd: wm5110: Add new interrupt register definitions
    mfd: arizona: Rename thermal shutdown interrupt
    mfd: wm5110: Add in the output done interrupts
    mfd: wm5110: Remove non-existant interrupts
    mfd: tps65912-spi: Remove unused variable
    mfd: htc-i2cpld: Remove unused code
    mfd: da9063: Add support for AD silicon variant
    mfd: arizona: Map MICVDD from extcon device to the Arizona core
    mfd: arizona: Add MICVDD to mapped regulators for wm8997
    mfd: max77686: Ensure device type IDs are architecture agnostic
    mfd: max77686: Add Maxim 77802 PMIC support
    mfd: tps6105x: Use managed resources when allocating memory
    mfd: wm8997-tables: Suppress 'line over 80 chars' warnings
    mfd: kempld-core: Correct a variety of checkpatch warnings
    mfd: ipaq-micro: Fix coding style errors/warnings reported by checkpatch
    mfd: si476x-cmd: Remedy checkpatch style complains
    ...

    Linus Torvalds
     

26 Jul, 2014

1 commit


09 Jul, 2014

1 commit

  • This patch add S2MPU02 regulator device to existing S2MPS11 device driver
    because of little difference between S2MPS1x and S2MPU02. The S2MPU02
    regulator device includes LDO[1-28] and BUCK[1-7].

    Signed-off-by: Chanwoo Choi
    [Add missing linear_min_sel of S2MPU02 LDO regulators by Jonghwa Lee]
    Signed-off-by: Jonghwa Lee
    Reviewed-by: Krzysztof Kozlowski
    Acked-by: Mark Brown
    Acked-by: Lee Jones

    Signed-off-by: Lee Jones

    Chanwoo Choi
     

17 May, 2014

1 commit

  • S2MPS11 supports enabling/disabling ramp delay only for buck[2346].
    Other bucks have ramp delay enabled always.

    However the bit shift for enabling buck6 ramp delay in register is equal
    to 0. When ramp delay was set for the bucks unsupporting enable/disable
    (buck[15789] and buck10), the ramp delay for buck6 was also enabled.

    Fixes: b96244fad953 ("regulator: s2mps11: Don't check enable_shift before setting enable ramp rate")
    Signed-off-by: Krzysztof Kozlowski
    Reviewed-by: Axel Lin
    Signed-off-by: Mark Brown

    Krzysztof Kozlowski
     

02 May, 2014

1 commit


15 Apr, 2014

2 commits

  • Add support for external control over GPIO for LDO10, LDO11 and LDO12
    S2MPS14 regulators. External control can be turned on by writing 0x0 to
    control register which in case of other regulators is used for disabling
    them. These LDO10-LDO12 regulators can be disabled only by I2C GPIO or
    PWREN pin so the patch actually allows proper way of disabling them.

    Additionally the GPIO control has two benefits:
    - It is faster than toggling it over I2C bus.
    - It allows disabling the regulator during suspend to RAM; The AP will
    enable it during resume.

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

    Krzysztof Kozlowski
     
  • Refactor code for parsing DTS to increase a little code readability. The
    behaviour should not change.

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

    Krzysztof Kozlowski
     

03 Apr, 2014

1 commit


27 Mar, 2014

2 commits


19 Mar, 2014

4 commits


04 Mar, 2014

1 commit

  • Remove __initconst from regulator_desc array because this array is used
    during probe and s2mps11_pmic_probe() is not in __init section. However
    still select the number of supported regulators according to device ID
    so the driver will be ready for adding support for S2MPS14 device.

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

    Krzysztof Kozlowski
     

03 Mar, 2014

1 commit

  • Add __initconst to 'regulator_desc' array with supported regulators.
    During probe choose how many and which regulators will be supported
    according to device ID. Then copy the 'regulator_desc' array to
    allocated memory so the regulator core can use it.

    Additionally allocate array of of_regulator_match() dynamically (based
    on number of regulators) instead of allocation on the stack.

    This is needed for supporting different devices in s2mps11
    driver and actually prepares the regulator driver for supporting the
    S2MPS14 device.

    Code for supporting the S2MPS14 device will add its own array of
    'regulator_desc' (also marked as __initconst). This way memory footprint
    of the driver will be reduced (approximately 'regulators_desc' array for
    S2MPS11 occupies 5 kB on 32-bit ARM, for S2MPS14 will occupy 3 kB).

    Signed-off-by: Krzysztof Kozlowski
    Signed-off-by: Chanwoo Choi
    Cc: Yadwinder Singh Brar
    Reviewed-by: Yadwinder Singh Brar
    Signed-off-by: Mark Brown

    Krzysztof Kozlowski