blob: 060e11256fbcf8866afc23d900134d4040c7a59a [file] [log] [blame]
Mattias Nilssonfea799e2011-08-12 10:28:02 +02001/*
2 * Copyright (C) ST Ericsson SA 2011
3 *
4 * License Terms: GNU General Public License v2
5 *
6 * STE Ux500 PRCMU API
7 */
8#ifndef __MACH_PRCMU_H
9#define __MACH_PRCMU_H
10
11#include <linux/interrupt.h>
12#include <linux/notifier.h>
Mattias Nilsson05089012012-01-13 16:20:20 +010013#include <linux/err.h>
Mattias Nilssonfea799e2011-08-12 10:28:02 +020014
Lee Jones67f13da2013-06-06 11:50:47 +010015#include <dt-bindings/mfd/dbx500-prcmu.h> /* For clock identifiers */
16
Linus Walleij05ec2602013-02-07 10:17:31 +010017/* Offset for the firmware version within the TCPM */
18#define DB8500_PRCMU_FW_VERSION_OFFSET 0xA4
19#define DBX540_PRCMU_FW_VERSION_OFFSET 0xA8
20
Mattias Nilssonfea799e2011-08-12 10:28:02 +020021/* PRCMU Wakeup defines */
22enum prcmu_wakeup_index {
23 PRCMU_WAKEUP_INDEX_RTC,
24 PRCMU_WAKEUP_INDEX_RTT0,
25 PRCMU_WAKEUP_INDEX_RTT1,
26 PRCMU_WAKEUP_INDEX_HSI0,
27 PRCMU_WAKEUP_INDEX_HSI1,
28 PRCMU_WAKEUP_INDEX_USB,
29 PRCMU_WAKEUP_INDEX_ABB,
30 PRCMU_WAKEUP_INDEX_ABB_FIFO,
31 PRCMU_WAKEUP_INDEX_ARM,
32 PRCMU_WAKEUP_INDEX_CD_IRQ,
33 NUM_PRCMU_WAKEUP_INDICES
34};
35#define PRCMU_WAKEUP(_name) (BIT(PRCMU_WAKEUP_INDEX_##_name))
36
37/* EPOD (power domain) IDs */
38
39/*
40 * DB8500 EPODs
41 * - EPOD_ID_SVAMMDSP: power domain for SVA MMDSP
42 * - EPOD_ID_SVAPIPE: power domain for SVA pipe
43 * - EPOD_ID_SIAMMDSP: power domain for SIA MMDSP
44 * - EPOD_ID_SIAPIPE: power domain for SIA pipe
45 * - EPOD_ID_SGA: power domain for SGA
46 * - EPOD_ID_B2R2_MCDE: power domain for B2R2 and MCDE
47 * - EPOD_ID_ESRAM12: power domain for ESRAM 1 and 2
48 * - EPOD_ID_ESRAM34: power domain for ESRAM 3 and 4
49 * - NUM_EPOD_ID: number of power domains
50 *
51 * TODO: These should be prefixed.
52 */
53#define EPOD_ID_SVAMMDSP 0
54#define EPOD_ID_SVAPIPE 1
55#define EPOD_ID_SIAMMDSP 2
56#define EPOD_ID_SIAPIPE 3
57#define EPOD_ID_SGA 4
58#define EPOD_ID_B2R2_MCDE 5
59#define EPOD_ID_ESRAM12 6
60#define EPOD_ID_ESRAM34 7
61#define NUM_EPOD_ID 8
62
63/*
Mattias Nilssonfea799e2011-08-12 10:28:02 +020064 * state definition for EPOD (power domain)
65 * - EPOD_STATE_NO_CHANGE: The EPOD should remain unchanged
66 * - EPOD_STATE_OFF: The EPOD is switched off
67 * - EPOD_STATE_RAMRET: The EPOD is switched off with its internal RAM in
68 * retention
69 * - EPOD_STATE_ON_CLK_OFF: The EPOD is switched on, clock is still off
70 * - EPOD_STATE_ON: Same as above, but with clock enabled
71 */
72#define EPOD_STATE_NO_CHANGE 0x00
73#define EPOD_STATE_OFF 0x01
74#define EPOD_STATE_RAMRET 0x02
75#define EPOD_STATE_ON_CLK_OFF 0x03
76#define EPOD_STATE_ON 0x04
77
78/*
79 * CLKOUT sources
80 */
81#define PRCMU_CLKSRC_CLK38M 0x00
82#define PRCMU_CLKSRC_ACLK 0x01
83#define PRCMU_CLKSRC_SYSCLK 0x02
84#define PRCMU_CLKSRC_LCDCLK 0x03
85#define PRCMU_CLKSRC_SDMMCCLK 0x04
86#define PRCMU_CLKSRC_TVCLK 0x05
87#define PRCMU_CLKSRC_TIMCLK 0x06
88#define PRCMU_CLKSRC_CLK009 0x07
89/* These are only valid for CLKOUT1: */
90#define PRCMU_CLKSRC_SIAMMDSPCLK 0x40
91#define PRCMU_CLKSRC_I2CCLK 0x41
92#define PRCMU_CLKSRC_MSP02CLK 0x42
93#define PRCMU_CLKSRC_ARMPLL_OBSCLK 0x43
94#define PRCMU_CLKSRC_HSIRXCLK 0x44
95#define PRCMU_CLKSRC_HSITXCLK 0x45
96#define PRCMU_CLKSRC_ARMCLKFIX 0x46
97#define PRCMU_CLKSRC_HDMICLK 0x47
98
Mattias Nilssonfea799e2011-08-12 10:28:02 +020099/**
Fabio Baltieri98c60a02013-01-18 12:40:11 +0100100 * enum prcmu_wdog_id - PRCMU watchdog IDs
101 * @PRCMU_WDOG_ALL: use all timers
102 * @PRCMU_WDOG_CPU1: use first CPU timer only
103 * @PRCMU_WDOG_CPU2: use second CPU timer conly
104 */
105enum prcmu_wdog_id {
106 PRCMU_WDOG_ALL = 0x00,
107 PRCMU_WDOG_CPU1 = 0x01,
108 PRCMU_WDOG_CPU2 = 0x02,
109};
110
111/**
Mattias Nilssonfea799e2011-08-12 10:28:02 +0200112 * enum ape_opp - APE OPP states definition
113 * @APE_OPP_INIT:
114 * @APE_NO_CHANGE: The APE operating point is unchanged
115 * @APE_100_OPP: The new APE operating point is ape100opp
116 * @APE_50_OPP: 50%
Mattias Nilsson4d64d2e2012-01-13 16:20:43 +0100117 * @APE_50_PARTLY_25_OPP: 50%, except some clocks at 25%.
Mattias Nilssonfea799e2011-08-12 10:28:02 +0200118 */
119enum ape_opp {
120 APE_OPP_INIT = 0x00,
121 APE_NO_CHANGE = 0x01,
122 APE_100_OPP = 0x02,
Mattias Nilsson4d64d2e2012-01-13 16:20:43 +0100123 APE_50_OPP = 0x03,
124 APE_50_PARTLY_25_OPP = 0xFF,
Mattias Nilssonfea799e2011-08-12 10:28:02 +0200125};
126
127/**
128 * enum arm_opp - ARM OPP states definition
129 * @ARM_OPP_INIT:
130 * @ARM_NO_CHANGE: The ARM operating point is unchanged
131 * @ARM_100_OPP: The new ARM operating point is arm100opp
132 * @ARM_50_OPP: The new ARM operating point is arm50opp
133 * @ARM_MAX_OPP: Operating point is "max" (more than 100)
134 * @ARM_MAX_FREQ100OPP: Set max opp if available, else 100
135 * @ARM_EXTCLK: The new ARM operating point is armExtClk
136 */
137enum arm_opp {
138 ARM_OPP_INIT = 0x00,
139 ARM_NO_CHANGE = 0x01,
140 ARM_100_OPP = 0x02,
141 ARM_50_OPP = 0x03,
142 ARM_MAX_OPP = 0x04,
143 ARM_MAX_FREQ100OPP = 0x05,
144 ARM_EXTCLK = 0x07
145};
146
147/**
148 * enum ddr_opp - DDR OPP states definition
149 * @DDR_100_OPP: The new DDR operating point is ddr100opp
150 * @DDR_50_OPP: The new DDR operating point is ddr50opp
151 * @DDR_25_OPP: The new DDR operating point is ddr25opp
152 */
153enum ddr_opp {
154 DDR_100_OPP = 0x00,
155 DDR_50_OPP = 0x01,
156 DDR_25_OPP = 0x02,
157};
158
159/*
160 * Definitions for controlling ESRAM0 in deep sleep.
161 */
162#define ESRAM0_DEEP_SLEEP_STATE_OFF 1
163#define ESRAM0_DEEP_SLEEP_STATE_RET 2
164
165/**
166 * enum ddr_pwrst - DDR power states definition
167 * @DDR_PWR_STATE_UNCHANGED: SDRAM and DDR controller state is unchanged
168 * @DDR_PWR_STATE_ON:
169 * @DDR_PWR_STATE_OFFLOWLAT:
170 * @DDR_PWR_STATE_OFFHIGHLAT:
171 */
172enum ddr_pwrst {
173 DDR_PWR_STATE_UNCHANGED = 0x00,
174 DDR_PWR_STATE_ON = 0x01,
175 DDR_PWR_STATE_OFFLOWLAT = 0x02,
176 DDR_PWR_STATE_OFFHIGHLAT = 0x03
177};
178
Linus Walleij05ec2602013-02-07 10:17:31 +0100179#define DB8500_PRCMU_LEGACY_OFFSET 0xDD4
180
181struct prcmu_pdata
182{
183 bool enable_set_ddr_opp;
184 bool enable_ape_opp_100_voltage;
185 struct ab8500_platform_data *ab_platdata;
Arnd Bergmann55b175d2013-03-21 22:51:07 +0100186 int ab_irq;
187 int irq_base;
Linus Walleij05ec2602013-02-07 10:17:31 +0100188 u32 version_offset;
189 u32 legacy_offset;
190 u32 adt_offset;
191};
192
193#define PRCMU_FW_PROJECT_U8500 2
194#define PRCMU_FW_PROJECT_U8400 3
195#define PRCMU_FW_PROJECT_U9500 4 /* Customer specific */
196#define PRCMU_FW_PROJECT_U8500_MBB 5
197#define PRCMU_FW_PROJECT_U8500_C1 6
198#define PRCMU_FW_PROJECT_U8500_C2 7
199#define PRCMU_FW_PROJECT_U8500_C3 8
200#define PRCMU_FW_PROJECT_U8500_C4 9
201#define PRCMU_FW_PROJECT_U9500_MBL 10
202#define PRCMU_FW_PROJECT_U8500_MBL 11 /* Customer specific */
203#define PRCMU_FW_PROJECT_U8500_MBL2 12 /* Customer specific */
204#define PRCMU_FW_PROJECT_U8520 13
205#define PRCMU_FW_PROJECT_U8420 14
206#define PRCMU_FW_PROJECT_A9420 20
207/* [32..63] 9540 and derivatives */
208#define PRCMU_FW_PROJECT_U9540 32
209/* [64..95] 8540 and derivatives */
210#define PRCMU_FW_PROJECT_L8540 64
211/* [96..126] 8580 and derivatives */
212#define PRCMU_FW_PROJECT_L8580 96
213
214#define PRCMU_FW_PROJECT_NAME_LEN 20
215struct prcmu_fw_version {
216 u32 project; /* Notice, project shifted with 8 on ux540 */
217 u8 api_version;
218 u8 func_version;
219 u8 errata;
220 char project_name[PRCMU_FW_PROJECT_NAME_LEN];
221};
222
Mattias Nilssonfea799e2011-08-12 10:28:02 +0200223#include <linux/mfd/db8500-prcmu.h>
Mattias Nilssonfea799e2011-08-12 10:28:02 +0200224
Linus Walleijdece3702012-04-13 14:01:39 +0200225#if defined(CONFIG_UX500_SOC_DB8500)
Mattias Nilssonfea799e2011-08-12 10:28:02 +0200226
Linus Walleij9a47a8d2013-03-21 12:27:25 +0100227static inline void prcmu_early_init(u32 phy_base, u32 size)
Mattias Nilssonfea799e2011-08-12 10:28:02 +0200228{
Linus Walleij9a47a8d2013-03-21 12:27:25 +0100229 return db8500_prcmu_early_init(phy_base, size);
Mattias Nilssonfea799e2011-08-12 10:28:02 +0200230}
231
232static inline int prcmu_set_power_state(u8 state, bool keep_ulp_clk,
233 bool keep_ap_pll)
234{
Linus Walleijdece3702012-04-13 14:01:39 +0200235 return db8500_prcmu_set_power_state(state, keep_ulp_clk,
236 keep_ap_pll);
Mattias Nilssonfea799e2011-08-12 10:28:02 +0200237}
238
Mattias Nilsson4d64d2e2012-01-13 16:20:43 +0100239static inline u8 prcmu_get_power_state_result(void)
240{
Linus Walleijdece3702012-04-13 14:01:39 +0200241 return db8500_prcmu_get_power_state_result();
Mattias Nilsson4d64d2e2012-01-13 16:20:43 +0100242}
243
Mattias Nilssonfea799e2011-08-12 10:28:02 +0200244static inline int prcmu_set_epod(u16 epod_id, u8 epod_state)
245{
Linus Walleijdece3702012-04-13 14:01:39 +0200246 return db8500_prcmu_set_epod(epod_id, epod_state);
Mattias Nilssonfea799e2011-08-12 10:28:02 +0200247}
248
249static inline void prcmu_enable_wakeups(u32 wakeups)
250{
Linus Walleijdece3702012-04-13 14:01:39 +0200251 db8500_prcmu_enable_wakeups(wakeups);
Mattias Nilssonfea799e2011-08-12 10:28:02 +0200252}
253
254static inline void prcmu_disable_wakeups(void)
255{
256 prcmu_enable_wakeups(0);
257}
258
259static inline void prcmu_config_abb_event_readout(u32 abb_events)
260{
Linus Walleijdece3702012-04-13 14:01:39 +0200261 db8500_prcmu_config_abb_event_readout(abb_events);
Mattias Nilssonfea799e2011-08-12 10:28:02 +0200262}
263
264static inline void prcmu_get_abb_event_buffer(void __iomem **buf)
265{
Linus Walleijdece3702012-04-13 14:01:39 +0200266 db8500_prcmu_get_abb_event_buffer(buf);
Mattias Nilssonfea799e2011-08-12 10:28:02 +0200267}
268
269int prcmu_abb_read(u8 slave, u8 reg, u8 *value, u8 size);
270int prcmu_abb_write(u8 slave, u8 reg, u8 *value, u8 size);
Mattias Nilsson3c3e4892012-03-08 14:02:05 +0100271int prcmu_abb_write_masked(u8 slave, u8 reg, u8 *value, u8 *mask, u8 size);
Mattias Nilssonfea799e2011-08-12 10:28:02 +0200272
273int prcmu_config_clkout(u8 clkout, u8 source, u8 div);
274
275static inline int prcmu_request_clock(u8 clock, bool enable)
276{
Linus Walleijdece3702012-04-13 14:01:39 +0200277 return db8500_prcmu_request_clock(clock, enable);
Mattias Nilssonfea799e2011-08-12 10:28:02 +0200278}
279
Mattias Nilsson05089012012-01-13 16:20:20 +0100280unsigned long prcmu_clock_rate(u8 clock);
281long prcmu_round_clock_rate(u8 clock, unsigned long rate);
282int prcmu_set_clock_rate(u8 clock, unsigned long rate);
283
284static inline int prcmu_set_ddr_opp(u8 opp)
285{
Linus Walleijdece3702012-04-13 14:01:39 +0200286 return db8500_prcmu_set_ddr_opp(opp);
Mattias Nilsson05089012012-01-13 16:20:20 +0100287}
288static inline int prcmu_get_ddr_opp(void)
289{
Linus Walleijdece3702012-04-13 14:01:39 +0200290 return db8500_prcmu_get_ddr_opp();
Mattias Nilsson05089012012-01-13 16:20:20 +0100291}
Mattias Nilssonfea799e2011-08-12 10:28:02 +0200292
293static inline int prcmu_set_arm_opp(u8 opp)
294{
Linus Walleijdece3702012-04-13 14:01:39 +0200295 return db8500_prcmu_set_arm_opp(opp);
Mattias Nilssonfea799e2011-08-12 10:28:02 +0200296}
297
298static inline int prcmu_get_arm_opp(void)
299{
Linus Walleijdece3702012-04-13 14:01:39 +0200300 return db8500_prcmu_get_arm_opp();
Mattias Nilssonfea799e2011-08-12 10:28:02 +0200301}
302
Mattias Nilsson05089012012-01-13 16:20:20 +0100303static inline int prcmu_set_ape_opp(u8 opp)
304{
Linus Walleijdece3702012-04-13 14:01:39 +0200305 return db8500_prcmu_set_ape_opp(opp);
Mattias Nilsson05089012012-01-13 16:20:20 +0100306}
307
308static inline int prcmu_get_ape_opp(void)
309{
Linus Walleijdece3702012-04-13 14:01:39 +0200310 return db8500_prcmu_get_ape_opp();
Mattias Nilsson05089012012-01-13 16:20:20 +0100311}
312
Ulf Hansson686f8712012-09-24 16:43:17 +0200313static inline int prcmu_request_ape_opp_100_voltage(bool enable)
314{
315 return db8500_prcmu_request_ape_opp_100_voltage(enable);
316}
317
Mattias Nilssonfea799e2011-08-12 10:28:02 +0200318static inline void prcmu_system_reset(u16 reset_code)
319{
Linus Walleijdece3702012-04-13 14:01:39 +0200320 return db8500_prcmu_system_reset(reset_code);
Mattias Nilssonfea799e2011-08-12 10:28:02 +0200321}
322
323static inline u16 prcmu_get_reset_code(void)
324{
Linus Walleijdece3702012-04-13 14:01:39 +0200325 return db8500_prcmu_get_reset_code();
Mattias Nilssonfea799e2011-08-12 10:28:02 +0200326}
327
Arun Murthy5261e102012-05-21 14:28:21 +0530328int prcmu_ac_wake_req(void);
Mattias Nilssonfea799e2011-08-12 10:28:02 +0200329void prcmu_ac_sleep_req(void);
Mattias Nilsson05089012012-01-13 16:20:20 +0100330static inline void prcmu_modem_reset(void)
331{
Linus Walleijdece3702012-04-13 14:01:39 +0200332 return db8500_prcmu_modem_reset();
Mattias Nilsson05089012012-01-13 16:20:20 +0100333}
334
Mattias Nilssonfea799e2011-08-12 10:28:02 +0200335static inline bool prcmu_is_ac_wake_requested(void)
336{
Linus Walleijdece3702012-04-13 14:01:39 +0200337 return db8500_prcmu_is_ac_wake_requested();
Mattias Nilssonfea799e2011-08-12 10:28:02 +0200338}
339
340static inline int prcmu_set_display_clocks(void)
341{
Linus Walleijdece3702012-04-13 14:01:39 +0200342 return db8500_prcmu_set_display_clocks();
Mattias Nilssonfea799e2011-08-12 10:28:02 +0200343}
344
345static inline int prcmu_disable_dsipll(void)
346{
Linus Walleijdece3702012-04-13 14:01:39 +0200347 return db8500_prcmu_disable_dsipll();
Mattias Nilssonfea799e2011-08-12 10:28:02 +0200348}
349
350static inline int prcmu_enable_dsipll(void)
351{
Linus Walleijdece3702012-04-13 14:01:39 +0200352 return db8500_prcmu_enable_dsipll();
Mattias Nilssonfea799e2011-08-12 10:28:02 +0200353}
354
355static inline int prcmu_config_esram0_deep_sleep(u8 state)
356{
Linus Walleijdece3702012-04-13 14:01:39 +0200357 return db8500_prcmu_config_esram0_deep_sleep(state);
Mattias Nilssonfea799e2011-08-12 10:28:02 +0200358}
Mattias Nilsson05089012012-01-13 16:20:20 +0100359
360static inline int prcmu_config_hotdog(u8 threshold)
361{
Linus Walleijdece3702012-04-13 14:01:39 +0200362 return db8500_prcmu_config_hotdog(threshold);
Mattias Nilsson05089012012-01-13 16:20:20 +0100363}
364
365static inline int prcmu_config_hotmon(u8 low, u8 high)
366{
Linus Walleijdece3702012-04-13 14:01:39 +0200367 return db8500_prcmu_config_hotmon(low, high);
Mattias Nilsson05089012012-01-13 16:20:20 +0100368}
369
370static inline int prcmu_start_temp_sense(u16 cycles32k)
371{
Linus Walleijdece3702012-04-13 14:01:39 +0200372 return db8500_prcmu_start_temp_sense(cycles32k);
Mattias Nilsson05089012012-01-13 16:20:20 +0100373}
374
375static inline int prcmu_stop_temp_sense(void)
376{
Linus Walleijdece3702012-04-13 14:01:39 +0200377 return db8500_prcmu_stop_temp_sense();
Mattias Nilsson05089012012-01-13 16:20:20 +0100378}
379
Mattias Nilssonb4a6dbd2012-01-13 16:21:00 +0100380static inline u32 prcmu_read(unsigned int reg)
381{
Linus Walleijdece3702012-04-13 14:01:39 +0200382 return db8500_prcmu_read(reg);
Mattias Nilssonb4a6dbd2012-01-13 16:21:00 +0100383}
384
385static inline void prcmu_write(unsigned int reg, u32 value)
386{
Linus Walleijdece3702012-04-13 14:01:39 +0200387 db8500_prcmu_write(reg, value);
Mattias Nilssonb4a6dbd2012-01-13 16:21:00 +0100388}
389
390static inline void prcmu_write_masked(unsigned int reg, u32 mask, u32 value)
391{
Linus Walleijdece3702012-04-13 14:01:39 +0200392 db8500_prcmu_write_masked(reg, mask, value);
Mattias Nilssonb4a6dbd2012-01-13 16:21:00 +0100393}
394
Mattias Nilsson05089012012-01-13 16:20:20 +0100395static inline int prcmu_enable_a9wdog(u8 id)
396{
Linus Walleijdece3702012-04-13 14:01:39 +0200397 return db8500_prcmu_enable_a9wdog(id);
Mattias Nilsson05089012012-01-13 16:20:20 +0100398}
399
400static inline int prcmu_disable_a9wdog(u8 id)
401{
Linus Walleijdece3702012-04-13 14:01:39 +0200402 return db8500_prcmu_disable_a9wdog(id);
Mattias Nilsson05089012012-01-13 16:20:20 +0100403}
404
405static inline int prcmu_kick_a9wdog(u8 id)
406{
Linus Walleijdece3702012-04-13 14:01:39 +0200407 return db8500_prcmu_kick_a9wdog(id);
Mattias Nilsson05089012012-01-13 16:20:20 +0100408}
409
410static inline int prcmu_load_a9wdog(u8 id, u32 timeout)
411{
Linus Walleijdece3702012-04-13 14:01:39 +0200412 return db8500_prcmu_load_a9wdog(id, timeout);
Mattias Nilsson05089012012-01-13 16:20:20 +0100413}
414
415static inline int prcmu_config_a9wdog(u8 num, bool sleep_auto_off)
416{
Linus Walleijdece3702012-04-13 14:01:39 +0200417 return db8500_prcmu_config_a9wdog(num, sleep_auto_off);
Mattias Nilsson05089012012-01-13 16:20:20 +0100418}
Mattias Nilssonfea799e2011-08-12 10:28:02 +0200419#else
420
Linus Walleij9a47a8d2013-03-21 12:27:25 +0100421static inline void prcmu_early_init(u32 phy_base, u32 size) {}
Mattias Nilssonfea799e2011-08-12 10:28:02 +0200422
423static inline int prcmu_set_power_state(u8 state, bool keep_ulp_clk,
424 bool keep_ap_pll)
425{
426 return 0;
427}
428
429static inline int prcmu_set_epod(u16 epod_id, u8 epod_state)
430{
431 return 0;
432}
433
434static inline void prcmu_enable_wakeups(u32 wakeups) {}
435
436static inline void prcmu_disable_wakeups(void) {}
437
438static inline int prcmu_abb_read(u8 slave, u8 reg, u8 *value, u8 size)
439{
440 return -ENOSYS;
441}
442
443static inline int prcmu_abb_write(u8 slave, u8 reg, u8 *value, u8 size)
444{
445 return -ENOSYS;
446}
447
Mattias Nilsson3c3e4892012-03-08 14:02:05 +0100448static inline int prcmu_abb_write_masked(u8 slave, u8 reg, u8 *value, u8 *mask,
449 u8 size)
450{
451 return -ENOSYS;
452}
453
Mattias Nilssonfea799e2011-08-12 10:28:02 +0200454static inline int prcmu_config_clkout(u8 clkout, u8 source, u8 div)
455{
456 return 0;
457}
458
459static inline int prcmu_request_clock(u8 clock, bool enable)
460{
461 return 0;
462}
463
Mattias Nilsson6b6fae22012-01-13 16:20:28 +0100464static inline long prcmu_round_clock_rate(u8 clock, unsigned long rate)
465{
466 return 0;
467}
468
469static inline int prcmu_set_clock_rate(u8 clock, unsigned long rate)
470{
471 return 0;
472}
473
474static inline unsigned long prcmu_clock_rate(u8 clock)
475{
476 return 0;
477}
478
Mattias Nilssonfea799e2011-08-12 10:28:02 +0200479static inline int prcmu_set_ape_opp(u8 opp)
480{
481 return 0;
482}
483
484static inline int prcmu_get_ape_opp(void)
485{
486 return APE_100_OPP;
487}
488
Ulf Hansson686f8712012-09-24 16:43:17 +0200489static inline int prcmu_request_ape_opp_100_voltage(bool enable)
490{
491 return 0;
492}
493
Mattias Nilssonfea799e2011-08-12 10:28:02 +0200494static inline int prcmu_set_arm_opp(u8 opp)
495{
496 return 0;
497}
498
499static inline int prcmu_get_arm_opp(void)
500{
501 return ARM_100_OPP;
502}
503
504static inline int prcmu_set_ddr_opp(u8 opp)
505{
506 return 0;
507}
508
509static inline int prcmu_get_ddr_opp(void)
510{
511 return DDR_100_OPP;
512}
513
514static inline void prcmu_system_reset(u16 reset_code) {}
515
516static inline u16 prcmu_get_reset_code(void)
517{
518 return 0;
519}
520
Arun Murthy5261e102012-05-21 14:28:21 +0530521static inline int prcmu_ac_wake_req(void)
522{
523 return 0;
524}
Mattias Nilssonfea799e2011-08-12 10:28:02 +0200525
526static inline void prcmu_ac_sleep_req(void) {}
527
528static inline void prcmu_modem_reset(void) {}
529
530static inline bool prcmu_is_ac_wake_requested(void)
531{
532 return false;
533}
534
535static inline int prcmu_set_display_clocks(void)
536{
537 return 0;
538}
539
540static inline int prcmu_disable_dsipll(void)
541{
542 return 0;
543}
544
545static inline int prcmu_enable_dsipll(void)
546{
547 return 0;
548}
549
550static inline int prcmu_config_esram0_deep_sleep(u8 state)
551{
552 return 0;
553}
554
555static inline void prcmu_config_abb_event_readout(u32 abb_events) {}
556
557static inline void prcmu_get_abb_event_buffer(void __iomem **buf)
558{
559 *buf = NULL;
560}
561
Mattias Nilsson05089012012-01-13 16:20:20 +0100562static inline int prcmu_config_hotdog(u8 threshold)
563{
564 return 0;
565}
566
567static inline int prcmu_config_hotmon(u8 low, u8 high)
568{
569 return 0;
570}
571
572static inline int prcmu_start_temp_sense(u16 cycles32k)
573{
574 return 0;
575}
576
577static inline int prcmu_stop_temp_sense(void)
578{
579 return 0;
580}
581
Mattias Nilssonb4a6dbd2012-01-13 16:21:00 +0100582static inline u32 prcmu_read(unsigned int reg)
583{
584 return 0;
585}
586
587static inline void prcmu_write(unsigned int reg, u32 value) {}
588
589static inline void prcmu_write_masked(unsigned int reg, u32 mask, u32 value) {}
590
591#endif
592
593static inline void prcmu_set(unsigned int reg, u32 bits)
594{
595 prcmu_write_masked(reg, bits, bits);
596}
597
598static inline void prcmu_clear(unsigned int reg, u32 bits)
599{
600 prcmu_write_masked(reg, bits, 0);
601}
602
Mattias Nilssonfea799e2011-08-12 10:28:02 +0200603/* PRCMU QoS APE OPP class */
604#define PRCMU_QOS_APE_OPP 1
605#define PRCMU_QOS_DDR_OPP 2
Mattias Nilsson4d64d2e2012-01-13 16:20:43 +0100606#define PRCMU_QOS_ARM_OPP 3
Mattias Nilssonfea799e2011-08-12 10:28:02 +0200607#define PRCMU_QOS_DEFAULT_VALUE -1
608
Mattias Nilsson4d64d2e2012-01-13 16:20:43 +0100609#ifdef CONFIG_DBX500_PRCMU_QOS_POWER
Mattias Nilssonfea799e2011-08-12 10:28:02 +0200610
611unsigned long prcmu_qos_get_cpufreq_opp_delay(void);
612void prcmu_qos_set_cpufreq_opp_delay(unsigned long);
613void prcmu_qos_force_opp(int, s32);
614int prcmu_qos_requirement(int pm_qos_class);
615int prcmu_qos_add_requirement(int pm_qos_class, char *name, s32 value);
616int prcmu_qos_update_requirement(int pm_qos_class, char *name, s32 new_value);
617void prcmu_qos_remove_requirement(int pm_qos_class, char *name);
618int prcmu_qos_add_notifier(int prcmu_qos_class,
619 struct notifier_block *notifier);
620int prcmu_qos_remove_notifier(int prcmu_qos_class,
621 struct notifier_block *notifier);
622
623#else
624
625static inline unsigned long prcmu_qos_get_cpufreq_opp_delay(void)
626{
627 return 0;
628}
629
630static inline void prcmu_qos_set_cpufreq_opp_delay(unsigned long n) {}
631
632static inline void prcmu_qos_force_opp(int prcmu_qos_class, s32 i) {}
633
634static inline int prcmu_qos_requirement(int prcmu_qos_class)
635{
636 return 0;
637}
638
639static inline int prcmu_qos_add_requirement(int prcmu_qos_class,
640 char *name, s32 value)
641{
642 return 0;
643}
644
645static inline int prcmu_qos_update_requirement(int prcmu_qos_class,
646 char *name, s32 new_value)
647{
648 return 0;
649}
650
651static inline void prcmu_qos_remove_requirement(int prcmu_qos_class, char *name)
652{
653}
654
655static inline int prcmu_qos_add_notifier(int prcmu_qos_class,
656 struct notifier_block *notifier)
657{
658 return 0;
659}
660static inline int prcmu_qos_remove_notifier(int prcmu_qos_class,
661 struct notifier_block *notifier)
662{
663 return 0;
664}
665
666#endif
667
668#endif /* __MACH_PRCMU_H */