From: Frieder Schrempf <frieder@fris.de>
To: Liam Girdwood <lgirdwood@gmail.com>,
linux-kernel@vger.kernel.org, Mark Brown <broonie@kernel.org>
Cc: Frieder Schrempf <frieder.schrempf@kontron.de>,
Bo Liu <liubo03@inspur.com>, Joy Zou <joy.zou@nxp.com>,
Rob Herring <robh@kernel.org>
Subject: [PATCH v2 4/5] regulator: pca9450: Make IRQ optional
Date: Mon, 8 Jul 2024 10:40:34 +0200 [thread overview]
Message-ID: <20240708084107.38986-5-frieder@fris.de> (raw)
In-Reply-To: <20240708084107.38986-1-frieder@fris.de>
From: Frieder Schrempf <frieder.schrempf@kontron.de>
The IRQ line might not be connected on some boards. Allow the driver
to be probed without it.
Signed-off-by: Frieder Schrempf <frieder.schrempf@kontron.de>
---
Changes for v2:
* none
---
drivers/regulator/pca9450-regulator.c | 41 +++++++++++++--------------
1 file changed, 19 insertions(+), 22 deletions(-)
diff --git a/drivers/regulator/pca9450-regulator.c b/drivers/regulator/pca9450-regulator.c
index be488c5dff140..9714afe347dcc 100644
--- a/drivers/regulator/pca9450-regulator.c
+++ b/drivers/regulator/pca9450-regulator.c
@@ -891,11 +891,6 @@ static int pca9450_i2c_probe(struct i2c_client *i2c)
unsigned int reset_ctrl;
int ret;
- if (!i2c->irq) {
- dev_err(&i2c->dev, "No IRQ configured?\n");
- return -EINVAL;
- }
-
pca9450 = devm_kzalloc(&i2c->dev, sizeof(struct pca9450), GFP_KERNEL);
if (!pca9450)
return -ENOMEM;
@@ -967,23 +962,25 @@ static int pca9450_i2c_probe(struct i2c_client *i2c)
}
}
- ret = devm_request_threaded_irq(pca9450->dev, pca9450->irq, NULL,
- pca9450_irq_handler,
- (IRQF_TRIGGER_FALLING | IRQF_ONESHOT),
- "pca9450-irq", pca9450);
- if (ret != 0) {
- dev_err(pca9450->dev, "Failed to request IRQ: %d\n",
- pca9450->irq);
- return ret;
- }
- /* Unmask all interrupt except PWRON/WDOG/RSVD */
- ret = regmap_update_bits(pca9450->regmap, PCA9450_REG_INT1_MSK,
- IRQ_VR_FLT1 | IRQ_VR_FLT2 | IRQ_LOWVSYS |
- IRQ_THERM_105 | IRQ_THERM_125,
- IRQ_PWRON | IRQ_WDOGB | IRQ_RSVD);
- if (ret) {
- dev_err(&i2c->dev, "Unmask irq error\n");
- return ret;
+ if (pca9450->irq) {
+ ret = devm_request_threaded_irq(pca9450->dev, pca9450->irq, NULL,
+ pca9450_irq_handler,
+ (IRQF_TRIGGER_FALLING | IRQF_ONESHOT),
+ "pca9450-irq", pca9450);
+ if (ret != 0) {
+ dev_err(pca9450->dev, "Failed to request IRQ: %d\n",
+ pca9450->irq);
+ return ret;
+ }
+ /* Unmask all interrupt except PWRON/WDOG/RSVD */
+ ret = regmap_update_bits(pca9450->regmap, PCA9450_REG_INT1_MSK,
+ IRQ_VR_FLT1 | IRQ_VR_FLT2 | IRQ_LOWVSYS |
+ IRQ_THERM_105 | IRQ_THERM_125,
+ IRQ_PWRON | IRQ_WDOGB | IRQ_RSVD);
+ if (ret) {
+ dev_err(&i2c->dev, "Unmask irq error\n");
+ return ret;
+ }
}
/* Clear PRESET_EN bit in BUCK123_DVS to use DVS registers */
--
2.45.2
next prev parent reply other threads:[~2024-07-08 8:41 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-07-08 8:40 [PATCH v2 0/5] Add support for Kontron OSM-S i.MX93 SoM and carrier board Frieder Schrempf
2024-07-08 8:40 ` [PATCH v2 1/5] dt-bindings: gpio: vf610: Allow gpio-line-names to be set Frieder Schrempf
2024-07-08 13:58 ` Krzysztof Kozlowski
2024-07-08 14:53 ` Bartosz Golaszewski
2024-07-08 8:40 ` [PATCH v2 2/5] dt-bindings: regulator: pca9450: Make interrupt optional Frieder Schrempf
2024-07-08 13:58 ` Krzysztof Kozlowski
2024-07-08 8:40 ` [PATCH v2 3/5] dt-bindings: arm: fsl: Add Kontron i.MX93 OSM-S based boards Frieder Schrempf
2024-07-08 8:40 ` Frieder Schrempf [this message]
2024-07-08 8:40 ` [PATCH v2 5/5] arm64: dts: Add support for Kontron i.MX93 OSM-S SoM and BL carrier board Frieder Schrempf
2024-07-08 14:34 ` [PATCH v2 0/5] Add support for Kontron OSM-S i.MX93 SoM and " Rob Herring (Arm)
2024-07-08 14:48 ` (subset) " Mark Brown
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20240708084107.38986-5-frieder@fris.de \
--to=frieder@fris.de \
--cc=broonie@kernel.org \
--cc=frieder.schrempf@kontron.de \
--cc=joy.zou@nxp.com \
--cc=lgirdwood@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=liubo03@inspur.com \
--cc=robh@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.