From patchwork Tue Jun 16 14:23:35 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Matthias Brugger X-Patchwork-Id: 6618311 Return-Path: X-Original-To: patchwork-linux-mediatek@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 4E9F0C0020 for ; Tue, 16 Jun 2015 14:24:51 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 7A48B20792 for ; Tue, 16 Jun 2015 14:24:50 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 9D69B207D0 for ; Tue, 16 Jun 2015 14:24:49 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1Z4rnE-0005iu-MC; Tue, 16 Jun 2015 14:24:48 +0000 Received: from mail-wi0-x22d.google.com ([2a00:1450:400c:c05::22d]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1Z4rme-0005VQ-Tc; Tue, 16 Jun 2015 14:24:13 +0000 Received: by wibdq8 with SMTP id dq8so21319041wib.1; Tue, 16 Jun 2015 07:23:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=3ovIpXLhID0sK9FjHxSTRUn8B/X27VjKYpsJGGo9GoQ=; b=JvFP2fwBU9RquIqf6lhjzwrfBAD4sXc3jp+LuCYCzRhv6QfkUgophoFSl/pi//wdhZ 9j9BCMlcKCZNPJQFUqsW5XxjJKoHh5mosKZKuwAoCYhppE3UwUSRrETpFrl2/LLGbWfC E6rVgmbu/EfgfrGeh4krpJua8HzquGmAqtFqKjOxabZKuDhR7ZvQ5qoe7wWEkQk7S/Tl U4R2D2QOS7YZZ76zte/LSYehP9osSTIrsTgmVWzjrEgaeHMO7vZqAnnfYbteLYX/SXju SvCBiPqHo3PmD7LlbGk97m7gqiOOfdfxnKKTuk5tfzGUZSCmU+u8lsNQSjmrA3kWBNAf xHAw== X-Received: by 10.180.206.14 with SMTP id lk14mr43445754wic.94.1434464630925; Tue, 16 Jun 2015 07:23:50 -0700 (PDT) Received: from localhost.localdomain (249.Red-2-139-157.staticIP.rima-tde.net. [2.139.157.249]) by mx.google.com with ESMTPSA id q2sm1903711wjz.15.2015.06.16.07.23.49 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 16 Jun 2015 07:23:50 -0700 (PDT) From: Matthias Brugger To: mturquette@gmail.com, sboyd@codeaurora.org, matthias.bgg@gmail.com Subject: [PATCH v4 3/3] clk: mediatek: Use regmap clk-mux for mt8135 Date: Tue, 16 Jun 2015 16:23:35 +0200 Message-Id: <1434464615-9080-4-git-send-email-matthias.bgg@gmail.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1434464615-9080-1-git-send-email-matthias.bgg@gmail.com> References: <1434464615-9080-1-git-send-email-matthias.bgg@gmail.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20150616_072413_142640_3C41FF9C X-CRM114-Status: UNSURE ( 9.95 ) X-CRM114-Notice: Please train this message. X-Spam-Score: -0.8 (/) Cc: jamesjj.liao@mediatek.com, heiko@sntech.de, manabian@gmail.com, linux-kernel@vger.kernel.org, henryc.chen@mediatek.com, linux-clk@vger.kernel.org, linux-mediatek@lists.infradead.org, p.zabel@pengutronix.de, s.hauer@pengutronix.de, linux-arm-kernel@lists.infradead.org X-BeenThere: linux-mediatek@lists.infradead.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: "Linux-mediatek" Errors-To: linux-mediatek-bounces+patchwork-linux-mediatek=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-4.7 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_MED, RP_MATCHES_RCVD, T_DKIM_INVALID, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP The pericfg controller is used by various device drivers, so that it is implemented via a regmap. In the actual clk implementation for mt8135, some clk-mux use the traditional register approach which acceses the register via iomem. This patch changes the use from iomem to the needed regmap. Signed-off-by: Matthias Brugger --- drivers/clk/mediatek/clk-mt8135.c | 21 +++++++-------------- 1 file changed, 7 insertions(+), 14 deletions(-) diff --git a/drivers/clk/mediatek/clk-mt8135.c b/drivers/clk/mediatek/clk-mt8135.c index 08b4b84..c28a9d4 100644 --- a/drivers/clk/mediatek/clk-mt8135.c +++ b/drivers/clk/mediatek/clk-mt8135.c @@ -513,11 +513,11 @@ static const char * const uart_ck_sel_parents[] __initconst = { "uart_sel", }; -static const struct mtk_composite peri_clks[] __initconst = { - MUX(CLK_PERI_UART0_SEL, "uart0_ck_sel", uart_ck_sel_parents, 0x40c, 0, 1), - MUX(CLK_PERI_UART1_SEL, "uart1_ck_sel", uart_ck_sel_parents, 0x40c, 1, 1), - MUX(CLK_PERI_UART2_SEL, "uart2_ck_sel", uart_ck_sel_parents, 0x40c, 2, 1), - MUX(CLK_PERI_UART3_SEL, "uart3_ck_sel", uart_ck_sel_parents, 0x40c, 3, 1), +static const struct mtk_regm_mux peri_clks[] __initconst = { + MUX_REGMAP(CLK_PERI_UART0_SEL, "uart0_ck_sel", uart_ck_sel_parents, 0x40c, 0, 1), + MUX_REGMAP(CLK_PERI_UART1_SEL, "uart1_ck_sel", uart_ck_sel_parents, 0x40c, 1, 1), + MUX_REGMAP(CLK_PERI_UART2_SEL, "uart2_ck_sel", uart_ck_sel_parents, 0x40c, 2, 1), + MUX_REGMAP(CLK_PERI_UART3_SEL, "uart3_ck_sel", uart_ck_sel_parents, 0x40c, 3, 1), }; static void __init mtk_topckgen_init(struct device_node *node) @@ -573,20 +573,13 @@ static void __init mtk_pericfg_init(struct device_node *node) { struct clk_onecell_data *clk_data; int r; - void __iomem *base; - - base = of_iomap(node, 0); - if (!base) { - pr_err("%s(): ioremap failed\n", __func__); - return; - } clk_data = mtk_alloc_clk_data(CLK_PERI_NR_CLK); mtk_clk_register_gates(node, peri_gates, ARRAY_SIZE(peri_gates), clk_data); - mtk_clk_register_composites(peri_clks, ARRAY_SIZE(peri_clks), base, - &mt8135_clk_lock, clk_data); + mtk_clk_regm_register_mux(node, peri_clks, ARRAY_SIZE(peri_clks), + clk_data); r = of_clk_add_provider(node, of_clk_src_onecell_get, clk_data); if (r)