Lines Matching +full:ultra +full:- +full:low +full:- +full:power

1 // SPDX-License-Identifier: GPL-2.0-only
4 * Dual, Ultra-Low-Power 10-Bit, Voltage-Output DACs
74 return MAX5522_REG_DATA(chan->channel); in max5522_info_to_reg()
86 *val = state->dac_cache[chan->channel]; in max5522_read_raw()
89 ret = regulator_get_voltage(state->vrefin_reg); in max5522_read_raw()
91 return -EINVAL; in max5522_read_raw()
96 return -EINVAL; in max5522_read_raw()
99 return -EINVAL; in max5522_read_raw()
110 return -EINVAL; in max5522_write_raw()
112 rval = regmap_write(state->regmap, max5522_info_to_reg(chan), in max5522_write_raw()
113 val << chan->scan_type.shift); in max5522_write_raw()
117 state->dac_cache[chan->channel] = val; in max5522_write_raw()
139 indio_dev = devm_iio_device_alloc(&spi->dev, sizeof(*state)); in max5522_spi_probe()
141 dev_err(&spi->dev, "failed to allocate iio device\n"); in max5522_spi_probe()
142 return -ENOMEM; in max5522_spi_probe()
146 state->chip_info = spi_get_device_match_data(spi); in max5522_spi_probe()
147 if (!state->chip_info) in max5522_spi_probe()
148 return -EINVAL; in max5522_spi_probe()
150 state->vrefin_reg = devm_regulator_get(&spi->dev, "vrefin"); in max5522_spi_probe()
151 if (IS_ERR(state->vrefin_reg)) in max5522_spi_probe()
152 return dev_err_probe(&spi->dev, PTR_ERR(state->vrefin_reg), in max5522_spi_probe()
155 ret = regulator_enable(state->vrefin_reg); in max5522_spi_probe()
157 return dev_err_probe(&spi->dev, ret, in max5522_spi_probe()
161 state->regmap = devm_regmap_init_spi(spi, &max5522_regmap_config); in max5522_spi_probe()
163 if (IS_ERR(state->regmap)) in max5522_spi_probe()
164 return PTR_ERR(state->regmap); in max5522_spi_probe()
166 indio_dev->info = &max5522_info; in max5522_spi_probe()
167 indio_dev->modes = INDIO_DIRECT_MODE; in max5522_spi_probe()
168 indio_dev->channels = max5522_channels; in max5522_spi_probe()
169 indio_dev->num_channels = ARRAY_SIZE(max5522_channels); in max5522_spi_probe()
170 indio_dev->name = max5522_chip_info_tbl[ID_MAX5522].name; in max5522_spi_probe()
172 return devm_iio_device_register(&spi->dev, indio_dev); in max5522_spi_probe()