]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
can: rcar_canfd: Update bit rate constants for RZ/G3E and R-Car Gen4
authorBiju Das <biju.das.jz@bp.renesas.com>
Mon, 8 Sep 2025 12:09:30 +0000 (13:09 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 13 Nov 2025 20:37:21 +0000 (15:37 -0500)
[ Upstream commit 100fafc3e46138cb5a6526ddc03dcede8b020c8c ]

The calculation formula for nominal bit rate of classical CAN is the same as
that of nominal bit rate of CANFD on the RZ/G3E and R-Car Gen4 SoCs
compared to other SoCs. Update nominal bit rate constants.

Signed-off-by: Biju Das <biju.das.jz@bp.renesas.com>
Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>
Link: https://patch.msgid.link/20250908120940.147196-2-biju.das.jz@bp.renesas.com
[mkl: slightly improve wording of commit message]
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/net/can/rcar/rcar_canfd.c

index 7e8b1d2f1af6519c36d95a0a6cd064f8cb5d8e40..4f3ce948d74da4dfcfcc4ee565908070a5eb1725 100644 (file)
@@ -1913,7 +1913,10 @@ static int rcar_canfd_channel_probe(struct rcar_canfd_global *gpriv, u32 ch,
                priv->can.fd.do_get_auto_tdcv = rcar_canfd_get_auto_tdcv;
        } else {
                /* Controller starts in Classical CAN only mode */
-               priv->can.bittiming_const = &rcar_canfd_bittiming_const;
+               if (gpriv->info->shared_can_regs)
+                       priv->can.bittiming_const = gpriv->info->nom_bittiming;
+               else
+                       priv->can.bittiming_const = &rcar_canfd_bittiming_const;
                priv->can.ctrlmode_supported = CAN_CTRLMODE_BERR_REPORTING;
        }