hc
2023-12-09 b22da3d8526a935aa31e086e63f60ff3246cb61c
kernel/include/linux/devfreq-event.h
....@@ -1,12 +1,9 @@
1
+/* SPDX-License-Identifier: GPL-2.0-only */
12 /*
23 * devfreq-event: a framework to provide raw data and events of devfreq devices
34 *
45 * Copyright (C) 2014 Samsung Electronics
56 * Author: Chanwoo Choi <cw00.choi@samsung.com>
6
- *
7
- * This program is free software; you can redistribute it and/or modify
8
- * it under the terms of the GNU General Public License version 2 as
9
- * published by the Free Software Foundation.
107 */
118
129 #ifndef __LINUX_DEVFREQ_EVENT_H__
....@@ -81,14 +78,20 @@
8178 * struct devfreq_event_desc - the descriptor of devfreq-event device
8279 *
8380 * @name : the name of devfreq-event device.
81
+ * @event_type : the type of the event determined and used by driver
8482 * @driver_data : the private data for devfreq-event driver.
8583 * @ops : the operation to control devfreq-event device.
8684 *
8785 * Each devfreq-event device is described with a this structure.
8886 * This structure contains the various data for devfreq-event device.
87
+ * The event_type describes what is going to be counted in the register.
88
+ * It might choose to count e.g. read requests, write data in bytes, etc.
89
+ * The full supported list of types is present in specyfic header in:
90
+ * include/dt-bindings/pmu/.
8991 */
9092 struct devfreq_event_desc {
9193 const char *name;
94
+ u32 event_type;
9295 void *driver_data;
9396
9497 const struct devfreq_event_ops *ops;
....@@ -103,8 +106,11 @@
103106 struct devfreq_event_data *edata);
104107 extern int devfreq_event_reset_event(struct devfreq_event_dev *edev);
105108 extern struct devfreq_event_dev *devfreq_event_get_edev_by_phandle(
106
- struct device *dev, int index);
107
-extern int devfreq_event_get_edev_count(struct device *dev);
109
+ struct device *dev,
110
+ const char *phandle_name,
111
+ int index);
112
+extern int devfreq_event_get_edev_count(struct device *dev,
113
+ const char *phandle_name);
108114 extern struct devfreq_event_dev *devfreq_event_add_edev(struct device *dev,
109115 struct devfreq_event_desc *desc);
110116 extern int devfreq_event_remove_edev(struct devfreq_event_dev *edev);
....@@ -149,12 +155,15 @@
149155 }
150156
151157 static inline struct devfreq_event_dev *devfreq_event_get_edev_by_phandle(
152
- struct device *dev, int index)
158
+ struct device *dev,
159
+ const char *phandle_name,
160
+ int index)
153161 {
154162 return ERR_PTR(-EINVAL);
155163 }
156164
157
-static inline int devfreq_event_get_edev_count(struct device *dev)
165
+static inline int devfreq_event_get_edev_count(struct device *dev,
166
+ const char *phandle_name)
158167 {
159168 return -EINVAL;
160169 }