@@ -496,6 +496,7 @@ struct rcar_canfd_global;
struct rcar_canfd_hw_info {
enum rcanfd_chip_id chip_id;
+ u8 postdiv;
/* hardware features */
unsigned shared_global_irqs:1; /* Has shared global irqs */
};
@@ -570,11 +571,13 @@ static const struct can_bittiming_const rcar_canfd_bittiming_const = {
static const struct rcar_canfd_hw_info rcar_gen3_hw_info = {
.chip_id = RENESAS_RCAR_GEN3,
+ .postdiv = 2,
.shared_global_irqs = 1,
};
static const struct rcar_canfd_hw_info rzg2l_hw_info = {
.chip_id = RENESAS_RZG2L,
+ .postdiv = 1,
};
/* Helper functions */
@@ -1861,9 +1864,9 @@ static int rcar_canfd_probe(struct platform_device *pdev)
}
fcan_freq = clk_get_rate(gpriv->can_clk);
- if (gpriv->fcan == RCANFD_CANFDCLK && info->chip_id == RENESAS_RCAR_GEN3)
+ if (gpriv->fcan == RCANFD_CANFDCLK)
/* CANFD clock is further divided by (1/2) within the IP */
- fcan_freq /= 2;
+ fcan_freq /= info->postdiv;
addr = devm_platform_ioremap_resource(pdev, 0);
if (IS_ERR(addr)) {