Lines Matching defs:max9611

3  * iio/adc/max9611.c
5 * Maxim max9611/max9612 high side current sense amplifier with
14 * Maxim max9611/max9612.
28 #define DRIVER_NAME "max9611"
30 /* max9611 register addresses */
37 /* max9611 REG1 mux configuration options */
45 /* max9611 voltage (both csa and input) helper macros */
50 * max9611 current sense amplifier voltage output:
70 * max9611 common input mode (CIM): LSB is 14mV, with 14mV offset at 25 C
79 * max9611 temperature reading: LSB is 480 milli degrees Celsius
205 * @max9611: max9611 device
209 static int max9611_read_single(struct max9611_dev *max9611,
222 mutex_lock(&max9611->lock);
223 ret = i2c_smbus_write_byte_data(max9611->i2c_client,
226 dev_err(max9611->dev, "i2c write byte failed: 0x%2x - 0x%2x\n",
228 mutex_unlock(&max9611->lock);
236 ret = i2c_smbus_read_word_swapped(max9611->i2c_client, reg_addr);
238 dev_err(max9611->dev, "i2c read word from 0x%2x failed\n",
240 mutex_unlock(&max9611->lock);
245 mutex_unlock(&max9611->lock);
258 * @max9611: max9611 device
262 static int max9611_read_csa_voltage(struct max9611_dev *max9611,
275 ret = max9611_read_single(max9611, gain_selectors[i], adc_raw);
353 * Even if max9611 can output raw csa voltage readings,
426 struct max9611_dev *max9611 = iio_priv(dev_to_iio_dev(dev));
429 i = max9611->shunt_resistor_uohm / 1000000;
430 r = max9611->shunt_resistor_uohm % 1000000;
455 static int max9611_init(struct max9611_dev *max9611)
457 struct i2c_client *client = max9611->i2c_client;
464 dev_err(max9611->dev,
470 ret = max9611_read_single(max9611, CONF_TEMP, &regval);
479 dev_err(max9611->dev,
486 ret = i2c_smbus_write_byte_data(max9611->i2c_client,
489 dev_err(max9611->dev, "i2c write byte failed: 0x%2x - 0x%2x\n",
494 ret = i2c_smbus_write_byte_data(max9611->i2c_client,
497 dev_err(max9611->dev, "i2c write byte failed: 0x%2x - 0x%2x\n",
507 {.compatible = "maxim,max9611", .data = "max9611"},
516 struct max9611_dev *max9611;
522 indio_dev = devm_iio_device_alloc(&client->dev, sizeof(*max9611));
528 max9611 = iio_priv(indio_dev);
529 max9611->dev = dev;
530 max9611->i2c_client = client;
531 mutex_init(&max9611->lock);
539 max9611->shunt_resistor_uohm = of_shunt;
541 ret = max9611_init(max9611);
564 MODULE_DESCRIPTION("Maxim max9611/12 current sense amplifier with 12bit ADC");