09 Jul, 2020

1 commit


24 Oct, 2019

1 commit

  • …git/broonie/regulator

    Pull regulator fixes from Mark Brown:
    "There are a few core fixes here around error handling and handling if
    suspend mode configuration and some driver specific fixes here but the
    most important change is the fix to the fixed-regulator DT schema
    conversion introduced during the last merge window.

    That fixes one of the last two errors preventing successful execution
    of "make dt_binding_check" which will be enormously helpful for DT
    schema development"

    * tag 'regulator-fix-v5.4-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/regulator:
    regulator: qcom-rpmh: Fix PMIC5 BoB min voltage
    regulator: pfuze100-regulator: Variable "val" in pfuze100_regulator_probe() could be uninitialized
    regulator: lochnagar: Add on_off_delay for VDDCORE
    regulator: ti-abb: Fix timeout in ti_abb_wait_txdone/ti_abb_clear_all_txdone
    regulator: da9062: fix suspend_enable/disable preparation
    dt-bindings: fixed-regulator: fix compatible enum
    regulator: fixed: Prevent NULL pointer dereference when !CONFIG_OF
    regulator: core: make regulator_register() EPROBE_DEFER aware
    regulator: of: fix suspend-min/max-voltage parsing

    Linus Torvalds
     

18 Sep, 2019

1 commit

  • …anaszewski/linux-leds

    Pull LED updates from Jacek Anaszewski:
    "In this cycle we've finally managed to contribute the patch set
    sorting out LED naming issues. Besides that there are many changes
    scattered among various LED class drivers and triggers.

    LED naming related improvements:

    - add new 'function' and 'color' fwnode properties and deprecate
    'label' property which has been frequently abused for conveying
    vendor specific names that have been available in sysfs anyway

    - introduce a set of standard LED_FUNCTION* definitions

    - introduce a set of standard LED_COLOR_ID* definitions

    - add a new {devm_}led_classdev_register_ext() API with the
    capability of automatic LED name composition basing on the
    properties available in the passed fwnode; the function is
    backwards compatible in a sense that it uses 'label' data, if
    present in the fwnode, for creating LED name

    - add tools/leds/get_led_device_info.sh script for retrieving LED
    vendor, product and bus names, if applicable; it also performs
    basic validation of an LED name

    - update following drivers and their DT bindings to use the new LED
    registration API:

    - leds-an30259a, leds-gpio, leds-as3645a, leds-aat1290, leds-cr0014114,
    leds-lm3601x, leds-lm3692x, leds-lp8860, leds-lt3593, leds-sc27xx-blt

    Other LED class improvements:

    - replace {devm_}led_classdev_register() macros with inlines

    - allow to call led_classdev_unregister() unconditionally

    - switch to use fwnode instead of be stuck with OF one

    LED triggers improvements:

    - led-triggers:
    - fix dereferencing of null pointer
    - fix a memory leak bug

    - ledtrig-gpio:
    - GPIO 0 is valid

    Drop superseeded apu2/3 support from leds-apu since for apu2+ a newer,
    more complete driver exists, based on a generic driver for the AMD
    SOCs gpio-controller, supporting LEDs as well other devices:

    - drop profile field from priv data

    - drop iosize field from priv data

    - drop enum_apu_led_platform_types

    - drop superseeded apu2/3 led support

    - add pr_fmt prefix for better log output

    - fix error message on probing failure

    Other misc fixes and improvements to existing LED class drivers:

    - leds-ns2, leds-max77650:
    - add of_node_put() before return

    - leds-pwm, leds-is31fl32xx:
    - use struct_size() helper

    - leds-lm3697, leds-lm36274, leds-lm3532:
    - switch to use fwnode_property_count_uXX()

    - leds-lm3532:
    - fix brightness control for i2c mode
    - change the define for the fs current register
    - fixes for the driver for stability
    - add full scale current configuration
    - dt: Add property for full scale current.
    - avoid potentially unpaired regulator calls
    - move static keyword to the front of declarations
    - fix optional led-max-microamp prop error handling

    - leds-max77650:
    - add of_node_put() before return
    - add MODULE_ALIAS()
    - Switch to fwnode property API

    - leds-as3645a:
    - fix misuse of strlcpy

    - leds-netxbig:
    - add of_node_put() in netxbig_leds_get_of_pdata()
    - remove legacy board-file support

    - leds-is31fl319x:
    - simplify getting the adapter of a client

    - leds-ti-lmu-common:
    - fix coccinelle issue
    - move static keyword to the front of declaration

    - leds-syscon:
    - use resource managed variant of device register

    - leds-ktd2692:
    - fix a typo in the name of a constant

    - leds-lp5562:
    - allow firmware files up to the maximum length

    - leds-an30259a:
    - fix typo

    - leds-pca953x:
    - include the right header"

    * tag 'leds-for-5.4-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/j.anaszewski/linux-leds: (72 commits)
    leds: lm3532: Fix optional led-max-microamp prop error handling
    led: triggers: Fix dereferencing of null pointer
    leds: ti-lmu-common: Move static keyword to the front of declaration
    leds: lm3532: Move static keyword to the front of declarations
    leds: trigger: gpio: GPIO 0 is valid
    leds: pwm: Use struct_size() helper
    leds: is31fl32xx: Use struct_size() helper
    leds: ti-lmu-common: Fix coccinelle issue in TI LMU
    leds: lm3532: Avoid potentially unpaired regulator calls
    leds: syscon: Use resource managed variant of device register
    leds: Replace {devm_}led_classdev_register() macros with inlines
    leds: Allow to call led_classdev_unregister() unconditionally
    leds: lm3532: Add full scale current configuration
    dt: lm3532: Add property for full scale current.
    leds: lm3532: Fixes for the driver for stability
    leds: lm3532: Change the define for the fs current register
    leds: lm3532: Fix brightness control for i2c mode
    leds: Switch to use fwnode instead of be stuck with OF one
    leds: max77650: Switch to fwnode property API
    led: triggers: Fix a memory leak bug
    ...

    Linus Torvalds
     

17 Sep, 2019

2 commits

  • Sometimes it can happen that the regulator_of_get_init_data() can't
    retrieve the config due to a not probed device the regulator depends on.
    Fix that by checking the return value of of_parse_cb() and return
    EPROBE_DEFER in such cases.

    Signed-off-by: Marco Felsch
    Link: https://lore.kernel.org/r/20190917154021.14693-4-m.felsch@pengutronix.de
    Signed-off-by: Mark Brown

    Marco Felsch
     
  • Currently the regulator-suspend-min/max-microvolt must be within the
    root regulator node but the dt-bindings specifies it as subnode
    properties for the regulator-state-[mem/disk/standby] node. The only DT
    using this bindings currently is the at91-sama5d2_xplained.dts and this
    DT uses it correctly. I don't know if it isn't tested but it can't work
    without this fix.

    Fixes: f7efad10b5c4 ("regulator: add PM suspend and resume hooks")
    Signed-off-by: Marco Felsch
    Link: https://lore.kernel.org/r/20190917154021.14693-3-m.felsch@pengutronix.de
    Signed-off-by: Mark Brown

    Marco Felsch
     

01 Aug, 2019

1 commit

  • The local variable search in regulator_of_get_init_node takes the value
    returned by either of_get_child_by_name or of_node_get, both of which
    get a node. If this node is not put before returning, it could cause a
    memory leak. Hence put search before a mid-loop return statement.
    Issue found with Coccinelle.

    Signed-off-by: Nishka Dasgupta
    Link: https://lore.kernel.org/r/20190724083231.10276-1-nishkadg.linux@gmail.com
    Signed-off-by: Mark Brown

    Nishka Dasgupta
     

30 Jul, 2019

1 commit

  • Introduce wrappers for {bus/driver/class}_find_device() to
    locate devices by its of_node.

    Cc: Maarten Lankhorst
    Cc: Maxime Ripard
    Cc: dri-devel@lists.freedesktop.org
    Cc: David Airlie
    Cc: Daniel Vetter
    Cc: devicetree@vger.kernel.org
    Cc: Florian Fainelli
    Cc: Frank Rowand
    Cc: Heiko Stuebner
    Cc: Liam Girdwood
    Cc: linux-i2c@vger.kernel.org
    Cc: linux-rockchip@lists.infradead.org
    Cc: linux-spi@vger.kernel.org
    Cc: Mathieu Poirier
    Cc: Rob Herring
    Cc: Srinivas Kandagatla
    Cc: Takashi Iwai
    Cc: Alan Tull
    Cc: linux-fpga@vger.kernel.org
    Cc: Peter Rosin
    Cc: Florian Fainelli
    Cc: Heiner Kallweit
    Cc: "David S. Miller"
    Cc: Andrew Lunn
    Cc: Liam Girdwood
    Cc: "Rafael J. Wysocki"
    Cc: Thor Thayer
    Cc: Jiri Slaby
    Cc: Andrew Lunn
    Cc: Peter Rosin
    Signed-off-by: Suzuki K Poulose
    Acked-by: Lee Jones
    Acked-by: Wolfram Sang # I2C part
    Acked-by: Moritz Fischer # For FPGA part
    Acked-by: Mark Brown
    Link: https://lore.kernel.org/r/20190723221838.12024-3-suzuki.poulose@arm.com
    Signed-off-by: Greg Kroah-Hartman

    Suzuki K Poulose
     

05 Jul, 2019

1 commit


25 Jun, 2019

1 commit

  • Right now regulator core supports only one type of regulators coupling,
    the "voltage max-spread" which keeps voltages of coupled regulators in a
    given range from each other. A more sophisticated coupling may be required
    in practice, one example is the NVIDIA Tegra SoCs which besides the
    max-spreading have other restrictions that must be adhered. Introduce API
    that allow platforms to provide their own customized coupling algorithms.

    Signed-off-by: Dmitry Osipenko
    Signed-off-by: Mark Brown

    Dmitry Osipenko
     

31 May, 2019

1 commit

  • Based on 1 normalized pattern(s):

    this program is free software you can redistribute it and or modify
    it under the terms of the gnu general public license as published by
    the free software foundation either version 2 of the license or at
    your option any later version

    extracted by the scancode license scanner the SPDX license identifier

    GPL-2.0-or-later

    has been chosen to replace the boilerplate/reference in 3029 file(s).

    Signed-off-by: Thomas Gleixner
    Reviewed-by: Allison Randal
    Cc: linux-spdx@vger.kernel.org
    Link: https://lkml.kernel.org/r/20190527070032.746973796@linutronix.de
    Signed-off-by: Greg Kroah-Hartman

    Thomas Gleixner
     

21 Mar, 2019

1 commit


08 Jan, 2019

1 commit


05 Dec, 2018

2 commits


19 Nov, 2018

1 commit


14 Nov, 2018

1 commit


09 Nov, 2018

1 commit

  • On NVIDIA Tegra30 there is a requirement for regulator "A" to have voltage
    higher than voltage of regulator "B" by N microvolts, the N value changes
    depending on the voltage of regulator "B". This is similar to min-spread
    between voltages of regulators, the difference is that the spread value
    isn't fixed. This means that extra carefulness is required for regulator
    "A" to drop its voltage without violating the requirement, hence its
    voltage should be changed in steps so that its couple "B" could follow
    (there is also max-spread requirement).

    Add new "max_uV_step" constraint that breaks voltage change into several
    steps, each step is limited by the max_uV_step value.

    Signed-off-by: Dmitry Osipenko
    Signed-off-by: Mark Brown

    Dmitry Osipenko
     

28 Sep, 2018

1 commit

  • regulator: Fixes for 4.19

    A collection of fairly minor bug fixes here, a couple of driver specific
    ones plus two core fixes. There's one fix for the new suspend state
    code which fixes some confusion with constant values that are supposed
    to indicate noop operation and another fixing a race condition with the
    creation of sysfs files on new regulators.

    Mark Brown
     

03 Sep, 2018

1 commit

  • Some regulators don't have all states defined and in such cases regulator
    core should not assume anything. However in current implementation
    of of_get_regulation_constraints() DO_NOTHING_IN_SUSPEND enable value was
    set only for regulators which had suspend node defined, otherwise the
    default 0 value was used, what means DISABLE_IN_SUSPEND. This lead to
    broken system suspend/resume on boards, which had simple regulator
    constraints definition (without suspend state nodes).

    To avoid further mismatches between the default and uninitialized values
    of the suspend enabled/disabled states, change the values of the them,
    so default '0' means DO_NOTHING_IN_SUSPEND.

    Fixes: 72069f9957a1: regulator: leave one item to record whether regulator is enabled
    Signed-off-by: Marek Szyprowski
    Signed-off-by: Mark Brown
    Cc: stable@vger.kernel.org

    Marek Szyprowski
     

29 Aug, 2018

1 commit


17 May, 2018

2 commits

  • On Odroid XU3/4 and other Exynos5422 based boards there is a case, that
    different devices on the board are supplied by different regulators
    with non-fixed voltages. If one of these devices temporarily requires
    higher voltage, there might occur a situation that the spread between
    devices' voltages is so high, that there is a risk of changing
    'high' and 'low' states on the interconnection between devices powered
    by those regulators.

    Add new structure "coupling_desc" to regulator_dev, which contains
    pointers to all coupled regulators including the owner of the structure,
    number of coupled regulators and counter of currently resolved
    regulators.

    Add of_functions to parse all data needed in regulator coupling.
    Provide method to check DTS data consistency. Check if each coupled
    regulator's max_spread is equal and if their lists of regulators match.

    Signed-off-by: Maciej Purski
    Signed-off-by: Mark Brown

    Maciej Purski
     
  • Add support for configuring the machine constraints
    valid_modes_mask element based on a list of allowed modes
    specified via a device tree property.

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

    David Collins
     

20 Apr, 2018

1 commit

  • In of_get_regulation_constraints() we were taking the result of
    of_map_mode() (an unsigned int) and assigning it to an int. We were
    then checking whether this value was -EINVAL. Some implementers of
    of_map_mode() were returning -EINVAL (even though the return type of
    their function needed to be unsigned int) because they needed to
    signal an error back to of_get_regulation_constraints().

    In general in the regulator framework the mode is always referred to
    as an unsigned int. While we could fix this to be a signed int (the
    highest value we store in there right now is 0x8), it's actually
    pretty clean to just define the regulator mode 0x0 (the lack of any
    bits set) as an invalid mode. Let's do that.

    Fixes: 5e5e3a42c653 ("regulator: of: Add support for parsing initial and suspend modes")
    Suggested-by: Javier Martinez Canillas
    Signed-off-by: Douglas Anderson
    Reviewed-by: Javier Martinez Canillas
    Signed-off-by: Mark Brown

    Douglas Anderson
     

12 Feb, 2018

1 commit


27 Jan, 2018

1 commit


26 Jan, 2018

3 commits

  • As of_find_regulator_by_node() is an of function it should be moved from
    core.c to of_regulator.c. It provides better separation of device tree
    functions from the core and allows other of_functions in of_regulator.c
    to resolve device_node to regulator_dev. This will be useful for
    implementation of parsing coupled regulators properties.

    Declare of_find_regulator_by_node() function in internal.h as well as
    regulator_class and dev_to_rdev(), as they are needed by
    of_find_regulator_by_node().

    Signed-off-by: Maciej Purski
    Signed-off-by: Mark Brown

    Maciej Purski
     
  • In this patch, consumers are allowed to set suspend voltage, and this
    actually just set the "uV" in constraint::regulator_state, when the
    regulator_suspend_late() was called by PM core through callback when
    the system is entering into suspend, the regulator device would act
    suspend activity then.

    And it assumes that if any consumer set suspend voltage, the regulator
    device should be enabled in the suspend state. And if the suspend
    voltage of a regulator device for all consumers was set zero, the
    regulator device would be off in the suspend state.

    This patch also provides a new function hook to regulator devices for
    resuming from suspend states.

    Signed-off-by: Chunyan Zhang
    Signed-off-by: Mark Brown

    Chunyan Zhang
     
  • The items "disabled" and "enabled" are a little redundant, since only one
    of them would be set to record if the regulator device should keep on
    or be switched to off in suspend states.

    So in this patch, the "disabled" was removed, only leave the "enabled":
    - enabled == 1 for regulator-on-in-suspend
    - enabled == 0 for regulator-off-in-suspend
    - enabled == -1 means do nothing when entering suspend mode.

    Signed-off-by: Chunyan Zhang
    Signed-off-by: Mark Brown

    Chunyan Zhang
     

06 Sep, 2017

1 commit

  • Pull power management updates from Rafael Wysocki:
    "This time (again) cpufreq gets the majority of changes which mostly
    are driver updates (including a major consolidation of intel_pstate),
    some schedutil governor modifications and core cleanups.

    There also are some changes in the system suspend area, mostly related
    to diagnostics and debug messages plus some renames of things related
    to suspend-to-idle. One major change here is that suspend-to-idle is
    now going to be preferred over S3 on systems where the ACPI tables
    indicate to do so and provide requsite support (the Low Power Idle S0
    _DSM in particular). The system sleep documentation and the tools
    related to it are updated too.

    The rest is a few cpuidle changes (nothing major), devfreq updates,
    generic power domains (genpd) framework updates and a few assorted
    modifications elsewhere.

    Specifics:

    - Drop the P-state selection algorithm based on a PID controller from
    intel_pstate and make it use the same P-state selection method
    (based on the CPU load) for all types of systems in the active mode
    (Rafael Wysocki, Srinivas Pandruvada).

    - Rework the cpufreq core and governors to make it possible to take
    cross-CPU utilization updates into account and modify the schedutil
    governor to actually do so (Viresh Kumar).

    - Clean up the handling of transition latency information in the
    cpufreq core and untangle it from the information on which drivers
    cannot do dynamic frequency switching (Viresh Kumar).

    - Add support for new SoCs (MT2701/MT7623 and MT7622) to the mediatek
    cpufreq driver and update its DT bindings (Sean Wang).

    - Modify the cpufreq dt-platdev driver to autimatically create
    cpufreq devices for the new (v2) Operating Performance Points (OPP)
    DT bindings and update its whitelist of supported systems (Viresh
    Kumar, Shubhrajyoti Datta, Marc Gonzalez, Khiem Nguyen, Finley
    Xiao).

    - Add support for Ux500 to the cpufreq-dt driver and drop the
    obsolete dbx500 cpufreq driver (Linus Walleij, Arnd Bergmann).

    - Add new SoC (R8A7795) support to the cpufreq rcar driver (Khiem
    Nguyen).

    - Fix and clean up assorted issues in the cpufreq drivers and core
    (Arvind Yadav, Christophe Jaillet, Colin Ian King, Gustavo Silva,
    Julia Lawall, Leonard Crestez, Rob Herring, Sudeep Holla).

    - Update the IO-wait boost handling in the schedutil governor to make
    it less aggressive (Joel Fernandes).

    - Rework system suspend diagnostics to make it print fewer messages
    to the kernel log by default, add a sysfs knob to allow more
    suspend-related messages to be printed and add Low Power S0 Idle
    constraints checks to the ACPI suspend-to-idle code (Rafael
    Wysocki, Srinivas Pandruvada).

    - Prefer suspend-to-idle over S3 on ACPI-based systems with the
    ACPI_FADT_LOW_POWER_S0 flag set and the Low Power Idle S0 _DSM
    interface present in the ACPI tables (Rafael Wysocki).

    - Update documentation related to system sleep and rename a number of
    items in the code to make it cleare that they are related to
    suspend-to-idle (Rafael Wysocki).

    - Export a variable allowing device drivers to check the target
    system sleep state from the core system suspend code (Florian
    Fainelli).

    - Clean up the cpuidle subsystem to handle the polling state on x86
    in a more straightforward way and to use %pOF instead of full_name
    (Rafael Wysocki, Rob Herring).

    - Update the devfreq framework to fix and clean up a few minor issues
    (Chanwoo Choi, Rob Herring).

    - Extend diagnostics in the generic power domains (genpd) framework
    and clean it up slightly (Thara Gopinath, Rob Herring).

    - Fix and clean up a couple of issues in the operating performance
    points (OPP) framework (Viresh Kumar, Waldemar Rymarkiewicz).

    - Add support for RV1108 to the rockchip-io Adaptive Voltage Scaling
    (AVS) driver (David Wu).

    - Fix the usage of notifiers in CPU power management on some
    platforms (Alex Shi).

    - Update the pm-graph system suspend/hibernation and boot profiling
    utility (Todd Brandt).

    - Make it possible to run the cpupower utility without CPU0 (Prarit
    Bhargava)"

    * tag 'pm-4.14-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm: (87 commits)
    cpuidle: Make drivers initialize polling state
    cpuidle: Move polling state initialization code to separate file
    cpuidle: Eliminate the CPUIDLE_DRIVER_STATE_START symbol
    cpufreq: imx6q: Fix imx6sx low frequency support
    cpufreq: speedstep-lib: make several arrays static, makes code smaller
    PM: docs: Delete the obsolete states.txt document
    PM: docs: Describe high-level PM strategies and sleep states
    PM / devfreq: Fix memory leak when fail to register device
    PM / devfreq: Add dependency on PM_OPP
    PM / devfreq: Move private devfreq_update_stats() into devfreq
    PM / devfreq: Convert to using %pOF instead of full_name
    PM / AVS: rockchip-io: add io selectors and supplies for RV1108
    cpufreq: ti: Fix 'of_node_put' being called twice in error handling path
    cpufreq: dt-platdev: Drop few entries from whitelist
    cpufreq: dt-platdev: Automatically create cpufreq device with OPP v2
    ARM: ux500: don't select CPUFREQ_DT
    cpuidle: Convert to using %pOF instead of full_name
    cpufreq: Convert to using %pOF instead of full_name
    PM / Domains: Convert to using %pOF instead of full_name
    cpufreq: Cap the default transition delay value to 10 ms
    ...

    Linus Torvalds
     

11 Aug, 2017

1 commit


19 Jul, 2017

1 commit

  • Boot fails for qcom-apq8074-dragonboard on 4.13-rc1 with error:
    OF: ERROR: Bad of_node_put() on /soc/spmi@fc4cf000/pm8941@1/regulators

    The error will occur if the configuration is set to:
    CONFIG_OF_OVERLAY y
    CONFIG_OF_UNITTEST y
    CONFIG_OF_DYNAMIC y
    CONFIG_OF_RESOLVE y

    If CONFIG_OF_DYNAMIC is enabled then of_node_release() detects an
    attempt to release a node that is still attached to the device tree.

    Signed-off-by: Frank Rowand
    Signed-off-by: Mark Brown

    Frank Rowand
     

17 May, 2017

1 commit


06 Apr, 2017

1 commit

  • Some regulators (some PWM regulators) have the voltage transition
    non-linear i.e. exponentially. On such cases, the settling time
    for voltage transition can not be presented in the voltage-ramp-delay.

    Add new property for non-linear voltage transition and handle this
    in getting the voltage settling time.

    Signed-off-by: Laxman Dewangan
    Signed-off-by: Mark Brown

    Laxman Dewangan
     

22 Jun, 2016

1 commit

  • Setup initial suspend state to mem, if suspend state is defined for
    mem state. This makes sure that the regulators are in proper mode
    already from boot.

    Signed-off-by: Tero Kristo
    Signed-off-by: Dave Gerlach
    Signed-off-by: Keerthy
    Signed-off-by: Mark Brown

    Keerthy
     

30 Mar, 2016

1 commit


27 Mar, 2016

1 commit

  • Currently we only attempt to set the voltage during constraints
    application if an exact voltage is specified. Extend this so that if
    the currently set voltage for the regulator is outside the bounds set in
    constraints we will move the voltage to the nearest constraint, raising
    to the minimum or lowering to the maximum as needed. This ensures that
    drivers can probe without the hardware being driven out of spec.

    Reported-by: Ivaylo Dimitrov
    Tested-by: Ivaylo Dimitrov
    Signed-off-by: Mark Brown

    Mark Brown
     

22 Mar, 2016

1 commit


13 Mar, 2016

1 commit


12 Mar, 2016

1 commit


02 Mar, 2016

1 commit