lkml.org 
[lkml]   [2020]   [Aug]   [11]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH V2] serial: qcom_geni_serial: To correct QUP Version detection logic
Date
The current implementation reduces the sampling rate by half
if qup HW version greater is than 2.5 by checking if the geni
SE major version is greater than 2 and geni SE minor version
is greater than 5.

This implementation fails when the version is 3 or greater.

Hence by adding the another check for geni SE major version,
this problem can be solved.

Signed-off-by: Paras Sharma <parashar@codeaurora.org>
---
drivers/tty/serial/qcom_geni_serial.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/tty/serial/qcom_geni_serial.c b/drivers/tty/serial/qcom_geni_serial.c
index 3aa29d2..a9f92d8 100644
--- a/drivers/tty/serial/qcom_geni_serial.c
+++ b/drivers/tty/serial/qcom_geni_serial.c
@@ -995,7 +995,8 @@ static void qcom_geni_serial_set_termios(struct uart_port *uport,
sampling_rate = UART_OVERSAMPLING;
/* Sampling rate is halved for IP versions >= 2.5 */
ver = geni_se_get_qup_hw_version(&port->se);
- if (GENI_SE_VERSION_MAJOR(ver) >= 2 && GENI_SE_VERSION_MINOR(ver) >= 5)
+ if ((GENI_SE_VERSION_MAJOR(ver) >= 2 && GENI_SE_VERSION_MINOR(ver) >= 5)
+ || GENI_SE_VERSION_MAJOR(ver) >= 3)
sampling_rate /= 2;

clk_rate = get_clk_div_rate(baud, sampling_rate, &clk_div);
--
QUALCOMM INDIA, on behalf of Qualcomm Innovation Center, Inc. is a member
of Code Aurora Forum, hosted by The Linux Foundation
\
 
 \ /
  Last update: 2020-08-11 09:44    [W:0.085 / U:0.632 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site