Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RFC: add support for switchable termination #92

Closed
marckleinebudde opened this issue Feb 15, 2022 · 2 comments
Closed

RFC: add support for switchable termination #92

marckleinebudde opened this issue Feb 15, 2022 · 2 comments

Comments

@marckleinebudde
Copy link
Contributor

Hello

@ryedwards and me are planing to add switchable termination to the gs_usb USB interface. The current idea is to add a new feature bit indicating support, and 2 control messages, one to set and one to get the current termination status. Similar to the IDENTIFY feature.

I'll add these to the candleLight firmware repo and send a PR when ready.

@marckleinebudde marckleinebudde changed the title add support for switchable termination RFC: add support for switchable termination Feb 15, 2022
@fenugrec
Copy link
Collaborator

fenugrec commented Mar 1, 2022

Cool. I see mention of something similar in the docs of CANdevstudio, where some drivers support usage such as
sudo ip link set can0 type can termination 1

Is that already in the socketcan layer or other linux drivers, or something entirely driver-specific ?

@marckleinebudde
Copy link
Contributor Author

There is complete support form the user space through the kernel into the CAN drivers. The driver has to implement the do_set_termination callback and fill out the termination_const and termination_const_cnt describing the supported resistor values.

ammarfaizi2 pushed a commit to ammarfaizi2/linux-fork that referenced this issue Sep 23, 2022
The candleLight community is working on switchable termination support
for the candleLight firmware. As the the Linux CAN framework supports
switchable termination add this feature to the gs_usb driver.

Devices supporting the feature should set the
GS_CAN_FEATURE_TERMINATION and implement the
GS_USB_BREQ_SET_TERMINATION and GS_USB_BREQ_GET_TERMINATION control
messages.

For now the driver assumes for activated termination the standard
termination value of 120Ω.

Link: https://lore.kernel.org/all/20220923074114.662045-1-mkl@pengutronix.de
Link: candle-usb/candleLight_fw#92
Link: candle-usb/candleLight_fw#109
Link: candle-usb/candleLight_fw#108
Cc: Daniel Trevitz <daniel.trevitz@wika.com>
Cc: Ryan Edwards <ryan.edwards@gmail.com>
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants