max9611 222 drivers/iio/adc/max9611.c static int max9611_read_single(struct max9611_dev *max9611, max9611 235 drivers/iio/adc/max9611.c mutex_lock(&max9611->lock); max9611 236 drivers/iio/adc/max9611.c ret = i2c_smbus_write_byte_data(max9611->i2c_client, max9611 239 drivers/iio/adc/max9611.c dev_err(max9611->dev, "i2c write byte failed: 0x%2x - 0x%2x\n", max9611 241 drivers/iio/adc/max9611.c mutex_unlock(&max9611->lock); max9611 249 drivers/iio/adc/max9611.c ret = i2c_smbus_read_word_swapped(max9611->i2c_client, reg_addr); max9611 251 drivers/iio/adc/max9611.c dev_err(max9611->dev, "i2c read word from 0x%2x failed\n", max9611 253 drivers/iio/adc/max9611.c mutex_unlock(&max9611->lock); max9611 258 drivers/iio/adc/max9611.c mutex_unlock(&max9611->lock); max9611 275 drivers/iio/adc/max9611.c static int max9611_read_csa_voltage(struct max9611_dev *max9611, max9611 288 drivers/iio/adc/max9611.c ret = max9611_read_single(max9611, gain_selectors[i], adc_raw); max9611 439 drivers/iio/adc/max9611.c struct max9611_dev *max9611 = iio_priv(dev_to_iio_dev(dev)); max9611 442 drivers/iio/adc/max9611.c i = max9611->shunt_resistor_uohm / 1000000; max9611 443 drivers/iio/adc/max9611.c r = max9611->shunt_resistor_uohm % 1000000; max9611 468 drivers/iio/adc/max9611.c static int max9611_init(struct max9611_dev *max9611) max9611 470 drivers/iio/adc/max9611.c struct i2c_client *client = max9611->i2c_client; max9611 477 drivers/iio/adc/max9611.c dev_err(max9611->dev, max9611 483 drivers/iio/adc/max9611.c ret = max9611_read_single(max9611, CONF_TEMP, ®val); max9611 492 drivers/iio/adc/max9611.c dev_err(max9611->dev, max9611 499 drivers/iio/adc/max9611.c ret = i2c_smbus_write_byte_data(max9611->i2c_client, max9611 502 drivers/iio/adc/max9611.c dev_err(max9611->dev, "i2c write byte failed: 0x%2x - 0x%2x\n", max9611 507 drivers/iio/adc/max9611.c ret = i2c_smbus_write_byte_data(max9611->i2c_client, max9611 510 drivers/iio/adc/max9611.c dev_err(max9611->dev, "i2c write byte failed: 0x%2x - 0x%2x\n", max9611 533 drivers/iio/adc/max9611.c struct max9611_dev *max9611; max9611 538 drivers/iio/adc/max9611.c indio_dev = devm_iio_device_alloc(&client->dev, sizeof(*max9611)); max9611 544 drivers/iio/adc/max9611.c max9611 = iio_priv(indio_dev); max9611 545 drivers/iio/adc/max9611.c max9611->dev = &client->dev; max9611 546 drivers/iio/adc/max9611.c max9611->i2c_client = client; max9611 547 drivers/iio/adc/max9611.c mutex_init(&max9611->lock); max9611 556 drivers/iio/adc/max9611.c max9611->shunt_resistor_uohm = of_shunt; max9611 558 drivers/iio/adc/max9611.c ret = max9611_init(max9611);