linux-serial.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Pramod Gurav <pramod.gurav@linaro.org>
To: sboyd@codeaurora.org, andy.gross@linaro.org,
	gregkh@linuxfoundation.org, davidb@codeaurora.org,
	jslaby@suse.com
Cc: linux-arm-msm@vger.kernel.org, linux-serial@vger.kernel.org,
	linux-kernel@vger.kernel.org,
	Pramod Gurav <pramod.gurav@linaro.org>
Subject: [PATCH] tty: serial: msm: Remove duplicate handling of clocks
Date: Wed, 11 May 2016 14:30:29 +0530	[thread overview]
Message-ID: <1462957229-17567-1-git-send-email-pramod.gurav@linaro.org> (raw)

msm_serial driver provides a .pm callback to the serial core to enable
and disable clock resource in suspend/resume path. This function is
also called before msm_startup. msm_startup also enables the clocks which
is not needed. Hence remove the duplcate clock operation from msm_startup
and msm_shutdown. Same is done in console setup to get rid of duplicate
clock operation.

Tested on DB410C console.

Signed-off-by: Pramod Gurav <pramod.gurav@linaro.org>
---
 drivers/tty/serial/msm_serial.c | 15 ++-------------
 1 file changed, 2 insertions(+), 13 deletions(-)

diff --git a/drivers/tty/serial/msm_serial.c b/drivers/tty/serial/msm_serial.c
index dcde955..73c3217 100644
--- a/drivers/tty/serial/msm_serial.c
+++ b/drivers/tty/serial/msm_serial.c
@@ -959,15 +959,6 @@ static int msm_set_baud_rate(struct uart_port *port, unsigned int baud,
 	return baud;
 }
 
-static void msm_init_clock(struct uart_port *port)
-{
-	struct msm_port *msm_port = UART_TO_MSM(port);
-
-	clk_prepare_enable(msm_port->clk);
-	clk_prepare_enable(msm_port->pclk);
-	msm_serial_set_mnd_regs(port);
-}
-
 static int msm_startup(struct uart_port *port)
 {
 	struct msm_port *msm_port = UART_TO_MSM(port);
@@ -982,7 +973,7 @@ static int msm_startup(struct uart_port *port)
 	if (unlikely(ret))
 		return ret;
 
-	msm_init_clock(port);
+	msm_serial_set_mnd_regs(port);
 
 	if (likely(port->fifosize > 12))
 		rfr_level = port->fifosize - 12;
@@ -1021,8 +1012,6 @@ static void msm_shutdown(struct uart_port *port)
 	if (msm_port->is_uartdm)
 		msm_release_dma(msm_port);
 
-	clk_disable_unprepare(msm_port->clk);
-
 	free_irq(port->irq, port);
 }
 
@@ -1451,7 +1440,7 @@ static int __init msm_console_setup(struct console *co, char *options)
 	if (unlikely(!port->membase))
 		return -ENXIO;
 
-	msm_init_clock(port);
+	msm_serial_set_mnd_regs(port);
 
 	if (options)
 		uart_parse_options(options, &baud, &parity, &bits, &flow);
-- 
1.8.2.1

             reply	other threads:[~2016-05-11  9:00 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-05-11  9:00 Pramod Gurav [this message]
2016-05-12  0:18 ` [PATCH] tty: serial: msm: Remove duplicate handling of clocks Stephen Boyd
2016-05-12  4:38   ` Pramod Gurav
2016-05-16  8:31 ` Pramod Gurav
2016-05-25 23:07   ` Stephen Boyd

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=1462957229-17567-1-git-send-email-pramod.gurav@linaro.org \
    --to=pramod.gurav@linaro.org \
    --cc=andy.gross@linaro.org \
    --cc=davidb@codeaurora.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=jslaby@suse.com \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-serial@vger.kernel.org \
    --cc=sboyd@codeaurora.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;
as well as URLs for NNTP newsgroup(s).