OSDN Git Service

can: dev: provide optional GPIO based termination support
authorOleksij Rempel <o.rempel@pengutronix.de>
Wed, 18 Aug 2021 07:12:32 +0000 (09:12 +0200)
committerMarc Kleine-Budde <mkl@pengutronix.de>
Thu, 19 Aug 2021 13:07:03 +0000 (15:07 +0200)
commit6e86a1543c378f2e8837ad88f361b7bf606c80f7
tree6450b887ef1a071b52e134e1bb3dc533c0a6d5b3
parentfe7edf2482e1e3d677cd1b5acebf5dd06d6246e6
can: dev: provide optional GPIO based termination support

For CAN buses to work, a termination resistor has to be present at both
ends of the bus. This resistor is usually 120 Ohms, other values may be
required for special bus topologies.

This patch adds support for a generic GPIO based CAN termination. The
resistor value has to be specified via device tree, and it can only be
attached to or detached from the bus. By default the termination is not
active.

Link: https://lore.kernel.org/r/20210818071232.20585-4-o.rempel@pengutronix.de
Signed-off-by: Oleksij Rempel <o.rempel@pengutronix.de>
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
drivers/net/can/dev/dev.c
include/linux/can/dev.h