mirror of
https://github.com/torvalds/linux.git
synced 2026-07-31 11:37:06 +02:00
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 <subbaram@codeaurora.org> [quic_subbaram@quicinc.com: Fixed merge conflicts in qcom-vadc-common.h due to location change] Signed-off-by: Subbaraman Narayanamurthy <quic_subbaram@quicinc.com>
This commit is contained in:
parent
6da5d51aa7
commit
49a1fd68db
|
|
@ -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;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user