blob: f9ccfee9637076eab3ff2378beeeb6f3e8189f34 [file] [log] [blame]
Duy Truong790f06d2013-02-13 16:38:12 -08001/* Copyright (c) 2010-2012, The Linux Foundation. All rights reserved.
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -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#ifndef __MACH_MSM_XO_H
13#define __MACH_MSM_XO_H
14
15enum 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 Huntsman3f2bc4d2011-08-16 17:27:22 -070022 NUM_MSM_XO_IDS
23};
24
25enum 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
32struct msm_xo_voter;
33
34#ifdef CONFIG_MSM_XO
35struct msm_xo_voter *msm_xo_get(enum msm_xo_ids xo_id, const char *voter);
36void msm_xo_put(struct msm_xo_voter *xo_voter);
37int msm_xo_mode_vote(struct msm_xo_voter *xo_voter, enum msm_xo_modes xo_mode);
38int __init msm_xo_init(void);
39#else
40static inline struct msm_xo_voter *msm_xo_get(enum msm_xo_ids xo_id,
41 const char *voter)
42{
43 return NULL;
44}
45
46static inline void msm_xo_put(struct msm_xo_voter *xo_voter) { }
47
48static inline int msm_xo_mode_vote(struct msm_xo_voter *xo_voter,
49 enum msm_xo_modes xo_mode)
50{
51 return 0;
52}
53static inline int msm_xo_init(void) { return 0; }
54#endif /* CONFIG_MSM_XO */
55
56#endif