diff options
author | Uwe Kleine-König <u.kleine-koenig@pengutronix.de> | 2011-08-24 13:28:21 (GMT) |
---|---|---|
committer | Samuel Ortiz <sameo@linux.intel.com> | 2011-10-24 12:09:12 (GMT) |
commit | fec316d63219f610e5385f5e54e6c3ea459e58e9 (patch) | |
tree | c3eb2e6352ccad730f93335edee789c58203b003 /include/linux/mfd/mc13xxx.h | |
parent | f3ca07824f309474b308d859c9a2cc871c6c5ab8 (diff) | |
download | linux-fsl-qoriq-fec316d63219f610e5385f5e54e6c3ea459e58e9.tar.xz |
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/mc13xxx.h')
-rw-r--r-- | include/linux/mfd/mc13xxx.h | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/include/linux/mfd/mc13xxx.h b/include/linux/mfd/mc13xxx.h index c064bea..6e7c0ac 100644 --- a/include/linux/mfd/mc13xxx.h +++ b/include/linux/mfd/mc13xxx.h @@ -37,6 +37,9 @@ int mc13xxx_irq_ack(struct mc13xxx *mc13xxx, int irq); int mc13xxx_get_flags(struct mc13xxx *mc13xxx); +int mc13xxx_adc_do_conversion(struct mc13xxx *mc13xxx, + unsigned int mode, unsigned int channel, unsigned int *sample); + #define MC13XXX_IRQ_ADCDONE 0 #define MC13XXX_IRQ_ADCBISDONE 1 #define MC13XXX_IRQ_TS 2 @@ -150,4 +153,20 @@ struct mc13xxx_platform_data { struct mc13xxx_leds_platform_data *leds; }; +#define MC13XXX_ADC_MODE_TS 1 +#define MC13XXX_ADC_MODE_SINGLE_CHAN 2 +#define MC13XXX_ADC_MODE_MULT_CHAN 3 + +#define MC13XXX_ADC0 43 +#define MC13XXX_ADC0_ADREFEN (1 << 10) +#define MC13XXX_ADC0_TSMOD0 (1 << 12) +#define MC13XXX_ADC0_TSMOD1 (1 << 13) +#define MC13XXX_ADC0_TSMOD2 (1 << 14) +#define MC13XXX_ADC0_ADINC1 (1 << 16) +#define MC13XXX_ADC0_ADINC2 (1 << 17) + +#define MC13XXX_ADC0_TSMOD_MASK (MC13XXX_ADC0_TSMOD0 | \ + MC13XXX_ADC0_TSMOD1 | \ + MC13XXX_ADC0_TSMOD2) + #endif /* ifndef __LINUX_MFD_MC13XXX_H */ |