aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/power
diff options
context:
space:
mode:
authorKim, Milo <Milo.Kim@ti.com>2012-10-18 02:11:33 -0400
committerAnton Vorontsov <anton.vorontsov@linaro.org>2012-11-17 23:40:59 -0500
commit968a47836c7f9dc6a3987f846bb7e095d30b86ec (patch)
treea3e03713a028f786974a01d9ca8aa038b92b25bc /drivers/power
parent952aeeb3ee28bc12a70744e40636de40688eb60d (diff)
lp8788-charger: Use consumer device name on setting IIO channels
To get the ADC value for the battery voltage and temperature, LP8788 ADC driver is used. LP8788 charger driver is the consumer of LP8788 ADC driver. Thus, specific ADC driver name is required on getting the channel using iio_channel_get(). Signed-off-by: Milo(Woogyom) Kim <milo.kim@ti.com> Acked-by: Jonathan Cameron <jic23@kernel.org> Signed-off-by: Anton Vorontsov <anton.vorontsov@linaro.org>
Diffstat (limited to 'drivers/power')
-rw-r--r--drivers/power/lp8788-charger.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/drivers/power/lp8788-charger.c b/drivers/power/lp8788-charger.c
index e852d12cd077..614e6aafc513 100644
--- a/drivers/power/lp8788-charger.c
+++ b/drivers/power/lp8788-charger.c
@@ -592,7 +592,8 @@ static void lp8788_irq_unregister(struct platform_device *pdev,
592 } 592 }
593} 593}
594 594
595static void lp8788_setup_adc_channel(struct lp8788_charger *pchg) 595static void lp8788_setup_adc_channel(const char *consumer_name,
596 struct lp8788_charger *pchg)
596{ 597{
597 struct lp8788_charger_platform_data *pdata = pchg->pdata; 598 struct lp8788_charger_platform_data *pdata = pchg->pdata;
598 struct device *dev = pchg->lp->dev; 599 struct device *dev = pchg->lp->dev;
@@ -616,7 +617,7 @@ static void lp8788_setup_adc_channel(struct lp8788_charger *pchg)
616 case LPADC_VBATT_5P5: 617 case LPADC_VBATT_5P5:
617 case LPADC_VBATT_6P0: 618 case LPADC_VBATT_6P0:
618 case LPADC_VBATT_5P0: 619 case LPADC_VBATT_5P0:
619 chan = iio_channel_get(NULL, chan_name[id]); 620 chan = iio_channel_get(consumer_name, chan_name[id]);
620 pchg->chan[LP8788_VBATT] = IS_ERR(chan) ? NULL : chan; 621 pchg->chan[LP8788_VBATT] = IS_ERR(chan) ? NULL : chan;
621 break; 622 break;
622 default: 623 default:
@@ -631,7 +632,7 @@ static void lp8788_setup_adc_channel(struct lp8788_charger *pchg)
631 case LPADC_ADC2: 632 case LPADC_ADC2:
632 case LPADC_ADC3: 633 case LPADC_ADC3:
633 case LPADC_ADC4: 634 case LPADC_ADC4:
634 chan = iio_channel_get(NULL, chan_name[id]); 635 chan = iio_channel_get(consumer_name, chan_name[id]);
635 pchg->chan[LP8788_BATT_TEMP] = IS_ERR(chan) ? NULL : chan; 636 pchg->chan[LP8788_BATT_TEMP] = IS_ERR(chan) ? NULL : chan;
636 break; 637 break;
637 default: 638 default:
@@ -747,7 +748,7 @@ static __devinit int lp8788_charger_probe(struct platform_device *pdev)
747 if (ret) 748 if (ret)
748 return ret; 749 return ret;
749 750
750 lp8788_setup_adc_channel(pchg); 751 lp8788_setup_adc_channel(pdev->name, pchg);
751 752
752 ret = lp8788_psy_register(pdev, pchg); 753 ret = lp8788_psy_register(pdev, pchg);
753 if (ret) 754 if (ret)