From: Johan Hovold <johan+linaro@kernel.org>
To: Lee Jones <lee@kernel.org>, Mark Brown <broonie@kernel.org>,
Bjorn Andersson <andersson@kernel.org>
Cc: Rob Herring <robh@kernel.org>,
Krzysztof Kozlowski <krzk+dt@kernel.org>,
Conor Dooley <conor+dt@kernel.org>,
Konrad Dybcio <konrad.dybcio@linaro.org>,
Liam Girdwood <lgirdwood@gmail.com>,
Das Srinagesh <quic_gurus@quicinc.com>,
Satya Priya Kakitapalli <quic_skakitap@quicinc.com>,
Linus Walleij <linus.walleij@linaro.org>,
Stephen Boyd <swboyd@chromium.org>,
Bryan O'Donoghue <bryan.odonoghue@linaro.org>,
Andy Shevchenko <andy.shevchenko@gmail.com>,
linux-arm-msm@vger.kernel.org, devicetree@vger.kernel.org,
linux-kernel@vger.kernel.org,
Johan Hovold <johan+linaro@kernel.org>
Subject: [PATCH v3 03/12] mfd: pm8008: Deassert reset on probe
Date: Sat, 8 Jun 2024 17:55:17 +0200 [thread overview]
Message-ID: <20240608155526.12996-4-johan+linaro@kernel.org> (raw)
In-Reply-To: <20240608155526.12996-1-johan+linaro@kernel.org>
Request and deassert any (optional) reset gpio during probe in case it
has been left asserted by the boot firmware.
Note the reset line is not asserted to avoid reverting to the default
I2C address in case the firmware has configured an alternate address.
Tested-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org>
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Johan Hovold <johan+linaro@kernel.org>
---
drivers/mfd/qcom-pm8008.c | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/drivers/mfd/qcom-pm8008.c b/drivers/mfd/qcom-pm8008.c
index f71c490f25c8..5a77155a63d7 100644
--- a/drivers/mfd/qcom-pm8008.c
+++ b/drivers/mfd/qcom-pm8008.c
@@ -4,6 +4,7 @@
*/
#include <linux/bitops.h>
+#include <linux/gpio/consumer.h>
#include <linux/i2c.h>
#include <linux/interrupt.h>
#include <linux/irq.h>
@@ -156,6 +157,7 @@ static struct regmap_config qcom_mfd_regmap_cfg = {
static int pm8008_probe(struct i2c_client *client)
{
struct regmap_irq_chip_data *irq_data;
+ struct gpio_desc *reset;
int rc;
struct device *dev;
struct regmap *regmap;
@@ -167,6 +169,16 @@ static int pm8008_probe(struct i2c_client *client)
i2c_set_clientdata(client, regmap);
+ reset = devm_gpiod_get_optional(dev, "reset", GPIOD_OUT_LOW);
+ if (IS_ERR(reset))
+ return PTR_ERR(reset);
+
+ /*
+ * The PMIC does not appear to require a post-reset delay, but wait
+ * for a millisecond for now anyway.
+ */
+ usleep_range(1000, 2000);
+
if (of_property_read_bool(dev->of_node, "interrupt-controller")) {
rc = devm_regmap_add_irq_chip(dev, regmap, client->irq,
IRQF_SHARED, 0, &pm8008_irq_chip, &irq_data);
--
2.44.1
next prev parent reply other threads:[~2024-06-08 15:57 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-06-08 15:55 [PATCH v3 00/12] arm64: dts: qcom: sc8280xp-x13s: enable pm8008 camera pmic Johan Hovold
2024-06-08 15:55 ` [PATCH v3 01/12] dt-bindings: mfd: pm8008: Add reset gpio Johan Hovold
2024-06-08 15:55 ` [PATCH v3 02/12] mfd: pm8008: Fix regmap irq chip initialisation Johan Hovold
2024-06-08 15:55 ` Johan Hovold [this message]
2024-06-08 15:55 ` [PATCH v3 04/12] mfd: pm8008: Mark regmap structures as const Johan Hovold
2024-06-08 15:55 ` [PATCH v3 05/12] mfd: pm8008: Use lower case hex notation Johan Hovold
2024-06-08 15:55 ` [PATCH v3 06/12] mfd: pm8008: Rename irq chip Johan Hovold
2024-06-08 15:55 ` [PATCH v3 07/12] mfd: pm8008: Drop unused driver data Johan Hovold
2024-06-08 15:55 ` [PATCH v3 08/12] dt-bindings: mfd: pm8008: Drop redundant descriptions Johan Hovold
2024-06-08 15:55 ` [PATCH v3 09/12] dt-bindings: mfd: pm8008: Rework binding Johan Hovold
2024-06-13 16:34 ` Rob Herring (Arm)
2024-06-08 15:55 ` [PATCH v3 10/12] mfd: pm8008: Rework to match new DT binding Johan Hovold
2024-06-08 15:55 ` [PATCH v3 11/12] regulator: add pm8008 pmic regulator driver Johan Hovold
2024-06-10 14:25 ` Mark Brown
2024-06-08 15:55 ` [PATCH v3 12/12] arm64: dts: qcom: sc8280xp-x13s: enable pm8008 camera pmic Johan Hovold
2024-06-18 11:58 ` Konrad Dybcio
2024-06-13 17:44 ` [PATCH v3 00/12] " Lee Jones
2024-06-14 7:33 ` [GIT PULL] Immutable branch between MFD and Regulator due for the v6.10 merge window Lee Jones
2024-06-14 7:37 ` Lee Jones
2024-06-14 7:39 ` [GIT v2 PULL] Immutable branch between MFD and Regulator due for the v6.11 " Lee Jones
2024-06-14 9:03 ` (subset) [PATCH v3 00/12] arm64: dts: qcom: sc8280xp-x13s: enable pm8008 camera pmic Lee Jones
2024-06-21 6:11 ` Bjorn Andersson
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=20240608155526.12996-4-johan+linaro@kernel.org \
--to=johan+linaro@kernel.org \
--cc=andersson@kernel.org \
--cc=andy.shevchenko@gmail.com \
--cc=broonie@kernel.org \
--cc=bryan.odonoghue@linaro.org \
--cc=conor+dt@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=konrad.dybcio@linaro.org \
--cc=krzk+dt@kernel.org \
--cc=lee@kernel.org \
--cc=lgirdwood@gmail.com \
--cc=linus.walleij@linaro.org \
--cc=linux-arm-msm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=quic_gurus@quicinc.com \
--cc=quic_skakitap@quicinc.com \
--cc=robh@kernel.org \
--cc=swboyd@chromium.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).