From patchwork Thu May 28 18:41:48 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Matthias Brugger X-Patchwork-Id: 6500481 Return-Path: X-Original-To: patchwork-linux-mediatek@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 37ABE9F40A for ; Thu, 28 May 2015 18:43:34 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 573CF2076F for ; Thu, 28 May 2015 18:43:29 +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 AF0F420732 for ; Thu, 28 May 2015 18:43:24 +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 1Yy2m4-0007uW-1R; Thu, 28 May 2015 18:43:24 +0000 Received: from mail-wg0-x236.google.com ([2a00:1450:400c:c00::236]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1Yy2l2-0007R5-PG; Thu, 28 May 2015 18:42:22 +0000 Received: by wgme6 with SMTP id e6so43979178wgm.2; Thu, 28 May 2015 11:42:00 -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=YK5of4AiFQfUphQqWqXN7+MN/hzL7uXiXyjpX6SMr2g=; b=mceJ52z7TAEddj8/ZPtgAA7jkshvVva9ZHgRuW8N3cllyBgxW9t5zj33XxDFQKRKnv uhn4G3ktUhlpJk8tcqPqiIwV9v6ii9tvzXOTafEXS/YTnsLR0QuuAHKxVnwjSYfEULZr 14p+KzjgymbNsXKRC2+HJVLNsfPYcgxKzg5ZglE0VcX/Q1AOqkhBVycU3v7BySp1ctrM eUUee/jrko6xhQ/9WwlMgu5b0w7hEloSoU9RvEu9g6cvHcTOqb2j0rf7HnwTnCaf60bO LBvH7JXzfTxw5n7REO3+5V2LDtDYUKgoUzr1zwPkpYG2Z2boI/3cXo2xmxSWcx1Ymzoa LO7Q== X-Received: by 10.194.178.201 with SMTP id da9mr7631648wjc.139.1432838520346; Thu, 28 May 2015 11:42:00 -0700 (PDT) Received: from localhost.localdomain (225.91.135.37.dynamic.jazztel.es. [37.135.91.225]) by mx.google.com with ESMTPSA id ei8sm4584943wjd.32.2015.05.28.11.41.58 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 28 May 2015 11:41:59 -0700 (PDT) From: Matthias Brugger To: mturquette@linaro.org, sboyd@codeaurora.org, matthias.bgg@gmail.com Subject: [PATCH 3/3] clk: mediatek: Use regmap clk-mux for mt8135 Date: Thu, 28 May 2015 20:41:48 +0200 Message-Id: <1432838508-5184-4-git-send-email-matthias.bgg@gmail.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1432838508-5184-1-git-send-email-matthias.bgg@gmail.com> References: <1432838508-5184-1-git-send-email-matthias.bgg@gmail.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20150528_114221_003030_5437F82F X-CRM114-Status: GOOD ( 10.54 ) X-Spam-Score: -0.8 (/) Cc: jamesjj.liao@mediatek.com, s.hauer@pengutronix.de, linux-kernel@vger.kernel.org, henryc.chen@mediatek.com, linux-mediatek@lists.infradead.org, p.zabel@pengutronix.de, linux-clk@vger.kernel.org, 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.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 a63435b..bfb56c6 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)