* [PATCH 1/2] dt-bindings: mfd: qcom,pm8008: make the interrupt line optional
2026-09-08 13:07 [PATCH 0/2] mfd: qcom-pm8008: support PMICs with no interrupt line Oleg Keri
@ 2026-09-08 13:07 ` Oleg Keri
2026-09-08 13:07 ` [PATCH 2/2] mfd: qcom-pm8008: support PMICs with no interrupt line Oleg Keri
2026-09-08 13:40 ` [PATCH 0/2] " Oleg Keri
2 siblings, 0 replies; 7+ messages in thread
From: Oleg Keri @ 2026-09-08 13:07 UTC (permalink / raw)
To: Lee Jones, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
Guru Das Srinagesh
Cc: linux-arm-msm, mfd, devicetree, linux-kernel
The PM8008 raises an interrupt for its own status, its temperature alarm
and its two GPIOs, but the pin does not have to be routed. On the Lenovo
Yoga Slim 7x Gen 11 it is not: the platform firmware describes the PMIC
with an I2C connection and nothing else, and the vendor driver talks to it
purely over I2C.
Drop interrupts from the required list, along with interrupt-controller
and #interrupt-cells, which cannot work without it. Add a dependency so
that a node claiming to be an interrupt controller still has to say where
its own interrupt comes from.
Signed-off-by: Oleg Keri <okerixx@gmail.com>
---
Documentation/devicetree/bindings/mfd/qcom,pm8008.yaml | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/Documentation/devicetree/bindings/mfd/qcom,pm8008.yaml b/Documentation/devicetree/bindings/mfd/qcom,pm8008.yaml
index 0c6e1870db1d..db1592e115e8 100644
--- a/Documentation/devicetree/bindings/mfd/qcom,pm8008.yaml
+++ b/Documentation/devicetree/bindings/mfd/qcom,pm8008.yaml
@@ -88,7 +88,6 @@ properties:
required:
- compatible
- reg
- - interrupts
- vdd-l1-l2-supply
- vdd-l3-l4-supply
- vdd-l5-supply
@@ -97,10 +96,12 @@ required:
- gpio-controller
- "#gpio-cells"
- gpio-ranges
- - interrupt-controller
- - "#interrupt-cells"
- "#thermal-sensor-cells"
+dependentRequired:
+ interrupt-controller: [ interrupts ]
+ "#interrupt-cells": [ interrupts ]
+
additionalProperties: false
examples:
--
2.55.0
^ permalink raw reply [flat|nested] 7+ messages in thread
* [PATCH 2/2] mfd: qcom-pm8008: support PMICs with no interrupt line
2026-09-08 13:07 [PATCH 0/2] mfd: qcom-pm8008: support PMICs with no interrupt line Oleg Keri
2026-09-08 13:07 ` [PATCH 1/2] dt-bindings: mfd: qcom,pm8008: make the interrupt line optional Oleg Keri
@ 2026-09-08 13:07 ` Oleg Keri
2026-09-08 13:40 ` [PATCH 0/2] " Oleg Keri
2 siblings, 0 replies; 7+ messages in thread
From: Oleg Keri @ 2026-09-08 13:07 UTC (permalink / raw)
To: Lee Jones, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
Guru Das Srinagesh
Cc: linux-arm-msm, mfd, devicetree, linux-kernel
The interrupt is only needed for the temperature alarm and the two GPIOs.
Where the pin is not routed the regulators are still perfectly usable, but
probe fails: client->irq is 0 and request_threaded_irq() rejects it.
Skip the IRQ chip in that case and register the regulator cell alone. The
temperature alarm cannot be registered without a domain either, because
its IORESOURCE_IRQ would be handed to the platform device as a raw number
rather than being mapped, and the GPIO cell needs the domain for the same
reason.
Signed-off-by: Oleg Keri <okerixx@gmail.com>
---
drivers/mfd/qcom-pm8008.c | 63 +++++++++++++++++++++++++--------------
1 file changed, 40 insertions(+), 23 deletions(-)
diff --git a/drivers/mfd/qcom-pm8008.c b/drivers/mfd/qcom-pm8008.c
index 60204cc9a2dc..b51a9657ee56 100644
--- a/drivers/mfd/qcom-pm8008.c
+++ b/drivers/mfd/qcom-pm8008.c
@@ -183,6 +183,10 @@ static const struct mfd_cell pm8008_cells[] = {
MFD_CELL_NAME("pm8008-gpio"),
};
+static const struct mfd_cell pm8008_regulator_cells[] = {
+ MFD_CELL_NAME("pm8008-regulator"),
+};
+
static void devm_irq_domain_fwnode_release(void *data)
{
struct fwnode_handle *fwnode = data;
@@ -195,9 +199,12 @@ static int pm8008_probe(struct i2c_client *client)
struct regmap_irq_chip_data *irq_data;
struct device *dev = &client->dev;
struct regmap *regmap, *regmap2;
+ const struct mfd_cell *cells;
struct fwnode_handle *fwnode;
+ struct irq_domain *domain;
struct i2c_client *dummy;
struct gpio_desc *reset;
+ int num_cells;
char *name;
int ret;
@@ -231,33 +238,43 @@ static int pm8008_probe(struct i2c_client *client)
*/
usleep_range(1000, 2000);
- name = devm_kasprintf(dev, GFP_KERNEL, "%pOF-internal", dev->of_node);
- if (!name)
- return -ENOMEM;
-
- name = strreplace(name, '/', ':');
-
- fwnode = irq_domain_alloc_named_fwnode(name);
- if (!fwnode)
- return -ENOMEM;
-
- ret = devm_add_action_or_reset(dev, devm_irq_domain_fwnode_release, fwnode);
- if (ret)
- return ret;
-
- ret = devm_regmap_add_irq_chip_fwnode(dev, fwnode, regmap, client->irq,
- IRQF_SHARED, 0, &pm8008_irq_chip, &irq_data);
- if (ret) {
- dev_err(dev, "failed to add IRQ chip: %d\n", ret);
- return ret;
+ if (client->irq > 0) {
+ name = devm_kasprintf(dev, GFP_KERNEL, "%pOF-internal", dev->of_node);
+ if (!name)
+ return -ENOMEM;
+
+ name = strreplace(name, '/', ':');
+
+ fwnode = irq_domain_alloc_named_fwnode(name);
+ if (!fwnode)
+ return -ENOMEM;
+
+ ret = devm_add_action_or_reset(dev, devm_irq_domain_fwnode_release, fwnode);
+ if (ret)
+ return ret;
+
+ ret = devm_regmap_add_irq_chip_fwnode(dev, fwnode, regmap,
+ client->irq, IRQF_SHARED, 0,
+ &pm8008_irq_chip, &irq_data);
+ if (ret) {
+ dev_err(dev, "failed to add IRQ chip: %d\n", ret);
+ return ret;
+ }
+
+ domain = regmap_irq_get_domain(irq_data);
+ cells = pm8008_cells;
+ num_cells = ARRAY_SIZE(pm8008_cells);
+ } else {
+ domain = NULL;
+ cells = pm8008_regulator_cells;
+ num_cells = ARRAY_SIZE(pm8008_regulator_cells);
}
/* Needed by GPIO driver. */
- dev_set_drvdata(dev, regmap_irq_get_domain(irq_data));
+ dev_set_drvdata(dev, domain);
- return devm_mfd_add_devices(dev, PLATFORM_DEVID_AUTO, pm8008_cells,
- ARRAY_SIZE(pm8008_cells), NULL, 0,
- regmap_irq_get_domain(irq_data));
+ return devm_mfd_add_devices(dev, PLATFORM_DEVID_AUTO, cells,
+ num_cells, NULL, 0, domain);
}
static const struct of_device_id pm8008_match[] = {
--
2.55.0
^ permalink raw reply [flat|nested] 7+ messages in thread* Re: [PATCH 0/2] mfd: qcom-pm8008: support PMICs with no interrupt line
2026-09-08 13:07 [PATCH 0/2] mfd: qcom-pm8008: support PMICs with no interrupt line Oleg Keri
2026-09-08 13:07 ` [PATCH 1/2] dt-bindings: mfd: qcom,pm8008: make the interrupt line optional Oleg Keri
2026-09-08 13:07 ` [PATCH 2/2] mfd: qcom-pm8008: support PMICs with no interrupt line Oleg Keri
@ 2026-09-08 13:40 ` Oleg Keri
2026-09-10 9:10 ` Jishnu Prakash
2 siblings, 1 reply; 7+ messages in thread
From: Oleg Keri @ 2026-09-08 13:40 UTC (permalink / raw)
To: Lee Jones, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
Guru Das Srinagesh
Cc: Nihal Kumar Gupta, linux-arm-msm, mfd, devicetree, linux-kernel
Please drop this series.
It duplicates, as a strict subset, work that was already on the list a day
before I posted:
[v2,3/6] dt-bindings: mfd: pm8008: Add PM8010 I2C support
[v2,5/6] mfd: qcom-pm8008: Add support for PM8010 PMIC
https://lore.kernel.org/all/20260907-glymur_camss-v2-0-75f7982dc983@oss.qualcomm.com/
Nihal's 3/6 relaxes the same required: entries mine does and more, and adds
the qcom,pm8010-i2c compatible; his 5/6 already carries the no-interrupt
path my 2/2 was adding:
static const struct mfd_cell pm8008_no_irq_cells[] = {
MFD_CELL_NAME("pm8008-regulator"),
};
on top of a PM8010 IRQ chip, match data and a pm8010-regulator cell. There
is nothing in my series that his does not do better. My apologies for the
noise - I should have searched the list before posting.
Nihal, if it is useful: the Lenovo Yoga Slim 7x Gen 11 (glymur, DMI 83QR)
has a PM8010 whose INT pin is genuinely not routed on the board, so it
exercises your no-IRQ path rather than being a DT omission. I have been
running an equivalent no-IRQ path there since 2026-08-25 - the LDOs
register and the OV08X40 works - and I am happy to test your series on it
and send a Tested-by once I have actually run it.
Your 6/6 also shows that describing a PM8010 as "qcom,pm8008", which is
what I do today, silently programs the wrong voltage ranges. On that board
the sensor takes dovdd from ldo4 at 1.8 V, and:
pm8008_pldo_ranges 1504000 + 8000 * n -> 1.8 V is selector 37
pm8010_pldo_lv_ranges 1800000 + 200000 * n -> 1.8 V is selector 0
so the same regulator-min/max-microvolt lands on a completely different
register value depending on which compatible the node carries. ldo3 and
ldo6 have the same split. ldo2 and ldo7 happen to map identically because
the nldo and pldo ranges share a base and step and differ only in their
upper bound.
The camera works on my board today despite this, which I would treat as
luck rather than evidence that it is harmless. It does mean your series
fixes a latent bug for boards already describing a PM8010 as qcom,pm8008,
not merely adding a new compatible - worth a line in 6/6 if you respin,
since those boards need the DT change and the driver change together.
^ permalink raw reply [flat|nested] 7+ messages in thread