#include <linux/module.h>
#include <linux/of_device.h>
static int ms5611_i2c_reset(struct device *dev)
struct ms5611_state *st = iio_priv(dev_to_iio_dev(dev));
return i2c_smbus_write_byte(st->client, MS5611_RESET);
static int ms5611_i2c_read_prom_word(struct device *dev, int index, u16 *word)
struct ms5611_state *st = iio_priv(dev_to_iio_dev(dev));
ret = i2c_smbus_read_word_swapped(st->client,
MS5611_READ_PROM_WORD + (index << 1));
static int ms5611_i2c_read_adc(struct ms5611_state *st, s32 *val)
ret = i2c_smbus_read_i2c_block_data(st->client, MS5611_READ_ADC,
*val = (buf[0] << 16) | (buf[1] << 8) | buf[2];
static int ms5611_i2c_read_adc_temp_and_pressure(struct device *dev,
s32 *temp, s32 *pressure)
struct ms5611_state *st = iio_priv(dev_to_iio_dev(dev));
const struct ms5611_osr *osr = st->temp_osr;