Skip to content

Commit

Permalink
can: mcp251x: Allow tuning SPI mode and limit maximal SPI speed
Browse files Browse the repository at this point in the history
Patch allow to use different mode settings for SPI (MODE3 for example)
and limit maximal speed according to IC datasheet.

Signed-off-by: Alexander Shiyan <shc_work@mail.ru>
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
  • Loading branch information
Alexander Shiyan authored and Marc Kleine-Budde committed Aug 21, 2013
1 parent ae5d589 commit b1ef05a
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion drivers/net/can/mcp251x.c
Original file line number Diff line number Diff line change
Expand Up @@ -1082,7 +1082,11 @@ static int mcp251x_can_probe(struct spi_device *spi)
SET_NETDEV_DEV(net, &spi->dev);

/* 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_setup(spi);

Expand Down

0 comments on commit b1ef05a

Please sign in to comment.