Patch "serial: sc16is7xx: set safe default SPI clock frequency" has been added to the 4.19-stable tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This is a note to let you know that I've just added the patch titled

    serial: sc16is7xx: set safe default SPI clock frequency

to the 4.19-stable tree which can be found at:
    http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     serial-sc16is7xx-set-safe-default-spi-clock-frequenc.patch
and it can be found in the queue-4.19 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@xxxxxxxxxxxxxxx> know about it.



commit 8ed11abb2953cd0de2ce0cd0a847fbfe6551f3a4
Author: Hugo Villeneuve <hvilleneuve@xxxxxxxxxxxx>
Date:   Thu Dec 21 18:18:10 2023 -0500

    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@xxxxxxxxxxxxxxx>
    Signed-off-by: Hugo Villeneuve <hvilleneuve@xxxxxxxxxxxx>
    Link: https://lore.kernel.org/r/20231221231823.2327894-4-hugo@xxxxxxxxxxx
    Signed-off-by: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/drivers/tty/serial/sc16is7xx.c b/drivers/tty/serial/sc16is7xx.c
index c65f9194abb0..07898a46fd96 100644
--- a/drivers/tty/serial/sc16is7xx.c
+++ b/drivers/tty/serial/sc16is7xx.c
@@ -24,6 +24,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"
@@ -1408,7 +1409,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;




[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux