Saravana Kannan | cedb32e | 2014-01-22 00:15:33 -0800 | [diff] [blame^] | 1 | /* |
| 2 | * Copyright (c) 2014, 2016, The Linux Foundation. All rights reserved. |
| 3 | * |
| 4 | * This program is free software; you can redistribute it and/or modify |
| 5 | * it under the terms of the GNU General Public License version 2 and |
| 6 | * only version 2 as published by the Free Software Foundation. |
| 7 | * |
| 8 | * This program is distributed in the hope that it will be useful, |
| 9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 11 | * GNU General Public License for more details. |
| 12 | */ |
| 13 | |
| 14 | #ifndef _GOVERNOR_CACHE_HWMON_H |
| 15 | #define _GOVERNOR_CACHE_HWMON_H |
| 16 | |
| 17 | #include <linux/kernel.h> |
| 18 | #include <linux/devfreq.h> |
| 19 | |
| 20 | struct mrps_stats { |
| 21 | unsigned long high; |
| 22 | unsigned long med; |
| 23 | unsigned long low; |
| 24 | unsigned int busy_percent; |
| 25 | }; |
| 26 | |
| 27 | struct cache_hwmon { |
| 28 | int (*start_hwmon)(struct devfreq *df, struct mrps_stats *mrps); |
| 29 | void (*stop_hwmon)(struct devfreq *df); |
| 30 | bool (*is_valid_irq)(struct devfreq *df); |
| 31 | unsigned long (*meas_mrps_and_set_irq)(struct devfreq *df, |
| 32 | unsigned int tol, unsigned int us, |
| 33 | struct mrps_stats *mrps); |
| 34 | int irq; |
| 35 | }; |
| 36 | |
| 37 | #ifdef CONFIG_DEVFREQ_GOV_QCOM_CACHE_HWMON |
| 38 | int register_cache_hwmon(struct cache_hwmon *hwmon); |
| 39 | #else |
| 40 | static inline int register_cache_hwmon(struct cache_hwmon *hwmon) |
| 41 | { |
| 42 | return 0; |
| 43 | } |
| 44 | #endif |
| 45 | |
| 46 | #endif /* _GOVERNOR_CACHE_HWMON_H */ |