* struct ad799x_chip_info - chip specifc information
* @channel: channel specification
* @num_channels: number of channels
- * @int_vref_mv: the internal reference voltage
* @monitor_mode: whether the chip supports monitor interrupts
* @default_config: device default configuration
* @event_attrs: pointer to the monitor event attribute group
struct ad799x_chip_info {
struct iio_chan_spec channel[9];
int num_channels;
- u16 int_vref_mv;
u16 default_config;
const struct iio_info *info;
};
[4] = IIO_CHAN_SOFT_TIMESTAMP(4),
},
.num_channels = 5,
- .int_vref_mv = 4096,
.info = &ad7991_info,
},
[ad7995] = {
[4] = IIO_CHAN_SOFT_TIMESTAMP(4),
},
.num_channels = 5,
- .int_vref_mv = 1024,
.info = &ad7991_info,
},
[ad7999] = {
[4] = IIO_CHAN_SOFT_TIMESTAMP(4),
},
.num_channels = 5,
- .int_vref_mv = 1024,
.info = &ad7991_info,
},
[ad7992] = {
[2] = IIO_CHAN_SOFT_TIMESTAMP(2),
},
.num_channels = 3,
- .int_vref_mv = 4096,
.default_config = AD7998_ALERT_EN,
.info = &ad7992_info,
},
[4] = IIO_CHAN_SOFT_TIMESTAMP(4),
},
.num_channels = 5,
- .int_vref_mv = 1024,
.default_config = AD7998_ALERT_EN,
.info = &ad7993_4_7_8_info,
},
[4] = IIO_CHAN_SOFT_TIMESTAMP(4),
},
.num_channels = 5,
- .int_vref_mv = 4096,
.default_config = AD7998_ALERT_EN,
.info = &ad7993_4_7_8_info,
},
[8] = IIO_CHAN_SOFT_TIMESTAMP(8),
},
.num_channels = 9,
- .int_vref_mv = 1024,
.default_config = AD7998_ALERT_EN,
.info = &ad7993_4_7_8_info,
},
[8] = IIO_CHAN_SOFT_TIMESTAMP(8),
},
.num_channels = 9,
- .int_vref_mv = 4096,
.default_config = AD7998_ALERT_EN,
.info = &ad7993_4_7_8_info,
},
/* TODO: Add pdata options for filtering and bit delay */
- if (pdata)
- st->int_vref_mv = pdata->vref_mv;
- else
- st->int_vref_mv = st->chip_info->int_vref_mv;
+ if (!pdata)
+ return -EINVAL;
+
+ st->int_vref_mv = pdata->vref_mv;
st->reg = regulator_get(&client->dev, "vcc");
if (!IS_ERR(st->reg)) {