Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 3b689805 authored by Marc Kleine-Budde's avatar Marc Kleine-Budde Committed by Greg Kroah-Hartman
Browse files

can: tcan4x5x: fix bittiming const, use common bittiming from m_can driver



commit aee2b3ccc8a63d1cd7da6a8a153d1f3712d40826 upstream.

According to the TCAN4550 datasheet "SLLSF91 - DECEMBER 2018" the tcan4x5x has
the same bittiming constants as a m_can revision 3.2.x/3.3.0.

The tcan4x5x chip I'm using identifies itself as m_can revision 3.2.1, so
remove the tcan4x5x specific bittiming values and rely on the values in the
m_can driver, which are selected according to core revision.

Fixes: 5443c226 ("can: tcan4x5x: Add tcan4x5x driver to the kernel")
Cc: Dan Murphy <dmurphy@ti.com>
Reviewed-by: default avatarSean Nyekjaer <sean@geanix.com>
Link: https://lore.kernel.org/r/20201215103238.524029-3-mkl@pengutronix.de


Signed-off-by: default avatarMarc Kleine-Budde <mkl@pengutronix.de>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent b77e0283
Loading
Loading
Loading
Loading
+0 −26
Original line number Original line Diff line number Diff line
@@ -126,30 +126,6 @@ struct tcan4x5x_priv {
	int reg_offset;
	int reg_offset;
};
};


static struct can_bittiming_const tcan4x5x_bittiming_const = {
	.name = DEVICE_NAME,
	.tseg1_min = 2,
	.tseg1_max = 31,
	.tseg2_min = 2,
	.tseg2_max = 16,
	.sjw_max = 16,
	.brp_min = 1,
	.brp_max = 32,
	.brp_inc = 1,
};

static struct can_bittiming_const tcan4x5x_data_bittiming_const = {
	.name = DEVICE_NAME,
	.tseg1_min = 1,
	.tseg1_max = 32,
	.tseg2_min = 1,
	.tseg2_max = 16,
	.sjw_max = 16,
	.brp_min = 1,
	.brp_max = 32,
	.brp_inc = 1,
};

static void tcan4x5x_check_wake(struct tcan4x5x_priv *priv)
static void tcan4x5x_check_wake(struct tcan4x5x_priv *priv)
{
{
	int wake_state = 0;
	int wake_state = 0;
@@ -449,8 +425,6 @@ static int tcan4x5x_can_probe(struct spi_device *spi)
	mcan_class->dev = &spi->dev;
	mcan_class->dev = &spi->dev;
	mcan_class->ops = &tcan4x5x_ops;
	mcan_class->ops = &tcan4x5x_ops;
	mcan_class->is_peripheral = true;
	mcan_class->is_peripheral = true;
	mcan_class->bit_timing = &tcan4x5x_bittiming_const;
	mcan_class->data_timing = &tcan4x5x_data_bittiming_const;
	mcan_class->net->irq = spi->irq;
	mcan_class->net->irq = spi->irq;


	spi_set_drvdata(spi, priv);
	spi_set_drvdata(spi, priv);