Commit cef49e5e authored by Linus Walleij's avatar Linus Walleij Committed by Jonathan Cameron
Browse files

iio: adc: ab8500-gpadc: Support non-hw-conversion



The hardware conversion mode only exists in the AB8500
version of the chip, as it is lacking in the AB8505 it
will not be in the device tree and we should just not
even try to obtain it.

The driver already contains code to avoid using a
non-existing hardware conversion IRQ at conversion time.

Signed-off-by: default avatarLinus Walleij <linus.walleij@linaro.org>
Link: https://lore.kernel.org/r/20201218222013.383704-1-linus.walleij@linaro.org


Signed-off-by: default avatarJonathan Cameron <Jonathan.Cameron@huawei.com>
parent 138daca3
Loading
Loading
Loading
Loading
+18 −12
Original line number Diff line number Diff line
@@ -1108,11 +1108,15 @@ static int ab8500_gpadc_probe(struct platform_device *pdev)
		return gpadc->irq_sw;
	}

	if (is_ab8500(gpadc->ab8500)) {
		gpadc->irq_hw = platform_get_irq_byname(pdev, "HW_CONV_END");
		if (gpadc->irq_hw < 0) {
			dev_err(dev, "failed to get platform hw_conv_end irq\n");
			return gpadc->irq_hw;
		}
	} else {
		gpadc->irq_hw = 0;
	}

	/* Initialize completion used to notify completion of conversion */
	init_completion(&gpadc->complete);
@@ -1128,6 +1132,7 @@ static int ab8500_gpadc_probe(struct platform_device *pdev)
		return ret;
	}

	if (gpadc->irq_hw) {
		ret = devm_request_threaded_irq(dev, gpadc->irq_hw, NULL,
			ab8500_bm_gpadcconvend_handler,	IRQF_NO_SUSPEND | IRQF_ONESHOT,
			"ab8500-gpadc-hw", gpadc);
@@ -1137,6 +1142,7 @@ static int ab8500_gpadc_probe(struct platform_device *pdev)
				gpadc->irq_hw);
			return ret;
		}
	}

	/* The VTVout LDO used to power the AB8500 GPADC */
	gpadc->vddadc = devm_regulator_get(dev, "vddadc");