Skip to contentSkip to conversation

can: m_can: Set pinmux into "default" state on start

PATCH In review Marek Vasut 1 participant 4 messages May 31, 2020 – Sep 17, 2020

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 can: m_can: Set pinmux into "default" state on start

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.

Cc Alexandre Torgue <[email protected]>
Cc Marc Kleine-Budde <[email protected]>
Cc Wolfgang Grandegger <[email protected]>

To: [email protected]

---
 drivers/net/can/m_can/m_can.c | 2 ++
 1 file changed, 2 insertions(+)
drivers/net/can/m_can/m_can.c +2 -0
index 02c5795b7393..76fadf2b8ac2 100644
@@ -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);
Signature · 1 line
2.25.1
#1 lore raw
Quoted 21 lines · Marek Vasut

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.

Cc Alexandre Torgue <[email protected]>
Cc Marc Kleine-Budde <[email protected]>
Cc Wolfgang Grandegger <[email protected]>

To: [email protected]

---
 drivers/net/can/m_can/m_can.c | 2 ++
 1 file changed, 2 insertions(+)
drivers/net/can/m_can/m_can.c +0 -0
index 02c5795b7393..76fadf2b8ac2 100644

drivers/net/can/m_can/m_can.c static void m_can_start(struct net_device *dev) · line 1254

Quoted 8 lines
drivers/net/can/m_can/m_can.c +2 -0
@@ -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 ?

#2 lore raw
Quoted 24 lines · Marek Vasut
Quoted 23 lines · Marek Vasut

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.

Cc Alexandre Torgue <[email protected]>
Cc Marc Kleine-Budde <[email protected]>
Cc Wolfgang Grandegger <[email protected]>

To: [email protected]

---
 drivers/net/can/m_can/m_can.c | 2 ++
 1 file changed, 2 insertions(+)
drivers/net/can/m_can/m_can.c +0 -0
index 02c5795b7393..76fadf2b8ac2 100644
@@ -1247,6 +1247,8 @@ static void m_can_start(struct net_device *dev)
 	/* basic m_can configuration */
 	m_can_chip_config(dev);
 
Quoted 8 lines

drivers/net/can/m_can/m_can.c static void m_can_start(struct net_device *dev) · line 1254

Quoted 6 lines
drivers/net/can/m_can/m_can.c +2 -0
+	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 ?

#3 lore raw
Quoted 29 lines · Marek Vasut
Quoted 28 lines · Marek Vasut
Quoted 27 lines · Marek Vasut

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.

Cc Alexandre Torgue <[email protected]>
Cc Marc Kleine-Budde <[email protected]>
Cc Wolfgang Grandegger <[email protected]>

To: [email protected]

---
 drivers/net/can/m_can/m_can.c | 2 ++
 1 file changed, 2 insertions(+)
drivers/net/can/m_can/m_can.c +2 -0
index 02c5795b7393..76fadf2b8ac2 100644
@@ -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;
 
Quoted 6 lines
Quoted 4 lines

drivers/net/can/m_can/m_can.c static void m_can_start(struct net_device *dev) · line 1254

Quoted 2 lines
drivers/net/can/m_can/m_can.c +0 -0
 	m_can_enable_all_interrupts(cdev);

Any news on this ?

Almost another month has passed by, ping ?

Bump ?