* [PATCH 1/2] dt-bindings: mfd: lp875xx: add optional reset GPIO
@ 2021-02-26 14:28 Luca Ceresoli
2021-02-26 14:28 ` [PATCH 2/2] mfd: lp87565: handle optional reset pin Luca Ceresoli
` (2 more replies)
0 siblings, 3 replies; 6+ messages in thread
From: Luca Ceresoli @ 2021-02-26 14:28 UTC (permalink / raw)
To: Lee Jones, devicetree; +Cc: Luca Ceresoli, Rob Herring, Keerthy, linux-kernel
Document the LP8756x-Q1 and LP87524-Q1 ICs reset pin.
Signed-off-by: Luca Ceresoli <luca@lucaceresoli.net>
---
Documentation/devicetree/bindings/mfd/ti,lp87524-q1.yaml | 4 ++++
Documentation/devicetree/bindings/mfd/ti,lp87561-q1.yaml | 4 ++++
Documentation/devicetree/bindings/mfd/ti,lp87565-q1.yaml | 4 ++++
3 files changed, 12 insertions(+)
diff --git a/Documentation/devicetree/bindings/mfd/ti,lp87524-q1.yaml b/Documentation/devicetree/bindings/mfd/ti,lp87524-q1.yaml
index c4fc5345d38d..f6cac4b1079c 100644
--- a/Documentation/devicetree/bindings/mfd/ti,lp87524-q1.yaml
+++ b/Documentation/devicetree/bindings/mfd/ti,lp87524-q1.yaml
@@ -17,6 +17,10 @@ properties:
description: I2C slave address
const: 0x60
+ reset-gpios:
+ description: GPIO connected to NRST pin (active low reset, pin 20)
+ maxItems: 1
+
gpio-controller: true
'#gpio-cells':
diff --git a/Documentation/devicetree/bindings/mfd/ti,lp87561-q1.yaml b/Documentation/devicetree/bindings/mfd/ti,lp87561-q1.yaml
index a7e57c0913e1..dc5a29b5ef7d 100644
--- a/Documentation/devicetree/bindings/mfd/ti,lp87561-q1.yaml
+++ b/Documentation/devicetree/bindings/mfd/ti,lp87561-q1.yaml
@@ -17,6 +17,10 @@ properties:
description: I2C slave address
const: 0x60
+ reset-gpios:
+ description: GPIO connected to NRST pin (active low reset, pin 20)
+ maxItems: 1
+
gpio-controller: true
'#gpio-cells':
diff --git a/Documentation/devicetree/bindings/mfd/ti,lp87565-q1.yaml b/Documentation/devicetree/bindings/mfd/ti,lp87565-q1.yaml
index 1da6d6a958c9..48d4d53c25f9 100644
--- a/Documentation/devicetree/bindings/mfd/ti,lp87565-q1.yaml
+++ b/Documentation/devicetree/bindings/mfd/ti,lp87565-q1.yaml
@@ -19,6 +19,10 @@ properties:
description: I2C slave address
const: 0x60
+ reset-gpios:
+ description: GPIO connected to NRST pin (active low reset, pin 20)
+ maxItems: 1
+
gpio-controller: true
'#gpio-cells':
--
2.30.0
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [PATCH 2/2] mfd: lp87565: handle optional reset pin
2021-02-26 14:28 [PATCH 1/2] dt-bindings: mfd: lp875xx: add optional reset GPIO Luca Ceresoli
@ 2021-02-26 14:28 ` Luca Ceresoli
2021-05-12 9:12 ` Luca Ceresoli
2021-05-19 12:25 ` Lee Jones
2021-03-08 17:22 ` [PATCH 1/2] dt-bindings: mfd: lp875xx: add optional reset GPIO Rob Herring
2021-03-10 9:20 ` Lee Jones
2 siblings, 2 replies; 6+ messages in thread
From: Luca Ceresoli @ 2021-02-26 14:28 UTC (permalink / raw)
To: Lee Jones, devicetree; +Cc: Luca Ceresoli, Rob Herring, Keerthy, linux-kernel
Optionally handle the NRST pin (active low reset) in order to start from a
known state during boot and to shut down the chip when rebooting.
Signed-off-by: Luca Ceresoli <luca@lucaceresoli.net>
---
drivers/mfd/lp87565.c | 27 +++++++++++++++++++++++++++
include/linux/mfd/lp87565.h | 1 +
2 files changed, 28 insertions(+)
diff --git a/drivers/mfd/lp87565.c b/drivers/mfd/lp87565.c
index 9c21483d9653..a52ab76febb3 100644
--- a/drivers/mfd/lp87565.c
+++ b/drivers/mfd/lp87565.c
@@ -5,6 +5,7 @@
* Author: Keerthy <j-keerthy@ti.com>
*/
+#include <linux/gpio/consumer.h>
#include <linux/interrupt.h>
#include <linux/mfd/core.h>
#include <linux/module.h>
@@ -64,6 +65,24 @@ static int lp87565_probe(struct i2c_client *client,
return ret;
}
+ lp87565->reset_gpio = devm_gpiod_get_optional(lp87565->dev, "reset",
+ GPIOD_OUT_LOW);
+ if (IS_ERR(lp87565->reset_gpio)) {
+ ret = PTR_ERR(lp87565->reset_gpio);
+ if (ret == -EPROBE_DEFER)
+ return ret;
+ }
+
+ if (lp87565->reset_gpio) {
+ gpiod_set_value_cansleep(lp87565->reset_gpio, 1);
+ /* The minimum assertion time is undocumented, just guess */
+ usleep_range(2000, 4000);
+
+ gpiod_set_value_cansleep(lp87565->reset_gpio, 0);
+ /* Min 1.2 ms before first I2C transaction */
+ usleep_range(1500, 3000);
+ }
+
ret = regmap_read(lp87565->regmap, LP87565_REG_OTP_REV, &otpid);
if (ret) {
dev_err(lp87565->dev, "Failed to read OTP ID\n");
@@ -83,6 +102,13 @@ static int lp87565_probe(struct i2c_client *client,
NULL, 0, NULL);
}
+static void lp87565_shutdown(struct i2c_client *client)
+{
+ struct lp87565 *lp87565 = i2c_get_clientdata(client);
+
+ gpiod_set_value_cansleep(lp87565->reset_gpio, 1);
+}
+
static const struct i2c_device_id lp87565_id_table[] = {
{ "lp87565-q1", 0 },
{ },
@@ -95,6 +121,7 @@ static struct i2c_driver lp87565_driver = {
.of_match_table = of_lp87565_match_table,
},
.probe = lp87565_probe,
+ .shutdown = lp87565_shutdown,
.id_table = lp87565_id_table,
};
module_i2c_driver(lp87565_driver);
diff --git a/include/linux/mfd/lp87565.h b/include/linux/mfd/lp87565.h
index 94cb581af34b..4c895072d91b 100644
--- a/include/linux/mfd/lp87565.h
+++ b/include/linux/mfd/lp87565.h
@@ -252,5 +252,6 @@ struct lp87565 {
u8 rev;
u8 dev_type;
struct regmap *regmap;
+ struct gpio_desc *reset_gpio;
};
#endif /* __LINUX_MFD_LP87565_H */
--
2.30.0
^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [PATCH 1/2] dt-bindings: mfd: lp875xx: add optional reset GPIO
2021-02-26 14:28 [PATCH 1/2] dt-bindings: mfd: lp875xx: add optional reset GPIO Luca Ceresoli
2021-02-26 14:28 ` [PATCH 2/2] mfd: lp87565: handle optional reset pin Luca Ceresoli
@ 2021-03-08 17:22 ` Rob Herring
2021-03-10 9:20 ` Lee Jones
2 siblings, 0 replies; 6+ messages in thread
From: Rob Herring @ 2021-03-08 17:22 UTC (permalink / raw)
To: Luca Ceresoli; +Cc: devicetree, Rob Herring, Lee Jones, linux-kernel, Keerthy
On Fri, 26 Feb 2021 15:28:51 +0100, Luca Ceresoli wrote:
> Document the LP8756x-Q1 and LP87524-Q1 ICs reset pin.
>
> Signed-off-by: Luca Ceresoli <luca@lucaceresoli.net>
> ---
> Documentation/devicetree/bindings/mfd/ti,lp87524-q1.yaml | 4 ++++
> Documentation/devicetree/bindings/mfd/ti,lp87561-q1.yaml | 4 ++++
> Documentation/devicetree/bindings/mfd/ti,lp87565-q1.yaml | 4 ++++
> 3 files changed, 12 insertions(+)
>
Reviewed-by: Rob Herring <robh@kernel.org>
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH 1/2] dt-bindings: mfd: lp875xx: add optional reset GPIO
2021-02-26 14:28 [PATCH 1/2] dt-bindings: mfd: lp875xx: add optional reset GPIO Luca Ceresoli
2021-02-26 14:28 ` [PATCH 2/2] mfd: lp87565: handle optional reset pin Luca Ceresoli
2021-03-08 17:22 ` [PATCH 1/2] dt-bindings: mfd: lp875xx: add optional reset GPIO Rob Herring
@ 2021-03-10 9:20 ` Lee Jones
2 siblings, 0 replies; 6+ messages in thread
From: Lee Jones @ 2021-03-10 9:20 UTC (permalink / raw)
To: Luca Ceresoli; +Cc: devicetree, Rob Herring, Keerthy, linux-kernel
On Fri, 26 Feb 2021, Luca Ceresoli wrote:
> Document the LP8756x-Q1 and LP87524-Q1 ICs reset pin.
>
> Signed-off-by: Luca Ceresoli <luca@lucaceresoli.net>
> ---
> Documentation/devicetree/bindings/mfd/ti,lp87524-q1.yaml | 4 ++++
> Documentation/devicetree/bindings/mfd/ti,lp87561-q1.yaml | 4 ++++
> Documentation/devicetree/bindings/mfd/ti,lp87565-q1.yaml | 4 ++++
> 3 files changed, 12 insertions(+)
Applied, thanks.
--
Lee Jones [李琼斯]
Senior Technical Lead - Developer Services
Linaro.org │ Open source software for Arm SoCs
Follow Linaro: Facebook | Twitter | Blog
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH 2/2] mfd: lp87565: handle optional reset pin
2021-02-26 14:28 ` [PATCH 2/2] mfd: lp87565: handle optional reset pin Luca Ceresoli
@ 2021-05-12 9:12 ` Luca Ceresoli
2021-05-19 12:25 ` Lee Jones
1 sibling, 0 replies; 6+ messages in thread
From: Luca Ceresoli @ 2021-05-12 9:12 UTC (permalink / raw)
To: Lee Jones, devicetree; +Cc: Rob Herring, Keerthy, linux-kernel
Hi,
On 26/02/21 15:28, Luca Ceresoli wrote:
> Optionally handle the NRST pin (active low reset) in order to start from a
> known state during boot and to shut down the chip when rebooting.
>
> Signed-off-by: Luca Ceresoli <luca@lucaceresoli.net>
Ping. Patch 2 is now in mainline. This patch applies cleanly on v5.13-rc1.
--
Luca
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH 2/2] mfd: lp87565: handle optional reset pin
2021-02-26 14:28 ` [PATCH 2/2] mfd: lp87565: handle optional reset pin Luca Ceresoli
2021-05-12 9:12 ` Luca Ceresoli
@ 2021-05-19 12:25 ` Lee Jones
1 sibling, 0 replies; 6+ messages in thread
From: Lee Jones @ 2021-05-19 12:25 UTC (permalink / raw)
To: Luca Ceresoli; +Cc: devicetree, Rob Herring, Keerthy, linux-kernel
On Fri, 26 Feb 2021, Luca Ceresoli wrote:
> Optionally handle the NRST pin (active low reset) in order to start from a
> known state during boot and to shut down the chip when rebooting.
>
> Signed-off-by: Luca Ceresoli <luca@lucaceresoli.net>
> ---
> drivers/mfd/lp87565.c | 27 +++++++++++++++++++++++++++
> include/linux/mfd/lp87565.h | 1 +
> 2 files changed, 28 insertions(+)
Applied, thanks.
--
Lee Jones [李琼斯]
Senior Technical Lead - Developer Services
Linaro.org │ Open source software for Arm SoCs
Follow Linaro: Facebook | Twitter | Blog
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2021-05-19 12:26 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-02-26 14:28 [PATCH 1/2] dt-bindings: mfd: lp875xx: add optional reset GPIO Luca Ceresoli
2021-02-26 14:28 ` [PATCH 2/2] mfd: lp87565: handle optional reset pin Luca Ceresoli
2021-05-12 9:12 ` Luca Ceresoli
2021-05-19 12:25 ` Lee Jones
2021-03-08 17:22 ` [PATCH 1/2] dt-bindings: mfd: lp875xx: add optional reset GPIO Rob Herring
2021-03-10 9:20 ` Lee Jones
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.