Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp4711932yba; Mon, 20 May 2019 02:21:46 -0700 (PDT) X-Google-Smtp-Source: APXvYqz5iORki8jJzOQQGKoyG+wykJsYLqUrmRZSkbOvu8dJGwoQzNvbTDq7u5iTBCkJK0yilqew X-Received: by 2002:a63:3190:: with SMTP id x138mr72847660pgx.402.1558344106496; Mon, 20 May 2019 02:21:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1558344106; cv=none; d=google.com; s=arc-20160816; b=ZKcoG6ky5pgF37/lQYwOFU7gA9WXwPsR8Q8Fpicpwr5EJgsBnnOtOUZSd639lRTOZb NJhJFaKvgoiPLeMwdetKG6h3MWgoSiGAibDf4K7hnYfoBmhlD55v59nhAyVpRBtBDpsR pNgDpvjxv89HFxvrIe1yeIptm/xCh3ojEWsPTa9fswVAN288dES5C8qX9c37vYAi1Liw jQ87lzI/oi0B30jzwBFHsOk6qqgcDx/5lV+HJcTxUt+myzkoZfQtDytvZMKb8cOzqNR6 RFflVRRgAUG6ULeAdJU4cSGsA7ZncEiS/Ukh+b7E3mCEm4NQxXNCVe7EDBa/wz4VUiEu A8zA== 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=4q3MjFHBDZa+IJdaRY4HKwExHaYATThZdJIip2iYEBg=; b=md/PBbTY2rTe9dTNLKH5pJ5lhmzuHkSnKpE96kBARUhTjdDFt39DEJFSaKRU8KamAe PAq2WsLb3YSL13sMKn44DvzpTNa8fAkHRfMoT67gtLBjGsJ1LTZkvV4gLswk2Tx7Hugg tHMq/xgY0hXjYuZrZ1qiVA5bMJ4GJMJ1zpCJyBKqK2v10zN3Y6nIvKNyTvRBehO8Wfyd MoUgPaDI1hWT0HkayziUrPKYqrG1vNmY4YJhKrFO+gLzgtwj6nqVRK74xGaTKWIB5Td4 YwsMK1WC7a2dOvLh3Rm1Wx5bILygPbWzgDaNtn33q1j7gVa83sYM60T462FO/hN7rhRo M74g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=aDNa+2yO; 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 g90si18058693plb.140.2019.05.20.02.21.31; Mon, 20 May 2019 02:21:46 -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=aDNa+2yO; 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 S1731150AbfETIG3 (ORCPT + 99 others); Mon, 20 May 2019 04:06:29 -0400 Received: from mail.kernel.org ([198.145.29.99]:36612 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730927AbfETIFk (ORCPT ); Mon, 20 May 2019 04:05:40 -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 63DBB2171F; Mon, 20 May 2019 08:05:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1558339539; bh=LW/pWzTHteG1srJqdSrJNeHIhFKP8tfLaLHrFixHZoc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=aDNa+2yO0r6VZpx63XvWxIE0sbUtGbAaJ415x8skKyNEjR1BKNr4f7o0JzzKu9mD1 6HSutSptN05V+nK7JU7gzYF4fJXAT8EO/OpyIdmBa4oqLzEwCzjBQvYIJsNRtdDQC5 G8dGSpzt44C7BoDgXNVseaZxaF1B+5QQG1qz7l0s= Received: by wens.tw (Postfix, from userid 1000) id EC63F65864; Mon, 20 May 2019 16:05:32 +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 Subject: [PATCH 24/25] clk: sunxi-ng: a80-usb: Use local parent references for SUNXI_CCU_GATE Date: Mon, 20 May 2019 16:04:20 +0800 Message-Id: <20190520080421.12575-25-wens@kernel.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190520080421.12575-1-wens@kernel.org> References: <20190520080421.12575-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. 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