mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH v8 0/2] regulator: add the Will Semiconductor WL2868C camera PMIC
@ 2026-11-06 11:42 Qianhui Xu
  2026-11-06 11:42 ` [PATCH v8 1/2] regulator: dt-bindings: willsemi,wl2868c: add the " Qianhui Xu
                   ` (2 more replies)
  0 siblings, 3 replies; 8+ messages in thread
From: Qianhui Xu @ 2026-11-06 11:42 UTC (permalink / raw)
  To: lgirdwood, broonie, robh, krzk+dt, conor+dt
  Cc: linux-kernel, devicetree, linux-arm-msm

*** AI-assistance disclosure ***
This cover letter and the two patches below were prepared with the help of
an LLM coding assistant.  The author reviewed every line, ran every gate
quoted in this letter himself, and takes full responsibility for the
content.

This is a re-post of the series sent a few minutes ago (Message-ID
<20261106113005.970822-1-xiaqinghuan@mail.ustc.edu.cn>): that posting lost
the version tag in the per-patch subjects -- they went out as "[PATCH 1/2]"
while the cover said v7 -- which is a tooling slip on my side.  The patch
content is unchanged, only the subject lines differ.  Apologies for the
noise.

This is a two-patch series: the binding and the driver for the WL2868C, a
seven-LDO I2C camera PMIC.  It supersedes the v6 posting
(<20261104032648.209747-1-xiaqinghuan@mail.ustc.edu.cn>) in full, and it is
deliberately smaller: the board devicetree patches of v6 (4/5 and 5/5) are
not part of it.  The reason is in "Board devicetree held back" below.

What changed, and why
=====================

Two reviews were waiting on this series: Krzysztof Kozlowski's
changes-requested on 5/5 and 3/5, and sashiko's three Medium findings on
the driver and two on the board devicetree.

Krzysztof, on 5/5: "I do not understand why this is a separate patch.  You
add new hardware, so the commit is 'add new hardware'.  One logical
action, one commit."  Taken -- and applied further than asked: the whole
board enablement (compatible in arm/qcom.yaml, the board DTS, and the
WL2868C regulators node) leaves this series, because it is not the same
logical action as "add the driver for this chip", and because the board
DTS cannot be sent on its own yet (see below).  The 3/5 commit message
objection ("Board cannot be shipped with such compatible ... 'Add Lenovo
Legion Y700 Gen4, an Qualcomm SM8750-based tablet'") is moot here for the
same reason; when the board series goes out, the compatible and the
message will be exactly that.

Board devicetree held back
==========================

v6 4/5 was a board skeleton: board clocks, reserved GPIOs and
chassis-type, with SPMI PMICs, console and storage explicitly deferred.
sashiko called it an unverified skeleton, and the v6 5/5 regulators node
then referenced VIN12/VIN34/VIN5/VIN7 from SPMI rails that do not exist in
the tree yet, so six LDOs ended up with dummy parents.  Krzysztof and
Konrad have both said the same thing in other words: a board is not
shipped as a skeleton.

So the board devicetree is not sent here.  It will go out with the SM8750
PMIC description and the camera consumers (CCI plus the two sensors) that
give it meaning, in the board series that is already in progress.  The
v6 4/5 + 5/5 content is kept, merged into one patch, in
held-back/ of this series directory, so nothing is lost; it needs the
PMIC rails described before it can be sent.

Response to sashiko on the driver (three Medium findings)
========================================================

 - "chip->enabled is not initialized, so a boot-enabled LDO bit is
   cleared by the next write": fixed, the tracked set is seeded from
   WL2868C_LDO_ENABLE during probe, so an output the firmware left on is
   carried over by enable() and disable() instead of being dropped.

 - "vsys-supply is never requested or enabled": fixed, probe enables it
   with devm_regulator_get_enable() before reading the device ID.  This is
   not cosmetic: the I2C interface is powered from the higher of VIN7 and
   VSYS, so without it the device does not answer on the bus at all.

 - "disable() clears the tracked bit before writing the register, so a
   failed write desynchronises the driver from the core": fixed, the new
   bit set is committed only after the register write succeeded.  A failed
   write leaves the output on and the core's use count unchanged, which is
   the only self-consistent state.

Response to sashiko on the board patches (two Medium findings)
==============================================================

Both are answered by holding the board patches back, as described above:
the skeleton devicetree is no longer part of this series, and the missing
VIN parents go away with it (the regulators node travels with the PMIC
description that provides them).

Changes relative to v6
======================

 - 1/2: unchanged content, moved MAINTAINERS into this patch.
 - 2/2: driver only; three state-consistency fixes above, and the commit
   message now describes the seeded state and the VSYS requirement.
 - dropped: v6 4/5 and 5/5 (board enablement), kept in held-back/.
 - net: 5 files, 369 insertions(+), 0 deletions(-).

Testing
=======

All re-run on this exact series:

 - checkpatch.pl --strict --patch - (mbox on stdin): 0 errors, 0 warnings
   for 1/2 (117 lines); 0 errors for 2/2 (270 lines) with one
   FILE_PATH_CHANGES note ("does MAINTAINERS need updating?"), which is
   checkpatch's per-patch heuristic -- MAINTAINERS is updated by 1/2 of
   this same series, so the note does not apply.
 - dt-doc-validate on willsemi,wl2868c.yaml: clean, exit 0.
 - make W=1 ARCH=arm64 CROSS_COMPILE=aarch64-linux-gnu-
   drivers/regulator/ with CONFIG_REGULATOR_WL2868C=m: 0 warnings, 0
   errors.
 - git am of 1/2..2/2 on f66469d9905b (torvalds master, 2026-11-06): applies
   cleanly, resulting tree is identical to the series tip.
 - scripts/check-series-selfcontained.sh: PASS, both patches replayed in
   order.

Board behaviour: this driver has been running on the tablet (Lenovo Legion
Y700 Gen4, SM8750) for several weeks as a module, with all seven LDOs
registered and the two camera sensors powered from LDO1/LDO2/LDO4/LDO7;
the LDO voltages match the values the stock firmware programs.  The
regulator node itself is part of the held-back board patch, so that
evidence is about the driver, not about an in-tree user.

Links
=====

v6: https://lore.kernel.org/all/20261104032648.209747-1-xiaqinghuan@mail.ustc.edu.cn/
Krzysztof on 5/5: <20261104-elfish-booby-of-awe-27d2b6@quoll>
Krzysztof on 3/5: <20261104-offbeat-cerulean-degu-cfec1b@quoll>
sashiko on 2/5: <sashiko-outbox-196615@kernel.org>
sashiko on 4/5: <sashiko-outbox-196620@kernel.org>
sashiko on 5/5: <sashiko-outbox-196621@kernel.org>

Qianhui Xu (2):
  regulator: dt-bindings: willsemi,wl2868c: add the WL2868C camera PMIC
  regulator: willsemi,wl2868c: add the WL2868C camera PMIC driver

 .../bindings/regulator/willsemi,wl2868c.yaml  | 104 ++++++++
 MAINTAINERS                                   |   7 +
 drivers/regulator/Kconfig                     |  11 +
 drivers/regulator/Makefile                    |   1 +
 drivers/regulator/wl2868c-regulator.c         | 246 ++++++++++++++++++
 5 files changed, 369 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/regulator/willsemi,wl2868c.yaml
 create mode 100644 drivers/regulator/wl2868c-regulator.c


base-commit: f66469d9905b39d2c260a15d7d6db450f4db67c1


^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2026-11-09 14:54 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-11-06 11:42 [PATCH v8 0/2] regulator: add the Will Semiconductor WL2868C camera PMIC Qianhui Xu
2026-11-06 11:42 ` [PATCH v8 1/2] regulator: dt-bindings: willsemi,wl2868c: add the " Qianhui Xu
2026-11-06 17:12   ` Conor Dooley
2026-11-06 11:42 ` [PATCH v8 2/2] regulator: willsemi,wl2868c: add the WL2868C camera PMIC driver Qianhui Xu
2026-11-07  1:50 ` [PATCH v9 0/2] regulator: add the Will Semiconductor WL2868C camera PMIC Qianhui Xu
2026-11-07  1:50   ` [PATCH v9 1/2] regulator: dt-bindings: willsemi,wl2868c: add the " Qianhui Xu
2026-11-09 14:54     ` Rob Herring (Arm)
2026-11-07  1:50   ` [PATCH v9 2/2] regulator: willsemi,wl2868c: add the WL2868C camera PMIC driver Qianhui Xu

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®