Lines Matching full:ltc2309
3 * The LTC2309 is an 8-Channel, 12-Bit SAR ADC with an I2C Interface.
30 * struct ltc2309 - internal device data structure
36 struct ltc2309 { struct
102 static int ltc2309_read_raw_channel(struct ltc2309 *ltc2309, in ltc2309_read_raw_channel() argument
113 ret = i2c_smbus_write_byte(ltc2309->client, din); in ltc2309_read_raw_channel()
115 dev_err(ltc2309->dev, "i2c command failed: %pe\n", in ltc2309_read_raw_channel()
120 ret = i2c_master_recv(ltc2309->client, (char *)&buf, 2); in ltc2309_read_raw_channel()
122 dev_err(ltc2309->dev, "i2c read failed: %pe\n", ERR_PTR(ret)); in ltc2309_read_raw_channel()
135 struct ltc2309 *ltc2309 = iio_priv(indio_dev); in ltc2309_read_raw() local
140 mutex_lock(<c2309->lock); in ltc2309_read_raw()
141 ret = ltc2309_read_raw_channel(ltc2309, chan->address, val); in ltc2309_read_raw()
142 mutex_unlock(<c2309->lock); in ltc2309_read_raw()
147 *val = ltc2309->vref_mv; in ltc2309_read_raw()
162 struct ltc2309 *ltc2309; in ltc2309_probe() local
165 indio_dev = devm_iio_device_alloc(&client->dev, sizeof(*ltc2309)); in ltc2309_probe()
169 ltc2309 = iio_priv(indio_dev); in ltc2309_probe()
170 ltc2309->dev = &indio_dev->dev; in ltc2309_probe()
171 ltc2309->client = client; in ltc2309_probe()
173 indio_dev->name = "ltc2309"; in ltc2309_probe()
181 return dev_err_probe(ltc2309->dev, ret, in ltc2309_probe()
184 ltc2309->vref_mv = ret == -ENODEV ? LTC2309_INTERNAL_REF_MV : ret / 1000; in ltc2309_probe()
186 mutex_init(<c2309->lock); in ltc2309_probe()
192 { .compatible = "lltc,ltc2309" },
198 { "ltc2309" },
205 .name = "ltc2309",
214 MODULE_DESCRIPTION("Linear Technology LTC2309 ADC");