All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v6 1/7] can: peak_usb: export ctrlmode_supported to adapter specific
@ 2015-01-20 14:15 Marc Kleine-Budde
  2015-01-20 14:15 ` [PATCH v6 2/7] can: peak_usb: add adapter BEC callback definition Marc Kleine-Budde
                   ` (6 more replies)
  0 siblings, 7 replies; 10+ messages in thread
From: Marc Kleine-Budde @ 2015-01-20 14:15 UTC (permalink / raw)
  To: s.grosjean; +Cc: linux-can, Marc Kleine-Budde

From: Stephane Grosjean <s.grosjean@peak-system.com>

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: Stephane Grosjean <s.grosjean@peak-system.com>
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
---
 drivers/net/can/usb/peak_usb/pcan_usb.c      | 1 +
 drivers/net/can/usb/peak_usb/pcan_usb_core.c | 3 +--
 drivers/net/can/usb/peak_usb/pcan_usb_core.h | 1 +
 drivers/net/can/usb/peak_usb/pcan_usb_pro.c  | 1 +
 4 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/drivers/net/can/usb/peak_usb/pcan_usb.c b/drivers/net/can/usb/peak_usb/pcan_usb.c
index 4e1659d07979..5972c7af4a76 100644
--- a/drivers/net/can/usb/peak_usb/pcan_usb.c
+++ b/drivers/net/can/usb/peak_usb/pcan_usb.c
@@ -858,6 +858,7 @@ struct peak_usb_adapter pcan_usb = {
 	.name = "PCAN-USB",
 	.device_id = PCAN_USB_PRODUCT_ID,
 	.ctrl_count = 1,
+	.ctrlmode_supported = CAN_CTRLMODE_3_SAMPLES | CAN_CTRLMODE_LISTENONLY,
 	.clock = {
 		.freq = PCAN_USB_CRYSTAL_HZ / 2 ,
 	},
diff --git a/drivers/net/can/usb/peak_usb/pcan_usb_core.c b/drivers/net/can/usb/peak_usb/pcan_usb_core.c
index c62f48a1161d..7a9098cd3914 100644
--- a/drivers/net/can/usb/peak_usb/pcan_usb_core.c
+++ b/drivers/net/can/usb/peak_usb/pcan_usb_core.c
@@ -751,8 +751,7 @@ static int peak_usb_create_dev(struct peak_usb_adapter *peak_usb_adapter,
 	dev->can.bittiming_const = &peak_usb_adapter->bittiming_const;
 	dev->can.do_set_bittiming = peak_usb_set_bittiming;
 	dev->can.do_set_mode = peak_usb_set_mode;
-	dev->can.ctrlmode_supported = CAN_CTRLMODE_3_SAMPLES |
-				      CAN_CTRLMODE_LISTENONLY;
+	dev->can.ctrlmode_supported = peak_usb_adapter->ctrlmode_supported;
 
 	netdev->netdev_ops = &peak_usb_netdev_ops;
 
diff --git a/drivers/net/can/usb/peak_usb/pcan_usb_core.h b/drivers/net/can/usb/peak_usb/pcan_usb_core.h
index 073b47ff8eee..6dcea649a825 100644
--- a/drivers/net/can/usb/peak_usb/pcan_usb_core.h
+++ b/drivers/net/can/usb/peak_usb/pcan_usb_core.h
@@ -44,6 +44,7 @@ struct peak_usb_device;
 struct peak_usb_adapter {
 	char *name;
 	u32 device_id;
+	u32 ctrlmode_supported;
 	struct can_clock clock;
 	const struct can_bittiming_const bittiming_const;
 	unsigned int ctrl_count;
diff --git a/drivers/net/can/usb/peak_usb/pcan_usb_pro.c b/drivers/net/can/usb/peak_usb/pcan_usb_pro.c
index 4cfa3b8605b1..a2fc94ab3f9a 100644
--- a/drivers/net/can/usb/peak_usb/pcan_usb_pro.c
+++ b/drivers/net/can/usb/peak_usb/pcan_usb_pro.c
@@ -1015,6 +1015,7 @@ struct peak_usb_adapter pcan_usb_pro = {
 	.name = "PCAN-USB Pro",
 	.device_id = PCAN_USBPRO_PRODUCT_ID,
 	.ctrl_count = PCAN_USBPRO_CHANNEL_COUNT,
+	.ctrlmode_supported = CAN_CTRLMODE_3_SAMPLES | CAN_CTRLMODE_LISTENONLY,
 	.clock = {
 		.freq = PCAN_USBPRO_CRYSTAL_HZ,
 	},
-- 
2.1.4


^ permalink raw reply related	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2015-01-22  8:39 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-01-20 14:15 [PATCH v6 1/7] can: peak_usb: export ctrlmode_supported to adapter specific Marc Kleine-Budde
2015-01-20 14:15 ` [PATCH v6 2/7] can: peak_usb: add adapter BEC callback definition Marc Kleine-Budde
2015-01-20 14:15 ` [PATCH v6 3/7] can: peak_usb: upgrade core to new CANFD extension - peak_usb_set_data_bittiming() Marc Kleine-Budde
2015-01-20 14:15 ` [PATCH v6 4/7] can: peak_usb: upgrade core to new CANFD extension - struct canfd_frame Marc Kleine-Budde
2015-01-20 14:15 ` [PATCH v6 5/7] can: peak_usb: add support for PEAK new CANFD USB adapters - pcan_usb_pro_*() Marc Kleine-Budde
2015-01-20 14:15 ` [PATCH v6 6/7] can: peak_usb: upgrade core to new CANFD extension - add peak_usb_netif_rx() Marc Kleine-Budde
2015-01-20 14:15 ` [PATCH v6 7/7] can: peak_usb: add support for PEAK new CANFD USB adapters Marc Kleine-Budde
2015-01-20 14:28 ` [PATCH v6 1/7] can: peak_usb: export ctrlmode_supported to adapter specific Marc Kleine-Budde
2015-01-22  8:30   ` Stephane Grosjean
2015-01-22  8:38     ` Marc Kleine-Budde

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.