On Friday, October 7, 2022 3:41:17 AM EDT Marc Kleine-Budde wrote: > On 06.10.2022 15:27:50, Daniel S. Trevitz wrote: > > Add documentation for how to use and setup the switchable termination > > resistor support for the can-controllers. > > > > Signed-off-by: Daniel Trevitz <dan@xxxxxxxxxx> > > --- > > > > Documentation/networking/can.rst | 30 ++++++++++++++++++++++++++++++ > > 1 file changed, 30 insertions(+) > > > > diff --git a/Documentation/networking/can.rst > > b/Documentation/networking/can.rst index ebc822e605f5..bb39cfa4c502 > > 100644 > > --- a/Documentation/networking/can.rst > > +++ b/Documentation/networking/can.rst > > @@ -1148,6 +1148,36 @@ tuning on deep embedded systems'. The author is > > running a MPC603e> > > load without any problems ... > > > > +Switchable Termination Resistors > > +-------------------------------- > > + > > +CAN bus requires a specific impedance across the differential pair, > > +typically provided by two 120Ohm resistors on the farthest nodes of > > +the bus. Some CAN controllers support activating / deactivating a > > +termination resistor(s) to provide the correct impedance.:: > > + > > > + - Query the available resistances: > You need double :: followed by a newline to mark as code. This whole section is a code block; :: is up three lines. > > > + $ ip -details link show can0 > > + ... > > + termination 120 [ 0, 120 > > The closing ] is missing, please add it, even if the current ip command > doesn't print it. I just noticed it got lost in a cleanup patch in > iproute2. Okay > > > + > > > + - Activate the terminating resistor: > same here > > > + $ ip link set dev can0 type can termination 120 > > + > > > + - Deactivate the terminating resistor: > same here > > > + $ ip link set dev can0 type can termination 0 > > + > > +To enable termination resistor support to a can-controller, either > > +implement in the controller's struct can-priv:: > > + > > + termination_const > > + termination_const_cnt > > + do_set_termination > > + > > +or add gpio control with the device tree entries from > > +Documentation/devicetree/bindings/net/can/can-controller.yaml > > + > > + > > > > The Virtual CAN Driver (vcan) > > ----------------------------- > > Marc -Dan