From: Songjun Wu <songjun.wu@linux.intel.com>
To: yixin.zhu@linux.intel.com, chuanhua.lei@linux.intel.com,
hauke.mehrtens@intel.com
Cc: Songjun Wu <songjun.wu@linux.intel.com>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
linux-kernel@vger.kernel.org, linux-serial@vger.kernel.org,
Jiri Slaby <jslaby@suse.com>
Subject: [PATCH 09/14] serial: lantiq: Add CCF support
Date: Mon, 24 Sep 2018 18:27:58 +0800 [thread overview]
Message-ID: <20180924102803.30263-10-songjun.wu@linux.intel.com> (raw)
In-Reply-To: <20180924102803.30263-1-songjun.wu@linux.intel.com>
Previous implementation uses platform-dependent API to get the clock.
Those functions are not available for other SoC which uses the same IP.
The CCF (Common Clock Framework) have an abstraction based APIs for
clock. In future, the platform specific code will be removed when the
legacy soc use CCF as well.
Change to use CCF APIs to get clock and rate. So that different SoCs
can use the same driver.
Signed-off-by: Songjun Wu <songjun.wu@linux.intel.com>
---
drivers/tty/serial/lantiq.c | 12 ++++++++++--
1 file changed, 10 insertions(+), 2 deletions(-)
diff --git a/drivers/tty/serial/lantiq.c b/drivers/tty/serial/lantiq.c
index 34b1ef3c12ce..88210de00f35 100644
--- a/drivers/tty/serial/lantiq.c
+++ b/drivers/tty/serial/lantiq.c
@@ -744,14 +744,22 @@ lqasc_probe(struct platform_device *pdev)
port->irq = irqres[0].start;
port->mapbase = mmres->start;
- ltq_port->freqclk = clk_get_fpi();
+ if (IS_ENABLED(CONFIG_LANTIQ) && !IS_ENABLED(CONFIG_COMMON_CLK))
+ ltq_port->freqclk = clk_get_fpi();
+ else
+ ltq_port->freqclk = devm_clk_get(&pdev->dev, "freq");
+
+
if (IS_ERR(ltq_port->freqclk)) {
pr_err("failed to get fpi clk\n");
return -ENOENT;
}
/* not all asc ports have clock gates, lets ignore the return code */
- ltq_port->clk = clk_get(&pdev->dev, NULL);
+ if (IS_ENABLED(CONFIG_LANTIQ) && !IS_ENABLED(CONFIG_COMMON_CLK))
+ ltq_port->clk = clk_get(&pdev->dev, NULL);
+ else
+ ltq_port->clk = devm_clk_get(&pdev->dev, "asc");
ltq_port->tx_irq = irqres[0].start;
ltq_port->rx_irq = irqres[1].start;
--
2.11.0
next prev parent reply other threads:[~2018-09-24 10:27 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-09-24 10:27 [PATCH 00/14] serial: langtiq: Add CCF suppport Songjun Wu
2018-09-24 10:27 ` [PATCH 03/14] serial: lantiq: Get serial id from dts Songjun Wu
2018-09-24 10:27 ` [PATCH 04/14] serial: lantiq: Change ltq_w32_mask to asc_update_bits Songjun Wu
2018-09-24 10:27 ` [PATCH 06/14] serial: lantiq: Use readl/writel instead of ltq_r32/ltq_w32 Songjun Wu
2018-09-24 10:27 ` [PATCH 07/14] serial: lantiq: Rename fpiclk to freqclk Songjun Wu
2018-09-24 10:27 ` [PATCH 08/14] serial: lantiq: Replace clk_enable/clk_disable with clk generic API Songjun Wu
2018-09-24 10:27 ` Songjun Wu [this message]
2018-09-24 10:27 ` [PATCH 10/14] serial: lantiq: Reorder the head files Songjun Wu
2018-09-24 10:28 ` [PATCH 12/14] serial: lantiq: Replace lantiq_soc.h with lantiq.h Songjun Wu
2018-09-24 10:28 ` [PATCH 13/14] serial: lantiq: Change init_lqasc to static declaration Songjun Wu
2018-09-24 10:28 ` [PATCH 14/14] dt-bindings: serial: lantiq: Add optional properties for CCF Songjun Wu
2018-10-15 21:58 ` [PATCH 00/14] serial: langtiq: Add CCF suppport Paul Burton
2018-10-16 9:05 ` Wu, Songjun
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=20180924102803.30263-10-songjun.wu@linux.intel.com \
--to=songjun.wu@linux.intel.com \
--cc=chuanhua.lei@linux.intel.com \
--cc=gregkh@linuxfoundation.org \
--cc=hauke.mehrtens@intel.com \
--cc=jslaby@suse.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-serial@vger.kernel.org \
--cc=yixin.zhu@linux.intel.com \
/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).