Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp4665581yba; Mon, 20 May 2019 01:20:06 -0700 (PDT) X-Google-Smtp-Source: APXvYqy01Hiy9FCJSkpf7cgmYsqR5bsAw6ssHV5ijA20+TSKLgqqVJh2cY5VXN7T7vJz7D4gUxz4 X-Received: by 2002:a63:171c:: with SMTP id x28mr74004711pgl.12.1558340406699; Mon, 20 May 2019 01:20:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1558340406; cv=none; d=google.com; s=arc-20160816; b=A+8I25elwlni6DqTVUMfQkNMt8Dw2l4AaxgiaUNDjHPB/ThNeiSPkeTGjDASbrjiZN 4urEy6jgkm/QroB4+lDM0DyyA4IDhsD0gaVZPuLl5w0YWZaU6PdwBUC7BCxj6Yix2hSX jcHUljMSbGQAUkUeOHTziC/Nu8msXi6aSOSIRqC/ijmtVVLNpGQcbHGrrU710pXN7sDy GuJWpUDsZwVKgIRXtEuA902DiGSzu+HkuYTsu18A8plHddjBz8plHUXNW8Aq17JAVTMj MQraENd9DoSs4bt7omLtST0fUWQWESaBfdgO/Fdhp8xhmVsxWqT5XEdgYkOUGKAGg4nF ELcg== 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=XZ42OG28LnfbPB7MCRyyWhYhtIyIFGA1AQqsbxXJRgs=; b=rweDQSBl/xBF86TnXN+zgUI5OIKKZq93vkSRLGFongk1QH5l2KLgb4ITKWLhV6hWz1 swbxoQJFqP40ERjPrREHn9d/+DFuEFr/tQsz0CBdgSEVX8sFFzMj/5kLIEeUBDt3VAhe XHzrDyGuEmDi7Le4Iu3gdRJtOZ0wyILt3OdYrotOl871//f3IAAqMc5Z2Xgh4tPO01W2 wLOHX66GsB6+dea7OZ0v/VCq4bCrf4Rl49aodeQcVcnUmVkat1H29KHw7JOh7tMXhf6t GJeFRie6V3TEQM3PZx/3pDgtEIZ1YuRejKd6G4VAwSEMzCDrSqHPhFobNe3uG3BnDboK sb6w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=vNxczmE1; 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 j1si18256979pld.399.2019.05.20.01.19.52; Mon, 20 May 2019 01:20:06 -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=vNxczmE1; 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 S1730392AbfETIHP (ORCPT + 99 others); Mon, 20 May 2019 04:07:15 -0400 Received: from mail.kernel.org ([198.145.29.99]:36476 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730854AbfETIFh (ORCPT ); Mon, 20 May 2019 04:05:37 -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 F40CC2133F; Mon, 20 May 2019 08:05:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1558339537; bh=/fSqDKQe72fpIBiodybVMXXJlEchuMCnvyjpyuyScHw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=vNxczmE1TEwFm3wP5ap/Eej77KuonYG7e3/DiBaxOngOKg9Yw8Ae2M6Sn5PU02wkL Dt6x94eAgacREnUNh6b3/iSkMHPUcXpH1Fa+PouNlbcGfe+e+dHzvbWtfKr+AhYM7+ 0+IFvtjYsmVRIZUgFJTdViFgbi3tiKFH2R9Dy5ag= Received: by wens.tw (Postfix, from userid 1000) id 8E20E65813; 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 11/25] clk: sunxi-ng: sun5i: Use local parent references for CLK_FIXED_FACTOR Date: Mon, 20 May 2019 16:04:07 +0800 Message-Id: <20190520080421.12575-12-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 CLK_FIXED_FACTOR_{HW,FW_NAME} macros, we can reference parents locally via pointers to struct clk_hw or DT clock-names. Convert existing CLK_FIXED_FACTOR definitions to either the _HW or _FW_NAME variant based on whether the parent clock is internal or external to the CCU. Signed-off-by: Chen-Yu Tsai --- drivers/clk/sunxi-ng/ccu-sun5i.c | 34 +++++++++++++++++++++----------- 1 file changed, 22 insertions(+), 12 deletions(-) diff --git a/drivers/clk/sunxi-ng/ccu-sun5i.c b/drivers/clk/sunxi-ng/ccu-sun5i.c index 813e9bf73cbf..d27f3e4c0147 100644 --- a/drivers/clk/sunxi-ng/ccu-sun5i.c +++ b/drivers/clk/sunxi-ng/ccu-sun5i.c @@ -611,19 +611,29 @@ static struct ccu_common *sun5i_a10s_ccu_clks[] = { &iep_clk.common, }; +static const struct clk_hw *clk_parent_pll_audio[] = { + &pll_audio_base_clk.common.hw +}; + /* We hardcode the divider to 1 for now */ -static CLK_FIXED_FACTOR(pll_audio_clk, "pll-audio", - "pll-audio-base", 1, 1, CLK_SET_RATE_PARENT); -static CLK_FIXED_FACTOR(pll_audio_2x_clk, "pll-audio-2x", - "pll-audio-base", 2, 1, CLK_SET_RATE_PARENT); -static CLK_FIXED_FACTOR(pll_audio_4x_clk, "pll-audio-4x", - "pll-audio-base", 1, 1, CLK_SET_RATE_PARENT); -static CLK_FIXED_FACTOR(pll_audio_8x_clk, "pll-audio-8x", - "pll-audio-base", 1, 2, CLK_SET_RATE_PARENT); -static CLK_FIXED_FACTOR(pll_video0_2x_clk, "pll-video0-2x", - "pll-video0", 1, 2, CLK_SET_RATE_PARENT); -static CLK_FIXED_FACTOR(pll_video1_2x_clk, "pll-video1-2x", - "pll-video1", 1, 2, CLK_SET_RATE_PARENT); +static CLK_FIXED_FACTOR_HWS(pll_audio_clk, "pll-audio", + clk_parent_pll_audio, + 1, 1, CLK_SET_RATE_PARENT); +static CLK_FIXED_FACTOR_HWS(pll_audio_2x_clk, "pll-audio-2x", + clk_parent_pll_audio, + 2, 1, CLK_SET_RATE_PARENT); +static CLK_FIXED_FACTOR_HWS(pll_audio_4x_clk, "pll-audio-4x", + clk_parent_pll_audio, + 1, 1, CLK_SET_RATE_PARENT); +static CLK_FIXED_FACTOR_HWS(pll_audio_8x_clk, "pll-audio-8x", + clk_parent_pll_audio, + 1, 2, CLK_SET_RATE_PARENT); +static CLK_FIXED_FACTOR_HW(pll_video0_2x_clk, "pll-video0-2x", + &pll_video0_clk.common.hw, + 1, 2, CLK_SET_RATE_PARENT); +static CLK_FIXED_FACTOR_HW(pll_video1_2x_clk, "pll-video1-2x", + &pll_video1_clk.common.hw, + 1, 2, CLK_SET_RATE_PARENT); static struct clk_hw_onecell_data sun5i_a10s_hw_clks = { .hws = { -- 2.20.1