Abhijeet Dharmapurikar | e8f8385 | 2013-02-06 18:57:17 -0800 | [diff] [blame] | 1 | /* Copyright (c) 2012-2013, The Linux Foundation. All rights reserved. |
Abhijeet Dharmapurikar | 00269e5 | 2012-05-14 17:59:10 -0700 | [diff] [blame] | 2 | * |
| 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 Dharmapurikar | 46a7ad3 | 2013-02-23 12:50:19 -0800 | [diff] [blame] | 16 | #define KRAIT_REGULATOR_DRIVER_NAME "krait-power-regulator" |
| 17 | #define KRAIT_PDN_DRIVER_NAME "krait-pdn" |
Abhijeet Dharmapurikar | 00269e5 | 2012-05-14 17:59:10 -0700 | [diff] [blame] | 18 | |
| 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 Mustafa | 2b51920 | 2012-12-13 14:41:44 -0800 | [diff] [blame] | 26 | |
| 27 | #ifdef CONFIG_ARCH_MSM8974 |
Abhijeet Dharmapurikar | 00269e5 | 2012-05-14 17:59:10 -0700 | [diff] [blame] | 28 | int __init krait_power_init(void); |
Abhijeet Dharmapurikar | e8571ef | 2012-08-14 20:44:58 -0700 | [diff] [blame] | 29 | void secondary_cpu_hs_init(void *base_ptr); |
Abhijeet Dharmapurikar | e8f8385 | 2013-02-06 18:57:17 -0800 | [diff] [blame] | 30 | |
| 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 | */ |
| 45 | int krait_power_mdd_enable(int cpu_num, bool on); |
Syed Rameez Mustafa | 2b51920 | 2012-12-13 14:41:44 -0800 | [diff] [blame] | 46 | #else |
| 47 | static inline int __init krait_power_init(void) |
| 48 | { |
| 49 | return -ENOSYS; |
| 50 | } |
| 51 | |
| 52 | static inline void secondary_cpu_hs_init(void *base_ptr) {} |
Abhijeet Dharmapurikar | e8f8385 | 2013-02-06 18:57:17 -0800 | [diff] [blame] | 53 | static inline int krait_power_mdd_enable(int cpu_num, bool on) |
| 54 | { |
| 55 | return -EINVAL; |
| 56 | } |
Syed Rameez Mustafa | 2b51920 | 2012-12-13 14:41:44 -0800 | [diff] [blame] | 57 | #endif |
Abhijeet Dharmapurikar | 00269e5 | 2012-05-14 17:59:10 -0700 | [diff] [blame] | 58 | |
| 59 | #endif |