aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/mfd/mc13xxx-core.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/mfd/mc13xxx-core.c')
-rw-r--r--drivers/mfd/mc13xxx-core.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/drivers/mfd/mc13xxx-core.c b/drivers/mfd/mc13xxx-core.c
index 7122386b4e3c..9fd4f63c45cc 100644
--- a/drivers/mfd/mc13xxx-core.c
+++ b/drivers/mfd/mc13xxx-core.c
@@ -560,6 +560,8 @@ EXPORT_SYMBOL(mc13xxx_get_flags);
560 560
561#define MC13XXX_ADC1_CHAN0_SHIFT 5 561#define MC13XXX_ADC1_CHAN0_SHIFT 5
562#define MC13XXX_ADC1_CHAN1_SHIFT 8 562#define MC13XXX_ADC1_CHAN1_SHIFT 8
563#define MC13783_ADC1_ATO_SHIFT 11
564#define MC13783_ADC1_ATOX (1 << 19)
563 565
564struct mc13xxx_adcdone_data { 566struct mc13xxx_adcdone_data {
565 struct mc13xxx *mc13xxx; 567 struct mc13xxx *mc13xxx;
@@ -580,7 +582,8 @@ static irqreturn_t mc13xxx_handler_adcdone(int irq, void *data)
580#define MC13XXX_ADC_WORKING (1 << 0) 582#define MC13XXX_ADC_WORKING (1 << 0)
581 583
582int mc13xxx_adc_do_conversion(struct mc13xxx *mc13xxx, unsigned int mode, 584int mc13xxx_adc_do_conversion(struct mc13xxx *mc13xxx, unsigned int mode,
583 unsigned int channel, unsigned int *sample) 585 unsigned int channel, u8 ato, bool atox,
586 unsigned int *sample)
584{ 587{
585 u32 adc0, adc1, old_adc0; 588 u32 adc0, adc1, old_adc0;
586 int i, ret; 589 int i, ret;
@@ -631,6 +634,9 @@ int mc13xxx_adc_do_conversion(struct mc13xxx *mc13xxx, unsigned int mode,
631 return -EINVAL; 634 return -EINVAL;
632 } 635 }
633 636
637 adc1 |= ato << MC13783_ADC1_ATO_SHIFT;
638 if (atox)
639 adc1 |= MC13783_ADC1_ATOX;
634 dev_dbg(&mc13xxx->spidev->dev, "%s: request irq\n", __func__); 640 dev_dbg(&mc13xxx->spidev->dev, "%s: request irq\n", __func__);
635 mc13xxx_irq_request(mc13xxx, MC13XXX_IRQ_ADCDONE, 641 mc13xxx_irq_request(mc13xxx, MC13XXX_IRQ_ADCDONE,
636 mc13xxx_handler_adcdone, __func__, &adcdone_data); 642 mc13xxx_handler_adcdone, __func__, &adcdone_data);
@@ -813,7 +819,8 @@ err_revision:
813 mc13xxx_add_subdevice(mc13xxx, "%s-rtc"); 819 mc13xxx_add_subdevice(mc13xxx, "%s-rtc");
814 820
815 if (mc13xxx->flags & MC13XXX_USE_TOUCHSCREEN) 821 if (mc13xxx->flags & MC13XXX_USE_TOUCHSCREEN)
816 mc13xxx_add_subdevice(mc13xxx, "%s-ts"); 822 mc13xxx_add_subdevice_pdata(mc13xxx, "%s-ts",
823 &pdata->touch, sizeof(pdata->touch));
817 824
818 if (pdata) { 825 if (pdata) {
819 mc13xxx_add_subdevice_pdata(mc13xxx, "%s-regulator", 826 mc13xxx_add_subdevice_pdata(mc13xxx, "%s-regulator",