[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <20181125162118.GA5358@arx-s1>
Date: Mon, 26 Nov 2018 00:21:18 +0800
From: Hao Zhang <hao5781286@...il.com>
To: robh+dt@...nel.org, mark.rutland@....com,
maxime.ripard@...tlin.com, wens@...e.org, mturquette@...libre.com,
sboyd@...nel.org, thierry.reding@...il.com
Cc: linux-gpio@...r.kernel.org, linux-kernel@...r.kernel.org,
devicetree@...r.kernel.org, linux-arm-kernel@...ts.infradead.org,
linux-pwm@...r.kernel.org, linux-sunxi@...glegroups.com,
hao5781286@...il.com
Subject: [PATCH v3 4/6] DEV: CLK: add function to check the using clock name
of driver.
In some situation we want to check clock whether is we want
and after the driver been probed use to change different clock source.
Signed-off-by: Hao Zhang <hao5781286@...il.com>
---
drivers/clk/clk.c | 6 ++++++
include/linux/clk-provider.h | 1 +
2 files changed, 7 insertions(+)
diff --git a/drivers/clk/clk.c b/drivers/clk/clk.c
index d31055a..3d2c2cd 100644
--- a/drivers/clk/clk.c
+++ b/drivers/clk/clk.c
@@ -3466,6 +3466,12 @@ static int devm_clk_hw_match(struct device *dev, void *res, void *data)
return hw == data;
}
+bool devm_clk_name_match(struct clk *clk, const char *string)
+{
+ return match_string(&clk->con_id, 1, string) == 0;
+}
+EXPORT_SYMBOL_GPL(devm_clk_name_match);
+
/**
* devm_clk_unregister - resource managed clk_unregister()
* @clk: clock to unregister
diff --git a/include/linux/clk-provider.h b/include/linux/clk-provider.h
index 08b1aa7..5cd2eed 100644
--- a/include/linux/clk-provider.h
+++ b/include/linux/clk-provider.h
@@ -764,6 +764,7 @@ struct clk *devm_clk_register(struct device *dev, struct clk_hw *hw);
int __must_check clk_hw_register(struct device *dev, struct clk_hw *hw);
int __must_check devm_clk_hw_register(struct device *dev, struct clk_hw *hw);
+bool devm_clk_name_match(struct clk *clk, const char *string);
void clk_unregister(struct clk *clk);
void devm_clk_unregister(struct device *dev, struct clk *clk);
--
2.7.4
Powered by blists - more mailing lists