dbx500-prcmu.h 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733
  1. /*
  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. #include <linux/interrupt.h>
  11. #include <linux/notifier.h>
  12. #include <linux/err.h>
  13. /* Offset for the firmware version within the TCPM */
  14. #define DB8500_PRCMU_FW_VERSION_OFFSET 0xA4
  15. #define DBX540_PRCMU_FW_VERSION_OFFSET 0xA8
  16. /* PRCMU Wakeup defines */
  17. enum prcmu_wakeup_index {
  18. PRCMU_WAKEUP_INDEX_RTC,
  19. PRCMU_WAKEUP_INDEX_RTT0,
  20. PRCMU_WAKEUP_INDEX_RTT1,
  21. PRCMU_WAKEUP_INDEX_HSI0,
  22. PRCMU_WAKEUP_INDEX_HSI1,
  23. PRCMU_WAKEUP_INDEX_USB,
  24. PRCMU_WAKEUP_INDEX_ABB,
  25. PRCMU_WAKEUP_INDEX_ABB_FIFO,
  26. PRCMU_WAKEUP_INDEX_ARM,
  27. PRCMU_WAKEUP_INDEX_CD_IRQ,
  28. NUM_PRCMU_WAKEUP_INDICES
  29. };
  30. #define PRCMU_WAKEUP(_name) (BIT(PRCMU_WAKEUP_INDEX_##_name))
  31. /* EPOD (power domain) IDs */
  32. /*
  33. * DB8500 EPODs
  34. * - EPOD_ID_SVAMMDSP: power domain for SVA MMDSP
  35. * - EPOD_ID_SVAPIPE: power domain for SVA pipe
  36. * - EPOD_ID_SIAMMDSP: power domain for SIA MMDSP
  37. * - EPOD_ID_SIAPIPE: power domain for SIA pipe
  38. * - EPOD_ID_SGA: power domain for SGA
  39. * - EPOD_ID_B2R2_MCDE: power domain for B2R2 and MCDE
  40. * - EPOD_ID_ESRAM12: power domain for ESRAM 1 and 2
  41. * - EPOD_ID_ESRAM34: power domain for ESRAM 3 and 4
  42. * - NUM_EPOD_ID: number of power domains
  43. *
  44. * TODO: These should be prefixed.
  45. */
  46. #define EPOD_ID_SVAMMDSP 0
  47. #define EPOD_ID_SVAPIPE 1
  48. #define EPOD_ID_SIAMMDSP 2
  49. #define EPOD_ID_SIAPIPE 3
  50. #define EPOD_ID_SGA 4
  51. #define EPOD_ID_B2R2_MCDE 5
  52. #define EPOD_ID_ESRAM12 6
  53. #define EPOD_ID_ESRAM34 7
  54. #define NUM_EPOD_ID 8
  55. /*
  56. * state definition for EPOD (power domain)
  57. * - EPOD_STATE_NO_CHANGE: The EPOD should remain unchanged
  58. * - EPOD_STATE_OFF: The EPOD is switched off
  59. * - EPOD_STATE_RAMRET: The EPOD is switched off with its internal RAM in
  60. * retention
  61. * - EPOD_STATE_ON_CLK_OFF: The EPOD is switched on, clock is still off
  62. * - EPOD_STATE_ON: Same as above, but with clock enabled
  63. */
  64. #define EPOD_STATE_NO_CHANGE 0x00
  65. #define EPOD_STATE_OFF 0x01
  66. #define EPOD_STATE_RAMRET 0x02
  67. #define EPOD_STATE_ON_CLK_OFF 0x03
  68. #define EPOD_STATE_ON 0x04
  69. /*
  70. * CLKOUT sources
  71. */
  72. #define PRCMU_CLKSRC_CLK38M 0x00
  73. #define PRCMU_CLKSRC_ACLK 0x01
  74. #define PRCMU_CLKSRC_SYSCLK 0x02
  75. #define PRCMU_CLKSRC_LCDCLK 0x03
  76. #define PRCMU_CLKSRC_SDMMCCLK 0x04
  77. #define PRCMU_CLKSRC_TVCLK 0x05
  78. #define PRCMU_CLKSRC_TIMCLK 0x06
  79. #define PRCMU_CLKSRC_CLK009 0x07
  80. /* These are only valid for CLKOUT1: */
  81. #define PRCMU_CLKSRC_SIAMMDSPCLK 0x40
  82. #define PRCMU_CLKSRC_I2CCLK 0x41
  83. #define PRCMU_CLKSRC_MSP02CLK 0x42
  84. #define PRCMU_CLKSRC_ARMPLL_OBSCLK 0x43
  85. #define PRCMU_CLKSRC_HSIRXCLK 0x44
  86. #define PRCMU_CLKSRC_HSITXCLK 0x45
  87. #define PRCMU_CLKSRC_ARMCLKFIX 0x46
  88. #define PRCMU_CLKSRC_HDMICLK 0x47
  89. /*
  90. * Clock identifiers.
  91. */
  92. enum prcmu_clock {
  93. PRCMU_SGACLK,
  94. PRCMU_UARTCLK,
  95. PRCMU_MSP02CLK,
  96. PRCMU_MSP1CLK,
  97. PRCMU_I2CCLK,
  98. PRCMU_SDMMCCLK,
  99. PRCMU_SPARE1CLK,
  100. PRCMU_SLIMCLK,
  101. PRCMU_PER1CLK,
  102. PRCMU_PER2CLK,
  103. PRCMU_PER3CLK,
  104. PRCMU_PER5CLK,
  105. PRCMU_PER6CLK,
  106. PRCMU_PER7CLK,
  107. PRCMU_LCDCLK,
  108. PRCMU_BMLCLK,
  109. PRCMU_HSITXCLK,
  110. PRCMU_HSIRXCLK,
  111. PRCMU_HDMICLK,
  112. PRCMU_APEATCLK,
  113. PRCMU_APETRACECLK,
  114. PRCMU_MCDECLK,
  115. PRCMU_IPI2CCLK,
  116. PRCMU_DSIALTCLK,
  117. PRCMU_DMACLK,
  118. PRCMU_B2R2CLK,
  119. PRCMU_TVCLK,
  120. PRCMU_SSPCLK,
  121. PRCMU_RNGCLK,
  122. PRCMU_UICCCLK,
  123. PRCMU_PWMCLK,
  124. PRCMU_IRDACLK,
  125. PRCMU_IRRCCLK,
  126. PRCMU_SIACLK,
  127. PRCMU_SVACLK,
  128. PRCMU_ACLK,
  129. PRCMU_HVACLK, /* Ux540 only */
  130. PRCMU_G1CLK, /* Ux540 only */
  131. PRCMU_SDMMCHCLK,
  132. PRCMU_CAMCLK,
  133. PRCMU_NUM_REG_CLOCKS,
  134. PRCMU_SYSCLK = PRCMU_NUM_REG_CLOCKS,
  135. PRCMU_CDCLK,
  136. PRCMU_TIMCLK,
  137. PRCMU_PLLSOC0,
  138. PRCMU_PLLSOC1,
  139. PRCMU_ARMSS,
  140. PRCMU_PLLDDR,
  141. PRCMU_PLLDSI,
  142. PRCMU_DSI0CLK,
  143. PRCMU_DSI1CLK,
  144. PRCMU_DSI0ESCCLK,
  145. PRCMU_DSI1ESCCLK,
  146. PRCMU_DSI2ESCCLK,
  147. /* LCD DSI PLL - Ux540 only */
  148. PRCMU_PLLDSI_LCD,
  149. PRCMU_DSI0CLK_LCD,
  150. PRCMU_DSI1CLK_LCD,
  151. PRCMU_DSI0ESCCLK_LCD,
  152. PRCMU_DSI1ESCCLK_LCD,
  153. PRCMU_DSI2ESCCLK_LCD,
  154. };
  155. /**
  156. * enum prcmu_wdog_id - PRCMU watchdog IDs
  157. * @PRCMU_WDOG_ALL: use all timers
  158. * @PRCMU_WDOG_CPU1: use first CPU timer only
  159. * @PRCMU_WDOG_CPU2: use second CPU timer conly
  160. */
  161. enum prcmu_wdog_id {
  162. PRCMU_WDOG_ALL = 0x00,
  163. PRCMU_WDOG_CPU1 = 0x01,
  164. PRCMU_WDOG_CPU2 = 0x02,
  165. };
  166. /**
  167. * enum ape_opp - APE OPP states definition
  168. * @APE_OPP_INIT:
  169. * @APE_NO_CHANGE: The APE operating point is unchanged
  170. * @APE_100_OPP: The new APE operating point is ape100opp
  171. * @APE_50_OPP: 50%
  172. * @APE_50_PARTLY_25_OPP: 50%, except some clocks at 25%.
  173. */
  174. enum ape_opp {
  175. APE_OPP_INIT = 0x00,
  176. APE_NO_CHANGE = 0x01,
  177. APE_100_OPP = 0x02,
  178. APE_50_OPP = 0x03,
  179. APE_50_PARTLY_25_OPP = 0xFF,
  180. };
  181. /**
  182. * enum arm_opp - ARM OPP states definition
  183. * @ARM_OPP_INIT:
  184. * @ARM_NO_CHANGE: The ARM operating point is unchanged
  185. * @ARM_100_OPP: The new ARM operating point is arm100opp
  186. * @ARM_50_OPP: The new ARM operating point is arm50opp
  187. * @ARM_MAX_OPP: Operating point is "max" (more than 100)
  188. * @ARM_MAX_FREQ100OPP: Set max opp if available, else 100
  189. * @ARM_EXTCLK: The new ARM operating point is armExtClk
  190. */
  191. enum arm_opp {
  192. ARM_OPP_INIT = 0x00,
  193. ARM_NO_CHANGE = 0x01,
  194. ARM_100_OPP = 0x02,
  195. ARM_50_OPP = 0x03,
  196. ARM_MAX_OPP = 0x04,
  197. ARM_MAX_FREQ100OPP = 0x05,
  198. ARM_EXTCLK = 0x07
  199. };
  200. /**
  201. * enum ddr_opp - DDR OPP states definition
  202. * @DDR_100_OPP: The new DDR operating point is ddr100opp
  203. * @DDR_50_OPP: The new DDR operating point is ddr50opp
  204. * @DDR_25_OPP: The new DDR operating point is ddr25opp
  205. */
  206. enum ddr_opp {
  207. DDR_100_OPP = 0x00,
  208. DDR_50_OPP = 0x01,
  209. DDR_25_OPP = 0x02,
  210. };
  211. /*
  212. * Definitions for controlling ESRAM0 in deep sleep.
  213. */
  214. #define ESRAM0_DEEP_SLEEP_STATE_OFF 1
  215. #define ESRAM0_DEEP_SLEEP_STATE_RET 2
  216. /**
  217. * enum ddr_pwrst - DDR power states definition
  218. * @DDR_PWR_STATE_UNCHANGED: SDRAM and DDR controller state is unchanged
  219. * @DDR_PWR_STATE_ON:
  220. * @DDR_PWR_STATE_OFFLOWLAT:
  221. * @DDR_PWR_STATE_OFFHIGHLAT:
  222. */
  223. enum ddr_pwrst {
  224. DDR_PWR_STATE_UNCHANGED = 0x00,
  225. DDR_PWR_STATE_ON = 0x01,
  226. DDR_PWR_STATE_OFFLOWLAT = 0x02,
  227. DDR_PWR_STATE_OFFHIGHLAT = 0x03
  228. };
  229. #define DB8500_PRCMU_LEGACY_OFFSET 0xDD4
  230. struct prcmu_pdata
  231. {
  232. bool enable_set_ddr_opp;
  233. bool enable_ape_opp_100_voltage;
  234. struct ab8500_platform_data *ab_platdata;
  235. int ab_irq;
  236. int irq_base;
  237. u32 version_offset;
  238. u32 legacy_offset;
  239. u32 adt_offset;
  240. };
  241. #define PRCMU_FW_PROJECT_U8500 2
  242. #define PRCMU_FW_PROJECT_U8400 3
  243. #define PRCMU_FW_PROJECT_U9500 4 /* Customer specific */
  244. #define PRCMU_FW_PROJECT_U8500_MBB 5
  245. #define PRCMU_FW_PROJECT_U8500_C1 6
  246. #define PRCMU_FW_PROJECT_U8500_C2 7
  247. #define PRCMU_FW_PROJECT_U8500_C3 8
  248. #define PRCMU_FW_PROJECT_U8500_C4 9
  249. #define PRCMU_FW_PROJECT_U9500_MBL 10
  250. #define PRCMU_FW_PROJECT_U8500_MBL 11 /* Customer specific */
  251. #define PRCMU_FW_PROJECT_U8500_MBL2 12 /* Customer specific */
  252. #define PRCMU_FW_PROJECT_U8520 13
  253. #define PRCMU_FW_PROJECT_U8420 14
  254. #define PRCMU_FW_PROJECT_A9420 20
  255. /* [32..63] 9540 and derivatives */
  256. #define PRCMU_FW_PROJECT_U9540 32
  257. /* [64..95] 8540 and derivatives */
  258. #define PRCMU_FW_PROJECT_L8540 64
  259. /* [96..126] 8580 and derivatives */
  260. #define PRCMU_FW_PROJECT_L8580 96
  261. #define PRCMU_FW_PROJECT_NAME_LEN 20
  262. struct prcmu_fw_version {
  263. u32 project; /* Notice, project shifted with 8 on ux540 */
  264. u8 api_version;
  265. u8 func_version;
  266. u8 errata;
  267. char project_name[PRCMU_FW_PROJECT_NAME_LEN];
  268. };
  269. #include <linux/mfd/db8500-prcmu.h>
  270. #if defined(CONFIG_UX500_SOC_DB8500)
  271. static inline void prcmu_early_init(u32 phy_base, u32 size)
  272. {
  273. return db8500_prcmu_early_init(phy_base, size);
  274. }
  275. static inline int prcmu_set_power_state(u8 state, bool keep_ulp_clk,
  276. bool keep_ap_pll)
  277. {
  278. return db8500_prcmu_set_power_state(state, keep_ulp_clk,
  279. keep_ap_pll);
  280. }
  281. static inline u8 prcmu_get_power_state_result(void)
  282. {
  283. return db8500_prcmu_get_power_state_result();
  284. }
  285. static inline int prcmu_set_epod(u16 epod_id, u8 epod_state)
  286. {
  287. return db8500_prcmu_set_epod(epod_id, epod_state);
  288. }
  289. static inline void prcmu_enable_wakeups(u32 wakeups)
  290. {
  291. db8500_prcmu_enable_wakeups(wakeups);
  292. }
  293. static inline void prcmu_disable_wakeups(void)
  294. {
  295. prcmu_enable_wakeups(0);
  296. }
  297. static inline void prcmu_config_abb_event_readout(u32 abb_events)
  298. {
  299. db8500_prcmu_config_abb_event_readout(abb_events);
  300. }
  301. static inline void prcmu_get_abb_event_buffer(void __iomem **buf)
  302. {
  303. db8500_prcmu_get_abb_event_buffer(buf);
  304. }
  305. int prcmu_abb_read(u8 slave, u8 reg, u8 *value, u8 size);
  306. int prcmu_abb_write(u8 slave, u8 reg, u8 *value, u8 size);
  307. int prcmu_abb_write_masked(u8 slave, u8 reg, u8 *value, u8 *mask, u8 size);
  308. int prcmu_config_clkout(u8 clkout, u8 source, u8 div);
  309. static inline int prcmu_request_clock(u8 clock, bool enable)
  310. {
  311. return db8500_prcmu_request_clock(clock, enable);
  312. }
  313. unsigned long prcmu_clock_rate(u8 clock);
  314. long prcmu_round_clock_rate(u8 clock, unsigned long rate);
  315. int prcmu_set_clock_rate(u8 clock, unsigned long rate);
  316. static inline int prcmu_set_ddr_opp(u8 opp)
  317. {
  318. return db8500_prcmu_set_ddr_opp(opp);
  319. }
  320. static inline int prcmu_get_ddr_opp(void)
  321. {
  322. return db8500_prcmu_get_ddr_opp();
  323. }
  324. static inline int prcmu_set_arm_opp(u8 opp)
  325. {
  326. return db8500_prcmu_set_arm_opp(opp);
  327. }
  328. static inline int prcmu_get_arm_opp(void)
  329. {
  330. return db8500_prcmu_get_arm_opp();
  331. }
  332. static inline int prcmu_set_ape_opp(u8 opp)
  333. {
  334. return db8500_prcmu_set_ape_opp(opp);
  335. }
  336. static inline int prcmu_get_ape_opp(void)
  337. {
  338. return db8500_prcmu_get_ape_opp();
  339. }
  340. static inline int prcmu_request_ape_opp_100_voltage(bool enable)
  341. {
  342. return db8500_prcmu_request_ape_opp_100_voltage(enable);
  343. }
  344. static inline void prcmu_system_reset(u16 reset_code)
  345. {
  346. return db8500_prcmu_system_reset(reset_code);
  347. }
  348. static inline u16 prcmu_get_reset_code(void)
  349. {
  350. return db8500_prcmu_get_reset_code();
  351. }
  352. int prcmu_ac_wake_req(void);
  353. void prcmu_ac_sleep_req(void);
  354. static inline void prcmu_modem_reset(void)
  355. {
  356. return db8500_prcmu_modem_reset();
  357. }
  358. static inline bool prcmu_is_ac_wake_requested(void)
  359. {
  360. return db8500_prcmu_is_ac_wake_requested();
  361. }
  362. static inline int prcmu_set_display_clocks(void)
  363. {
  364. return db8500_prcmu_set_display_clocks();
  365. }
  366. static inline int prcmu_disable_dsipll(void)
  367. {
  368. return db8500_prcmu_disable_dsipll();
  369. }
  370. static inline int prcmu_enable_dsipll(void)
  371. {
  372. return db8500_prcmu_enable_dsipll();
  373. }
  374. static inline int prcmu_config_esram0_deep_sleep(u8 state)
  375. {
  376. return db8500_prcmu_config_esram0_deep_sleep(state);
  377. }
  378. static inline int prcmu_config_hotdog(u8 threshold)
  379. {
  380. return db8500_prcmu_config_hotdog(threshold);
  381. }
  382. static inline int prcmu_config_hotmon(u8 low, u8 high)
  383. {
  384. return db8500_prcmu_config_hotmon(low, high);
  385. }
  386. static inline int prcmu_start_temp_sense(u16 cycles32k)
  387. {
  388. return db8500_prcmu_start_temp_sense(cycles32k);
  389. }
  390. static inline int prcmu_stop_temp_sense(void)
  391. {
  392. return db8500_prcmu_stop_temp_sense();
  393. }
  394. static inline u32 prcmu_read(unsigned int reg)
  395. {
  396. return db8500_prcmu_read(reg);
  397. }
  398. static inline void prcmu_write(unsigned int reg, u32 value)
  399. {
  400. db8500_prcmu_write(reg, value);
  401. }
  402. static inline void prcmu_write_masked(unsigned int reg, u32 mask, u32 value)
  403. {
  404. db8500_prcmu_write_masked(reg, mask, value);
  405. }
  406. static inline int prcmu_enable_a9wdog(u8 id)
  407. {
  408. return db8500_prcmu_enable_a9wdog(id);
  409. }
  410. static inline int prcmu_disable_a9wdog(u8 id)
  411. {
  412. return db8500_prcmu_disable_a9wdog(id);
  413. }
  414. static inline int prcmu_kick_a9wdog(u8 id)
  415. {
  416. return db8500_prcmu_kick_a9wdog(id);
  417. }
  418. static inline int prcmu_load_a9wdog(u8 id, u32 timeout)
  419. {
  420. return db8500_prcmu_load_a9wdog(id, timeout);
  421. }
  422. static inline int prcmu_config_a9wdog(u8 num, bool sleep_auto_off)
  423. {
  424. return db8500_prcmu_config_a9wdog(num, sleep_auto_off);
  425. }
  426. #else
  427. static inline void prcmu_early_init(u32 phy_base, u32 size) {}
  428. static inline int prcmu_set_power_state(u8 state, bool keep_ulp_clk,
  429. bool keep_ap_pll)
  430. {
  431. return 0;
  432. }
  433. static inline int prcmu_set_epod(u16 epod_id, u8 epod_state)
  434. {
  435. return 0;
  436. }
  437. static inline void prcmu_enable_wakeups(u32 wakeups) {}
  438. static inline void prcmu_disable_wakeups(void) {}
  439. static inline int prcmu_abb_read(u8 slave, u8 reg, u8 *value, u8 size)
  440. {
  441. return -ENOSYS;
  442. }
  443. static inline int prcmu_abb_write(u8 slave, u8 reg, u8 *value, u8 size)
  444. {
  445. return -ENOSYS;
  446. }
  447. static inline int prcmu_abb_write_masked(u8 slave, u8 reg, u8 *value, u8 *mask,
  448. u8 size)
  449. {
  450. return -ENOSYS;
  451. }
  452. static inline int prcmu_config_clkout(u8 clkout, u8 source, u8 div)
  453. {
  454. return 0;
  455. }
  456. static inline int prcmu_request_clock(u8 clock, bool enable)
  457. {
  458. return 0;
  459. }
  460. static inline long prcmu_round_clock_rate(u8 clock, unsigned long rate)
  461. {
  462. return 0;
  463. }
  464. static inline int prcmu_set_clock_rate(u8 clock, unsigned long rate)
  465. {
  466. return 0;
  467. }
  468. static inline unsigned long prcmu_clock_rate(u8 clock)
  469. {
  470. return 0;
  471. }
  472. static inline int prcmu_set_ape_opp(u8 opp)
  473. {
  474. return 0;
  475. }
  476. static inline int prcmu_get_ape_opp(void)
  477. {
  478. return APE_100_OPP;
  479. }
  480. static inline int prcmu_request_ape_opp_100_voltage(bool enable)
  481. {
  482. return 0;
  483. }
  484. static inline int prcmu_set_arm_opp(u8 opp)
  485. {
  486. return 0;
  487. }
  488. static inline int prcmu_get_arm_opp(void)
  489. {
  490. return ARM_100_OPP;
  491. }
  492. static inline int prcmu_set_ddr_opp(u8 opp)
  493. {
  494. return 0;
  495. }
  496. static inline int prcmu_get_ddr_opp(void)
  497. {
  498. return DDR_100_OPP;
  499. }
  500. static inline void prcmu_system_reset(u16 reset_code) {}
  501. static inline u16 prcmu_get_reset_code(void)
  502. {
  503. return 0;
  504. }
  505. static inline int prcmu_ac_wake_req(void)
  506. {
  507. return 0;
  508. }
  509. static inline void prcmu_ac_sleep_req(void) {}
  510. static inline void prcmu_modem_reset(void) {}
  511. static inline bool prcmu_is_ac_wake_requested(void)
  512. {
  513. return false;
  514. }
  515. static inline int prcmu_set_display_clocks(void)
  516. {
  517. return 0;
  518. }
  519. static inline int prcmu_disable_dsipll(void)
  520. {
  521. return 0;
  522. }
  523. static inline int prcmu_enable_dsipll(void)
  524. {
  525. return 0;
  526. }
  527. static inline int prcmu_config_esram0_deep_sleep(u8 state)
  528. {
  529. return 0;
  530. }
  531. static inline void prcmu_config_abb_event_readout(u32 abb_events) {}
  532. static inline void prcmu_get_abb_event_buffer(void __iomem **buf)
  533. {
  534. *buf = NULL;
  535. }
  536. static inline int prcmu_config_hotdog(u8 threshold)
  537. {
  538. return 0;
  539. }
  540. static inline int prcmu_config_hotmon(u8 low, u8 high)
  541. {
  542. return 0;
  543. }
  544. static inline int prcmu_start_temp_sense(u16 cycles32k)
  545. {
  546. return 0;
  547. }
  548. static inline int prcmu_stop_temp_sense(void)
  549. {
  550. return 0;
  551. }
  552. static inline u32 prcmu_read(unsigned int reg)
  553. {
  554. return 0;
  555. }
  556. static inline void prcmu_write(unsigned int reg, u32 value) {}
  557. static inline void prcmu_write_masked(unsigned int reg, u32 mask, u32 value) {}
  558. #endif
  559. static inline void prcmu_set(unsigned int reg, u32 bits)
  560. {
  561. prcmu_write_masked(reg, bits, bits);
  562. }
  563. static inline void prcmu_clear(unsigned int reg, u32 bits)
  564. {
  565. prcmu_write_masked(reg, bits, 0);
  566. }
  567. /* PRCMU QoS APE OPP class */
  568. #define PRCMU_QOS_APE_OPP 1
  569. #define PRCMU_QOS_DDR_OPP 2
  570. #define PRCMU_QOS_ARM_OPP 3
  571. #define PRCMU_QOS_DEFAULT_VALUE -1
  572. #ifdef CONFIG_DBX500_PRCMU_QOS_POWER
  573. unsigned long prcmu_qos_get_cpufreq_opp_delay(void);
  574. void prcmu_qos_set_cpufreq_opp_delay(unsigned long);
  575. void prcmu_qos_force_opp(int, s32);
  576. int prcmu_qos_requirement(int pm_qos_class);
  577. int prcmu_qos_add_requirement(int pm_qos_class, char *name, s32 value);
  578. int prcmu_qos_update_requirement(int pm_qos_class, char *name, s32 new_value);
  579. void prcmu_qos_remove_requirement(int pm_qos_class, char *name);
  580. int prcmu_qos_add_notifier(int prcmu_qos_class,
  581. struct notifier_block *notifier);
  582. int prcmu_qos_remove_notifier(int prcmu_qos_class,
  583. struct notifier_block *notifier);
  584. #else
  585. static inline unsigned long prcmu_qos_get_cpufreq_opp_delay(void)
  586. {
  587. return 0;
  588. }
  589. static inline void prcmu_qos_set_cpufreq_opp_delay(unsigned long n) {}
  590. static inline void prcmu_qos_force_opp(int prcmu_qos_class, s32 i) {}
  591. static inline int prcmu_qos_requirement(int prcmu_qos_class)
  592. {
  593. return 0;
  594. }
  595. static inline int prcmu_qos_add_requirement(int prcmu_qos_class,
  596. char *name, s32 value)
  597. {
  598. return 0;
  599. }
  600. static inline int prcmu_qos_update_requirement(int prcmu_qos_class,
  601. char *name, s32 new_value)
  602. {
  603. return 0;
  604. }
  605. static inline void prcmu_qos_remove_requirement(int prcmu_qos_class, char *name)
  606. {
  607. }
  608. static inline int prcmu_qos_add_notifier(int prcmu_qos_class,
  609. struct notifier_block *notifier)
  610. {
  611. return 0;
  612. }
  613. static inline int prcmu_qos_remove_notifier(int prcmu_qos_class,
  614. struct notifier_block *notifier)
  615. {
  616. return 0;
  617. }
  618. #endif
  619. #endif /* __MACH_PRCMU_H */