Lines Matching +full:vref +full:- +full:mv

1 // SPDX-License-Identifier: GPL-2.0-or-later
3 * max517.c - Support for Maxim MAX517, MAX518 and MAX519
47 struct i2c_client *client = data->client; in max517_set_value()
52 return -EINVAL; in max517_set_value()
61 return -EIO; in max517_set_value()
76 /* Corresponds to Vref / 2^(bits) */ in max517_read_raw()
77 *val = data->vref_mv[chan->channel]; in max517_read_raw()
83 return -EINVAL; in max517_read_raw()
93 ret = max517_set_value(indio_dev, val, chan->channel); in max517_write_raw()
96 ret = -EINVAL; in max517_write_raw()
149 struct max517_platform_data *platform_data = client->dev.platform_data; in max517_probe()
152 indio_dev = devm_iio_device_alloc(&client->dev, sizeof(*data)); in max517_probe()
154 return -ENOMEM; in max517_probe()
156 data->client = client; in max517_probe()
158 switch (id->driver_data) { in max517_probe()
160 indio_dev->num_channels = 8; in max517_probe()
163 indio_dev->num_channels = 4; in max517_probe()
167 indio_dev->num_channels = 2; in max517_probe()
170 indio_dev->num_channels = 1; in max517_probe()
173 indio_dev->channels = max517_channels; in max517_probe()
174 indio_dev->modes = INDIO_DIRECT_MODE; in max517_probe()
175 indio_dev->info = &max517_info; in max517_probe()
181 for (chan = 0; chan < indio_dev->num_channels; chan++) { in max517_probe()
182 if (id->driver_data == ID_MAX518 || !platform_data) in max517_probe()
183 data->vref_mv[chan] = 5000; /* mV */ in max517_probe()
185 data->vref_mv[chan] = platform_data->vref_mv[chan]; in max517_probe()
188 return devm_iio_device_register(&client->dev, indio_dev); in max517_probe()
212 MODULE_DESCRIPTION("MAX517/518/519/520/521 8-bit DAC");