From 49a1fd68dbbfc4832d738ae62a0e37f290d32374 Mon Sep 17 00:00:00 2001 From: Subbaraman Narayanamurthy Date: Tue, 24 Nov 2020 12:45:12 -0800 Subject: [PATCH] iio: adc: qcom-spmi-adc5: add an unique irq name Currently, interrupts of qcom-spmi-adc5 driver are registered with name "pm-adc5". However on platforms with multiple PMICs that can have different ADC types (adc5 or adc7), this naming is not user friendly when looking at interrupt data. Add a name that looks unique for different adc types so that they can be interpreted easily. Change-Id: Iac1080dc8e02d278b30cff0d61eca40e081bc306 Signed-off-by: Subbaraman Narayanamurthy [quic_subbaram@quicinc.com: Fixed merge conflicts in qcom-vadc-common.h due to location change] Signed-off-by: Subbaraman Narayanamurthy --- drivers/iio/adc/qcom-spmi-adc5.c | 11 ++++++++++- include/linux/iio/adc/qcom-vadc-common.h | 1 + 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/drivers/iio/adc/qcom-spmi-adc5.c b/drivers/iio/adc/qcom-spmi-adc5.c index 7941d6804b7f..571a13fe1baf 100644 --- a/drivers/iio/adc/qcom-spmi-adc5.c +++ b/drivers/iio/adc/qcom-spmi-adc5.c @@ -818,6 +818,7 @@ static int adc5_get_dt_channel_data(struct adc5_chip *adc, } static const struct adc5_data adc5_data_pmic = { + .name = "pm-adc5", .full_scale_code_volt = 0x70e4, .full_scale_code_cur = 0x2710, .adc_chans = adc5_chans_pmic, @@ -833,6 +834,7 @@ static const struct adc5_data adc5_data_pmic = { }; static const struct adc5_data adc7_data_pmic = { + .name = "pm-adc7", .full_scale_code_volt = 0x70e4, .adc_chans = adc7_chans_pmic, .info = &adc7_info, @@ -845,6 +847,7 @@ static const struct adc5_data adc7_data_pmic = { }; static const struct adc5_data adc5_data_pmic5_lite = { + .name = "pm-adc5-lite", .full_scale_code_volt = 0x70e4, /* On PMI632, IBAT LSB = 5A/32767 */ .full_scale_code_cur = 5000, @@ -855,6 +858,7 @@ static const struct adc5_data adc5_data_pmic5_lite = { }; static const struct adc5_data adc5_data_pmic_rev2 = { + .name = "pm-adc4-rev2", .full_scale_code_volt = 0x4000, .full_scale_code_cur = 0x1800, .adc_chans = adc5_chans_rev2, @@ -952,6 +956,7 @@ static int adc5_probe(struct platform_device *pdev) struct iio_dev *indio_dev; struct adc5_chip *adc; struct regmap *regmap; + const char *irq_name; int ret, irq_eoc; u32 reg; @@ -987,8 +992,12 @@ static int adc5_probe(struct platform_device *pdev) return irq_eoc; adc->poll_eoc = true; } else { + irq_name = "pm-adc5"; + if (adc->data->name) + irq_name = adc->data->name; + ret = devm_request_irq(dev, irq_eoc, adc5_isr, 0, - "pm-adc5", adc); + irq_name, adc); if (ret) return ret; } diff --git a/include/linux/iio/adc/qcom-vadc-common.h b/include/linux/iio/adc/qcom-vadc-common.h index 55a17d81a83c..c58870892a30 100644 --- a/include/linux/iio/adc/qcom-vadc-common.h +++ b/include/linux/iio/adc/qcom-vadc-common.h @@ -162,6 +162,7 @@ enum vadc_scale_fn_type { }; struct adc5_data { + const char *name; const u32 full_scale_code_volt; const u32 full_scale_code_cur; const struct adc5_channels *adc_chans;