| .. | .. |
|---|
| 1 | +/* SPDX-License-Identifier: GPL-2.0-only */ |
|---|
| 1 | 2 | /* |
|---|
| 2 | 3 | * governor.h - internal header for devfreq governors. |
|---|
| 3 | 4 | * |
|---|
| 4 | 5 | * Copyright (C) 2011 Samsung Electronics |
|---|
| 5 | 6 | * MyungJoo Ham <myungjoo.ham@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 | * This header is for devfreq governors in drivers/devfreq/ |
|---|
| 12 | 9 | */ |
|---|
| .. | .. |
|---|
| 21 | 18 | /* Devfreq events */ |
|---|
| 22 | 19 | #define DEVFREQ_GOV_START 0x1 |
|---|
| 23 | 20 | #define DEVFREQ_GOV_STOP 0x2 |
|---|
| 24 | | -#define DEVFREQ_GOV_INTERVAL 0x3 |
|---|
| 21 | +#define DEVFREQ_GOV_UPDATE_INTERVAL 0x3 |
|---|
| 25 | 22 | #define DEVFREQ_GOV_SUSPEND 0x4 |
|---|
| 26 | 23 | #define DEVFREQ_GOV_RESUME 0x5 |
|---|
| 27 | 24 | |
|---|
| .. | .. |
|---|
| 33 | 30 | * @node: list node - contains registered devfreq governors |
|---|
| 34 | 31 | * @name: Governor's name |
|---|
| 35 | 32 | * @immutable: Immutable flag for governor. If the value is 1, |
|---|
| 36 | | - * this govenror is never changeable to other governor. |
|---|
| 33 | + * this governor is never changeable to other governor. |
|---|
| 34 | + * @interrupt_driven: Devfreq core won't schedule polling work for this |
|---|
| 35 | + * governor if value is set to 1. |
|---|
| 37 | 36 | * @get_target_freq: Returns desired operating frequency for the device. |
|---|
| 38 | 37 | * Basically, get_target_freq will run |
|---|
| 39 | 38 | * devfreq_dev_profile.get_dev_status() to get the |
|---|
| .. | .. |
|---|
| 52 | 51 | |
|---|
| 53 | 52 | const char name[DEVFREQ_NAME_LEN]; |
|---|
| 54 | 53 | const unsigned int immutable; |
|---|
| 54 | + const unsigned int interrupt_driven; |
|---|
| 55 | 55 | int (*get_target_freq)(struct devfreq *this, unsigned long *freq); |
|---|
| 56 | 56 | int (*event_handler)(struct devfreq *devfreq, |
|---|
| 57 | 57 | unsigned int event, void *data); |
|---|
| 58 | 58 | }; |
|---|
| 59 | 59 | |
|---|
| 60 | | -/* Caution: devfreq->lock must be locked before calling update_devfreq */ |
|---|
| 61 | | -extern int update_devfreq(struct devfreq *devfreq); |
|---|
| 60 | +void devfreq_monitor_start(struct devfreq *devfreq); |
|---|
| 61 | +void devfreq_monitor_stop(struct devfreq *devfreq); |
|---|
| 62 | +void devfreq_monitor_suspend(struct devfreq *devfreq); |
|---|
| 63 | +void devfreq_monitor_resume(struct devfreq *devfreq); |
|---|
| 64 | +void devfreq_update_interval(struct devfreq *devfreq, unsigned int *delay); |
|---|
| 62 | 65 | |
|---|
| 63 | | -extern void devfreq_monitor_start(struct devfreq *devfreq); |
|---|
| 64 | | -extern void devfreq_monitor_stop(struct devfreq *devfreq); |
|---|
| 65 | | -extern void devfreq_monitor_suspend(struct devfreq *devfreq); |
|---|
| 66 | | -extern void devfreq_monitor_resume(struct devfreq *devfreq); |
|---|
| 67 | | -extern void devfreq_interval_update(struct devfreq *devfreq, |
|---|
| 68 | | - unsigned int *delay); |
|---|
| 66 | +int devfreq_add_governor(struct devfreq_governor *governor); |
|---|
| 67 | +int devfreq_remove_governor(struct devfreq_governor *governor); |
|---|
| 69 | 68 | |
|---|
| 70 | | -extern int devfreq_add_governor(struct devfreq_governor *governor); |
|---|
| 71 | | -extern int devfreq_remove_governor(struct devfreq_governor *governor); |
|---|
| 72 | | - |
|---|
| 73 | | -extern int devfreq_update_status(struct devfreq *devfreq, unsigned long freq); |
|---|
| 69 | +int devfreq_update_status(struct devfreq *devfreq, unsigned long freq); |
|---|
| 74 | 70 | |
|---|
| 75 | 71 | static inline int devfreq_update_stats(struct devfreq *df) |
|---|
| 76 | 72 | { |
|---|