mirror of
https://github.com/torvalds/linux.git
synced 2026-08-07 07:54:18 +02:00
can: rcar_canfd: Add ch_interface_mode variable to struct rcar_canfd_hw_info
R-Car Gen4 has channel specific interface mode bit for setting CAN-FD or Classical CAN mode whereas on R-Car Gen3 it is global. Add a ch_interface_mode variable to struct rcar_canfd_hw_info to handle this difference. Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be> Reviewed-by: Vincent Mailhol <mailhol.vincent@wanadoo.fr> Signed-off-by: Biju Das <biju.das.jz@bp.renesas.com> Link: https://patch.msgid.link/20250417054320.14100-14-biju.das.jz@bp.renesas.com Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
This commit is contained in:
parent
b5a9f2ec42
commit
c10e551010
|
|
@ -516,6 +516,7 @@ struct rcar_canfd_hw_info {
|
|||
/* hardware features */
|
||||
unsigned shared_global_irqs:1; /* Has shared global irqs */
|
||||
unsigned multi_channel_irqs:1; /* Has multiple channel irqs */
|
||||
unsigned ch_interface_mode:1; /* Has channel interface mode */
|
||||
};
|
||||
|
||||
/* Channel priv data */
|
||||
|
|
@ -619,6 +620,7 @@ static const struct rcar_canfd_hw_info rcar_gen3_hw_info = {
|
|||
.max_channels = 2,
|
||||
.postdiv = 2,
|
||||
.shared_global_irqs = 1,
|
||||
.ch_interface_mode = 0,
|
||||
};
|
||||
|
||||
static const struct rcar_canfd_hw_info rcar_gen4_hw_info = {
|
||||
|
|
@ -630,6 +632,7 @@ static const struct rcar_canfd_hw_info rcar_gen4_hw_info = {
|
|||
.max_channels = 8,
|
||||
.postdiv = 2,
|
||||
.shared_global_irqs = 1,
|
||||
.ch_interface_mode = 1,
|
||||
};
|
||||
|
||||
static const struct rcar_canfd_hw_info rzg2l_hw_info = {
|
||||
|
|
@ -641,6 +644,7 @@ static const struct rcar_canfd_hw_info rzg2l_hw_info = {
|
|||
.max_channels = 2,
|
||||
.postdiv = 1,
|
||||
.multi_channel_irqs = 1,
|
||||
.ch_interface_mode = 0,
|
||||
};
|
||||
|
||||
/* Helper functions */
|
||||
|
|
@ -733,7 +737,7 @@ static void rcar_canfd_setrnc(struct rcar_canfd_global *gpriv, unsigned int ch,
|
|||
|
||||
static void rcar_canfd_set_mode(struct rcar_canfd_global *gpriv)
|
||||
{
|
||||
if (is_gen4(gpriv)) {
|
||||
if (gpriv->info->ch_interface_mode) {
|
||||
u32 ch, val = gpriv->fdmode ? RCANFD_GEN4_FDCFG_FDOE
|
||||
: RCANFD_GEN4_FDCFG_CLOE;
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user