Skip to content

Commit a136631

Browse files
sknseanmarckleinebudde
authored andcommitted
can: tcan4x5x: add deinit callback to set standby mode
At Vsup 12V, standby mode will save 7-8mA, when the interface is down. Signed-off-by: Sean Nyekjaer <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Marc Kleine-Budde <[email protected]>
1 parent baa8aaf commit a136631

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

drivers/net/can/m_can/tcan4x5x-core.c

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -279,6 +279,14 @@ static int tcan4x5x_init(struct m_can_classdev *cdev)
279279
return ret;
280280
}
281281

282+
static int tcan4x5x_deinit(struct m_can_classdev *cdev)
283+
{
284+
struct tcan4x5x_priv *tcan4x5x = cdev_to_priv(cdev);
285+
286+
return regmap_update_bits(tcan4x5x->regmap, TCAN4X5X_CONFIG,
287+
TCAN4X5X_MODE_SEL_MASK, TCAN4X5X_MODE_STANDBY);
288+
};
289+
282290
static int tcan4x5x_disable_wake(struct m_can_classdev *cdev)
283291
{
284292
struct tcan4x5x_priv *tcan4x5x = cdev_to_priv(cdev);
@@ -376,6 +384,7 @@ static int tcan4x5x_get_gpios(struct m_can_classdev *cdev,
376384

377385
static const struct m_can_ops tcan4x5x_ops = {
378386
.init = tcan4x5x_init,
387+
.deinit = tcan4x5x_deinit,
379388
.read_reg = tcan4x5x_read_reg,
380389
.write_reg = tcan4x5x_write_reg,
381390
.write_fifo = tcan4x5x_write_fifo,

0 commit comments

Comments
 (0)