From patchwork Fri Jul 31 15:14:19 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Matthias Brugger X-Patchwork-Id: 6914041 Return-Path: X-Original-To: patchwork-linux-arm@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 8E7A99F38B for ; Fri, 31 Jul 2015 15:18:10 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 17EEB202AE for ; Fri, 31 Jul 2015 15:18:05 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id DEBE320304 for ; Fri, 31 Jul 2015 15:18:03 +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 1ZLC2b-00004z-N4; Fri, 31 Jul 2015 15:16:09 +0000 Received: from mail-wi0-x22b.google.com ([2a00:1450:400c:c05::22b]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1ZLC1S-0006S5-Tw; Fri, 31 Jul 2015 15:14:59 +0000 Received: by wibud3 with SMTP id ud3so36149986wib.0; Fri, 31 Jul 2015 08:14:39 -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=FMr3406y35OxMaPfrwEW1psS3e3gEqUS4h0hAacohV+XNTXqvnlnM2WJAV1vS4/dBf QvWo38fCJbDSRd5XR+NsfGO0kl9jWl4SKoYibl4G1bNZ/YSuCwDyMTe2a57kCzsInc3q RzJHQWw5chQ/hBd7rbKqRF2TZ1bvminudnqQbss8Jd+dsXxGtPQcYcq+B4IN03ZA3h4E CamEZ40PK5PS7oKnkBGK3q5FIdITE7ocasLRt7mVfl7qfrmC25NrUWP8JZhQWVXojn0l erq11En5LNjCnv6tCtkAqckVUSfcWae9aSCm2p2utnwZ/0/jbi+ab0dad43Jm/TD2ZH1 GFMw== X-Received: by 10.180.77.40 with SMTP id p8mr8100772wiw.29.1438355679319; Fri, 31 Jul 2015 08:14:39 -0700 (PDT) Received: from localhost.localdomain (225.91.135.37.dynamic.jazztel.es. [37.135.91.225]) by smtp.gmail.com with ESMTPSA id nb9sm4958844wic.10.2015.07.31.08.14.36 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 31 Jul 2015 08:14:38 -0700 (PDT) From: Matthias Brugger To: mturquette@linaro.org, sboyd@codeaurora.org, matthias.bgg@gmail.com Subject: [PATCH v4 RESEND 3/3] clk: mediatek: Use regmap clk-mux for mt8135 Date: Fri, 31 Jul 2015 17:14:19 +0200 Message-Id: <1438355659-21558-4-git-send-email-matthias.bgg@gmail.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1438355659-21558-1-git-send-email-matthias.bgg@gmail.com> References: <1438355659-21558-1-git-send-email-matthias.bgg@gmail.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20150731_081459_206652_065B4510 X-CRM114-Status: GOOD ( 13.87 ) X-Spam-Score: -2.7 (--) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: jamesjj.liao@mediatek.com, p.zabel@pengutronix.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 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=-5.5 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)