Duy Truong | 790f06d | 2013-02-13 16:38:12 -0800 | [diff] [blame] | 1 | /* Copyright (c) 2010-2012, The Linux Foundation. All rights reserved. |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -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 | #ifndef __MACH_MSM_XO_H |
| 13 | #define __MACH_MSM_XO_H |
| 14 | |
| 15 | enum msm_xo_ids { |
| 16 | MSM_XO_TCXO_D0, |
| 17 | MSM_XO_TCXO_D1, |
| 18 | MSM_XO_TCXO_A0, |
| 19 | MSM_XO_TCXO_A1, |
| 20 | MSM_XO_TCXO_A2, |
| 21 | MSM_XO_CORE, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 22 | NUM_MSM_XO_IDS |
| 23 | }; |
| 24 | |
| 25 | enum msm_xo_modes { |
| 26 | MSM_XO_MODE_OFF, |
| 27 | MSM_XO_MODE_PIN_CTRL, |
| 28 | MSM_XO_MODE_ON, |
| 29 | NUM_MSM_XO_MODES |
| 30 | }; |
| 31 | |
| 32 | struct msm_xo_voter; |
| 33 | |
| 34 | #ifdef CONFIG_MSM_XO |
| 35 | struct msm_xo_voter *msm_xo_get(enum msm_xo_ids xo_id, const char *voter); |
| 36 | void msm_xo_put(struct msm_xo_voter *xo_voter); |
| 37 | int msm_xo_mode_vote(struct msm_xo_voter *xo_voter, enum msm_xo_modes xo_mode); |
| 38 | int __init msm_xo_init(void); |
| 39 | #else |
| 40 | static inline struct msm_xo_voter *msm_xo_get(enum msm_xo_ids xo_id, |
| 41 | const char *voter) |
| 42 | { |
| 43 | return NULL; |
| 44 | } |
| 45 | |
| 46 | static inline void msm_xo_put(struct msm_xo_voter *xo_voter) { } |
| 47 | |
| 48 | static inline int msm_xo_mode_vote(struct msm_xo_voter *xo_voter, |
| 49 | enum msm_xo_modes xo_mode) |
| 50 | { |
| 51 | return 0; |
| 52 | } |
| 53 | static inline int msm_xo_init(void) { return 0; } |
| 54 | #endif /* CONFIG_MSM_XO */ |
| 55 | |
| 56 | #endif |