hwmon: qpnp-adc: Request interrupt by name instead of number
Request the interrupt source by name instead of the number.
This is to make it more obvious what interrupt source is
being requested. There are multiple interrupts within the ADC
and requesting by name makes it know what interrupt is being
requested instead of using only an interrupt index. For normal
ADC operation the end of conversion interrupt is to
being requested here.
Change-Id: I2d24446daaba7f2d5a8f8a408ccfc6bd6bfcffa2
Signed-off-by: Siddartha Mohanadoss <smohanad@codeaurora.org>
diff --git a/drivers/hwmon/qpnp-adc-common.c b/drivers/hwmon/qpnp-adc-common.c
index e319813..6324c62 100644
--- a/drivers/hwmon/qpnp-adc-common.c
+++ b/drivers/hwmon/qpnp-adc-common.c
@@ -844,8 +844,9 @@
adc_qpnp->offset = res->start;
/* Register the ADC peripheral interrupt */
- adc_qpnp->adc_irq = spmi_get_irq(spmi, 0, 0);
- if (adc_qpnp->adc_irq < 0) {
+ adc_qpnp->adc_irq_eoc = spmi_get_irq_byname(spmi, NULL,
+ "eoc-int-en-set");
+ if (adc_qpnp->adc_irq_eoc < 0) {
pr_err("Invalid irq\n");
return -ENXIO;
}