summaryrefslogtreecommitdiff
path: root/include/linux/busfreq-imx.h
blob: 85b8b3844dba8a5ec9c2b2bf498c071cc331599c (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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
/*
 * Copyright 2012-2015 Freescale Semiconductor, Inc. All Rights Reserved.
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License version 2 as
 * published by the Free Software Foundation.
 */

#ifndef __ASM_ARCH_MXC_BUSFREQ_H__
#define __ASM_ARCH_MXC_BUSFREQ_H__

#include <linux/notifier.h>

/*
 * This enumerates busfreq low power mode entry and exit.
 */
enum busfreq_event {
	LOW_BUSFREQ_ENTER,
	LOW_BUSFREQ_EXIT,
};

/*
  * This enumerates the system bus and ddr frequencies in various modes.
  * BUS_FREQ_HIGH - DDR @ 528MHz, AHB @ 132MHz.
  * BUS_FREQ_MED - DDR @ 400MHz, AHB @ 132MHz
  * BUS_FREQ_AUDIO - DDR @ 50MHz/100MHz, AHB @ 24MHz.
  * BUS_FREQ_LOW  - DDR @ 24MHz, AHB @ 24MHz.
  * BUS_FREQ_ULTRA_LOW - DDR @ 1MHz, AHB - 3MHz.
  *
  * Drivers need to request/release the bus/ddr frequencies based on their performance
  * requirements. Drivers cannot request/release BUS_FREQ_ULTRA_LOW mode as
  * this mode is automatically entered from either BUS_FREQ_AUDIO or BUS_FREQ_LOW
  * modes.
  */
enum bus_freq_mode {
	BUS_FREQ_HIGH,
	BUS_FREQ_MED,
	BUS_FREQ_AUDIO,
	BUS_FREQ_LOW,
	BUS_FREQ_ULTRA_LOW,
};

#ifdef CONFIG_CPU_FREQ
void request_bus_freq(enum bus_freq_mode mode);
void release_bus_freq(enum bus_freq_mode mode);
int register_busfreq_notifier(struct notifier_block *nb);
int unregister_busfreq_notifier(struct notifier_block *nb);
int get_bus_freq_mode(void);
#else
static inline void request_bus_freq(enum bus_freq_mode mode)
{
	return;
}
static inline void release_bus_freq(enum bus_freq_mode mode)
{
	return;
}
static inline int register_busfreq_notifier(struct notifier_block *nb)
{
	return 0;
}
static inline int unregister_busfreq_notifier(struct notifier_block *nb)
{
	return 0;
}
static inline int get_bus_freq_mode(void)
{
	return BUS_FREQ_HIGH;
}
#endif
#endif