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: 9618643 X-Patchwork-Delegate: sboyd@codeaurora.org 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 071DF604A9 for ; Sat, 11 Mar 2017 12:52:19 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id F3DE528779 for ; Sat, 11 Mar 2017 12:52:18 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id E8C2E287AA; Sat, 11 Mar 2017 12:52:18 +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=-6.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 79D0828779 for ; Sat, 11 Mar 2017 12:52:18 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755646AbdCKMwS (ORCPT ); Sat, 11 Mar 2017 07:52:18 -0500 Received: from fllnx209.ext.ti.com ([198.47.19.16]:16739 "EHLO fllnx209.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753959AbdCKMwS (ORCPT ); Sat, 11 Mar 2017 07:52:18 -0500 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: , , , , CC: 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 Sender: linux-clk-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-clk@vger.kernel.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;