Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp4236143ybi; Tue, 11 Jun 2019 03:19:20 -0700 (PDT) X-Google-Smtp-Source: APXvYqy+0772sygoxQvj+zU5cWR4fFMeFV2TfKsSuP8KLbezbiOhhkbI0/nCrMEeYXeaZE/Kby+u X-Received: by 2002:a63:1208:: with SMTP id h8mr19101313pgl.377.1560248360437; Tue, 11 Jun 2019 03:19:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1560248360; cv=none; d=google.com; s=arc-20160816; b=h7bI5DAw5M4bibZQhYIzrvA2U0rRRIKGQuJpCI7ifgYUJKWiFAdzgr3RIy//I+QkwT ud7aiAbKkEKCU8xdhy01NFHH3MbrlqOPcP4edws/gstZH1mFIgOMnPxig7KvKMRDJi3+ qWgwnItPrpkPtuurDI7WDp1oOacJzoxlpSFXghqNAgUD6b9qjvr/C90lWhWe/NFSjzFS QJ7+Ryl7Tn1cKcW/8qzuBEN+U40o60nLVL4kSmct2t94upmW1aPaEoUMQ+3MWJPl1M+X elkLhn/i6FZAFW1c4e463RhXgEbbYf+MjIMavbGZkMoSj6JFP2vAGm33nmLvSEgyOHuy f2Aw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=VHkPmAPu/i541enrI5+f4VH5iXFCvOUjhGrjcAgKuGo=; b=kHI48h3h2kqcDOrcEuX6wQyDaiCkq+Ebezc3KcZRfbjaqkIXdl7dfzm2ZeQI8WVVkf 8rwIVktCOeLTphDmUejKx7YrVb86FroD14Bka+JeddtDlKKDjpwbjNf+kE8y+UEAiO/Y hAYPfydkhvtBXN0wVPLfEnc6J2bh0/xV04ZbVYlkeoXVYR774Esyx5SlQCXJGbS9B7ey jFviv/JgISFKbqihA+dpecSoXDT6WLuaobidKQA7mGx9J1+altVxG4pgZE6m2EDDFHBd I3SZMnoJVWef9Sh8C9Entn6KQHNNbM1HVELDUrr7E/B9dssjT0ZhxB3Euv8AoLdDcuRs /arQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=PqCnYjC5; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id w15si8516032pll.173.2019.06.11.03.19.04; Tue, 11 Jun 2019 03:19:20 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=PqCnYjC5; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2405438AbfFKKRy (ORCPT + 99 others); Tue, 11 Jun 2019 06:17:54 -0400 Received: from mail.kernel.org ([198.145.29.99]:45908 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2405340AbfFKKR1 (ORCPT ); Tue, 11 Jun 2019 06:17:27 -0400 Received: from wens.tw (mirror2.csie.ntu.edu.tw [140.112.30.76]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 7EF65217D4; Tue, 11 Jun 2019 10:17:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1560248245; bh=ADdQyps2/+oLNB/Geo1dIqcg9SQiRrczN9IzzsM2o+I=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=PqCnYjC5BypVeQLOHOFGuVs583+rbxEXS+J/tLL1dvTAWMqhpN5jFV4Vc5Pr23LnY 0q3rQFhwS0Xv44Ywsw2P0QxhTx+C0LC15W05bSh+4Vm/qRhqpRuGvROOaIvrGOObcj fJIh10LuuvY4lccOsIpFsfso9aoFWqW9TTeIWIAs= Received: by wens.tw (Postfix, from userid 1000) id AA88F60B85; Tue, 11 Jun 2019 18:17:18 +0800 (CST) From: Chen-Yu Tsai To: Maxime Ripard , Stephen Boyd , Michael Turquette Cc: Chen-Yu Tsai , linux-arm-kernel@lists.infradead.org, linux-clk@vger.kernel.org, linux-kernel@vger.kernel.org, Chen-Yu Tsai Subject: [PATCH v2 24/25] clk: sunxi-ng: a80-usb: Use local parent references for SUNXI_CCU_GATE Date: Tue, 11 Jun 2019 18:16:57 +0800 Message-Id: <20190611101658.23855-25-wens@kernel.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190611101658.23855-1-wens@kernel.org> References: <20190611101658.23855-1-wens@kernel.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Chen-Yu Tsai With the new clk parenting code and SUNXI_CCU_GATE macros, we can reference parents locally via pointers to struct clk_hw or DT clock-names. Convert existing SUNXI_CCU_GATE definitions to SUNXI_CCU_GATE_DATA to specify the parent clock. Acked-by: Maxime Ripard Signed-off-by: Chen-Yu Tsai --- drivers/clk/sunxi-ng/ccu-sun9i-a80-usb.c | 32 +++++++++++++++--------- 1 file changed, 20 insertions(+), 12 deletions(-) diff --git a/drivers/clk/sunxi-ng/ccu-sun9i-a80-usb.c b/drivers/clk/sunxi-ng/ccu-sun9i-a80-usb.c index 1d76f24f7df3..23bc11e65539 100644 --- a/drivers/clk/sunxi-ng/ccu-sun9i-a80-usb.c +++ b/drivers/clk/sunxi-ng/ccu-sun9i-a80-usb.c @@ -22,18 +22,26 @@ #include "ccu-sun9i-a80-usb.h" -static SUNXI_CCU_GATE(bus_hci0_clk, "bus-hci0", "bus-usb", 0x0, BIT(1), 0); -static SUNXI_CCU_GATE(usb_ohci0_clk, "usb-ohci0", "osc24M", 0x0, BIT(2), 0); -static SUNXI_CCU_GATE(bus_hci1_clk, "bus-hci1", "bus-usb", 0x0, BIT(3), 0); -static SUNXI_CCU_GATE(bus_hci2_clk, "bus-hci2", "bus-usb", 0x0, BIT(5), 0); -static SUNXI_CCU_GATE(usb_ohci2_clk, "usb-ohci2", "osc24M", 0x0, BIT(6), 0); - -static SUNXI_CCU_GATE(usb0_phy_clk, "usb0-phy", "osc24M", 0x4, BIT(1), 0); -static SUNXI_CCU_GATE(usb1_hsic_clk, "usb1-hsic", "osc24M", 0x4, BIT(2), 0); -static SUNXI_CCU_GATE(usb1_phy_clk, "usb1-phy", "osc24M", 0x4, BIT(3), 0); -static SUNXI_CCU_GATE(usb2_hsic_clk, "usb2-hsic", "osc24M", 0x4, BIT(4), 0); -static SUNXI_CCU_GATE(usb2_phy_clk, "usb2-phy", "osc24M", 0x4, BIT(5), 0); -static SUNXI_CCU_GATE(usb_hsic_clk, "usb-hsic", "osc24M", 0x4, BIT(10), 0); +static const struct clk_parent_data clk_parent_hosc[] = { + { .fw_name = "hosc" }, +}; + +static const struct clk_parent_data clk_parent_bus[] = { + { .fw_name = "bus" }, +}; + +static SUNXI_CCU_GATE_DATA(bus_hci0_clk, "bus-hci0", clk_parent_bus, 0x0, BIT(1), 0); +static SUNXI_CCU_GATE_DATA(usb_ohci0_clk, "usb-ohci0", clk_parent_hosc, 0x0, BIT(2), 0); +static SUNXI_CCU_GATE_DATA(bus_hci1_clk, "bus-hci1", clk_parent_bus, 0x0, BIT(3), 0); +static SUNXI_CCU_GATE_DATA(bus_hci2_clk, "bus-hci2", clk_parent_bus, 0x0, BIT(5), 0); +static SUNXI_CCU_GATE_DATA(usb_ohci2_clk, "usb-ohci2", clk_parent_hosc, 0x0, BIT(6), 0); + +static SUNXI_CCU_GATE_DATA(usb0_phy_clk, "usb0-phy", clk_parent_hosc, 0x4, BIT(1), 0); +static SUNXI_CCU_GATE_DATA(usb1_hsic_clk, "usb1-hsic", clk_parent_hosc, 0x4, BIT(2), 0); +static SUNXI_CCU_GATE_DATA(usb1_phy_clk, "usb1-phy", clk_parent_hosc, 0x4, BIT(3), 0); +static SUNXI_CCU_GATE_DATA(usb2_hsic_clk, "usb2-hsic", clk_parent_hosc, 0x4, BIT(4), 0); +static SUNXI_CCU_GATE_DATA(usb2_phy_clk, "usb2-phy", clk_parent_hosc, 0x4, BIT(5), 0); +static SUNXI_CCU_GATE_DATA(usb_hsic_clk, "usb-hsic", clk_parent_hosc, 0x4, BIT(10), 0); static struct ccu_common *sun9i_a80_usb_clks[] = { &bus_hci0_clk.common, -- 2.20.1