History

thermal: of-thermal: add API for getting sensor ID from DT

This patch adds new API thermal_zone_of_get_sensor_id() to provide the feature of getting sensor ID from DT thermal zone's node. It's useful for thermal driver to register the specific thermal zone devices from DT in a common way.

Anson Huang committed 6 years ago

Commit 34471ab1 parent 7dc6ffb2 files · +56 −16Browse files

Showing the changes to include/linux (1 of 2 files). Show all

Unified · Split

include/linux/thermal.h+10−0
@@ -364,6 +364,9 @@ struct thermal_trip { · 363 unmodified lines
364364
365365 /* Function declarations */
366366 #ifdef CONFIG_THERMAL_OF
367+int thermal_zone_of_get_sensor_id(struct device_node *tz_np,
368+ struct device_node *sensor_np,
369+ u32 *id);
367370 struct thermal_zone_device *
368371 thermal_zone_of_sensor_register(struct device *dev, int id, void *data,
369372 const struct thermal_zone_of_device_ops *ops);
@@ -375,6 +378,13 @@ struct thermal_zone_device *devm_thermal_zone_of_sensor_register( · 5 unmodified lines
375378 void devm_thermal_zone_of_sensor_unregister(struct device *dev,
376379 struct thermal_zone_device *tz);
377380 #else
381+
382+static int thermal_zone_of_get_sensor_id(struct device_node *tz_np,
383+ struct device_node *sensor_np,
384+ u32 *id)
385+{
386+ return -ENOENT;
387+}
378388 static inline struct thermal_zone_device *
379389 thermal_zone_of_sensor_register(struct device *dev, int id, void *data,
380390 const struct thermal_zone_of_device_ops *ops)

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t