20 Jan, 2021

3 commits

  • This is the 5.10.9 stable release

    * tag 'v5.10.9': (153 commits)
    Linux 5.10.9
    netfilter: nf_nat: Fix memleak in nf_nat_init
    netfilter: conntrack: fix reading nf_conntrack_buckets
    ...

    Signed-off-by: Jason Liu

    Jason Liu
     
  • This is the 5.10.8 stable release

    * tag 'v5.10.8': (104 commits)
    Linux 5.10.8
    tools headers UAPI: Sync linux/fscrypt.h with the kernel sources
    drm/panfrost: Remove unused variables in panfrost_job_close()
    ...

    Signed-off-by: Jason Liu

    Jason Liu
     
  • [ Upstream commit 3b66e4a8e58a85af3212c7117d7a29c9ef6679a2 ]

    Use the typical startup times from the data sheet so boards get a
    reasonable default. Not setting any enable time can lead to board hangs
    when e.g. clocks are enabled too soon afterwards.

    This fixes gpu power domain resume on the Librem 5.

    [Moved #defines into driver, seems to be general agreement and avoids any
    cross tree issues -- broonie]

    Signed-off-by: Guido Günther
    Reviewed-by: Matti Vaittinen
    Link: https://lore.kernel.org/r/41fb2ed19f584f138336344e2297ae7301f72b75.1608316658.git.agx@sigxcpu.org
    Signed-off-by: Mark Brown
    Signed-off-by: Sasha Levin

    Guido Günther
     

17 Jan, 2021

1 commit

  • commit df6b92fa40050e59ea89784294bf6d04c0c47705 upstream.

    According to the datasheet pm8009's HFS515 regulators have 16mV
    resolution rather than declared 1.6 mV. Correct the resolution.

    Signed-off-by: Dmitry Baryshkov
    Fixes: 06369bcc15a1 ("regulator: qcom-rpmh: Add support for SM8150")
    Reviewed-by: Vinod Koul
    Link: https://lore.kernel.org/r/20201231122348.637917-3-dmitry.baryshkov@linaro.org
    Signed-off-by: Mark Brown
    Signed-off-by: Greg Kroah-Hartman

    Dmitry Baryshkov
     

04 Jan, 2021

1 commit

  • This is the 5.10.4 stable release

    * tag 'v5.10.4': (717 commits)
    Linux 5.10.4
    x86/CPU/AMD: Save AMD NodeId as cpu_die_id
    drm/edid: fix objtool warning in drm_cvt_modes()
    ...

    Signed-off-by: Jason Liu

    Conflicts:
    drivers/gpu/drm/imx/dcss/dcss-plane.c
    drivers/media/i2c/ov5640.c

    Jason Liu
     

30 Dec, 2020

1 commit

  • commit 291de1d102fafef0798cdad9666cd4f8da7da7cc upstream.

    When I use the axp20x chip to power my SDIO device on the 5.4 kernel,
    the output voltage of DLDO2 is wrong. After comparing the register
    manual and source code of the chip, I found that the mask bit of the
    driver register of the port was wrong. I fixed this error by modifying
    the mask register of the source code. This error seems to be a copy
    error of the macro when writing the code. Now the voltage output of
    the DLDO2 port of axp20x is correct. My development environment is
    Allwinner A40I of arm architecture, and the kernel version is 5.4.

    Signed-off-by: DingHua Ma
    Reviewed-by: Chen-Yu Tsai
    Cc:
    Fixes: db4a555f7c4c ("regulator: axp20x: use defines for masks")
    Link: https://lore.kernel.org/r/20201201001000.22302-1-dinghua.ma.sz@gmail.com
    Signed-off-by: Mark Brown
    Signed-off-by: Greg Kroah-Hartman

    DingHua Ma
     

14 Dec, 2020

11 commits

  • BuckX enable mode
    00b = OFF
    01b = ON by PMIC_ON_REQ = H
    10b = ON by PMIC_ON_REQ = H && PMIC_STBY_REQ = L
    11b = Always ON

    For such enable mode, enable_value should be clearly set in requlator desc,
    00/11 is not enough, correct it now for different bucks. For example, buck2
    is designed for vddarm which could be off in 'PMIC_STBY_REQ = H' after kernel
    enter suspend, so should be set '10b' as ON, while others is '01b' as ON.
    All are the same as the default setting which means bucks no need to be
    enabled again during kernel boot even if they have been enabled already after
    pmic on.

    Signed-off-by: Robin Gong
    Reviewed-by: Anson Huang

    Robin Gong
     
  • 67b06ba0 ("PM: QoS: Drop PM_QOS_CPU_DMA_LATENCY and rename related functions")
    changed the pm_qos_*() APIs. Updated the IMX usage of them to the new
    APIs.

    Signed-off-by: Li Yang
    Signed-off-by: Dong Aisheng

    Li Yang
     
  • Take account of bypass case where min_dropout_uV is 0 to adjust external
    supply voltage correctly, otherwise, external pmic voltage will never be
    in ldo bypass mode.

    Signed-off-by: Robin Gong
    Reviewed-by: Anson Huang

    Robin Gong
     
  • In bypass mode, the anatop digital regulators do not have any minimum
    dropout value (the input voltage is equal to the output voltage according
    to documentation).

    Having a min dropout value of 125mV will lead to an increased voltage
    for PMIC supplies.

    Only set minimum dropout value for ldo enabled mode.

    Signed-off-by: Irina Tirdea
    Signed-off-by: Vipul Kumar
    Signed-off-by: Robin Gong
    Reviewed-by: Anson Huang
    (cherry picked from commit 9092e24ba0dce713e5478c0f925168b00e9e83cb)

    Irina Tirdea
     
  • Some registers on pfuze3000 will lost after exit from LPSR, need restore them,
    otherwise system may reboot with below command after system enter LPSR one time:

    root@imx7d_all:~# echo enabled > /sys/class/tty/ttymxc0/power/wakeup
    root@imx7d_all:~# echo mem > /sys/power/state

    because LDOGCTL not recover as 1. Add 'fsl,lpsr-mode' property to this case,
    please add this property if your board support LPSR mode as imx7d-12x12-lpddr3-arm2
    board.

    Signed-off-by: Robin Gong
    Reviewed-by: Anson Huang
    (cherry picked from commit 4aa2a2a92814433d76de1bf6ae8902e46fb87961)
    [ Aisheng: change dt binding part to json schema ]
    Signed-off-by: Dong Aisheng

    Robin Gong
     
  • Add n_voltages/min_uV in regulator description so that no failure return
    while regulator_count_voltages() called, which cause vqmmc regulator
    voltage switching to 1.8V failure on i.mx7ulp-evk. This issue is exposed
    by commit 498209445124 ("regulator: core: simplify return value on
    suported_voltage").

    Signed-off-by: Robin Gong
    Reported-by: Haibo Chen
    Reviewed-by: Anson Huang

    Robin Gong
     
  • At some systems, the pinctrl setting will be lost or needs to
    set as "sleep" state to save power consumption. So, we need to
    configure pinctrl as "sleep" state when system enters suspend,
    and as "default" state after system resumes. In this way, the
    pinctrl value can be recovered as "default" state after resuming.

    Signed-off-by: Peter Chen
    Signed-off-by: Vipul Kumar

    Peter Chen
     
  • The Linux kernel regulator core implementation does not accept negative
    voltage values; all negative values are treated as errors.

    The problem with the EPDC is that the panel uses a negative voltage
    regulator which fails to be enabled by the regulator core. This issue has
    slipped up until the 4.9 rebase because the voltage range [min, max] was
    checked against only when min = max. This has been fixed in 4.9, resulting
    in errors in the VCOM regulator driver.

    The fix is to use the negative values when communicating with the hardware,
    but send only positive values to the regulator core.

    This patch sends the absolute value to the regulator core and transforms
    the received value (from the regulator core) to negative one before sending
    it to hardware.

    Fix device tree to deal with negative voltage regulator values by setting
    min_value = -real_max_value and vice versa. Boards affected:
    - imx6dl-sabresd
    - imx6ull-14x14-ddr3-arm2
    - imx7d-12x12-lpddr3-arm2
    - imx7d-sdb
    - imx6sll-evk
    - imx6sl-evk
    - imx6sll-lpddr3-arm2

    Signed-off-by: Cristina Ciocan
    [Arul: Fix merge conflicts]
    Signed-off-by: Arulpandiyan Vadivel

    [Robby: split original patch to driver and dts part. this is driver part.]
    Signed-off-by: Robby Cai

    Cristina Ciocan
     
  • Add PMIC 'MAX17135' module drivers to 4.1.y kernel. These are necessary
    to supply power for E-ink panel display functions.

    Signed-off-by: Robby Cai
    Signed-off-by: Vipul Kumar

    Robby Cai
     
  • Return EPROBE_DEFER if rpmsg channel is not ready.

    Signed-off-by: Robin Gong

    Robin Gong
     
  • Add pf1550 rpmsg driver for i.mx7ulp-evk.

    Signed-off-by: Robin Gong

    Robin Gong
     

19 Nov, 2020

1 commit

  • At the start of driver initialization, we do not know what bias
    setting the bootloader has configured the system for and we only know
    for certain the very first time we do a transition.

    However, since the initial value of the comparison index is -EINVAL,
    this negative value results in an array out of bound access on the
    very first transition.

    Since we don't know what the setting is, we just set the bias
    configuration as there is nothing to compare against. This prevents
    the array out of bound access.

    NOTE: Even though we could use a more relaxed check of "< 0" the only
    valid values(ignoring cosmic ray induced bitflips) are -EINVAL, 0+.

    Fixes: 40b1936efebd ("regulator: Introduce TI Adaptive Body Bias(ABB) on-chip LDO driver")
    Link: https://lore.kernel.org/linux-mm/CA+G9fYuk4imvhyCN7D7T6PMDH6oNp6HDCRiTUKMQ6QXXjBa4ag@mail.gmail.com/
    Reported-by: Naresh Kamboju
    Reviewed-by: Arnd Bergmann
    Signed-off-by: Nishanth Menon
    Link: https://lore.kernel.org/r/20201118145009.10492-1-nm@ti.com
    Signed-off-by: Mark Brown

    Nishanth Menon
     

13 Nov, 2020

3 commits

  • Workaround regulators whose supply name happens to be the same as its
    own name. This fixes boards that used to work before the early supply
    resolving was removed. The error message is left in place so that
    offending drivers can be detected.

    Fixes: aea6cb99703e ("regulator: resolve supply after creating regulator")
    Cc: stable@vger.kernel.org
    Reported-by: Ahmad Fatoum
    Signed-off-by: Michał Mirosław
    Tested-by: Ahmad Fatoum # stpmic1
    Link: https://lore.kernel.org/r/d703acde2a93100c3c7a81059d716c50ad1b1f52.1605226675.git.mirq-linux@rere.qmqm.pl
    Signed-off-by: Mark Brown

    Michał Mirosław
     
  • When a regulator's name equals its supply's name the
    regulator_resolve_supply() recurses indefinitely. Add a check
    so that debugging the problem is easier. The "fixed" commit
    just exposed the problem.

    Fixes: aea6cb99703e ("regulator: resolve supply after creating regulator")
    Cc: stable@vger.kernel.org
    Reported-by: Ahmad Fatoum
    Signed-off-by: Michał Mirosław
    Tested-by: Ahmad Fatoum # stpmic1
    Link: https://lore.kernel.org/r/c6171057cfc0896f950c4d8cb82df0f9f1b89ad9.1605226675.git.mirq-linux@rere.qmqm.pl
    Signed-off-by: Mark Brown

    Michał Mirosław
     
  • Fixed commit introduced a possible second call to
    set_machine_constraints() and that allocates memory for
    rdev->constraints. Move the allocation to the caller so
    it's easier to manage and done once.

    Fixes: aea6cb99703e ("regulator: resolve supply after creating regulator")
    Cc: stable@vger.kernel.org
    Signed-off-by: Michał Mirosław
    Tested-by: Ahmad Fatoum # stpmic1
    Link: https://lore.kernel.org/r/78c3d4016cebc08d441aad18cb924b4e4d9cf9df.1605226675.git.mirq-linux@rere.qmqm.pl
    Signed-off-by: Mark Brown

    Michał Mirosław
     

11 Nov, 2020

2 commits

  • Limit the fsl,pfuze-support-disable-sw to the pfuze100 and pfuze200
    variants.
    When enabling fsl,pfuze-support-disable-sw and using a pfuze3000 or
    pfuze3001, the driver would choose pfuze100_sw_disable_regulator_ops
    instead of the newly introduced and correct pfuze3000_sw_regulator_ops.

    Signed-off-by: Sean Nyekjaer
    Fixes: 6f1cf5257acc ("regualtor: pfuze100: correct sw1a/sw2 on pfuze3000")
    Cc: stable@vger.kernel.org
    Link: https://lore.kernel.org/r/20201110174113.2066534-1-sean@geanix.com
    Signed-off-by: Mark Brown

    Sean Nyekjaer
     
  • In regulator_late_cleanup when is_enabled failed, don't try to disable
    the regulator since it would likely to fail too and causing confusing
    error messages.

    Signed-off-by: Pi-Hsun Shih
    Link: https://lore.kernel.org/r/20201106064817.3290927-1-pihsun@chromium.org
    Signed-off-by: Mark Brown

    Pi-Hsun Shih
     

03 Nov, 2020

1 commit

  • regulator_get_voltage_rdev() is called in regulator probe() when
    applying machine constraints. The "fixed" commit exposed the problem
    that non-bypassed regulators can forward the request to its parent
    (like bypassed ones) supply. Return -EPROBE_DEFER when the supply
    is expected but not resolved yet.

    Fixes: aea6cb99703e ("regulator: resolve supply after creating regulator")
    Cc: stable@vger.kernel.org
    Signed-off-by: Michał Mirosław
    Reported-by: Ondřej Jirman
    Reported-by: Corentin Labbe
    Tested-by: Ondřej Jirman
    Link: https://lore.kernel.org/r/a9041d68b4d35e4a2dd71629c8a6422662acb5ee.1604351936.git.mirq-linux@rere.qmqm.pl
    Signed-off-by: Mark Brown

    Michał Mirosław
     

05 Oct, 2020

4 commits


02 Oct, 2020

6 commits

  • AngeloGioacchino Del Regno :

    From: AngeloGioacchino Del Regno

    This patch series enables support for the regulators as found in
    the PM660 and PM660L PMICs.
    While at it, and to make them work, along with other regulators
    for other qcom PMICs, enlarge the maximum property name length in
    the regulator core, so that we're able to correctly parse the
    supply parents, which have got very long names (details in patch 1/5).

    This patch series has been tested against the following devices:
    - Sony Xperia XA2 Ultra (SDM630 Nile Discovery)
    - Sony Xperia 10 (SDM630 Ganges Kirin)
    - Sony Xperia 10 Plus (SDM636 Ganges Mermaid)

    AngeloGioacchino Del Regno (7):
    regulator: core: Enlarge max OF property name length to 64 chars
    regulator: qcom_spmi: Add support for new regulator types
    regulator: qcom_spmi: Add PM660/PM660L regulators
    regulator: dt-bindings: Document the PM660/660L SPMI PMIC entries
    regulator: qcom_smd: Add PM660/PM660L regulator support
    mfd: qcom-spmi-pmic: Add support for PM660/PM660L
    regulator: dt-bindings: Document the PM660/PM660L PMICs entries

    .../regulator/qcom,smd-rpm-regulator.yaml | 7 ++
    .../regulator/qcom,spmi-regulator.txt | 31 +++++
    drivers/mfd/qcom-spmi-pmic.c | 4 +
    drivers/regulator/core.c | 4 +-
    drivers/regulator/qcom_smd-regulator.c | 113 ++++++++++++++++++
    drivers/regulator/qcom_spmi-regulator.c | 107 +++++++++++++++++
    include/linux/soc/qcom/smd-rpm.h | 4 +
    7 files changed, 268 insertions(+), 2 deletions(-)

    --
    2.28.0

    Mark Brown
     
  • The only usage of qcom_labibb_ops is to assign it to the ops field in
    the regulator_desc struct, which is a const pointer. The only usage of
    pmi8998_lab_desc and pmi8998_ibb_desc is to assign their address to the
    desc field in the labibb_regulator_data struct which can be made const,
    since it is only copied into the desc field in the
    labbibb_regulator_data struct. This struct is modified, but that's a
    copy of the static one. Make them const to allow the compiler to put
    them in read-only memory.

    Signed-off-by: Rikard Falkeborn
    Link: https://lore.kernel.org/r/20200930162602.18583-1-rikard.falkeborn@gmail.com
    Signed-off-by: Mark Brown

    Rikard Falkeborn
     
  • The PM660 and PM660L are a very very common PMIC combo, found on
    boards using the SDM630, SDM636, SDM660 (and SDA variants) SoC.

    PM660 provides 6 SMPS and 19 LDOs (of which one is unaccesible),
    while PM660L provides 5 SMPS (of which S3 and S4 are combined),
    10 LDOs and a Buck-or-Boost (BoB) regulator.

    The PM660L IC also provides other regulators that are very
    specialized (for example, for the display) and will be managed
    in the other appropriate drivers (for example, labibb).

    Signed-off-by: AngeloGioacchino Del Regno
    Link: https://lore.kernel.org/r/20200926125549.13191-6-kholk11@gmail.com
    Signed-off-by: Mark Brown

    AngeloGioacchino Del Regno
     
  • The PM660 PMIC is very often paired with the PM660L option on
    SDM630/663/660 (and SDA variants) boards.

    The PM660 has 11 "660" LDOs (2 NMOS, 9 PMOS) and 7 HT LDOs (4 NMOS,
    3 PMOS) and a quirk: the L4 regulator is unaccessible or does not
    exist on the PMIC.
    The PM660L has 8 "660" LDOs (1 NMOS, 7 PMOS) and 2 HT NMOS LDOs.

    Signed-off-by: AngeloGioacchino Del Regno
    Link: https://lore.kernel.org/r/20200926125549.13191-4-kholk11@gmail.com
    Signed-off-by: Mark Brown

    AngeloGioacchino Del Regno
     
  • This commit adds the support for some regulator types that are
    missing in this driver, such as the ht nmos-ldo, ht-lv nmos-ldo
    and new gen n/pmos-ldo, all belonging to the FTSMPS426 register
    layout.
    This is done in preparation for adding support for the PM660 and
    PM660L PMICs.

    Signed-off-by: AngeloGioacchino Del Regno
    Link: https://lore.kernel.org/r/20200926125549.13191-3-kholk11@gmail.com
    Signed-off-by: Mark Brown

    AngeloGioacchino Del Regno
     
  • Some regulator drivers may be defining very long names: this is the
    case with the qcom_smd and qcom_spmi regulators, where we need to
    parse the regulator parents from DT.

    For clarity, this is an example:
    { "l13a", QCOM_SMD_RPM_LDOA, 13, &pm660_ht_lvpldo,
    "vdd_l8_l9_l10_l11_l12_l13_l14" },
    pm660-regulators {
    ...
    vdd_l8_l9_l10_l11_l12_l13_l14-supply =
    ...
    };
    Now, with a 32 characters limit, the function is trying to parse,
    exactly, "vdd_l8_l9_l10_l11_l12_l13_l14-s" (32 chars) instead of
    the right one, which is 37 chars long in this specific case.

    ... And this is not only the case with PM660/PM660L, but also with
    PMA8084, PM8916, PM8950 and others that are not implemented yet.

    The length of 64 chars was chosen based on the longest parsed property
    name that I could find, which is in PM8916, and would be 53 characters
    long.
    At that point, rounding that to 64 looked like being the best idea.

    Signed-off-by: AngeloGioacchino Del Regno
    Link: https://lore.kernel.org/r/20200926125549.13191-2-kholk11@gmail.com
    Signed-off-by: Mark Brown

    AngeloGioacchino Del Regno
     

01 Oct, 2020

1 commit


30 Sep, 2020

2 commits


29 Sep, 2020

3 commits

  • Three simple patches to aid in debugging regulators.

    Michał Mirosław (3):
    regulator: print state at boot
    regulator: print symbolic errors in kernel messages
    regulator: resolve supply after creating regulator

    drivers/regulator/core.c | 124 ++++++++++++++++++++++-----------------
    1 file changed, 69 insertions(+), 55 deletions(-)

    --
    2.20.1

    Mark Brown
     
  • Add support for Richtek RTMV20 load switch regulator.

    Signed-off-by: ChiYuan Huang
    Link: https://lore.kernel.org/r/1601277584-5526-1-git-send-email-u0084500@gmail.com
    Signed-off-by: Mark Brown

    ChiYuan Huang
     
  • When creating a new regulator its supply cannot create the sysfs link
    because the device is not yet published. Remove early supply resolving
    since it will be done later anyway. This makes the following error
    disappear and the symlinks get created instead.

    DCDC_REG1: supplied by VSYS
    VSYS: could not add device link regulator.3 err -2

    Note: It doesn't fix the problem for bypassed regulators, though.

    Fixes: 45389c47526d ("regulator: core: Add early supply resolution for regulators")
    Signed-off-by: Michał Mirosław
    Link: https://lore.kernel.org/r/ba09e0a8617ffeeb25cb4affffe6f3149319cef8.1601155770.git.mirq-linux@rere.qmqm.pl
    Signed-off-by: Mark Brown

    Michał Mirosław