[PATCH v3 12/15] can: grcan: Advertise CANFD capability

Arun Muthusamy
2026-01-22T12:10:58Z

Advertise CANFD capability for GRCANFD hardware by enabling
CAN_CTRLMODE_FD flag and providing CANFD timing operations.

Signed-off-by: Arun Muthusamy <arun.muthusamy@gaisler.com>
---
drivers/net/can/grcan.c | 3 +++
1 file changed, 3 insertions(+)

diff --git a/drivers/net/can/grcan.c b/drivers/net/can/grcan.c
index e99a8c2bffc6..9fc18064fab1 100644
--- a/drivers/net/can/grcan.c
+++ b/drivers/net/can/grcan.c
@@ -1656,11 +1656,14 @@ static int grcan_setup_netdev(struct platform_device *ofdev,
priv->ofdev_dev = &ofdev->dev;
priv->regs = base;
priv->can.bittiming_const = hwcap->bt_const;
+ priv->can.fd.data_bittiming_const = hwcap->bt_const;
priv->can.do_set_mode = grcan_set_mode;
priv->can.do_get_berr_counter = grcan_get_berr_counter;
priv->can.clock.freq = ambafreq;
priv->can.ctrlmode_supported =
CAN_CTRLMODE_LISTENONLY | CAN_CTRLMODE_ONE_SHOT;
+ if (hwcap->fd)
+ priv->can.ctrlmode_supported |= CAN_CTRLMODE_FD;
priv->need_txbug_workaround = txbug;
priv->hwcap = hwcap;

--
2.51.0