mc13783: rename mc13783_{{un,}mask,ack_irq} to have a mc13783_irq prefix
[linux-2.6/linux-acpi-2.6/ibm-acpi-2.6.git] / include / linux / mfd / mc13783.h
blobb8b9f3b4f3e2f0adb650582b560618897e845a14
1 /*
2 * Copyright 2009 Pengutronix
3 * Uwe Kleine-Koenig <u.kleine-koenig@pengutronix.de>
5 * This program is free software; you can redistribute it and/or modify it under
6 * the terms of the GNU General Public License version 2 as published by the
7 * Free Software Foundation.
8 */
9 #ifndef __LINUX_MFD_MC13783_H
10 #define __LINUX_MFD_MC13783_H
12 #include <linux/interrupt.h>
14 struct mc13783;
16 void mc13783_lock(struct mc13783 *mc13783);
17 void mc13783_unlock(struct mc13783 *mc13783);
19 int mc13783_reg_read(struct mc13783 *mc13783, unsigned int offset, u32 *val);
20 int mc13783_reg_write(struct mc13783 *mc13783, unsigned int offset, u32 val);
21 int mc13783_reg_rmw(struct mc13783 *mc13783, unsigned int offset,
22 u32 mask, u32 val);
24 int mc13783_irq_request(struct mc13783 *mc13783, int irq,
25 irq_handler_t handler, const char *name, void *dev);
26 int mc13783_irq_request_nounmask(struct mc13783 *mc13783, int irq,
27 irq_handler_t handler, const char *name, void *dev);
28 int mc13783_irq_free(struct mc13783 *mc13783, int irq, void *dev);
30 int mc13783_irq_mask(struct mc13783 *mc13783, int irq);
31 int mc13783_irq_unmask(struct mc13783 *mc13783, int irq);
32 int mc13783_irq_ack(struct mc13783 *mc13783, int irq);
34 static inline int mc13783_mask(struct mc13783 *mc13783, int irq) __deprecated;
35 static inline int mc13783_mask(struct mc13783 *mc13783, int irq)
37 return mc13783_irq_mask(mc13783, irq);
40 static inline int mc13783_unmask(struct mc13783 *mc13783, int irq) __deprecated;
41 static inline int mc13783_unmask(struct mc13783 *mc13783, int irq)
43 return mc13783_irq_unmask(mc13783, irq);
46 static inline int mc13783_ackirq(struct mc13783 *mc13783, int irq) __deprecated;
47 static inline int mc13783_ackirq(struct mc13783 *mc13783, int irq)
49 return mc13783_irq_ack(mc13783, irq);
52 #define MC13783_ADC0 43
53 #define MC13783_ADC0_ADREFEN (1 << 10)
54 #define MC13783_ADC0_ADREFMODE (1 << 11)
55 #define MC13783_ADC0_TSMOD0 (1 << 12)
56 #define MC13783_ADC0_TSMOD1 (1 << 13)
57 #define MC13783_ADC0_TSMOD2 (1 << 14)
58 #define MC13783_ADC0_ADINC1 (1 << 16)
59 #define MC13783_ADC0_ADINC2 (1 << 17)
61 #define MC13783_ADC0_TSMOD_MASK (MC13783_ADC0_TSMOD0 | \
62 MC13783_ADC0_TSMOD1 | \
63 MC13783_ADC0_TSMOD2)
65 /* to be cleaned up */
66 struct regulator_init_data;
68 struct mc13783_regulator_init_data {
69 int id;
70 struct regulator_init_data *init_data;
73 struct mc13783_regulator_platform_data {
74 int num_regulators;
75 struct mc13783_regulator_init_data *regulators;
78 struct mc13783_platform_data {
79 int num_regulators;
80 struct mc13783_regulator_init_data *regulators;
82 #define MC13783_USE_TOUCHSCREEN (1 << 0)
83 #define MC13783_USE_CODEC (1 << 1)
84 #define MC13783_USE_ADC (1 << 2)
85 #define MC13783_USE_RTC (1 << 3)
86 #define MC13783_USE_REGULATOR (1 << 4)
87 unsigned int flags;
90 #define MC13783_ADC_MODE_TS 1
91 #define MC13783_ADC_MODE_SINGLE_CHAN 2
92 #define MC13783_ADC_MODE_MULT_CHAN 3
94 int mc13783_adc_do_conversion(struct mc13783 *mc13783, unsigned int mode,
95 unsigned int channel, unsigned int *sample);
98 #define MC13783_SW_SW1A 0
99 #define MC13783_SW_SW1B 1
100 #define MC13783_SW_SW2A 2
101 #define MC13783_SW_SW2B 3
102 #define MC13783_SW_SW3 4
103 #define MC13783_SW_PLL 5
104 #define MC13783_REGU_VAUDIO 6
105 #define MC13783_REGU_VIOHI 7
106 #define MC13783_REGU_VIOLO 8
107 #define MC13783_REGU_VDIG 9
108 #define MC13783_REGU_VGEN 10
109 #define MC13783_REGU_VRFDIG 11
110 #define MC13783_REGU_VRFREF 12
111 #define MC13783_REGU_VRFCP 13
112 #define MC13783_REGU_VSIM 14
113 #define MC13783_REGU_VESIM 15
114 #define MC13783_REGU_VCAM 16
115 #define MC13783_REGU_VRFBG 17
116 #define MC13783_REGU_VVIB 18
117 #define MC13783_REGU_VRF1 19
118 #define MC13783_REGU_VRF2 20
119 #define MC13783_REGU_VMMC1 21
120 #define MC13783_REGU_VMMC2 22
121 #define MC13783_REGU_GPO1 23
122 #define MC13783_REGU_GPO2 24
123 #define MC13783_REGU_GPO3 25
124 #define MC13783_REGU_GPO4 26
125 #define MC13783_REGU_V1 27
126 #define MC13783_REGU_V2 28
127 #define MC13783_REGU_V3 29
128 #define MC13783_REGU_V4 30
129 #define MC13783_REGU_PWGT1SPI 31
130 #define MC13783_REGU_PWGT2SPI 32
132 #define MC13783_IRQ_ADCDONE 0
133 #define MC13783_IRQ_ADCBISDONE 1
134 #define MC13783_IRQ_TS 2
135 #define MC13783_IRQ_WHIGH 3
136 #define MC13783_IRQ_WLOW 4
137 #define MC13783_IRQ_CHGDET 6
138 #define MC13783_IRQ_CHGOV 7
139 #define MC13783_IRQ_CHGREV 8
140 #define MC13783_IRQ_CHGSHORT 9
141 #define MC13783_IRQ_CCCV 10
142 #define MC13783_IRQ_CHGCURR 11
143 #define MC13783_IRQ_BPON 12
144 #define MC13783_IRQ_LOBATL 13
145 #define MC13783_IRQ_LOBATH 14
146 #define MC13783_IRQ_UDP 15
147 #define MC13783_IRQ_USB 16
148 #define MC13783_IRQ_ID 19
149 #define MC13783_IRQ_SE1 21
150 #define MC13783_IRQ_CKDET 22
151 #define MC13783_IRQ_UDM 23
152 #define MC13783_IRQ_1HZ 24
153 #define MC13783_IRQ_TODA 25
154 #define MC13783_IRQ_ONOFD1 27
155 #define MC13783_IRQ_ONOFD2 28
156 #define MC13783_IRQ_ONOFD3 29
157 #define MC13783_IRQ_SYSRST 30
158 #define MC13783_IRQ_RTCRST 31
159 #define MC13783_IRQ_PC 32
160 #define MC13783_IRQ_WARM 33
161 #define MC13783_IRQ_MEMHLD 34
162 #define MC13783_IRQ_PWRRDY 35
163 #define MC13783_IRQ_THWARNL 36
164 #define MC13783_IRQ_THWARNH 37
165 #define MC13783_IRQ_CLK 38
166 #define MC13783_IRQ_SEMAF 39
167 #define MC13783_IRQ_MC2B 41
168 #define MC13783_IRQ_HSDET 42
169 #define MC13783_IRQ_HSL 43
170 #define MC13783_IRQ_ALSPTH 44
171 #define MC13783_IRQ_AHSSHORT 45
172 #define MC13783_NUM_IRQ 46
174 #endif /* __LINUX_MFD_MC13783_H */