From patchwork Tue Jun 9 15:38:03 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Matthias Brugger X-Patchwork-Id: 6573591 Return-Path: X-Original-To: patchwork-linux-arm@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 AC70EC0020 for ; Tue, 9 Jun 2015 15:40:59 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id D9DF4204A0 for ; Tue, 9 Jun 2015 15:40:58 +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 170A8204AD for ; Tue, 9 Jun 2015 15:40:58 +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 1Z2LcK-0001SN-2L; Tue, 09 Jun 2015 15:39:08 +0000 Received: from mail-wi0-x22a.google.com ([2a00:1450:400c:c05::22a]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1Z2Lbs-0001Ep-A7; Tue, 09 Jun 2015 15:38:41 +0000 Received: by wiwd19 with SMTP id d19so22698579wiw.0; Tue, 09 Jun 2015 08:38:17 -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=D9v9F23ENRAEmGDtlMZ78RUECFd06HS2MHu7a06VqrtTSN7UDxPYEUxEFBdHzvi8MC n2gWKpCrtC4MgSZnWJE/uShbqvsi+Bnz9Bs2cc7ps9yiw1FF5RNG8ZpAHHiBgcR9Vrrq HmiM4Ke25DmrpYEriQg+NL9k3EQCRN8xZqfLZVuTaBAevkmshvSEBk4gHMVYuz45EzTa C3XdPoahdyB9Xl6iFGwnSk+pcZLzGOFKCb9Y1BX5wSE/x3Lfa3LvYLcbNN9/n8Cjw7/T idDiyrvgaQQedNLxgIRlhCuzx9L0K7hXLd2L9eDz5ORipHzOkiK0M3pZ1Th4kc58mIxj Pkig== X-Received: by 10.194.172.72 with SMTP id ba8mr43179006wjc.136.1433864297447; Tue, 09 Jun 2015 08:38:17 -0700 (PDT) Received: from ubix.com ([77.231.207.184]) by mx.google.com with ESMTPSA id k2sm3417734wix.4.2015.06.09.08.38.15 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 09 Jun 2015 08:38:16 -0700 (PDT) From: Matthias Brugger To: mturquette@linaro.org, sboyd@codeaurora.org, matthias.bgg@gmail.com Subject: [PATCH v3 3/3] clk: mediatek: Use regmap clk-mux for mt8135 Date: Tue, 9 Jun 2015 17:38:03 +0200 Message-Id: <1433864283-25490-4-git-send-email-matthias.bgg@gmail.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1433864283-25490-1-git-send-email-matthias.bgg@gmail.com> References: <1433864283-25490-1-git-send-email-matthias.bgg@gmail.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20150609_083840_537015_11174455 X-CRM114-Status: UNSURE ( 9.93 ) X-CRM114-Notice: Please train this message. X-Spam-Score: -0.8 (/) Cc: jamesjj.liao@mediatek.com, manabian@gmail.com, s.hauer@pengutronix.de, linux-kernel@vger.kernel.org, henryc.chen@mediatek.com, linux-mediatek@lists.infradead.org, linux-clk@vger.kernel.org, linux-arm-kernel@lists.infradead.org X-BeenThere: linux-arm-kernel@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-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-4.1 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_MED, T_DKIM_INVALID, T_RP_MATCHES_RCVD, 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)