.. | .. |
---|
| 1 | +/* SPDX-License-Identifier: GPL-2.0-only */ |
---|
1 | 2 | /* |
---|
2 | 3 | * devfreq-event: a framework to provide raw data and events of devfreq devices |
---|
3 | 4 | * |
---|
4 | 5 | * Copyright (C) 2014 Samsung Electronics |
---|
5 | 6 | * 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. |
---|
10 | 7 | */ |
---|
11 | 8 | |
---|
12 | 9 | #ifndef __LINUX_DEVFREQ_EVENT_H__ |
---|
.. | .. |
---|
81 | 78 | * struct devfreq_event_desc - the descriptor of devfreq-event device |
---|
82 | 79 | * |
---|
83 | 80 | * @name : the name of devfreq-event device. |
---|
| 81 | + * @event_type : the type of the event determined and used by driver |
---|
84 | 82 | * @driver_data : the private data for devfreq-event driver. |
---|
85 | 83 | * @ops : the operation to control devfreq-event device. |
---|
86 | 84 | * |
---|
87 | 85 | * Each devfreq-event device is described with a this structure. |
---|
88 | 86 | * 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/. |
---|
89 | 91 | */ |
---|
90 | 92 | struct devfreq_event_desc { |
---|
91 | 93 | const char *name; |
---|
| 94 | + u32 event_type; |
---|
92 | 95 | void *driver_data; |
---|
93 | 96 | |
---|
94 | 97 | const struct devfreq_event_ops *ops; |
---|
.. | .. |
---|
103 | 106 | struct devfreq_event_data *edata); |
---|
104 | 107 | extern int devfreq_event_reset_event(struct devfreq_event_dev *edev); |
---|
105 | 108 | 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); |
---|
108 | 114 | extern struct devfreq_event_dev *devfreq_event_add_edev(struct device *dev, |
---|
109 | 115 | struct devfreq_event_desc *desc); |
---|
110 | 116 | extern int devfreq_event_remove_edev(struct devfreq_event_dev *edev); |
---|
.. | .. |
---|
149 | 155 | } |
---|
150 | 156 | |
---|
151 | 157 | 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) |
---|
153 | 161 | { |
---|
154 | 162 | return ERR_PTR(-EINVAL); |
---|
155 | 163 | } |
---|
156 | 164 | |
---|
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) |
---|
158 | 167 | { |
---|
159 | 168 | return -EINVAL; |
---|
160 | 169 | } |
---|