From: Lukasz Majewski Date: Thu, 25 Apr 2019 12:29:46 +0200 Subject: [U-Boot] [PATCH v3 04/11] clk: Extend struct clk to provide information regarding clock rate In-Reply-To: <20190425102953.5348-1-lukma@denx.de> References: <20190425102953.5348-1-lukma@denx.de> Message-ID: <20190425102953.5348-5-lukma@denx.de> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de This commit extends the struct clk to provide information regarding the clock rate. As a result the clock tree traversal is performed at most once, and further reads are using the cached value. Signed-off-by: Lukasz Majewski --- Changes in v3: None include/clk.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/include/clk.h b/include/clk.h index f6fbcc6634..f29ba02da1 100644 --- a/include/clk.h +++ b/include/clk.h @@ -39,6 +39,7 @@ struct udevice; * other clock APIs to identify which clock signal to operate upon. * * @dev: The device which implements the clock signal. + * @rate: The clock rate (in HZ). * @id: The clock signal ID within the provider. * @data: An optional data field for scenarios where a single integer ID is not * sufficient. If used, it can be populated through an .of_xlate op and @@ -54,6 +55,7 @@ struct udevice; */ struct clk { struct udevice *dev; + unsigned long rate; /* in HZ */ /* * Written by of_xlate. In the future, we might add more fields here. */ -- 2.11.0