From: Jiri Slaby <jirislaby@kernel.org>
To: Praveen Talari <quic_ptalari@quicinc.com>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
Rob Herring <robh@kernel.org>,
Krzysztof Kozlowski <krzk+dt@kernel.org>,
Conor Dooley <conor+dt@kernel.org>,
Bjorn Andersson <andersson@kernel.org>,
Konrad Dybcio <konradybcio@kernel.org>,
Viresh Kumar <vireshk@kernel.org>, Nishanth Menon <nm@ti.com>,
Stephen Boyd <sboyd@kernel.org>,
"Rafael J. Wysocki" <rafael@kernel.org>,
linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org,
linux-serial@vger.kernel.org, devicetree@vger.kernel.org,
linux-pm@vger.kernel.org
Cc: psodagud@quicinc.com, djaggi@quicinc.com,
quic_msavaliy@quicinc.com, quic_vtanuku@quicinc.com,
quic_arandive@quicinc.com, quic_mnaresh@quicinc.com,
quic_shazhuss@quicinc.com
Subject: Re: [PATCH v1 7/9] serial: qcom-geni: move clock-rate logic to separate function
Date: Mon, 14 Apr 2025 10:01:41 +0200 [thread overview]
Message-ID: <966960bf-0d5a-4e1f-af77-b573c3d1e1cb@kernel.org> (raw)
In-Reply-To: <20250410174010.31588-8-quic_ptalari@quicinc.com>
On 10. 04. 25, 19:40, Praveen Talari wrote:
> Facilitates future modifications within the new function,
> leading to better readability and maintainability of the code.
>
> Move the code that handles the actual logic of clock-rate
> calculations to a separate function geni_serial_set_rate()
> which enhances code readability.
>
> Signed-off-by: Praveen Talari <quic_ptalari@quicinc.com>
> ---
> drivers/tty/serial/qcom_geni_serial.c | 56 +++++++++++++++++----------
> 1 file changed, 36 insertions(+), 20 deletions(-)
>
> diff --git a/drivers/tty/serial/qcom_geni_serial.c b/drivers/tty/serial/qcom_geni_serial.c
> index e341f5090ecc..25d16ac3f406 100644
> --- a/drivers/tty/serial/qcom_geni_serial.c
> +++ b/drivers/tty/serial/qcom_geni_serial.c
...
> @@ -1323,6 +1310,37 @@ static void qcom_geni_serial_set_termios(struct uart_port *uport,
> port->se.icc_paths[CPU_TO_GENI].avg_bw = Bps_to_icc(baud);
> geni_icc_set_bw(&port->se);
>
> + writel(ser_clk_cfg, uport->membase + GENI_SER_M_CLK_CFG);
> + writel(ser_clk_cfg, uport->membase + GENI_SER_S_CLK_CFG);
> + return 0;
Did this pass checkpatch?
> +}
> +
> +static void qcom_geni_serial_set_termios(struct uart_port *uport,
> + struct ktermios *termios,
> + const struct ktermios *old)
> +{
> + struct qcom_geni_serial_port *port = to_dev_port(uport);
> + unsigned int baud;
> + unsigned long timeout;
> + u32 bits_per_char;
> + u32 tx_trans_cfg;
> + u32 tx_parity_cfg;
> + u32 rx_trans_cfg;
> + u32 rx_parity_cfg;
> + u32 stop_bit_len;
> + int ret = 0;
> +
> + /* baud rate */
> + baud = uart_get_baud_rate(uport, termios, old, 300, 4000000);
> +
> + ret = geni_serial_set_rate(uport, baud);
> + if (ret) {
> + dev_err(port->se.dev,
> + "%s: Failed to set baud: %u ret: %d\n",
Why the doubled spaces?
> + __func__, baud, ret);
> + return;
> + }
> +
> /* parity */
> tx_trans_cfg = readl(uport->membase + SE_UART_TX_TRANS_CFG);
> tx_parity_cfg = readl(uport->membase + SE_UART_TX_PARITY_CFG);
thanks,
--
js
suse labs
next prev parent reply other threads:[~2025-04-14 8:01 UTC|newest]
Thread overview: 24+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-04-10 17:40 [PATCH v1 0/9] Enable QUPs and Serial on SA8255p Qualcomm platforms Praveen Talari
2025-04-10 17:40 ` [PATCH v1 1/9] opp: add new helper API dev_pm_opp_set_level() Praveen Talari
2025-04-10 17:40 ` [PATCH v1 2/9] dt-bindings: serial: describe SA8255p Praveen Talari
2025-04-11 17:57 ` Rob Herring
2025-04-11 18:15 ` Praveen Talari
2025-04-10 17:40 ` [PATCH v1 3/9] dt-bindings: qcom: geni-se: " Praveen Talari
2025-04-10 18:34 ` Rob Herring (Arm)
2025-04-10 17:40 ` [PATCH v1 4/9] soc: qcom: geni-se: Enable QUPs on SA8255p Qualcomm platforms Praveen Talari
2025-04-11 18:40 ` kernel test robot
2025-04-11 18:40 ` kernel test robot
2025-04-14 7:56 ` Jiri Slaby
2025-04-14 17:59 ` Praveen Talari
2025-04-10 17:40 ` [PATCH v1 5/9] serial: qcom-geni: move resource initialization to separate functions Praveen Talari
2025-04-14 7:58 ` Jiri Slaby
2025-04-10 17:40 ` [PATCH v1 6/9] serial: qcom-geni: move resource control logic " Praveen Talari
2025-04-14 7:59 ` Jiri Slaby
2025-04-14 8:55 ` Praveen Talari
2025-04-10 17:40 ` [PATCH v1 7/9] serial: qcom-geni: move clock-rate logic to separate function Praveen Talari
2025-04-11 19:12 ` kernel test robot
2025-04-14 8:01 ` Jiri Slaby [this message]
2025-04-10 17:40 ` [PATCH v1 8/9] serial: qcom-geni: Enable PM runtime for serial driver Praveen Talari
2025-04-10 17:40 ` [PATCH v1 9/9] serial: qcom-geni: Enable Serial on SA8255p Qualcomm platforms Praveen Talari
2025-04-14 8:09 ` Jiri Slaby
2025-04-14 17:49 ` Praveen Talari
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=966960bf-0d5a-4e1f-af77-b573c3d1e1cb@kernel.org \
--to=jirislaby@kernel.org \
--cc=andersson@kernel.org \
--cc=conor+dt@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=djaggi@quicinc.com \
--cc=gregkh@linuxfoundation.org \
--cc=konradybcio@kernel.org \
--cc=krzk+dt@kernel.org \
--cc=linux-arm-msm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pm@vger.kernel.org \
--cc=linux-serial@vger.kernel.org \
--cc=nm@ti.com \
--cc=psodagud@quicinc.com \
--cc=quic_arandive@quicinc.com \
--cc=quic_mnaresh@quicinc.com \
--cc=quic_msavaliy@quicinc.com \
--cc=quic_ptalari@quicinc.com \
--cc=quic_shazhuss@quicinc.com \
--cc=quic_vtanuku@quicinc.com \
--cc=rafael@kernel.org \
--cc=robh@kernel.org \
--cc=sboyd@kernel.org \
--cc=vireshk@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox