Skip to content

arm64: dts: qcom: sc8280xp-x13s: enable pm8008 camera pmic

Johan Hovold linux-arm-msm linux-devicetree lkml 3 versions – Applied

Status from this message: Applied, thanks!

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v3 Latest12 patches 9 repliesApplied
  2. v214 patches 25 repliesSuperseded
  3. v113 patches 69 repliesSuperseded

Changes in v3 from the cover letter

- capitalise MFD commit summaries
- drop pinctrl patches which have been applied for 6.10
- amend binding commit message to clarify that the binding is unused
- move pinctrl subschema under pinctrl node in binding

Patches in v3 Applied

#Subject and filesSizeRepliesApplied
1/12dt-bindings: mfd: pm8008: Add reset gpioDocumentation/devicetree/bindings/mfd/qcom,pm8008.yaml+6 -00 replies
2/12mfd: pm8008: Fix regmap irq chip initialisationdrivers/mfd/qcom-pm8008.c+23 -410 replies
3/12mfd: pm8008: Deassert reset on probedrivers/mfd/qcom-pm8008.c+12 -00 replies
4/12mfd: pm8008: Mark regmap structures as constdrivers/mfd/qcom-pm8008.c+2 -20 replies
5/12mfd: pm8008: Use lower case hex notationdrivers/mfd/qcom-pm8008.c+3 -30 replies
6/12mfd: pm8008: Rename irq chipdrivers/mfd/qcom-pm8008.c+1 -10 replies
7/12mfd: pm8008: Drop unused driver datadrivers/mfd/qcom-pm8008.c+0 -20 replies
8/12dt-bindings: mfd: pm8008: Drop redundant descriptionsDocumentation/devicetree/bindings/mfd/qcom,pm8008.yaml+0 -50 replies
9/12dt-bindings: mfd: pm8008: Rework bindingDocumentation/devicetree/bindings/mfd/qcom,pm8008.yaml+80 -551 reply
10/12mfd: pm8008: Rework to match new DT bindingdrivers/mfd/Kconfig drivers/mfd/qcom-pm8008.c include/dt-bindings/mfd/qcom-pm8008.h+86 -310 replies
11/12regulator: add pm8008 pmic regulator driverdrivers/regulator/Kconfig drivers/regulator/Makefile drivers/regulator/qcom-pm8008-regulator.c+206 -01 reply
12/12arm64: dts: qcom: sc8280xp-x13s: enable pm8008 camera pmicarch/arm64/boot/dts/qcom/sc8280xp-lenovo-thinkpad-x13s.dts+123 -01 reply

Reviews trailers per patch

11 of 12 patches have a Reviewed-by or Acked-by.

PatchBryan O'DonoghueLinus WalleijStephen BoydMark BrownKrzysztof KozlowskiRob Herring (Arm)Konrad Dybcio
1/12R-b R-b R-b
2/12R-b
3/12T-b R-b
4/12R-b R-b
5/12R-b R-b
6/12R-b R-b
7/12R-b R-b
8/12R-b
9/12R-b
10/12T-b
11/12R-b R-b
12/12R-b T-b R-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes. Scroll the table sideways for all 7 reviewers.

Read the v3 thread

Cover letter [PATCH v3 00/12] arm64: dts: qcom: sc8280xp-x13s: enable pm8008 camera pmic

The Qualcomm PM8008 PMIC is a so called QPNP PMIC with seven LDO regulators, a temperature alarm block and two GPIO pins (which are also used for interrupt signalling and reset).

Unlike previous QPNP PMICs it uses an I2C rather than SPMI interface, which has implications for how interrupts are handled.

A previous attempt by Qualcomm to upstream support for PM8008 stalled two years ago at version 15 after a lot of back and forth discussion on how best to describe this device in the devicetree. [1]

After reviewing the backstory on this and surveying the current SPMI PMIC bindings and implementation, I opted for a new approach that does not describe internal details like register offsets and interrupts in the devicetree.

The original decision to include registers offsets and internal interrupts for SPMI PMICs has led to a number of PMIC dtsi being created to avoid copying lots of boiler plate declarations. This in turn causes trouble when the PMIC USID address is configurable as the address is included in every interrupt specifier.

The current SPMI bindings still do not describe the devices fully and additional data is therefore already provided by drivers (e.g. additional register blocks, supplies, additional interrupt specifiers).

The fact that PMICs which use two USIDs (addresses) are modelled as two separate devices causes trouble, for example, when there are dependencies between subfunctions. [2]

Subfunctions also do not necessarily map neatly onto the 256-register block partitioning of the SPMI register space, something which has lead to unresolved inconsistencies in how functions like PWM are described.
[3]

In short, it's a bit of a mess.

With the new style of bindings, by contrast, only essential information that actually differs between machines would be included in the devicetree. The bindings would also be mostly decoupled from the implementation, which has started to leak out into the binding (e.g. how the QPNP interrupts are handled). This also allows for extending the implementation without having to update the binding, which is especially important as Qualcomm does not publish any documentation (e.g. to later enable regulator over-current protection).

Some PMICs support both I2C and SPMI interfaces (e.g. PM8010) and we want to be able to reuse the same bindings regardless of the interface.

As a proof concept I have written a new pmc8280 driver for one of the SPMI PMICs in the Lenovo ThinkPad X13s that uses the new style of bindings and I've been using that one to control backlight and peripheral regulators for a while now. Specifically, the gpio and temperature-alarm blocks can be used with some minor updates to the current drivers.

That work still needs a bit of polish before posting, but my working PoC means that I'm confident enough that the new model will work and that we can go ahead and merge regulator support for the PM8008.

This series is specifically needed for the camera sensors in the X13s, for which camera subsystem (camss) support has now been merged for 6.10.

The first seven patches are preparatory and can possibly be merged separately from the rest of the series. The next two patches drop the broken GPIO support for PM8008 which had already been upstreamed (dropped in v3). The last five patches rework the binding and MFD driver, add support for the regulators and enable the camera PMIC on the X13s.

Johan

[1] https://lore.kernel.org/all/[email protected]
[2] https://lore.kernel.org/lkml/[email protected]
[3] https://lore.kernel.org/r/[email protected]

Changes in v3
- capitalise MFD commit summaries
- drop pinctrl patches which have been applied for 6.10
- amend binding commit message to clarify that the binding is unused
- move pinctrl subschema under pinctrl node in binding

Changes in v2
- use IRQ_TYPE_SENSE_MASK in regmap_irq table
- add post-reset delay
- reorder pinctrl binding and driver update
- split out binding cleanups
- use platform_device_id matching
- replace underscore in supply names with dash
- use more fine-grained includes in regulator driver
- rework regulator driver and update authorship

Johan Hovold (12):
dt-bindings: mfd: pm8008: Add reset gpio
mfd: pm8008: Fix regmap irq chip initialisation
mfd: pm8008: Deassert reset on probe
mfd: pm8008: Mark regmap structures as const
mfd: pm8008: Use lower case hex notation
mfd: pm8008: Rename irq chip
mfd: pm8008: Drop unused driver data
dt-bindings: mfd: pm8008: Drop redundant descriptions
dt-bindings: mfd: pm8008: Rework binding
mfd: pm8008: Rework to match new DT binding
regulator: add pm8008 pmic regulator driver
arm64: dts: qcom: sc8280xp-x13s: enable pm8008 camera pmic

 .../devicetree/bindings/mfd/qcom,pm8008.yaml  | 144 +++++++------
 .../qcom/sc8280xp-lenovo-thinkpad-x13s.dts    | 123 +++++++++++
 drivers/mfd/Kconfig                           |   1 +
 drivers/mfd/qcom-pm8008.c                     | 169 ++++++++++-----
 drivers/regulator/Kconfig                     |   7 +
 drivers/regulator/Makefile                    |   1 +
 drivers/regulator/qcom-pm8008-regulator.c     | 198 ++++++++++++++++++
 include/dt-bindings/mfd/qcom-pm8008.h         |  19 --
 8 files changed, 532 insertions(+), 130 deletions(-)
 create mode 100644 drivers/regulator/qcom-pm8008-regulator.c
 delete mode 100644 include/dt-bindings/mfd/qcom-pm8008.h
Signature · 1 line
2.44.1