mirror of
https://github.com/rd-stuffs/msm-4.14.git
synced 2025-02-20 11:45:48 +08:00
serial: sc16is7xx: set safe default SPI clock frequency
[ Upstream commit 3ef79cd1412236d884ab0c46b4d1921380807b48 ] 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: 2c837a8a8f9f ("sc16is7xx: spi interface is added") Cc: <stable@vger.kernel.org> Signed-off-by: Hugo Villeneuve <hvilleneuve@dimonoff.com> Link: https://lore.kernel.org/r/20231221231823.2327894-4-hugo@hugovil.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Signed-off-by: Sasha Levin <sashal@kernel.org> (cherry picked from commit 5733959d6770324020e30dd9313cbeac0aec07ef) Signed-off-by: Vegard Nossum <vegard.nossum@oracle.com>
This commit is contained in:
parent
a86917709d
commit
43f2c1d0c3
@ -29,6 +29,7 @@
|
||||
#include <linux/tty_flip.h>
|
||||
#include <linux/spi/spi.h>
|
||||
#include <linux/uaccess.h>
|
||||
#include <linux/units.h>
|
||||
#include <uapi/linux/sched/types.h>
|
||||
|
||||
#define SC16IS7XX_NAME "sc16is7xx"
|
||||
@ -1403,7 +1404,7 @@ static int sc16is7xx_spi_probe(struct spi_device *spi)
|
||||
spi->bits_per_word = 8;
|
||||
/* only supports mode 0 on SC16IS762 */
|
||||
spi->mode = spi->mode ? : SPI_MODE_0;
|
||||
spi->max_speed_hz = spi->max_speed_hz ? : 15000000;
|
||||
spi->max_speed_hz = spi->max_speed_hz ? : 4 * HZ_PER_MHZ;
|
||||
ret = spi_setup(spi);
|
||||
if (ret)
|
||||
return ret;
|
||||
|
Loading…
x
Reference in New Issue
Block a user