aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/mfd/88pm860x-core.c
diff options
context:
space:
mode:
authorHaojian Zhuang <haojian.zhuang@gmail.com>2012-09-21 06:06:53 -0400
committerSamuel Ortiz <sameo@linux.intel.com>2012-10-02 05:43:16 -0400
commitfe1d38e80d1497a2b64685dd2e7a6018dc79b408 (patch)
tree19205799f6b7da7ffc7731e403c6730409dce34c /drivers/mfd/88pm860x-core.c
parent2e57d56747e601b3e0ff6697e524025d0504d161 (diff)
mfd: 88pm860x: Move gpadc init into touch
The initilization of GPADC is moved from core driver to touch driver with DT support. Signed-off-by: Haojian Zhuang <haojian.zhuang@gmail.com> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
Diffstat (limited to 'drivers/mfd/88pm860x-core.c')
-rw-r--r--drivers/mfd/88pm860x-core.c51
1 files changed, 0 insertions, 51 deletions
diff --git a/drivers/mfd/88pm860x-core.c b/drivers/mfd/88pm860x-core.c
index fdaf6861ce95..59d117e9fa31 100644
--- a/drivers/mfd/88pm860x-core.c
+++ b/drivers/mfd/88pm860x-core.c
@@ -558,53 +558,6 @@ static struct irq_domain_ops pm860x_irq_domain_ops = {
558 .xlate = irq_domain_xlate_onetwocell, 558 .xlate = irq_domain_xlate_onetwocell,
559}; 559};
560 560
561static int __devinit device_gpadc_init(struct pm860x_chip *chip,
562 struct pm860x_platform_data *pdata)
563{
564 struct i2c_client *i2c = (chip->id == CHIP_PM8607) ? chip->client \
565 : chip->companion;
566 int data;
567 int ret;
568
569 /* initialize GPADC without activating it */
570
571 if (!pdata || !pdata->touch)
572 return -EINVAL;
573
574 /* set GPADC MISC1 register */
575 data = 0;
576 data |= (pdata->touch->gpadc_prebias << 1) & PM8607_GPADC_PREBIAS_MASK;
577 data |= (pdata->touch->slot_cycle << 3) & PM8607_GPADC_SLOT_CYCLE_MASK;
578 data |= (pdata->touch->off_scale << 5) & PM8607_GPADC_OFF_SCALE_MASK;
579 data |= (pdata->touch->sw_cal << 7) & PM8607_GPADC_SW_CAL_MASK;
580 if (data) {
581 ret = pm860x_reg_write(i2c, PM8607_GPADC_MISC1, data);
582 if (ret < 0)
583 goto out;
584 }
585 /* set tsi prebias time */
586 if (pdata->touch->tsi_prebias) {
587 data = pdata->touch->tsi_prebias;
588 ret = pm860x_reg_write(i2c, PM8607_TSI_PREBIAS, data);
589 if (ret < 0)
590 goto out;
591 }
592 /* set prebias & prechg time of pen detect */
593 data = 0;
594 data |= pdata->touch->pen_prebias & PM8607_PD_PREBIAS_MASK;
595 data |= (pdata->touch->pen_prechg << 5) & PM8607_PD_PRECHG_MASK;
596 if (data) {
597 ret = pm860x_reg_write(i2c, PM8607_PD_PREBIAS, data);
598 if (ret < 0)
599 goto out;
600 }
601
602 ret = pm860x_set_bits(i2c, PM8607_GPADC_MISC1,
603 PM8607_GPADC_EN, PM8607_GPADC_EN);
604out:
605 return ret;
606}
607
608static int __devinit device_irq_init(struct pm860x_chip *chip, 561static int __devinit device_irq_init(struct pm860x_chip *chip,
609 struct pm860x_platform_data *pdata) 562 struct pm860x_platform_data *pdata)
610{ 563{
@@ -1053,10 +1006,6 @@ static void __devinit device_8607_init(struct pm860x_chip *chip,
1053 goto out; 1006 goto out;
1054 } 1007 }
1055 1008
1056 ret = device_gpadc_init(chip, pdata);
1057 if (ret < 0)
1058 goto out;
1059
1060 ret = device_irq_init(chip, pdata); 1009 ret = device_irq_init(chip, pdata);
1061 if (ret < 0) 1010 if (ret < 0)
1062 goto out; 1011 goto out;