[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1654602615-28849-5-git-send-email-quic_c_skakit@quicinc.com>
Date: Tue, 7 Jun 2022 17:20:10 +0530
From: Satya Priya <quic_c_skakit@...cinc.com>
To: Bjorn Andersson <bjorn.andersson@...aro.org>,
Rob Herring <robh+dt@...nel.org>
CC: Lee Jones <lee.jones@...aro.org>,
Liam Girdwood <lgirdwood@...il.com>,
Mark Brown <broonie@...nel.org>,
<linux-arm-msm@...r.kernel.org>, <devicetree@...r.kernel.org>,
<linux-kernel@...r.kernel.org>, <swboyd@...omium.org>,
<quic_collinsd@...cinc.com>, <quic_subbaram@...cinc.com>,
<quic_jprakash@...cinc.com>,
Satya Priya <quic_c_skakit@...cinc.com>
Subject: [PATCH V14 4/9] mfd: pm8008: Add reset-gpios
Add the reset-gpio toggling in the pm8008_probe() to bring
pm8008 chip out of reset instead of doing it in DT node using
"output-high" property.
Signed-off-by: Satya Priya <quic_c_skakit@...cinc.com>
Reviewed-by: Stephen Boyd <swboyd@...omium.org>
---
Changes in V14:
- None.
Changes in V13:
- None.
Changes in V12:
- Move reset_gpio acquiring above probe_irq_peripherals in pm8008_probe.
Changes in V11:
- Use local variable for reset_gpios as it is not used outside of probe.
- Use GPIOD_OUT_LOW flag to initialize the gpio and remove below line
as it is not required "gpiod_set_value(chip->reset_gpio, 1);".
drivers/mfd/qcom-pm8008.c | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/drivers/mfd/qcom-pm8008.c b/drivers/mfd/qcom-pm8008.c
index c472d7f..5a670b0 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>
@@ -221,6 +222,7 @@ static int pm8008_probe(struct i2c_client *client)
{
int rc;
struct pm8008_data *chip;
+ struct gpio_desc *reset_gpio;
chip = devm_kzalloc(&client->dev, sizeof(*chip), GFP_KERNEL);
if (!chip)
@@ -233,6 +235,10 @@ static int pm8008_probe(struct i2c_client *client)
i2c_set_clientdata(client, chip);
+ reset_gpio = devm_gpiod_get(chip->dev, "reset", GPIOD_OUT_LOW);
+ if (IS_ERR(reset_gpio))
+ return PTR_ERR(reset_gpio);
+
if (of_property_read_bool(chip->dev->of_node, "interrupt-controller")) {
rc = pm8008_probe_irq_peripherals(chip, client->irq);
if (rc)
--
2.7.4
Powered by blists - more mailing lists