Commit e3c5ea60 authored by Stephane Grosjean's avatar Stephane Grosjean Committed by Marc Kleine-Budde

can: peak_usb: export ctrlmode_supported to adapter specific definition

Export the ctrlmode_supported value from the core file to each adapter specific
file. This has been mandatory for supporting the new CANFD extension.
Signed-off-by: default avatarStephane Grosjean <s.grosjean@peak-system.com>
Signed-off-by: default avatarMarc Kleine-Budde <mkl@pengutronix.de>
parent d6b5f30d
...@@ -859,6 +859,7 @@ const struct peak_usb_adapter pcan_usb = { ...@@ -859,6 +859,7 @@ const struct peak_usb_adapter pcan_usb = {
.name = "PCAN-USB", .name = "PCAN-USB",
.device_id = PCAN_USB_PRODUCT_ID, .device_id = PCAN_USB_PRODUCT_ID,
.ctrl_count = 1, .ctrl_count = 1,
.ctrlmode_supported = CAN_CTRLMODE_3_SAMPLES | CAN_CTRLMODE_LISTENONLY,
.clock = { .clock = {
.freq = PCAN_USB_CRYSTAL_HZ / 2 , .freq = PCAN_USB_CRYSTAL_HZ / 2 ,
}, },
......
...@@ -750,8 +750,7 @@ static int peak_usb_create_dev(const struct peak_usb_adapter *peak_usb_adapter, ...@@ -750,8 +750,7 @@ static int peak_usb_create_dev(const struct peak_usb_adapter *peak_usb_adapter,
dev->can.bittiming_const = &peak_usb_adapter->bittiming_const; dev->can.bittiming_const = &peak_usb_adapter->bittiming_const;
dev->can.do_set_bittiming = peak_usb_set_bittiming; dev->can.do_set_bittiming = peak_usb_set_bittiming;
dev->can.do_set_mode = peak_usb_set_mode; dev->can.do_set_mode = peak_usb_set_mode;
dev->can.ctrlmode_supported = CAN_CTRLMODE_3_SAMPLES | dev->can.ctrlmode_supported = peak_usb_adapter->ctrlmode_supported;
CAN_CTRLMODE_LISTENONLY;
netdev->netdev_ops = &peak_usb_netdev_ops; netdev->netdev_ops = &peak_usb_netdev_ops;
......
...@@ -44,6 +44,7 @@ struct peak_usb_device; ...@@ -44,6 +44,7 @@ struct peak_usb_device;
struct peak_usb_adapter { struct peak_usb_adapter {
char *name; char *name;
u32 device_id; u32 device_id;
u32 ctrlmode_supported;
struct can_clock clock; struct can_clock clock;
const struct can_bittiming_const bittiming_const; const struct can_bittiming_const bittiming_const;
unsigned int ctrl_count; unsigned int ctrl_count;
......
...@@ -1016,6 +1016,7 @@ const struct peak_usb_adapter pcan_usb_pro = { ...@@ -1016,6 +1016,7 @@ const struct peak_usb_adapter pcan_usb_pro = {
.name = "PCAN-USB Pro", .name = "PCAN-USB Pro",
.device_id = PCAN_USBPRO_PRODUCT_ID, .device_id = PCAN_USBPRO_PRODUCT_ID,
.ctrl_count = PCAN_USBPRO_CHANNEL_COUNT, .ctrl_count = PCAN_USBPRO_CHANNEL_COUNT,
.ctrlmode_supported = CAN_CTRLMODE_3_SAMPLES | CAN_CTRLMODE_LISTENONLY,
.clock = { .clock = {
.freq = PCAN_USBPRO_CRYSTAL_HZ, .freq = PCAN_USBPRO_CRYSTAL_HZ,
}, },
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment