aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/mfd/mc13783.h
diff options
context:
space:
mode:
authorUwe Kleine-König <u.kleine-koenig@pengutronix.de>2011-08-24 09:28:21 -0400
committerSamuel Ortiz <sameo@linux.intel.com>2011-10-24 08:09:12 -0400
commitfec316d63219f610e5385f5e54e6c3ea459e58e9 (patch)
treec3eb2e6352ccad730f93335edee789c58203b003 /include/linux/mfd/mc13783.h
parentf3ca07824f309474b308d859c9a2cc871c6c5ab8 (diff)
mfd: Provide a generic version of mc13xxx adc_do_conversion
This is needed to convert the touch driver away from using struct mc13783. Note this patch drops MC13783_ADC0_ADREFMODE. This is unused and doesn't exist on mc13892. Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
Diffstat (limited to 'include/linux/mfd/mc13783.h')
-rw-r--r--include/linux/mfd/mc13783.h35
1 files changed, 18 insertions, 17 deletions
diff --git a/include/linux/mfd/mc13783.h b/include/linux/mfd/mc13783.h
index 7d0f3d6a0002..e7a3c0169f63 100644
--- a/include/linux/mfd/mc13783.h
+++ b/include/linux/mfd/mc13783.h
@@ -89,18 +89,15 @@ static inline int mc13783_irq_ack(struct mc13783 *mc13783, int irq)
89 return mc13xxx_irq_ack(mc13783_to_mc13xxx(mc13783), irq); 89 return mc13xxx_irq_ack(mc13783_to_mc13xxx(mc13783), irq);
90} 90}
91 91
92#define MC13783_ADC0 43 92#define MC13783_ADC0 MC13XXX_ADC0
93#define MC13783_ADC0_ADREFEN (1 << 10) 93#define MC13783_ADC0_ADREFEN MC13XXX_ADC0_ADREFEN
94#define MC13783_ADC0_ADREFMODE (1 << 11) 94#define MC13783_ADC0_TSMOD0 MC13XXX_ADC0_TSMOD0
95#define MC13783_ADC0_TSMOD0 (1 << 12) 95#define MC13783_ADC0_TSMOD1 MC13XXX_ADC0_TSMOD1
96#define MC13783_ADC0_TSMOD1 (1 << 13) 96#define MC13783_ADC0_TSMOD2 MC13XXX_ADC0_TSMOD2
97#define MC13783_ADC0_TSMOD2 (1 << 14) 97#define MC13783_ADC0_ADINC1 MC13XXX_ADC0_ADINC1
98#define MC13783_ADC0_ADINC1 (1 << 16) 98#define MC13783_ADC0_ADINC2 MC13XXX_ADC0_ADINC2
99#define MC13783_ADC0_ADINC2 (1 << 17) 99
100 100#define MC13783_ADC0_TSMOD_MASK MC13XXX_ADC0_TSMOD_MASK
101#define MC13783_ADC0_TSMOD_MASK (MC13783_ADC0_TSMOD0 | \
102 MC13783_ADC0_TSMOD1 | \
103 MC13783_ADC0_TSMOD2)
104 101
105#define mc13783_regulator_init_data mc13xxx_regulator_init_data 102#define mc13783_regulator_init_data mc13xxx_regulator_init_data
106#define mc13783_regulator_platform_data mc13xxx_regulator_platform_data 103#define mc13783_regulator_platform_data mc13xxx_regulator_platform_data
@@ -115,12 +112,16 @@ static inline int mc13783_irq_ack(struct mc13783 *mc13783, int irq)
115#define MC13783_USE_REGULATOR MC13XXX_USE_REGULATOR 112#define MC13783_USE_REGULATOR MC13XXX_USE_REGULATOR
116#define MC13783_USE_LED MC13XXX_USE_LED 113#define MC13783_USE_LED MC13XXX_USE_LED
117 114
118#define MC13783_ADC_MODE_TS 1 115#define MC13783_ADC_MODE_TS MC13XXX_ADC_MODE_TS
119#define MC13783_ADC_MODE_SINGLE_CHAN 2 116#define MC13783_ADC_MODE_SINGLE_CHAN MC13XXX_ADC_MODE_SINGLE_CHAN
120#define MC13783_ADC_MODE_MULT_CHAN 3 117#define MC13783_ADC_MODE_MULT_CHAN MC13XXX_ADC_MODE_MULT_CHAN
121 118
122int mc13783_adc_do_conversion(struct mc13783 *mc13783, unsigned int mode, 119static inline int mc13783_adc_do_conversion(struct mc13783 *mc13783,
123 unsigned int channel, unsigned int *sample); 120 unsigned int mode, unsigned int channel, unsigned int *sample)
121{
122 return mc13xxx_adc_do_conversion(mc13783_to_mc13xxx(mc13783), mode,
123 channel, sample);
124}
124 125
125 126
126#define MC13783_REG_SW1A 0 127#define MC13783_REG_SW1A 0