aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/omap4_duty_cycle_governor.h
blob: 035cc1f71a3689c8d6ee8dd9b003b9f62c936405 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
/*
 * Duty sycle governor
 *
 * Copyright (C) 2012 Texas Instruments Incorporated - http://www.ti.com/
 * Author: Eugene Mandrenko <ievgen.mandrenko@ti.com>
 *
 * This software is licensed under the terms of the GNU General Public
 * License version 2, as published by the Free Software Foundation, and
 * may be copied, distributed, and modified under those terms.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
*/

#ifndef __OMAP4_DUTY_CYCLE_GOVERNOR_H__
#define __OMAP4_DUTY_CYCLE_GOVERNOR_H__

struct pcb_sens {
	int (*update_temp) (void);
};

struct duty_cycle_params {
	u32 nitro_rate;		/* the maximum OPP frequency */
	u32 cooling_rate;	/* the OPP used to cool off */
	u32 nitro_interval;	/* time interval to control the duty cycle */
	u32 nitro_percentage;	/* % out of nitro_interval to use max OPP */
};

struct pcb_section {
	u32 pcb_temp_level;
	u32 max_opp;
	struct duty_cycle_params tduty_params;
	bool duty_cycle_enabled;
};

struct duty_cycle {
	int (*update_params)(struct duty_cycle_params *);
	int (*enable)(bool val, bool update);
};

void omap4_duty_pcb_section_reg(struct pcb_section *pcb_sect, int sect_size);
int omap4_duty_pcb_register(struct pcb_sens *tpcb);

#ifdef CONFIG_OMAP4_DUTY_CYCLE_GOVERNOR
int omap4_duty_cycle_register(struct duty_cycle *tduty);
#else
static inline int omap4_duty_cycle_register(struct duty_cycle *tduty)
{
	return 0;
}
#endif


#endif /*__OMAP4_DUTY_CYCLE_GOVERNOR_H__*/