Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp322063imm; Thu, 2 Aug 2018 20:05:56 -0700 (PDT) X-Google-Smtp-Source: AAOMgpcnvDWFbpJz6swOq1ih1s5pxidI5P6Dlv9LVLA/P5n1vzLIvkENvQ6YH2LBnzcNOYRdaLHc X-Received: by 2002:a63:6fcc:: with SMTP id k195-v6mr1890056pgc.135.1533265556123; Thu, 02 Aug 2018 20:05:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1533265556; cv=none; d=google.com; s=arc-20160816; b=y91CMXve/YRniyPgoJrvmmd884kYWPnfw2drOyFgaIg4pd0PQJrWypqo3Xqbi6AztI EVBH7WY6WdQqdm9dgAgFXrq3feW/XITrhtwEWRM1DFsnnkn8H6Mn1r7kkrxDkXYjCaKx RBLE6I8DpTqWI/C4s02/bOrkeD3BmMZoG/zt+E7h0326i83NCGLeb1fat0GdTlZx5JPv GzTRegnyjOl8Z8k3KWAVkAwo+yoJxYGVcm0xCrCnCF/t7zclmv/yf0YFOM9T/AhpUp1R HyxOeAhVLKnIyDfXXBzDwelhvDyccNhCFWKrmJt+HMQ1coQxH94t1SKLHqnezg7ZQN/f vjNg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:arc-authentication-results; bh=4SLh/xislvK/TPt0k9Nbt+BYmvWKx77cum7beCxSGaU=; b=LNgacF/0JzGuW7IXGg9y5wXE0rJ3NeAgNGWA6NmcVuVsHRB6tBkY6y8FYRGTc0wtW9 ry/80VREQ1o3Qmgi9Z3V1EAFLuXKIM4yf8tnH6PvCjrWyl28Qc9cV+6fFNXzhjogbAgl suI0rK5aHSqx5IJ07qnJ/6OwbrFbp/AjtUpNgMzFSH15cZxC6HlKAD+o2LZpwUo+elOu LU87XwCausZ+HD7KzUg1FQ+AmQGCOp8VJuH7nVzx1TJ9m0krOthHr7QS/S4CWRSsvjHF Uv3/q5Iy6cqu6qoeXL7jc05UQVmNpVBaFHTjpazHRAFsP8HUHspogHNz/QJxCrf9w/9k PIPw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id j6-v6si2919789plk.438.2018.08.02.20.05.41; Thu, 02 Aug 2018 20:05:56 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729876AbeHCE6f (ORCPT + 99 others); Fri, 3 Aug 2018 00:58:35 -0400 Received: from mga05.intel.com ([192.55.52.43]:63304 "EHLO mga05.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726413AbeHCE6f (ORCPT ); Fri, 3 Aug 2018 00:58:35 -0400 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by fmsmga105.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 02 Aug 2018 20:04:27 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.51,437,1526367600"; d="scan'208";a="69687702" Received: from sgsxdev001.isng.intel.com (HELO localhost) ([10.226.88.11]) by FMSMGA003.fm.intel.com with ESMTP; 02 Aug 2018 20:04:25 -0700 From: Songjun Wu To: hua.ma@linux.intel.com, yixin.zhu@linux.intel.com, chuanhua.lei@linux.intel.com, qi-ming.wu@intel.com Cc: linux-mips@linux-mips.org, linux-clk@vger.kernel.org, linux-serial@vger.kernel.org, devicetree@vger.kernel.org, Songjun Wu , Greg Kroah-Hartman , linux-kernel@vger.kernel.org, Jiri Slaby Subject: [PATCH v2 14/18] serial: intel: Add CCF support Date: Fri, 3 Aug 2018 11:02:33 +0800 Message-Id: <20180803030237.3366-15-songjun.wu@linux.intel.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20180803030237.3366-1-songjun.wu@linux.intel.com> References: <20180803030237.3366-1-songjun.wu@linux.intel.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 --- Changes in v2: None drivers/tty/serial/lantiq.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/drivers/tty/serial/lantiq.c b/drivers/tty/serial/lantiq.c index 36479d66fb7c..35518ab3a80d 100644 --- a/drivers/tty/serial/lantiq.c +++ b/drivers/tty/serial/lantiq.c @@ -26,7 +26,9 @@ #include #include +#ifdef CONFIG_LANTIQ #include +#endif #define PORT_LTQ_ASC 111 #define MAXPORTS 2 @@ -744,14 +746,23 @@ lqasc_probe(struct platform_device *pdev) port->irq = irqres[0].start; port->mapbase = mmres->start; +#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"); +#endif + 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 */ +#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"); +#endif ltq_port->tx_irq = irqres[0].start; ltq_port->rx_irq = irqres[1].start; -- 2.11.0