Received: by 2002:a25:1506:0:0:0:0:0 with SMTP id 6csp2211642ybv; Mon, 24 Feb 2020 01:10:01 -0800 (PST) X-Google-Smtp-Source: APXvYqxL+5uIn0kWwQzFurBIJ8KkzYAKxqiCHnqwTIN8BRBC0eDaoqFl8iYUQiNbWn0LCyQ2e2yw X-Received: by 2002:aca:ddc2:: with SMTP id u185mr11835085oig.24.1582535400942; Mon, 24 Feb 2020 01:10:00 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1582535400; cv=none; d=google.com; s=arc-20160816; b=OOTEBI31PBg11ZdodFSgg2oiO40w+CfdQIIHxKQx7sR/L8/SjHokwY1/Q3ZpI2K1WK V76/iFVKgyFv5x5dr/n9jESs2Fk/suV1Ubr27XQfB+NOlh6+x0fzzrAgJJIURWKsStN8 Gd/5mNlT0BbXMZMMJCI6tdqygPgXmEtZKjkqe3cMJnqMlMp+N9f9xspe1+LHZfRHGbbt 3x8K0qZFEm+fSB7NwlkkgOf4Pp6b3xR9oL7mMhaIWN6pgnYeq7oUX4SAJHfR3kjXEuZ9 cRu7ofEvKTQCEtKHodmv1F+PeZ8Z0vL9SvqY9qx7NibQ1PWLmh3nB9z/vjCpC5FpIwgF ZiOA== 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:dkim-signature; bh=APkkeiGxG2kym+pvaE8cxqfPNgYD5YHNGasHd1ihKbk=; b=Or3cs3AUPxdCHIVXyUWeRo6WQi0GYgj00ZSr51bEZ+4l3FbKkM3nMB0C6nDtv/VPXJ HbOSzm9k3ir+PitSnkRFnRiKaEJAsb0BsXw7UG3Fn+R/za05zCIxl6rIdQ7092dplLlH klURCDjYuXgM8O79YnPmP9W2XKCpPB3t6Kz8uCWXh4SQb2U2xpoO07AJZ2Bc4hifnrzO 06iGxHdxAlFMfqlbp4lY6I2aWsia7+0+xD8gtB2RDJspf4fNJ7z4VrsYbrdO/y7CRSo4 QTzsULdgQhpjQ6j5uemml6OyTKgKZsbbMipPqwbuHoIq4Hrp2kVbTPvnlzFOrEjXtCKp Y29Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@cerno.tech header.s=fm2 header.b=JHlRQfnV; dkim=pass header.i=@messagingengine.com header.s=fm2 header.b=bI4CvtHs; 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=cerno.tech Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id m19si5919141otq.40.2020.02.24.01.09.49; Mon, 24 Feb 2020 01:10:00 -0800 (PST) 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=@cerno.tech header.s=fm2 header.b=JHlRQfnV; dkim=pass header.i=@messagingengine.com header.s=fm2 header.b=bI4CvtHs; 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=cerno.tech Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727689AbgBXJJY (ORCPT + 99 others); Mon, 24 Feb 2020 04:09:24 -0500 Received: from wnew3-smtp.messagingengine.com ([64.147.123.17]:52787 "EHLO wnew3-smtp.messagingengine.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727500AbgBXJJP (ORCPT ); Mon, 24 Feb 2020 04:09:15 -0500 Received: from compute3.internal (compute3.nyi.internal [10.202.2.43]) by mailnew.west.internal (Postfix) with ESMTP id 304395F7; Mon, 24 Feb 2020 04:09:13 -0500 (EST) Received: from mailfrontend1 ([10.202.2.162]) by compute3.internal (MEProxy); Mon, 24 Feb 2020 04:09:14 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cerno.tech; h= from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; s=fm2; bh=APkkeiGxG2kym +pvaE8cxqfPNgYD5YHNGasHd1ihKbk=; b=JHlRQfnVQEjEcpgxMCpe52tb4fmUF 4itJH3OzJfVAGFny4BJzvbpWS5U7FJRqN2ZyX503mun0k2WedCfk5R7CakTq4cJa WFLfEvDZhVklMw+yFtQ4v6MEcrBpHUx7Uz3/NfGHFtALjEqkL7C2kFb0o+/U2JMP hcrjPyHrTHjfMnymPwUi3keeQ6hJyoexNbytQ/pQqg0/9mvl3KYfj/wtbogGn6Xk CMKy1Qro1MEubrhD4x1mz+R4/5LSpbV5LZwe2PkezpN5W+nvZqX61biL7BKMBp48 VWZJvzvwBa0zmwoGd7o0NeLu1Zo3wswZm6d3Zms7iD5weML9wFnJlI2hA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:date:from :in-reply-to:message-id:mime-version:references:subject:to :x-me-proxy:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s= fm2; bh=APkkeiGxG2kym+pvaE8cxqfPNgYD5YHNGasHd1ihKbk=; b=bI4CvtHs U0eB03hB5u3Wr+eKy+fh4YmOTCnMRrWyh+VGE3QPjjeX1lKrzQCLk64chwpg+yHN BAHgm1ME1VFtpqbv+Q9k91k9A7hmGO+LtPFIgtrVJsxTl2mJ1WDpsi9PESzk1uAv uVjHC/MiCPiCNJdk2vrOAlEHEJYLtPctmSYA++Brnqte8BlRNTrqhVkN0K3Sf0m6 mMqr9e+OvyrM1JhaAmqWCDmshabUPZhRmqFaURIMeQohPkzelHgpsPajxnYAauhr aWubj/dOF9AMm9IFPZ6OilobzkiQixdk9fV7/Ao3iS4UL6+H+x9eIs6euudM6DCM Vx7PfH2TAvVftA== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedugedrledtucetufdoteggodetrfdotffvucfrrh hofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgenuceurghi lhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmnecujfgurh ephffvufffkffojghfggfgsedtkeertdertddtnecuhfhrohhmpeforgigihhmvgcutfhi phgrrhguuceomhgrgihimhgvsegtvghrnhhordhtvggthheqnecukfhppeeltddrkeelrd eikedrjeeinecuvehluhhsthgvrhfuihiivgepudefnecurfgrrhgrmhepmhgrihhlfhhr ohhmpehmrgigihhmvgestggvrhhnohdrthgvtghh X-ME-Proxy: Received: from localhost (lfbn-tou-1-1502-76.w90-89.abo.wanadoo.fr [90.89.68.76]) by mail.messagingengine.com (Postfix) with ESMTPA id 71DA6328005E; Mon, 24 Feb 2020 04:09:12 -0500 (EST) From: Maxime Ripard To: Nicolas Saenz Julienne , Eric Anholt Cc: dri-devel@lists.freedesktop.org, linux-rpi-kernel@lists.infradead.org, bcm-kernel-feedback-list@broadcom.com, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Dave Stevenson , Tim Gover , Phil Elwell , Maxime Ripard , Michael Turquette , Stephen Boyd , linux-clk@vger.kernel.org Subject: [PATCH 16/89] clk: bcm: rpi: Add clock id to data Date: Mon, 24 Feb 2020 10:06:18 +0100 Message-Id: <3028e04887c7b8a6ffc150c016aa63281461b434.1582533919.git-series.maxime@cerno.tech> X-Mailer: git-send-email 2.24.1 In-Reply-To: References: 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 The driver has really only supported one clock so far and has hardcoded the ID used in communications with the firmware in all the functions implementing the clock framework hooks. Let's store that in the clock data structure so that we can support more clocks later on. Cc: Michael Turquette Cc: Stephen Boyd Cc: linux-clk@vger.kernel.org Signed-off-by: Maxime Ripard --- drivers/clk/bcm/clk-raspberrypi.c | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/drivers/clk/bcm/clk-raspberrypi.c b/drivers/clk/bcm/clk-raspberrypi.c index 964fc8f792cc..e796dabbc641 100644 --- a/drivers/clk/bcm/clk-raspberrypi.c +++ b/drivers/clk/bcm/clk-raspberrypi.c @@ -39,6 +39,7 @@ struct raspberrypi_clk { struct raspberrypi_clk_data { struct clk_hw hw; + unsigned id; unsigned long min_rate; unsigned long max_rate; @@ -95,7 +96,7 @@ static int raspberrypi_fw_pll_is_on(struct clk_hw *hw) ret = raspberrypi_clock_property(rpi->firmware, RPI_FIRMWARE_GET_CLOCK_STATE, - RPI_FIRMWARE_ARM_CLK_ID, &val); + data->id, &val); if (ret) return 0; @@ -114,8 +115,7 @@ static unsigned long raspberrypi_fw_pll_get_rate(struct clk_hw *hw, ret = raspberrypi_clock_property(rpi->firmware, RPI_FIRMWARE_GET_CLOCK_RATE, - RPI_FIRMWARE_ARM_CLK_ID, - &val); + data->id, &val); if (ret) return ret; @@ -133,8 +133,7 @@ static int raspberrypi_fw_pll_set_rate(struct clk_hw *hw, unsigned long rate, ret = raspberrypi_clock_property(rpi->firmware, RPI_FIRMWARE_SET_CLOCK_RATE, - RPI_FIRMWARE_ARM_CLK_ID, - &new_rate); + data->id, &new_rate); if (ret) dev_err_ratelimited(rpi->dev, "Failed to change %s frequency: %d", clk_hw_get_name(hw), ret); @@ -189,6 +188,7 @@ static int raspberrypi_register_pllb(struct raspberrypi_clk *rpi) if (!data) return -ENOMEM; data->rpi = rpi; + data->id = RPI_FIRMWARE_ARM_CLK_ID; /* All of the PLLs derive from the external oscillator. */ init.parent_names = (const char *[]){ "osc" }; @@ -200,8 +200,7 @@ static int raspberrypi_register_pllb(struct raspberrypi_clk *rpi) /* Get min & max rates set by the firmware */ ret = raspberrypi_clock_property(rpi->firmware, RPI_FIRMWARE_GET_MIN_CLOCK_RATE, - RPI_FIRMWARE_ARM_CLK_ID, - &min_rate); + data->id, &min_rate); if (ret) { dev_err(rpi->dev, "Failed to get %s min freq: %d\n", init.name, ret); @@ -210,8 +209,7 @@ static int raspberrypi_register_pllb(struct raspberrypi_clk *rpi) ret = raspberrypi_clock_property(rpi->firmware, RPI_FIRMWARE_GET_MAX_CLOCK_RATE, - RPI_FIRMWARE_ARM_CLK_ID, - &max_rate); + data->id, &max_rate); if (ret) { dev_err(rpi->dev, "Failed to get %s max freq: %d\n", init.name, ret); -- git-series 0.9.1