All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] can: m_can: Set pinmux into "default" state on start
@ 2020-05-31 18:13 Marek Vasut
  2020-08-09 11:01 ` Marek Vasut
  0 siblings, 1 reply; 4+ messages in thread
From: Marek Vasut @ 2020-05-31 18:13 UTC (permalink / raw)
  To: linux-can
  Cc: Marek Vasut, Alexandre Torgue, Marc Kleine-Budde, Wolfgang Grandegger

On systems like stm32mp1 where pins have both "default" and "sleep" pinmux
states in DT, the pins are in "sleep" state by default. Switch the pins into
the "default" state when bringing the interface up in m_can_start(), because
otherwise no CAN communication is possible. This replicates the behavior of
the resume path, which does the same.

Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Alexandre Torgue <alexandre.torgue@st.com>
Cc: Marc Kleine-Budde <mkl@pengutronix.de>
Cc: Wolfgang Grandegger <wg@grandegger.com>
To: linux-can@vger.kernel.org
---
 drivers/net/can/m_can/m_can.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/net/can/m_can/m_can.c b/drivers/net/can/m_can/m_can.c
index 02c5795b7393..76fadf2b8ac2 100644
--- a/drivers/net/can/m_can/m_can.c
+++ b/drivers/net/can/m_can/m_can.c
@@ -1247,6 +1247,8 @@ static void m_can_start(struct net_device *dev)
 	/* basic m_can configuration */
 	m_can_chip_config(dev);
 
+	pinctrl_pm_select_default_state(cdev->dev);
+
 	cdev->can.state = CAN_STATE_ERROR_ACTIVE;
 
 	m_can_enable_all_interrupts(cdev);
-- 
2.25.1

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

* Re: [PATCH] can: m_can: Set pinmux into "default" state on start
  2020-05-31 18:13 [PATCH] can: m_can: Set pinmux into "default" state on start Marek Vasut
@ 2020-08-09 11:01 ` Marek Vasut
  2020-09-01 18:56   ` Marek Vasut
  0 siblings, 1 reply; 4+ messages in thread
From: Marek Vasut @ 2020-08-09 11:01 UTC (permalink / raw)
  To: linux-can; +Cc: Alexandre Torgue, Marc Kleine-Budde, Wolfgang Grandegger

On 5/31/20 8:13 PM, Marek Vasut wrote:
> On systems like stm32mp1 where pins have both "default" and "sleep" pinmux
> states in DT, the pins are in "sleep" state by default. Switch the pins into
> the "default" state when bringing the interface up in m_can_start(), because
> otherwise no CAN communication is possible. This replicates the behavior of
> the resume path, which does the same.
> 
> Signed-off-by: Marek Vasut <marex@denx.de>
> Cc: Alexandre Torgue <alexandre.torgue@st.com>
> Cc: Marc Kleine-Budde <mkl@pengutronix.de>
> Cc: Wolfgang Grandegger <wg@grandegger.com>
> To: linux-can@vger.kernel.org
> ---
>  drivers/net/can/m_can/m_can.c | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/drivers/net/can/m_can/m_can.c b/drivers/net/can/m_can/m_can.c
> index 02c5795b7393..76fadf2b8ac2 100644
> --- a/drivers/net/can/m_can/m_can.c
> +++ b/drivers/net/can/m_can/m_can.c
> @@ -1247,6 +1247,8 @@ static void m_can_start(struct net_device *dev)
>  	/* basic m_can configuration */
>  	m_can_chip_config(dev);
>  
> +	pinctrl_pm_select_default_state(cdev->dev);
> +
>  	cdev->can.state = CAN_STATE_ERROR_ACTIVE;
>  
>  	m_can_enable_all_interrupts(cdev);
> 

Any news on this ?

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

* Re: [PATCH] can: m_can: Set pinmux into "default" state on start
  2020-08-09 11:01 ` Marek Vasut
@ 2020-09-01 18:56   ` Marek Vasut
  2020-09-17  1:04     ` Marek Vasut
  0 siblings, 1 reply; 4+ messages in thread
From: Marek Vasut @ 2020-09-01 18:56 UTC (permalink / raw)
  To: linux-can
  Cc: Alexandre Torgue, Marc Kleine-Budde, Wolfgang Grandegger,
	dmurphy, netdev

On 8/9/20 1:01 PM, Marek Vasut wrote:
> On 5/31/20 8:13 PM, Marek Vasut wrote:
>> On systems like stm32mp1 where pins have both "default" and "sleep" pinmux
>> states in DT, the pins are in "sleep" state by default. Switch the pins into
>> the "default" state when bringing the interface up in m_can_start(), because
>> otherwise no CAN communication is possible. This replicates the behavior of
>> the resume path, which does the same.
>>
>> Signed-off-by: Marek Vasut <marex@denx.de>
>> Cc: Alexandre Torgue <alexandre.torgue@st.com>
>> Cc: Marc Kleine-Budde <mkl@pengutronix.de>
>> Cc: Wolfgang Grandegger <wg@grandegger.com>
>> To: linux-can@vger.kernel.org
>> ---
>>  drivers/net/can/m_can/m_can.c | 2 ++
>>  1 file changed, 2 insertions(+)
>>
>> diff --git a/drivers/net/can/m_can/m_can.c b/drivers/net/can/m_can/m_can.c
>> index 02c5795b7393..76fadf2b8ac2 100644
>> --- a/drivers/net/can/m_can/m_can.c
>> +++ b/drivers/net/can/m_can/m_can.c
>> @@ -1247,6 +1247,8 @@ static void m_can_start(struct net_device *dev)
>>  	/* basic m_can configuration */
>>  	m_can_chip_config(dev);
>>  
>> +	pinctrl_pm_select_default_state(cdev->dev);
>> +
>>  	cdev->can.state = CAN_STATE_ERROR_ACTIVE;
>>  
>>  	m_can_enable_all_interrupts(cdev);
>>
> 
> Any news on this ?

Almost another month has passed by, ping ?

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

* Re: [PATCH] can: m_can: Set pinmux into "default" state on start
  2020-09-01 18:56   ` Marek Vasut
@ 2020-09-17  1:04     ` Marek Vasut
  0 siblings, 0 replies; 4+ messages in thread
From: Marek Vasut @ 2020-09-17  1:04 UTC (permalink / raw)
  To: linux-can
  Cc: Alexandre Torgue, Marc Kleine-Budde, Wolfgang Grandegger,
	dmurphy, netdev, socketcan, davem, andrew

On 9/1/20 8:56 PM, Marek Vasut wrote:
> On 8/9/20 1:01 PM, Marek Vasut wrote:
>> On 5/31/20 8:13 PM, Marek Vasut wrote:
>>> On systems like stm32mp1 where pins have both "default" and "sleep" pinmux
>>> states in DT, the pins are in "sleep" state by default. Switch the pins into
>>> the "default" state when bringing the interface up in m_can_start(), because
>>> otherwise no CAN communication is possible. This replicates the behavior of
>>> the resume path, which does the same.
>>>
>>> Signed-off-by: Marek Vasut <marex@denx.de>
>>> Cc: Alexandre Torgue <alexandre.torgue@st.com>
>>> Cc: Marc Kleine-Budde <mkl@pengutronix.de>
>>> Cc: Wolfgang Grandegger <wg@grandegger.com>
>>> To: linux-can@vger.kernel.org
>>> ---
>>>  drivers/net/can/m_can/m_can.c | 2 ++
>>>  1 file changed, 2 insertions(+)
>>>
>>> diff --git a/drivers/net/can/m_can/m_can.c b/drivers/net/can/m_can/m_can.c
>>> index 02c5795b7393..76fadf2b8ac2 100644
>>> --- a/drivers/net/can/m_can/m_can.c
>>> +++ b/drivers/net/can/m_can/m_can.c
>>> @@ -1247,6 +1247,8 @@ static void m_can_start(struct net_device *dev)
>>>  	/* basic m_can configuration */
>>>  	m_can_chip_config(dev);
>>>  
>>> +	pinctrl_pm_select_default_state(cdev->dev);
>>> +
>>>  	cdev->can.state = CAN_STATE_ERROR_ACTIVE;
>>>  
>>>  	m_can_enable_all_interrupts(cdev);
>>>
>>
>> Any news on this ?
> 
> Almost another month has passed by, ping ?

Bump ?

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

end of thread, other threads:[~2020-09-17  1:13 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-05-31 18:13 [PATCH] can: m_can: Set pinmux into "default" state on start Marek Vasut
2020-08-09 11:01 ` Marek Vasut
2020-09-01 18:56   ` Marek Vasut
2020-09-17  1:04     ` Marek Vasut

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.