All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/2] net: m_can: tcan4x5x: add required delay after reset
@ 2019-12-06 15:29 Sean Nyekjaer
  2019-12-06 15:29 ` [PATCH 2/2] dt-bindings: can: tcan4x5x: reset pin is active high Sean Nyekjaer
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: Sean Nyekjaer @ 2019-12-06 15:29 UTC (permalink / raw)
  To: mkl, dmurphy, linux-can, robh+dt; +Cc: Sean Nyekjaer, devicetree, martin

According to section "8.3.8 RST Pin" in the datasheet we are required to
wait >700us after the device is reset.

Signed-off-by: Sean Nyekjaer <sean@geanix.com>
---
 drivers/net/can/m_can/tcan4x5x.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/net/can/m_can/tcan4x5x.c b/drivers/net/can/m_can/tcan4x5x.c
index 6e37c3fd87af..cb5fdb695ec9 100644
--- a/drivers/net/can/m_can/tcan4x5x.c
+++ b/drivers/net/can/m_can/tcan4x5x.c
@@ -367,6 +367,8 @@ static int tcan4x5x_parse_config(struct m_can_classdev *cdev)
 	if (IS_ERR(tcan4x5x->reset_gpio))
 		tcan4x5x->reset_gpio = NULL;
 
+	usleep_range(700, 1000);
+
 	tcan4x5x->device_state_gpio = devm_gpiod_get_optional(cdev->dev,
 							      "device-state",
 							      GPIOD_IN);
-- 
2.24.0


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [PATCH 2/2] dt-bindings: can: tcan4x5x: reset pin is active high
  2019-12-06 15:29 [PATCH 1/2] net: m_can: tcan4x5x: add required delay after reset Sean Nyekjaer
@ 2019-12-06 15:29 ` Sean Nyekjaer
  2019-12-06 15:33 ` [PATCH 1/2] net: m_can: tcan4x5x: add required delay after reset Dan Murphy
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: Sean Nyekjaer @ 2019-12-06 15:29 UTC (permalink / raw)
  To: mkl, dmurphy, linux-can, robh+dt; +Cc: Sean Nyekjaer, devicetree, martin

Change the reset pin example to active high to be in line with
the datasheet

Signed-off-by: Sean Nyekjaer <sean@geanix.com>
---
 Documentation/devicetree/bindings/net/can/tcan4x5x.txt | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/Documentation/devicetree/bindings/net/can/tcan4x5x.txt b/Documentation/devicetree/bindings/net/can/tcan4x5x.txt
index 27e1b4cebfbd..e8aa21d9174e 100644
--- a/Documentation/devicetree/bindings/net/can/tcan4x5x.txt
+++ b/Documentation/devicetree/bindings/net/can/tcan4x5x.txt
@@ -36,5 +36,5 @@ tcan4x5x: tcan4x5x@0 {
 		interrupts = <14 GPIO_ACTIVE_LOW>;
 		device-state-gpios = <&gpio3 21 GPIO_ACTIVE_HIGH>;
 		device-wake-gpios = <&gpio1 15 GPIO_ACTIVE_HIGH>;
-		reset-gpios = <&gpio1 27 GPIO_ACTIVE_LOW>;
+		reset-gpios = <&gpio1 27 GPIO_ACTIVE_HIGH>;
 };
-- 
2.24.0


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH 1/2] net: m_can: tcan4x5x: add required delay after reset
  2019-12-06 15:29 [PATCH 1/2] net: m_can: tcan4x5x: add required delay after reset Sean Nyekjaer
  2019-12-06 15:29 ` [PATCH 2/2] dt-bindings: can: tcan4x5x: reset pin is active high Sean Nyekjaer
@ 2019-12-06 15:33 ` Dan Murphy
  2019-12-06 15:34 ` Dan Murphy
  2019-12-07 13:03 ` Marc Kleine-Budde
  3 siblings, 0 replies; 5+ messages in thread
From: Dan Murphy @ 2019-12-06 15:33 UTC (permalink / raw)
  To: Sean Nyekjaer, mkl, linux-can, robh+dt; +Cc: devicetree, martin

Sean

On 12/6/19 9:29 AM, Sean Nyekjaer wrote:
> According to section "8.3.8 RST Pin" in the datasheet we are required to
> wait >700us after the device is reset.
>
> Signed-off-by: Sean Nyekjaer <sean@geanix.com>
> ---
>   drivers/net/can/m_can/tcan4x5x.c | 2 ++
>   1 file changed, 2 insertions(+)
>
> diff --git a/drivers/net/can/m_can/tcan4x5x.c b/drivers/net/can/m_can/tcan4x5x.c
> index 6e37c3fd87af..cb5fdb695ec9 100644
> --- a/drivers/net/can/m_can/tcan4x5x.c
> +++ b/drivers/net/can/m_can/tcan4x5x.c
> @@ -367,6 +367,8 @@ static int tcan4x5x_parse_config(struct m_can_classdev *cdev)
>   	if (IS_ERR(tcan4x5x->reset_gpio))
>   		tcan4x5x->reset_gpio = NULL;
>   
> +	usleep_range(700, 1000);
> +
>   	tcan4x5x->device_state_gpio = devm_gpiod_get_optional(cdev->dev,
>   							      "device-state",
>   							      GPIOD_IN);

Acked-by: Dan Murphy <dmurphy@ti.com>

Thanks for the patch.  My data sheet was old and did not have the timing 
diagrams in them.
I downloaded the latest data sheet.

Dan


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH 1/2] net: m_can: tcan4x5x: add required delay after reset
  2019-12-06 15:29 [PATCH 1/2] net: m_can: tcan4x5x: add required delay after reset Sean Nyekjaer
  2019-12-06 15:29 ` [PATCH 2/2] dt-bindings: can: tcan4x5x: reset pin is active high Sean Nyekjaer
  2019-12-06 15:33 ` [PATCH 1/2] net: m_can: tcan4x5x: add required delay after reset Dan Murphy
@ 2019-12-06 15:34 ` Dan Murphy
  2019-12-07 13:03 ` Marc Kleine-Budde
  3 siblings, 0 replies; 5+ messages in thread
From: Dan Murphy @ 2019-12-06 15:34 UTC (permalink / raw)
  To: Sean Nyekjaer, mkl, linux-can, robh+dt; +Cc: devicetree, martin

Sean

On 12/6/19 9:29 AM, Sean Nyekjaer wrote:
> According to section "8.3.8 RST Pin" in the datasheet we are required to
> wait >700us after the device is reset.
>
> Signed-off-by: Sean Nyekjaer <sean@geanix.com>
> ---
>   drivers/net/can/m_can/tcan4x5x.c | 2 ++
>   1 file changed, 2 insertions(+)
>
> diff --git a/drivers/net/can/m_can/tcan4x5x.c b/drivers/net/can/m_can/tcan4x5x.c
> index 6e37c3fd87af..cb5fdb695ec9 100644
> --- a/drivers/net/can/m_can/tcan4x5x.c
> +++ b/drivers/net/can/m_can/tcan4x5x.c
> @@ -367,6 +367,8 @@ static int tcan4x5x_parse_config(struct m_can_classdev *cdev)
>   	if (IS_ERR(tcan4x5x->reset_gpio))
>   		tcan4x5x->reset_gpio = NULL;
>   
> +	usleep_range(700, 1000);
> +
>   	tcan4x5x->device_state_gpio = devm_gpiod_get_optional(cdev->dev,
>   							      "device-state",
>   							      GPIOD_IN);
Acked-by: Dan Murphy <dmurphy@ti.com>

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH 1/2] net: m_can: tcan4x5x: add required delay after reset
  2019-12-06 15:29 [PATCH 1/2] net: m_can: tcan4x5x: add required delay after reset Sean Nyekjaer
                   ` (2 preceding siblings ...)
  2019-12-06 15:34 ` Dan Murphy
@ 2019-12-07 13:03 ` Marc Kleine-Budde
  3 siblings, 0 replies; 5+ messages in thread
From: Marc Kleine-Budde @ 2019-12-07 13:03 UTC (permalink / raw)
  To: Sean Nyekjaer, dmurphy, linux-can, robh+dt; +Cc: devicetree, martin


[-- Attachment #1.1: Type: text/plain, Size: 531 bytes --]

On 12/6/19 4:29 PM, Sean Nyekjaer wrote:
> According to section "8.3.8 RST Pin" in the datasheet we are required to
> wait >700us after the device is reset.
> 
> Signed-off-by: Sean Nyekjaer <sean@geanix.com>

applied both to linux-can.

tnx,
Marc

-- 
Pengutronix e.K.                 | Marc Kleine-Budde           |
Embedded Linux                   | https://www.pengutronix.de  |
Vertretung West/Dortmund         | Phone: +49-231-2826-924     |
Amtsgericht Hildesheim, HRA 2686 | Fax:   +49-5121-206917-5555 |


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2019-12-07 13:04 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-12-06 15:29 [PATCH 1/2] net: m_can: tcan4x5x: add required delay after reset Sean Nyekjaer
2019-12-06 15:29 ` [PATCH 2/2] dt-bindings: can: tcan4x5x: reset pin is active high Sean Nyekjaer
2019-12-06 15:33 ` [PATCH 1/2] net: m_can: tcan4x5x: add required delay after reset Dan Murphy
2019-12-06 15:34 ` Dan Murphy
2019-12-07 13:03 ` Marc Kleine-Budde

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.