aboutsummaryrefslogtreecommitdiff
path: root/drivers/devfreq/devfreq-event.c
diff options
context:
space:
mode:
authorRafael J. Wysocki <[email protected]>2020-09-30 17:52:11 +0200
committerRafael J. Wysocki <[email protected]>2020-09-30 17:52:11 +0200
commit4285027c733a2a5bada0d053ace3e4f040f1b58a (patch)
tree2a3383dc7450a11a23ad64bc51b392cf48f3f1af /drivers/devfreq/devfreq-event.c
parenta1b8638ba1320e6684aa98233c15255eb803fac7 (diff)
parentd353d1202b89ab039acd079cd97f7646058ebe11 (diff)
Merge tag 'devfreq-next-for-5.10' of git://git.kernel.org/pub/scm/linux/kernel/git/chanwoo/linux into pm-devfreq
Pull devfreq updates for 5.10 from Chanwoo Choi: "1. Update devfreq core - Until now, devfreq and devfreq-event framework defined the fixed 'devfreq' and 'devfreq-event' property to get the devfreq/devfreq-event phandle. But, these property names are not expressing the h/w. So, deprecate the fixed property names 'devfreq' and 'devfreq-event'. But, in order to keep the backward compatibility of devicetree, don't change the property name on devfreq device drivers and devicetree. 2. Update devfreq driver - Replace reset_control_(assert|dessert) fucntions with reset_control_reset() for reseting the h/w during probe on tegra30-devfreq.c." * tag 'devfreq-next-for-5.10' of git://git.kernel.org/pub/scm/linux/kernel/git/chanwoo/linux: PM / devfreq: tegra30: Improve initial hardware resetting PM / devfreq: event: Change prototype of devfreq_event_get_edev_by_phandle function PM / devfreq: Change prototype of devfreq_get_devfreq_by_phandle function PM / devfreq: Add devfreq_get_devfreq_by_node function
Diffstat (limited to 'drivers/devfreq/devfreq-event.c')
-rw-r--r--drivers/devfreq/devfreq-event.c14
1 files changed, 8 insertions, 6 deletions
diff --git a/drivers/devfreq/devfreq-event.c b/drivers/devfreq/devfreq-event.c
index 56efbeb7851e..6765c03334bc 100644
--- a/drivers/devfreq/devfreq-event.c
+++ b/drivers/devfreq/devfreq-event.c
@@ -213,20 +213,21 @@ EXPORT_SYMBOL_GPL(devfreq_event_reset_event);
* devfreq_event_get_edev_by_phandle() - Get the devfreq-event dev from
* devicetree.
* @dev : the pointer to the given device
+ * @phandle_name: name of property holding a phandle value
* @index : the index into list of devfreq-event device
*
* Note that this function return the pointer of devfreq-event device.
*/
struct devfreq_event_dev *devfreq_event_get_edev_by_phandle(struct device *dev,
- int index)
+ const char *phandle_name, int index)
{
struct device_node *node;
struct devfreq_event_dev *edev;
- if (!dev->of_node)
+ if (!dev->of_node || !phandle_name)
return ERR_PTR(-EINVAL);
- node = of_parse_phandle(dev->of_node, "devfreq-events", index);
+ node = of_parse_phandle(dev->of_node, phandle_name, index);
if (!node)
return ERR_PTR(-ENODEV);
@@ -258,19 +259,20 @@ EXPORT_SYMBOL_GPL(devfreq_event_get_edev_by_phandle);
/**
* devfreq_event_get_edev_count() - Get the count of devfreq-event dev
* @dev : the pointer to the given device
+ * @phandle_name: name of property holding a phandle value
*
* Note that this function return the count of devfreq-event devices.
*/
-int devfreq_event_get_edev_count(struct device *dev)
+int devfreq_event_get_edev_count(struct device *dev, const char *phandle_name)
{
int count;
- if (!dev->of_node) {
+ if (!dev->of_node || !phandle_name) {
dev_err(dev, "device does not have a device node entry\n");
return -EINVAL;
}
- count = of_property_count_elems_of_size(dev->of_node, "devfreq-events",
+ count = of_property_count_elems_of_size(dev->of_node, phandle_name,
sizeof(u32));
if (count < 0) {
dev_err(dev,