From 70179b1925b2879e37ce49c97e49957005847af1 Mon Sep 17 00:00:00 2001 From: William Qiu Date: Tue, 11 Oct 2022 10:11:18 +0800 Subject: [PATCH] can:starfive:modify some data field and clock frequency modify some data field and clock frequency Signed-off-by: William Qiu --- drivers/net/can/ipms_canfd.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/drivers/net/can/ipms_canfd.c b/drivers/net/can/ipms_canfd.c index cfa4992..6e0a816 100644 --- a/drivers/net/can/ipms_canfd.c +++ b/drivers/net/can/ipms_canfd.c @@ -186,10 +186,10 @@ struct ipms_canfd_priv { static struct can_bittiming_const canfd_bittiming_const = { .name = DRIVER_NAME, .tseg1_min = 2, - .tseg1_max = 17, + .tseg1_max = 65, .tseg2_min = 1, .tseg2_max = 8, - .sjw_max = 8, + .sjw_max = 16, .brp_min = 1, .brp_max = 512, .brp_inc = 1, @@ -199,10 +199,10 @@ static struct can_bittiming_const canfd_bittiming_const = { static struct can_bittiming_const canfd_data_bittiming_const = { .name = DRIVER_NAME, .tseg1_min = 2, - .tseg1_max = 65, + .tseg1_max = 17, .tseg2_min = 1, .tseg2_max = 8, - .sjw_max = 16, + .sjw_max = 8, .brp_min = 1, .brp_max = 512, .brp_inc = 1, @@ -1045,6 +1045,7 @@ static int canfd_driver_probe(struct platform_device *pdev) struct ipms_canfd_priv *priv; void __iomem *addr; int ret; + u32 frq; addr = devm_platform_ioremap_resource(pdev, 0); if (IS_ERR(addr)) { @@ -1107,6 +1108,9 @@ static int canfd_driver_probe(struct platform_device *pdev) goto reset_exit; } + device_property_read_u32(priv->dev, "frequency", &frq); + clk_set_rate(priv->can_clk, frq); + priv->can.clock.freq = clk_get_rate(priv->can_clk); ndev->irq = platform_get_irq(pdev, 0); -- 2.7.4