mirror of https://gitee.com/openkylin/linux.git
iio: adc: Add info property under adc_data
Add info property under adc_data to support adding ADC variants which may use different iio_info than the one defined for PMIC5. Signed-off-by: Jishnu Prakash <jprakash@codeaurora.org> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
This commit is contained in:
parent
d1492bbd47
commit
572e76e381
|
@ -629,6 +629,7 @@ static const struct adc5_data adc5_data_pmic = {
|
|||
.full_scale_code_volt = 0x70e4,
|
||||
.full_scale_code_cur = 0x2710,
|
||||
.adc_chans = adc5_chans_pmic,
|
||||
.info = &adc5_info,
|
||||
.decimation = (unsigned int [ADC5_DECIMATION_SAMPLES_MAX])
|
||||
{250, 420, 840},
|
||||
.hw_settle_1 = (unsigned int [VADC_HW_SETTLE_SAMPLES_MAX])
|
||||
|
@ -643,6 +644,7 @@ static const struct adc5_data adc5_data_pmic_rev2 = {
|
|||
.full_scale_code_volt = 0x4000,
|
||||
.full_scale_code_cur = 0x1800,
|
||||
.adc_chans = adc5_chans_rev2,
|
||||
.info = &adc5_info,
|
||||
.decimation = (unsigned int [ADC5_DECIMATION_SAMPLES_MAX])
|
||||
{256, 512, 1024},
|
||||
.hw_settle_1 = (unsigned int [VADC_HW_SETTLE_SAMPLES_MAX])
|
||||
|
@ -777,7 +779,7 @@ static int adc5_probe(struct platform_device *pdev)
|
|||
indio_dev->dev.of_node = node;
|
||||
indio_dev->name = pdev->name;
|
||||
indio_dev->modes = INDIO_DIRECT_MODE;
|
||||
indio_dev->info = &adc5_info;
|
||||
indio_dev->info = adc->data->info;
|
||||
indio_dev->channels = adc->iio_chans;
|
||||
indio_dev->num_channels = adc->nchannels;
|
||||
|
||||
|
|
|
@ -136,6 +136,7 @@ struct adc5_data {
|
|||
const u32 full_scale_code_volt;
|
||||
const u32 full_scale_code_cur;
|
||||
const struct adc5_channels *adc_chans;
|
||||
const struct iio_info *info;
|
||||
unsigned int *decimation;
|
||||
unsigned int *hw_settle_1;
|
||||
unsigned int *hw_settle_2;
|
||||
|
|
Loading…
Reference in New Issue