di->parent = dev_get_drvdata(pdev->dev.parent);
/* Get ADC channels */
- di->adc_main_charger_v = devm_iio_channel_get(dev, "main_charger_v");
- if (IS_ERR(di->adc_main_charger_v)) {
- ret = dev_err_probe(dev, PTR_ERR(di->adc_main_charger_v),
- "failed to get ADC main charger voltage\n");
- return ret;
- }
- di->adc_main_charger_c = devm_iio_channel_get(dev, "main_charger_c");
- if (IS_ERR(di->adc_main_charger_c)) {
- ret = dev_err_probe(dev, PTR_ERR(di->adc_main_charger_c),
- "failed to get ADC main charger current\n");
- return ret;
+ if (!is_ab8505(di->parent)) {
+ di->adc_main_charger_v = devm_iio_channel_get(dev, "main_charger_v");
+ if (IS_ERR(di->adc_main_charger_v)) {
+ ret = dev_err_probe(dev, PTR_ERR(di->adc_main_charger_v),
+ "failed to get ADC main charger voltage\n");
+ return ret;
+ }
+ di->adc_main_charger_c = devm_iio_channel_get(dev, "main_charger_c");
+ if (IS_ERR(di->adc_main_charger_c)) {
+ ret = dev_err_probe(dev, PTR_ERR(di->adc_main_charger_c),
+ "failed to get ADC main charger current\n");
+ return ret;
+ }
}
di->adc_vbus_v = devm_iio_channel_get(dev, "vbus_v");
if (IS_ERR(di->adc_vbus_v)) {