Commit b1ef05a5 authored by Alexander Shiyan's avatar Alexander Shiyan Committed by Marc Kleine-Budde

can: mcp251x: Allow tuning SPI mode and limit maximal SPI speed

Patch allow to use different mode settings for SPI (MODE3 for example)
and limit maximal speed according to IC datasheet.
Signed-off-by: default avatarAlexander Shiyan <shc_work@mail.ru>
Signed-off-by: default avatarMarc Kleine-Budde <mkl@pengutronix.de>
parent ae5d589e
...@@ -1082,7 +1082,11 @@ static int mcp251x_can_probe(struct spi_device *spi) ...@@ -1082,7 +1082,11 @@ static int mcp251x_can_probe(struct spi_device *spi)
SET_NETDEV_DEV(net, &spi->dev); SET_NETDEV_DEV(net, &spi->dev);
/* Configure the SPI bus */ /* Configure the SPI bus */
spi->mode = SPI_MODE_0; spi->mode = spi->mode ? : SPI_MODE_0;
if (mcp251x_is_2510(spi))
spi->max_speed_hz = spi->max_speed_hz ? : 5 * 1000 * 1000;
else
spi->max_speed_hz = spi->max_speed_hz ? : 10 * 1000 * 1000;
spi->bits_per_word = 8; spi->bits_per_word = 8;
spi_setup(spi); spi_setup(spi);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment