#include <linux/bitfield.h>
#include <linux/cleanup.h>
#include <linux/delay.h>
#include <linux/device.h>
#include <linux/log2.h>
#include <linux/module.h>
#include <linux/regmap.h>
#include <linux/iio/iio.h>
#include <linux/iio/sysfs.h>
#include <linux/unaligned.h>
#include "bme680.h"
enum { … };
enum { … };
enum { … };
struct bme680_calib { … };
struct bme680_data { … };
static const struct regmap_range bme680_volatile_ranges[] = …;
static const struct regmap_access_table bme680_volatile_table = …;
const struct regmap_config bme680_regmap_config = …;
EXPORT_SYMBOL_NS(…);
static const struct iio_chan_spec bme680_channels[] = …;
static int bme680_read_calib(struct bme680_data *data,
struct bme680_calib *calib)
{ … }
static int bme680_read_temp_adc(struct bme680_data *data, u32 *adc_temp)
{ … }
static s32 bme680_calc_t_fine(struct bme680_data *data, u32 adc_temp)
{ … }
static int bme680_get_t_fine(struct bme680_data *data, s32 *t_fine)
{ … }
static s16 bme680_compensate_temp(struct bme680_data *data,
u32 adc_temp)
{ … }
static int bme680_read_press_adc(struct bme680_data *data, u32 *adc_press)
{ … }
static u32 bme680_compensate_press(struct bme680_data *data,
u32 adc_press, s32 t_fine)
{ … }
static int bme680_read_humid_adc(struct bme680_data *data, u32 *adc_humidity)
{ … }
static u32 bme680_compensate_humid(struct bme680_data *data,
u16 adc_humid, s32 t_fine)
{ … }
static u32 bme680_compensate_gas(struct bme680_data *data, u16 gas_res_adc,
u8 gas_range)
{ … }
static u8 bme680_calc_heater_res(struct bme680_data *data, u16 temp)
{ … }
static u8 bme680_calc_heater_dur(u16 dur)
{ … }
static int bme680_set_mode(struct bme680_data *data, bool mode)
{ … }
static u8 bme680_oversampling_to_reg(u8 val)
{ … }
static int bme680_wait_for_eoc(struct bme680_data *data)
{ … }
static int bme680_chip_config(struct bme680_data *data)
{ … }
static int bme680_gas_config(struct bme680_data *data)
{ … }
static int bme680_read_temp(struct bme680_data *data, int *val)
{ … }
static int bme680_read_press(struct bme680_data *data,
int *val, int *val2)
{ … }
static int bme680_read_humid(struct bme680_data *data,
int *val, int *val2)
{ … }
static int bme680_read_gas(struct bme680_data *data,
int *val)
{ … }
static int bme680_read_raw(struct iio_dev *indio_dev,
struct iio_chan_spec const *chan,
int *val, int *val2, long mask)
{ … }
static bool bme680_is_valid_oversampling(int rate)
{ … }
static int bme680_write_raw(struct iio_dev *indio_dev,
struct iio_chan_spec const *chan,
int val, int val2, long mask)
{ … }
static const char bme680_oversampling_ratio_show[] = …;
static IIO_CONST_ATTR(oversampling_ratio_available,
bme680_oversampling_ratio_show);
static struct attribute *bme680_attributes[] = …;
static const struct attribute_group bme680_attribute_group = …;
static const struct iio_info bme680_info = …;
int bme680_core_probe(struct device *dev, struct regmap *regmap,
const char *name)
{ … }
EXPORT_SYMBOL_NS_GPL(…);
MODULE_AUTHOR(…) …;
MODULE_DESCRIPTION(…) …;
MODULE_LICENSE(…) …;