Lines Matching +full:end +full:- +full:of +full:- +full:conversion
1 // SPDX-License-Identifier: GPL-2.0-only
3 * ltc2497.c - Driver for Analog Devices/Linear Technology LTC2497 ADC
49 if (st->recv_size == 3) in ltc2497_result_and_measure()
50 ret = i2c_master_recv(st->client, (char *)&st->data.d8, in ltc2497_result_and_measure()
51 st->recv_size); in ltc2497_result_and_measure()
53 ret = i2c_master_recv(st->client, (char *)&st->data.d32, in ltc2497_result_and_measure()
54 st->recv_size); in ltc2497_result_and_measure()
56 dev_err(&st->client->dev, "i2c_master_recv failed\n"); in ltc2497_result_and_measure()
66 if (st->recv_size == 3) { in ltc2497_result_and_measure()
67 *val = (get_unaligned_be24(st->data.d8) >> 6) in ltc2497_result_and_measure()
68 - BIT(ddata->chip_info->resolution + 1); in ltc2497_result_and_measure()
70 *val = (be32_to_cpu(st->data.d32) >> 6) in ltc2497_result_and_measure()
71 - BIT(ddata->chip_info->resolution + 1); in ltc2497_result_and_measure()
75 * The part started a new conversion at the end of the above i2c in ltc2497_result_and_measure()
78 * If not (which should only happen when some sort of bulk in ltc2497_result_and_measure()
79 * conversion is implemented) we have to program the new in ltc2497_result_and_measure()
80 * address. Note that this probably fails as the conversion that in ltc2497_result_and_measure()
84 if (ddata->addr_prev == address) in ltc2497_result_and_measure()
88 ret = i2c_smbus_write_byte(st->client, in ltc2497_result_and_measure()
91 dev_err(&st->client->dev, "i2c transfer failed: %pe\n", in ltc2497_result_and_measure()
101 struct device *dev = &client->dev; in ltc2497_probe()
104 if (!i2c_check_functionality(client->adapter, I2C_FUNC_I2C | in ltc2497_probe()
106 return -EOPNOTSUPP; in ltc2497_probe()
110 return -ENOMEM; in ltc2497_probe()
114 st->client = client; in ltc2497_probe()
115 st->common_ddata.result_and_measure = ltc2497_result_and_measure; in ltc2497_probe()
118 st->common_ddata.chip_info = chip_info; in ltc2497_probe()
120 resolution = chip_info->resolution; in ltc2497_probe()
121 st->recv_size = BITS_TO_BYTES(resolution) + 1; in ltc2497_probe()
156 MODULE_DEVICE_TABLE(of, ltc2497_of_match);