blob: b784531bf2a8cf9f36c407d4a1187017030efa60 [file] [log] [blame]
Abhijeet Dharmapurikare8f83852013-02-06 18:57:17 -08001/* Copyright (c) 2012-2013, The Linux Foundation. All rights reserved.
Abhijeet Dharmapurikar00269e52012-05-14 17:59:10 -07002 *
3 * This program is free software; you can redistribute it and/or modify
4 * it under the terms of the GNU General Public License version 2 and
5 * only version 2 as published by the Free Software Foundation.
6 *
7 * This program is distributed in the hope that it will be useful,
8 * but WITHOUT ANY WARRANTY; without even the implied warranty of
9 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10 * GNU General Public License for more details.
11 */
12
13#ifndef __KRAIT_REGULATOR_H__
14#define __KRAIT_REGULATOR_H__
15
Abhijeet Dharmapurikar46a7ad32013-02-23 12:50:19 -080016#define KRAIT_REGULATOR_DRIVER_NAME "krait-power-regulator"
17#define KRAIT_PDN_DRIVER_NAME "krait-pdn"
Abhijeet Dharmapurikar00269e52012-05-14 17:59:10 -070018
19/**
20 * krait_power_init - driver initialization function
21 *
22 * This function registers the krait-power-regulator platform driver. This
23 * should be called from appropriate initialization code. Returns 0 on
24 * success and error on failure.
25 */
Syed Rameez Mustafa2b519202012-12-13 14:41:44 -080026
27#ifdef CONFIG_ARCH_MSM8974
Abhijeet Dharmapurikar00269e52012-05-14 17:59:10 -070028int __init krait_power_init(void);
Abhijeet Dharmapurikare8571ef2012-08-14 20:44:58 -070029void secondary_cpu_hs_init(void *base_ptr);
Abhijeet Dharmapurikare8f83852013-02-06 18:57:17 -080030
31/**
32 * krait_power_mdd_enable - function to turn on/off MDD. Turning off MDD
33 * turns off badngap reference for LDO. If
34 * a core is running on a LDO, requests to
35 * turn off MDD will not be honoured
36 * @on: boolean to indicate whether to turn MDD on/off
37 *
38 * CONTEXT: Can be called in interrupt context, only when the core
39 * is about to go to idle, this guarantees that there are no
40 * frequency changes on that cpu happening. Note if going from off
41 * to on mode there will be settling delays
42 *
43 * RETURNS: -EINVAL if MDD cannot be turned off
44 */
45int krait_power_mdd_enable(int cpu_num, bool on);
Syed Rameez Mustafa2b519202012-12-13 14:41:44 -080046#else
47static inline int __init krait_power_init(void)
48{
49 return -ENOSYS;
50}
51
52static inline void secondary_cpu_hs_init(void *base_ptr) {}
Abhijeet Dharmapurikare8f83852013-02-06 18:57:17 -080053static inline int krait_power_mdd_enable(int cpu_num, bool on)
54{
55 return -EINVAL;
56}
Syed Rameez Mustafa2b519202012-12-13 14:41:44 -080057#endif
Abhijeet Dharmapurikar00269e52012-05-14 17:59:10 -070058
59#endif