From patchwork Sat Mar 11 12:50:01 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tero Kristo X-Patchwork-Id: 9618685 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 1E105604CC for ; Sat, 11 Mar 2017 13:11:12 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 0328128799 for ; Sat, 11 Mar 2017 13:11:12 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id EA47B28789; Sat, 11 Mar 2017 13:11:11 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [65.50.211.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 73DFF28789 for ; Sat, 11 Mar 2017 13:11:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-ID:Date:Subject:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=uaN3bgfRaEgOa/A8laFX6g50E+DRQbp30TGw4sTpQD4=; b=odFTbqopYNYIXi SPmh4QhE9XJATpPeA34nnhQfxOaU6VzH67SVlcFU1X1FMhtAf0Nx7X8xFCYYNPQersanBm4gE35vs Gipfk0dbe7MMs0i9N3io3Sm+OhKZjbSZ2ro3MP4fzwt83F9yXrWqeaksjz7TkUIZMXT6S1daWOEe7 ue4fsPbIarr2KcAEi9V2yIyB3PnOyfC8MZIGOzieta+TBX4/d5jUKgOso7Qf7FqUs/6XL6YOfg9oW d/Fxl2kDeiFb1sW74sIwSy6gKwD70zuVuV93dLCepSYDY7sYIn3DTQ+VplEzYzyvnk2d1ipGxb7+F MyXFErz1O2bZIzMRBodQ==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.87 #1 (Red Hat Linux)) id 1cmgnb-0004KD-1n; Sat, 11 Mar 2017 13:11:07 +0000 Received: from casper.infradead.org ([2001:770:15f::2]) by bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1cmgVJ-00035c-US for linux-arm-kernel@bombadil.infradead.org; Sat, 11 Mar 2017 12:52:14 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=Content-Type:MIME-Version:References: In-Reply-To:Message-ID:Date:Subject:CC:To:From:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=VQvocAzbL6sHaXED20ncdMWdYoH6kCKt6wvAKTIAh0g=; b=gje7vNf5qcqWs6158vM9r1Oh0 Z8rpp8OUBUzkBTT0goRMSO+VzZaFyIx/XV6hUW8Ac/qpVqVa9IQRi5GCFsUUSCTsabPaS79CNEu0B /kOd+Hf6bg3KEcLrg+sKdOJgTuxik/sSIYEjQBJOMxHicjgFXXfEZ2KPiPgPVQ0NuUDpFJFh4a0AL toT3hrBrByb5PkCRPxNP+HwOkbfYKHsjEeYLtDoXSyojnRGH8hB5vgzeYzJCX3ZQcl3lQwVjIBf6E gIJ1e0EG1uIr7+ZkVLcwWd4reaoVivhMcWUX7egBJbbjDqlOrSuyd/6Mv8eGaZDpue3NeApVAiqXC XDqc1s+hQ==; Received: from fllnx209.ext.ti.com ([198.47.19.16]) by casper.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1cmgVF-0005YQ-Jw for linux-arm-kernel@lists.infradead.org; Sat, 11 Mar 2017 12:52:12 +0000 Received: from dlelxv90.itg.ti.com ([172.17.2.17]) by fllnx209.ext.ti.com (8.15.1/8.15.1) with ESMTP id v2BCorVD012963; Sat, 11 Mar 2017 06:50:53 -0600 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ti.com; s=ti-com-17Q1; t=1489236653; bh=iwcrlkIE2AMwFkQkTgq8yaIZYf7ofbFiT40z5Tg5pVw=; h=From:To:CC:Subject:Date:In-Reply-To:References; b=ucRkDm1rm7TPLlvQwT0pjUw9tAaHnfbJFSze9dFmI3Uf7eOoaHC9S92xXPoYWEXTV y5BJBRLdpTAgnN0Nj4wQLKPCJI+3m+pfEJ53De0jaS90MkC1U1Av/QNYI8iXltovqD CP6aWtgatkqtBk6ENirrfeI5KPPFd5LFJVa2me60= Received: from DLEE70.ent.ti.com (dlee70.ent.ti.com [157.170.170.113]) by dlelxv90.itg.ti.com (8.14.3/8.13.8) with ESMTP id v2BComOZ028389; Sat, 11 Mar 2017 06:50:48 -0600 Received: from dflp33.itg.ti.com (10.64.6.16) by DLEE70.ent.ti.com (157.170.170.113) with Microsoft SMTP Server id 14.3.294.0; Sat, 11 Mar 2017 06:50:47 -0600 Received: from gomoku.home (ileax41-snat.itg.ti.com [10.172.224.153]) by dflp33.itg.ti.com (8.14.3/8.13.8) with ESMTP id v2BCoHhx015557; Sat, 11 Mar 2017 06:50:46 -0600 From: Tero Kristo To: , , , , Subject: [PATCHv2 10/15] clk: ti: mux: convert TI mux clock to use its internal data representation Date: Sat, 11 Mar 2017 14:50:01 +0200 Message-ID: <1489236606-24023-11-git-send-email-t-kristo@ti.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1489236606-24023-1-git-send-email-t-kristo@ti.com> References: <1489236606-24023-1-git-send-email-t-kristo@ti.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20170311_125210_014330_6EA459CE X-CRM114-Status: GOOD ( 11.86 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-arm-kernel@lists.infradead.org Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP Instead of using the generic clock driver data struct, use one internal for the TI clock driver itself. This allows modifying the register access parts in subsequent patch. Signed-off-by: Tero Kristo Acked-by: Tony Lindgren --- drivers/clk/ti/clock.h | 11 +++++++++++ drivers/clk/ti/mux.c | 10 +++++----- 2 files changed, 16 insertions(+), 5 deletions(-) diff --git a/drivers/clk/ti/clock.h b/drivers/clk/ti/clock.h index cb906a1..41913bf 100644 --- a/drivers/clk/ti/clock.h +++ b/drivers/clk/ti/clock.h @@ -16,6 +16,17 @@ #ifndef __DRIVERS_CLK_TI_CLOCK__ #define __DRIVERS_CLK_TI_CLOCK__ +struct clk_omap_mux { + struct clk_hw hw; + void __iomem *reg; + u32 *table; + u32 mask; + u8 shift; + u8 flags; +}; + +#define to_clk_omap_mux(_hw) container_of(_hw, struct clk_omap_mux, hw) + enum { TI_CLK_FIXED, TI_CLK_MUX, diff --git a/drivers/clk/ti/mux.c b/drivers/clk/ti/mux.c index 3cc6db4..daa2dee 100644 --- a/drivers/clk/ti/mux.c +++ b/drivers/clk/ti/mux.c @@ -28,7 +28,7 @@ static u8 ti_clk_mux_get_parent(struct clk_hw *hw) { - struct clk_mux *mux = to_clk_mux(hw); + struct clk_omap_mux *mux = to_clk_omap_mux(hw); int num_parents = clk_hw_get_num_parents(hw); u32 val; @@ -65,7 +65,7 @@ static u8 ti_clk_mux_get_parent(struct clk_hw *hw) static int ti_clk_mux_set_parent(struct clk_hw *hw, u8 index) { - struct clk_mux *mux = to_clk_mux(hw); + struct clk_omap_mux *mux = to_clk_omap_mux(hw); u32 val; if (mux->table) { @@ -102,7 +102,7 @@ static struct clk *_register_mux(struct device *dev, const char *name, void __iomem *reg, u8 shift, u32 mask, u8 clk_mux_flags, u32 *table) { - struct clk_mux *mux; + struct clk_omap_mux *mux; struct clk *clk; struct clk_init_data init; @@ -229,7 +229,7 @@ static void of_mux_clk_setup(struct device_node *node) struct clk_hw *ti_clk_build_component_mux(struct ti_clk_mux *setup) { - struct clk_mux *mux; + struct clk_omap_mux *mux; struct clk_omap_reg *reg; int num_parents; @@ -260,7 +260,7 @@ struct clk_hw *ti_clk_build_component_mux(struct ti_clk_mux *setup) static void __init of_ti_composite_mux_clk_setup(struct device_node *node) { - struct clk_mux *mux; + struct clk_omap_mux *mux; unsigned int num_parents; u32 val;