Skip to content

Commit 3ef79cd

Browse files
hvilleneuvedoogregkh
authored andcommitted
serial: sc16is7xx: set safe default SPI clock frequency
15 MHz is supported only by 76x variants. If the SPI clock frequency is not specified, use a safe default clock value of 4 MHz that is supported by all variants. Also use HZ_PER_MHZ macro to improve readability. Fixes: 2c837a8 ("sc16is7xx: spi interface is added") Cc: <[email protected]> Signed-off-by: Hugo Villeneuve <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent 6d710b7 commit 3ef79cd

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

drivers/tty/serial/sc16is7xx.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
#include <linux/tty_flip.h>
2525
#include <linux/spi/spi.h>
2626
#include <linux/uaccess.h>
27+
#include <linux/units.h>
2728
#include <uapi/linux/sched/types.h>
2829

2930
#define SC16IS7XX_NAME "sc16is7xx"
@@ -1738,7 +1739,7 @@ static int sc16is7xx_spi_probe(struct spi_device *spi)
17381739
return dev_err_probe(&spi->dev, -EINVAL, "Unsupported SPI mode\n");
17391740

17401741
spi->mode = spi->mode ? : SPI_MODE_0;
1741-
spi->max_speed_hz = spi->max_speed_hz ? : 15000000;
1742+
spi->max_speed_hz = spi->max_speed_hz ? : 4 * HZ_PER_MHZ;
17421743
ret = spi_setup(spi);
17431744
if (ret)
17441745
return ret;

0 commit comments

Comments
 (0)