USB: audio: guard kernel-only code with __KERNEL__
[safe/jmp/linux-2.6] / include / linux / mfd / mc13783.h
1 /*
2  * Copyright 2009 Pengutronix, Sascha Hauer <s.hauer@pengutronix.de>
3  *
4  * Initial development of this code was funded by
5  * Phytec Messtechnik GmbH, http://www.phytec.de
6  *
7  * This program is free software; you can redistribute it and/or modify
8  * it under the terms of the GNU General Public License as published by
9  * the Free Software Foundation; either version 2 of the License, or
10  * (at your option) any later version.
11  *
12  * This program is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15  * GNU General Public License for more details.
16  *
17  * You should have received a copy of the GNU General Public License
18  * along with this program; if not, write to the Free Software
19  * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
20  */
21
22 #ifndef __INCLUDE_LINUX_MFD_MC13783_H
23 #define __INCLUDE_LINUX_MFD_MC13783_H
24
25 struct mc13783;
26 struct regulator_init_data;
27
28 struct mc13783_regulator_init_data {
29         int id;
30         struct regulator_init_data *init_data;
31 };
32
33 struct mc13783_platform_data {
34         struct mc13783_regulator_init_data *regulators;
35         int num_regulators;
36         unsigned int flags;
37 };
38
39 /* mc13783_platform_data flags */
40 #define MC13783_USE_TOUCHSCREEN (1 << 0)
41 #define MC13783_USE_CODEC       (1 << 1)
42 #define MC13783_USE_ADC         (1 << 2)
43 #define MC13783_USE_RTC         (1 << 3)
44 #define MC13783_USE_REGULATOR   (1 << 4)
45
46 int mc13783_adc_do_conversion(struct mc13783 *mc13783, unsigned int mode,
47                 unsigned int channel, unsigned int *sample);
48
49 void mc13783_adc_set_ts_status(struct mc13783 *mc13783, unsigned int status);
50
51 #define MC13783_SW_SW1A         0
52 #define MC13783_SW_SW1B         1
53 #define MC13783_SW_SW2A         2
54 #define MC13783_SW_SW2B         3
55 #define MC13783_SW_SW3          4
56 #define MC13783_SW_PLL          5
57 #define MC13783_REGU_VAUDIO     6
58 #define MC13783_REGU_VIOHI      7
59 #define MC13783_REGU_VIOLO      8
60 #define MC13783_REGU_VDIG       9
61 #define MC13783_REGU_VGEN       10
62 #define MC13783_REGU_VRFDIG     11
63 #define MC13783_REGU_VRFREF     12
64 #define MC13783_REGU_VRFCP      13
65 #define MC13783_REGU_VSIM       14
66 #define MC13783_REGU_VESIM      15
67 #define MC13783_REGU_VCAM       16
68 #define MC13783_REGU_VRFBG      17
69 #define MC13783_REGU_VVIB       18
70 #define MC13783_REGU_VRF1       19
71 #define MC13783_REGU_VRF2       20
72 #define MC13783_REGU_VMMC1      21
73 #define MC13783_REGU_VMMC2      22
74 #define MC13783_REGU_GPO1       23
75 #define MC13783_REGU_GPO2       24
76 #define MC13783_REGU_GPO3       25
77 #define MC13783_REGU_GPO4       26
78 #define MC13783_REGU_V1         27
79 #define MC13783_REGU_V2         28
80 #define MC13783_REGU_V3         29
81 #define MC13783_REGU_V4         30
82
83 #endif /* __INCLUDE_LINUX_MFD_MC13783_H */
84