31 Mar, 2020

1 commit

  • Pull spi and regulator updates from Mark Brown:
    "At one point in the release cycle I managed to fat finger things and
    apply some SPI fixes onto a regulator branch and merge that into the
    SPI tree, then pull in a change shared with the MTD tree moving the
    Mediatek quadspi driver over to become the Mediatek spi-nor driver in
    the SPI tree.

    This has made a mess which I only just noticed while preparing this
    and I can't see a sensible way to unpick things due to other
    subsequent merge commits especially the pull from MTD so it looks like
    the most sensible thing to do is give up and combine the two pull
    requests.

    Fortunately both subsystems were fairly quiet this cycle, the
    highlights are:

    regulator:

    - Support for Monoloithic Power Systems MP5416, MP8867 and MPS8869
    and Qualcomm PMI8994 and SMB208.

    SPI:

    - Lots of enhancements for spi-fsl-dspi, including XSPI mode support,
    from Vladimir Oltean.

    - Support for amlogic Meson G12A, IBM FSI, Mediatek spi-nor (moved
    from MTD), NXP i.MX8Mx, Rockchip PX30, RK3308 and RK3328, and
    Qualcomm Atheros AR934x/QCA95xx"

    * tag 'regulator-spi-v5.7' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/misc: (118 commits)
    spi: efm32: Convert to use GPIO descriptors
    regulator: qcom_smd: Add pmi8994 regulator support
    regulator: da9063: Fix get_mode() functions to read sleep field
    spi: spi-fsl-lpspi: Replace zero-length array with flexible-array member
    spi: spi-s3c24xx: Replace zero-length array with flexible-array member
    spi: stm32: Fix comments compilation warnings
    spi: atmel-quadspi: Add verbose debug facilities to monitor register accesses
    spi: spi-fsl-dspi: Add support for LS1028A
    spi: spi-fsl-dspi: Move invariant configs out of dspi_transfer_one_message
    spi: spi-fsl-dspi: Fix interrupt-less DMA mode taking an XSPI code path
    spi: spi-fsl-dspi: Avoid NULL pointer in dspi_slave_abort for non-DMA mode
    spi: spi-fsl-dspi: Replace interruptible wait queue with a simple completion
    spi: spi-fsl-dspi: Protect against races on dspi->words_in_flight
    spi: spi-fsl-dspi: Avoid reading more data than written in EOQ mode
    spi: spi-fsl-dspi: Fix bits-per-word acceleration in DMA mode
    spi: spi-fsl-dspi: Fix little endian access to PUSHR CMD and TXDATA
    spi: spi-fsl-dspi: Don't access reserved fields in SPI_MCR
    regulator: driver.h: fix regulator_map_* function names
    regulator: da9063: fix suspend
    spi: mxs: Drop GPIO includes
    ...

    Linus Torvalds
     

25 Mar, 2020

4 commits


19 Mar, 2020

1 commit

  • The .set_suspend_enable() and .set_suspend_disable() methods are not
    supposed to immediately change the regulator state but just indicated
    if the regulator should be enabled or disabled when standby mode is
    entered (by a hardware signal).

    However currently they set control the SEL bits in the DVC registers,
    which causes the voltage to change to immediately between the "A"
    (normal) and "B" (standby) values as programmed and does nothing for
    the enable state...

    This means that "regulator-on-in-suspend" does not work (the regulator
    is switched off when the PMIC enters standby mode on the hardware
    signal) and, potentially, depending on the A and B voltage
    configurations the voltage could be incorrectly changed *before*
    actually entering suspend.

    The right bit to use for the functionality is the "CONF" bit in the
    "CONT" register.
    The detailed register description says "Sequencer target state"
    for this bit which is not very clear but the functional description
    is clearer.

    >From 5.1.5 System Enable:

    De-asserting SYS_EN (changing from active to passive state)
    clears control SYSTEM_EN which triggers a power down sequence
    into hibernate/standby mode
    ...
    With the exception of supplies that have the xxxx_CONF control
    bit asserted, all regulators in power domains POWER1, POWER, and
    SYSTEM are sequentially disabled in reverse order.
    Regulators with the _CONF bit set remain on but change the
    active voltage controlregisters from V_A to V_B
    (if V_B is notalready selected).

    Signed-off-by: Martin Fuzzey
    Link: https://lore.kernel.org/r/1584461691-14344-1-git-send-email-martin.fuzzey@flowbird.group
    Signed-off-by: Mark Brown

    Martin Fuzzey
     

17 Mar, 2020

2 commits

  • MP8867 is an I2C-controlled adjustable voltage regulator made by
    Monolithic Power Systems. The difference between MP8867 and MP8869
    are:
    1.If V_BOOT, the vref of MP8869 is fixed at 600mv while vref of
    MP8867 is determined by the I2C control.
    2.For MP8867, when setting voltage, if the step is within 5, we
    need to manually set the GO BIT to 0.

    Signed-off-by: Jisheng Zhang
    Link: https://lore.kernel.org/r/20200316223127.4b1ecc92@xhacker
    Signed-off-by: Mark Brown

    Jisheng Zhang
     
  • The MP8869 from Monolithic Power Systems is a single output DC/DC
    converter. The voltage can be controlled via I2C.

    Signed-off-by: Jisheng Zhang
    Link: https://lore.kernel.org/r/20200316223020.1a6d92ae@xhacker
    Signed-off-by: Mark Brown

    Jisheng Zhang
     

14 Mar, 2020

1 commit

  • With current code:
    st-gyro-i2c i2c-PRP0001:00: i2c-PRP0001:00 supply vdd not found, using dummy regulator

    which looks a bit oververbose.

    Replace this with simplified format string for the above case, and drop
    "deviceless" case since for all dev_*() macros used in _regulator_get()
    the "(null)" will be printed anyway.

    Signed-off-by: Andy Shevchenko
    Link: https://lore.kernel.org/r/20200312183245.1612-1-andriy.shevchenko@linux.intel.com
    Signed-off-by: Mark Brown

    Andy Shevchenko
     

09 Mar, 2020

1 commit


07 Mar, 2020

1 commit


05 Mar, 2020

1 commit

  • The regulator_init_complete_work logic defers the cleanup for an
    arbitrary 30 seconds of time to allow modules loaded by userland
    to start.

    This arbitrary timeout is similar to the
    driver_deferred_probe_timeout value, and its been suggested we
    align these so users have a method to extend the timeouts as
    needed.

    So this patch changes the logic to use the
    driver_deferred_probe_timeout value for the delay value if it
    is set (using a delay of 0 if it is not).

    Cc: linux-pm@vger.kernel.org
    Cc: Greg Kroah-Hartman
    Cc: Linus Walleij
    Cc: Thierry Reding
    Cc: Mark Brown
    Cc: Liam Girdwood
    Cc: Bjorn Andersson
    Cc: Saravana Kannan
    Cc: Todd Kjos
    Cc: Len Brown
    Cc: Pavel Machek
    Cc: Ulf Hansson
    Cc: Kevin Hilman
    Cc: "Rafael J. Wysocki"
    Cc: Rob Herring
    Acked-by: Mark Brown
    Signed-off-by: John Stultz
    Link: https://lore.kernel.org/r/20200225050828.56458-7-john.stultz@linaro.org
    Signed-off-by: Greg Kroah-Hartman

    John Stultz
     

04 Mar, 2020

1 commit

  • There maybe an overshoot, when disabling, then re-enabling vrefbuf
    too quickly. VREFBUF is used by ADC/DAC on some boards. When re-enabling
    too quickly, an overshoot on the reference voltage make the conversions
    inaccurate for a short period of time.
    - Don't put the VREFBUF in HiZ when disabling, to force an active
    discharge.
    - Enforce a 1ms OFF/ON delay

    Fixes: 0cdbf481e927 ("regulator: Add support for stm32-vrefbuf")

    Signed-off-by: Fabrice Gasnier
    Message-Id:
    Signed-off-by: Mark Brown

    Fabrice Gasnier
     

03 Mar, 2020

1 commit

  • devm_regulator_register() could return -EPROBE_DEFER when trying to
    get init data and NOT all resources are available at that time, for
    this case, error message is better to be present for debug level ONLY.

    Signed-off-by: Anson Huang
    Link: https://lore.kernel.org/r/1583243052-1930-1-git-send-email-Anson.Huang@nxp.com
    Signed-off-by: Mark Brown

    Anson Huang
     

02 Mar, 2020

2 commits

  • Deferred probe is an expected return value for devm_pwm_get(). Given
    that the driver deals with it properly, rather than warn on probe
    deferral, only output a message on probe deferral if debug level
    prints are enabled.

    Signed-off-by: Jon Hunter
    Link: https://lore.kernel.org/r/20200302141428.14119-1-jonathanh@nvidia.com
    Signed-off-by: Mark Brown

    Jon Hunter
     
  • ANATOP regulator should depend on ARCH_MXC or COMPILE_TEST.

    Signed-off-by: Anson Huang
    Link: https://lore.kernel.org/r/1583150118-8014-1-git-send-email-Anson.Huang@nxp.com
    Signed-off-by: Mark Brown

    Anson Huang
     

27 Feb, 2020

1 commit

  • Smb208 regulators are used on some ipq806x soc.
    Add support for it to make it avaiable on some routers
    that use it.

    Signed-off-by: Ansuel Smith
    Signed-off-by: Adrian Panella
    Acked-by: Lee Jones
    Link: https://lore.kernel.org/r/20200219163711.479-1-ansuelsmth@gmail.com
    Signed-off-by: Mark Brown

    Ansuel Smith
     

24 Feb, 2020

1 commit


18 Feb, 2020

1 commit


13 Feb, 2020

2 commits

  • The current codebase makes use of the zero-length array language
    extension to the C90 standard, but the preferred mechanism to declare
    variable-length types such as these ones is a flexible array member[1][2],
    introduced in C99:

    struct foo {
    int stuff;
    struct boo array[];
    };

    By making use of the mechanism above, we will get a compiler warning
    in case the flexible array does not occur last in the structure, which
    will help us prevent some kind of undefined behavior bugs from being
    inadvertenly introduced[3] to the codebase from now on.

    This issue was found with the help of Coccinelle.

    [1] https://gcc.gnu.org/onlinedocs/gcc/Zero-Length.html
    [2] https://github.com/KSPP/linux/issues/21
    [3] commit 76497732932f ("cxgb3/l2t: Fix undefined behaviour")

    Signed-off-by: Gustavo A. R. Silva
    Acked-by: Adam Thomson
    Link: https://lore.kernel.org/r/20200211234612.GA28682@embeddedor
    Signed-off-by: Mark Brown

    Gustavo A. R. Silva
     
  • The current codebase makes use of the zero-length array language
    extension to the C90 standard, but the preferred mechanism to declare
    variable-length types such as these ones is a flexible array member[1][2],
    introduced in C99:

    struct foo {
    int stuff;
    struct boo array[];
    };

    By making use of the mechanism above, we will get a compiler warning
    in case the flexible array does not occur last in the structure, which
    will help us prevent some kind of undefined behavior bugs from being
    inadvertenly introduced[3] to the codebase from now on.

    This issue was found with the help of Coccinelle.

    [1] https://gcc.gnu.org/onlinedocs/gcc/Zero-Length.html
    [2] https://github.com/KSPP/linux/issues/21
    [3] commit 76497732932f ("cxgb3/l2t: Fix undefined behaviour")

    Signed-off-by: Gustavo A. R. Silva
    Link: https://lore.kernel.org/r/20200211234710.GA29532@embeddedor
    Signed-off-by: Mark Brown

    Gustavo A. R. Silva
     

11 Feb, 2020

4 commits

  • Adding regulator driver for the device mp5416.
    The MP5416 PMIC device contains four DC-DC buck converters and
    five regulators, accessed over I2C.

    Signed-off-by: Saravanan Sekar
    Link: https://lore.kernel.org/r/20200204110419.25933-3-sravanhome@gmail.com
    Signed-off-by: Mark Brown

    Saravanan Sekar
     
  • The devm_request_threaded_irq() already returns 0 on success
    and negative error code on failure. So return from this itself
    can be used while preserving error log in case of failure.

    Signed-off-by: Rishi Gupta
    Link: https://lore.kernel.org/r/1580996996-28798-1-git-send-email-gupt21@gmail.com
    Signed-off-by: Mark Brown

    Rishi Gupta
     
  • This commit fixes following errors & warnings in this driver
    as reported by checkpatch.pl:

    - WARNING: Prefer 'unsigned int' to bare use of 'unsigned'
    - WARNING: line over 80 characters
    - ERROR: space prohibited before that ',' (ctx:WxW)
    - ERROR: code indent should use tabs where possible
    - WARNING: Block comments use * on subsequent lines

    Signed-off-by: Rishi Gupta
    Link: https://lore.kernel.org/r/1580996917-28494-1-git-send-email-gupt21@gmail.com
    Signed-off-by: Mark Brown

    Rishi Gupta
     
  • Add vin_supply to the regulator description to support a nice
    regulator tree.

    Signed-off-by: Markus Reichl
    Reviewed-by: Heiko Stuebner
    Link: https://lore.kernel.org/r/20200203110034.1448-1-m.reichl@fivetechno.de
    Signed-off-by: Mark Brown

    Markus Reichl
     

03 Feb, 2020

1 commit

  • Pull MFD updates from Lee Jones:
    "New Drivers:
    - Add support for ROHM BD71828 PMICs and GPIOs
    - Add support for Qualcomm Aqstic Audio Codecs WCD9340 and WCD9341

    New Device Support:
    - Add support for BD71828 to BD70528 RTC driver
    - Add support for Intel's Jasper Lake to LPSS PCI

    New Functionality:
    - Add support for Power Key to ROHM BD71828
    - Add support for Clocks to ROHM BD71828
    - Add support for GPIOs to Dialog DA9062
    - Add support for USB PD Notify to ChromiumOS EC
    - Allow callers to specify args when requesting regmap lookup; syscon

    Fix-ups:
    - Improve error handling and sanity checking; atmel-hlcdc, dln2
    - Device Tree support/documentation; bd71828, da9062, xylon,logicvc,
    ab8500, max14577, atmel-usart
    - Match devices using platform IDs; bd7xxxx
    - Refactor BD718x7 regulator component; bd718x7-regulator
    - Use standard interfaces/helpers; syscon, sm501
    - Trivial (whitespace, spelling, etc); ab8500-core, Kconfig
    - Remove unused code; db8500-prcmu, tqmx86
    - Wait until boot has finished before accessing registers;
    madera-core
    - Provide missing register value defaults; cs47l15-tables
    - Allow more time for hardware to reset; madera-core

    Bug Fixes:
    - Fix erroneous register values; rohm-bd70528
    - Fix register volatility; axp20x, rn5t618
    - Fix Kconfig dependencies; MFD_MAX77650
    - Fix incorrect compatible string; da9062-core
    - Fix syscon_regmap_lookup_by_phandle_args() stub; syscon"

    * tag 'mfd-next-5.6' of git://git.kernel.org/pub/scm/linux/kernel/git/lee/mfd: (41 commits)
    mfd: syscon: Fix syscon_regmap_lookup_by_phandle_args() dummy
    mfd: wcd934x: Add support to wcd9340/wcd9341 codec
    mfd: syscon: Add arguments support for syscon reference
    mfd: rn5t618: Mark ADC control register volatile
    dt-bindings: atmel-usart: Add microchip,sam9x60-{usart, dbgu}
    dt-bindings: atmel-usart: Remove wildcard
    mfd: cros_ec: Add cros-usbpd-notify subdevice
    mfd: da9062: Fix watchdog compatible string
    mfd: madera: Allow more time for hardware reset
    mfd: cs47l15: Add missing register default
    mfd: madera: Wait for boot done before accessing any other registers
    mfd: Kconfig: Rename Samsung to lowercase
    mfd: tqmx86: remove set but not used variable 'i2c_ien'
    mfd: dbx500-prcmu: Drop DSI pll clock functions
    mfd: dbx500-prcmu: Drop set_display_clocks()
    mfd: max77650: Select REGMAP_IRQ in Kconfig
    mfd: axp20x: Mark AXP20X_VBUS_IPSOUT_MGMT as volatile
    mfd: ab8500: Fix ab8500-clk typo
    mfd: intel-lpss: Add Intel Jasper Lake PCI IDs
    dt-bindings: mfd: max14577: Add reference to max14040_battery.txt descriptions
    ...

    Linus Torvalds
     

28 Jan, 2020

1 commit


24 Jan, 2020

2 commits

  • Few ROHM PMICs allow setting the voltage states for different system states
    like RUN, IDLE, SUSPEND and LPSR. States are then changed via SoC specific
    mechanisms. bd718x7 driver implemented device-tree parsing functions for
    these state specific voltages. The parsing functions can be re-used by
    other ROHM chip drivers like bd71828. Split the generic functions from
    bd718x7-regulator.c to rohm-regulator.c and export them for other modules
    to use.

    Signed-off-by: Matti Vaittinen
    Acked-by: Mark Brown
    Signed-off-by: Lee Jones

    Matti Vaittinen
     
  • Thanks to Stephen Boyd I today learned we can use platform_device_id
    to do device and module matching for MFD sub-devices!

    Do device matching using the platform_device_id instead of using
    explicit module_aliases to load modules and custom parent-data field
    to do module loading and sub-device matching.

    Cc: Stephen Boyd
    Signed-off-by: Matti Vaittinen
    Acked-by: Mark Brown
    Signed-off-by: Lee Jones

    Matti Vaittinen
     

23 Jan, 2020

3 commits


21 Jan, 2020

1 commit

  • Change the exported symbols introduced by commit e9153311491da
    ("regulator: vctrl-regulator: Avoid deadlock getting and setting the voltage")
    from EXPORT_SYMBOL() to EXPORT_SYMBOL_GPL(), like is used for all the core
    parts.

    Fixes: e9153311491da ("regulator: vctrl-regulator: Avoid deadlock getting and setting the voltage")
    Reported-by: Dmitry Osipenko
    Signed-off-by: Enric Balletbo i Serra
    Link: https://lore.kernel.org/r/20200120123921.1204339-1-enric.balletbo@collabora.com
    Signed-off-by: Mark Brown

    Enric Balletbo i Serra
     

17 Jan, 2020

3 commits

  • Fix defines for MPQ7920_MASK_BUCK_ILIM and MPQ7920_DISCHARGE_ON
    Remove unused MPQ7920_REG_REGULATOR_EN1.

    Signed-off-by: Axel Lin
    Link: https://lore.kernel.org/r/20200115002953.14731-1-axel.lin@ingics.com
    Signed-off-by: Mark Brown

    Axel Lin
     
  • Remove .owner field if calls are used which set it automatically
    Generated by: scripts/coccinelle/api/platform_no_drv_owner.cocci

    Signed-off-by: YueHaibing
    Link: https://lore.kernel.org/r/20200116023344.163592-1-yuehaibing@huawei.com
    Signed-off-by: Mark Brown

    YueHaibing
     
  • `cat /sys/kernel/debug/regulator/regulator_summary` ends on a deadlock
    when you have a voltage controlled regulator (vctrl).

    The problem is that the vctrl_get_voltage() and vctrl_set_voltage() calls the
    regulator_get_voltage() and regulator_set_voltage() and that will try to lock
    again the dependent regulators (the regulator supplying the control voltage).

    Fix the issue by exporting the unlocked version of the regulator_get_voltage()
    and regulator_set_voltage() API so drivers that need it, like the voltage
    controlled regulator driver can use it.

    Fixes: f8702f9e4aa7 ("regulator: core: Use ww_mutex for regulators locking")
    Reported-by: Douglas Anderson
    Signed-off-by: Enric Balletbo i Serra
    Link: https://lore.kernel.org/r/20200116094543.2847321-1-enric.balletbo@collabora.com
    Signed-off-by: Mark Brown

    Enric Balletbo i Serra
     

14 Jan, 2020

4 commits

  • Add regulator_is_equal() helper to compare whether two regulators are
    the same. This is useful for checking whether two separate regulators
    in a driver are actually the same supply.

    Signed-off-by: Marek Vasut
    Cc: Fabio Estevam
    Cc: Igor Opaniuk
    Cc: Liam Girdwood
    Cc: Marcel Ziswiler
    Cc: Mark Brown
    Cc: Oleksandr Suvorov
    Link: https://lore.kernel.org/r/20191220164450.1395038-1-marex@denx.de
    Signed-off-by: Mark Brown

    Marek Vasut
     
  • Use the new .probe_new instead.

    Signed-off-by: Axel Lin
    Link: https://lore.kernel.org/r/20200114124449.28408-2-axel.lin@ingics.com
    Signed-off-by: Mark Brown

    Axel Lin
     
  • Both *dev and *rdev are only used in .probe, so use local variable instead.
    Also remove mpq7920_regulator_register() because it is so trivial and
    there is only one caller.

    Signed-off-by: Axel Lin
    Link: https://lore.kernel.org/r/20200114124449.28408-1-axel.lin@ingics.com
    Signed-off-by: Mark Brown

    Axel Lin
     
  • A few trivial clean up:
    * Make ipq4019_regulator_voltage_ops and vmmc_regulator const
    * Make ipq4019_vmmcq_regmap_config static
    * Use regulator_map_voltage_ascend

    Signed-off-by: Axel Lin
    Link: https://lore.kernel.org/r/20200114065847.31667-2-axel.lin@ingics.com
    Signed-off-by: Mark Brown

    Axel Lin