RE: [PATCH v2 3/3] can: gs_usb: add switchable termination support

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Marc,

+       if (feature & GS_CAN_FEATURE_TERMINATION) {
+               dev->can.termination_const = gs_usb_termination_const;
+               dev->can.termination_const_cnt = ARRAY_SIZE(gs_usb_termination_const);
+               dev->can.do_set_termination = gs_usb_set_termination;
+
+               rc = gs_usb_get_termination(netdev, &dev->can.termination);
+               if (rc) {
+                       dev_err(&intf->dev,
+                               "Couldn't get current termination state for channel %d (%pe)\n",
+                               channel, ERR_PTR(rc));
+                       goto out_free_candev;
+               }
+       }

Does it make sense to check if we have the termination support, then set the values?
My logic is that just because the termination is not working correctly, it does not mean everything is broken.
This way you could have a multi-can-channel USB device but with only specific channels supporting configurable termination resistors.

Something like:

rc = gs_usb_get_termination(netdev, &dev->can.termination);
 if (rc) {
	dev_err(&intf->dev,
		"Couldn't get current termination state for channel %d (%pe). Not enabling termination support for this channel\n",
		channel, ERR_PTR(rc));
 } else {
	dev->can.termination_const = gs_usb_termination_const;
	dev->can.termination_const_cnt = ARRAY_SIZE(gs_usb_termination_const);
	dev->can.do_set_termination = gs_usb_set_termination;
}

BR,
  Daniel




**CONFIDENTIALITY NOTICE**


This communication, including any attachments, is from WIKA Mobile Control, LP and contains confidential information intended only for the addressee(s). If you are not the intended recipient, any use, dissemination, distribution or copying of this document or its contents is strictly prohibited. If you have received this communication in error, please contact the sender by reply e-mail immediately and destroy all copies of the original message. 




[Index of Archives]     [Automotive Discussions]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [eCos]     [Asterisk Internet PBX]     [Linux API]     [CAN Bus]

  Powered by Linux