#define pr_fmt(fmt) …
#include <linux/bitops.h>
#include <linux/bitfield.h>
#include <linux/cleanup.h>
#include <linux/completion.h>
#include <linux/delay.h>
#include <linux/device.h>
#include <linux/gpio/consumer.h>
#include <linux/interrupt.h>
#include <linux/irq.h>
#include <linux/module.h>
#include <linux/nvmem-provider.h>
#include <linux/pm_runtime.h>
#include <linux/random.h>
#include <linux/regmap.h>
#include <linux/regulator/consumer.h>
#include <linux/iio/buffer.h>
#include <linux/iio/iio.h>
#include <linux/iio/trigger_consumer.h>
#include <linux/iio/triggered_buffer.h>
#include <linux/unaligned.h>
#include "bmp280.h"
enum { … };
enum bmp380_odr { … };
enum bmp580_odr { … };
enum { … };
enum { … };
enum bmp280_scan { … };
static const struct iio_chan_spec bmp280_channels[] = …;
static const struct iio_chan_spec bme280_channels[] = …;
static const struct iio_chan_spec bmp380_channels[] = …;
static const struct iio_chan_spec bmp580_channels[] = …;
static int bmp280_read_calib(struct bmp280_data *data)
{ … }
static int bme280_read_calib(struct bmp280_data *data)
{ … }
static int bme280_read_humid_adc(struct bmp280_data *data, u16 *adc_humidity)
{ … }
static u32 bme280_compensate_humidity(struct bmp280_data *data,
u16 adc_humidity, s32 t_fine)
{ … }
static int bmp280_read_temp_adc(struct bmp280_data *data, u32 *adc_temp)
{ … }
static s32 bmp280_calc_t_fine(struct bmp280_data *data, u32 adc_temp)
{ … }
static int bmp280_get_t_fine(struct bmp280_data *data, s32 *t_fine)
{ … }
static s32 bmp280_compensate_temp(struct bmp280_data *data, u32 adc_temp)
{ … }
static int bmp280_read_press_adc(struct bmp280_data *data, u32 *adc_press)
{ … }
static u32 bmp280_compensate_press(struct bmp280_data *data,
u32 adc_press, s32 t_fine)
{ … }
static int bmp280_read_temp(struct bmp280_data *data, s32 *comp_temp)
{ … }
static int bmp280_read_press(struct bmp280_data *data, u32 *comp_press)
{ … }
static int bme280_read_humid(struct bmp280_data *data, u32 *comp_humidity)
{ … }
static int bmp280_read_raw_impl(struct iio_dev *indio_dev,
struct iio_chan_spec const *chan,
int *val, int *val2, long mask)
{ … }
static int bmp280_read_raw(struct iio_dev *indio_dev,
struct iio_chan_spec const *chan,
int *val, int *val2, long mask)
{ … }
static int bme280_write_oversampling_ratio_humid(struct bmp280_data *data,
int val)
{ … }
static int bmp280_write_oversampling_ratio_temp(struct bmp280_data *data,
int val)
{ … }
static int bmp280_write_oversampling_ratio_press(struct bmp280_data *data,
int val)
{ … }
static int bmp280_write_sampling_frequency(struct bmp280_data *data,
int val, int val2)
{ … }
static int bmp280_write_iir_filter_coeffs(struct bmp280_data *data, int val)
{ … }
static int bmp280_write_raw_impl(struct iio_dev *indio_dev,
struct iio_chan_spec const *chan,
int val, int val2, long mask)
{ … }
static int bmp280_write_raw(struct iio_dev *indio_dev,
struct iio_chan_spec const *chan,
int val, int val2, long mask)
{ … }
static int bmp280_read_avail(struct iio_dev *indio_dev,
struct iio_chan_spec const *chan,
const int **vals, int *type, int *length,
long mask)
{ … }
static const struct iio_info bmp280_info = …;
static const unsigned long bmp280_avail_scan_masks[] = …;
static const unsigned long bme280_avail_scan_masks[] = …;
static int bmp280_chip_config(struct bmp280_data *data)
{ … }
static irqreturn_t bmp280_trigger_handler(int irq, void *p)
{ … }
static const int bmp280_oversampling_avail[] = …;
static const u8 bmp280_chip_ids[] = …;
static const int bmp280_temp_coeffs[] = …;
static const int bmp280_press_coeffs[] = …;
const struct bmp280_chip_info bmp280_chip_info = …;
EXPORT_SYMBOL_NS(…);
static int bme280_chip_config(struct bmp280_data *data)
{ … }
static irqreturn_t bme280_trigger_handler(int irq, void *p)
{ … }
static const u8 bme280_chip_ids[] = …;
static const int bme280_humid_coeffs[] = …;
const struct bmp280_chip_info bme280_chip_info = …;
EXPORT_SYMBOL_NS(…);
static int bmp380_cmd(struct bmp280_data *data, u8 cmd)
{ … }
static int bmp380_read_temp_adc(struct bmp280_data *data, u32 *adc_temp)
{ … }
static s32 bmp380_calc_t_fine(struct bmp280_data *data, u32 adc_temp)
{ … }
static int bmp380_get_t_fine(struct bmp280_data *data, s32 *t_fine)
{ … }
static int bmp380_compensate_temp(struct bmp280_data *data, u32 adc_temp)
{ … }
static int bmp380_read_press_adc(struct bmp280_data *data, u32 *adc_press)
{ … }
static u32 bmp380_compensate_press(struct bmp280_data *data,
u32 adc_press, s32 t_fine)
{ … }
static int bmp380_read_temp(struct bmp280_data *data, s32 *comp_temp)
{ … }
static int bmp380_read_press(struct bmp280_data *data, u32 *comp_press)
{ … }
static int bmp380_read_calib(struct bmp280_data *data)
{ … }
static const int bmp380_odr_table[][2] = …;
static int bmp380_preinit(struct bmp280_data *data)
{ … }
static int bmp380_chip_config(struct bmp280_data *data)
{ … }
static irqreturn_t bmp380_trigger_handler(int irq, void *p)
{ … }
static const int bmp380_oversampling_avail[] = …;
static const int bmp380_iir_filter_coeffs_avail[] = …;
static const u8 bmp380_chip_ids[] = …;
static const int bmp380_temp_coeffs[] = …;
static const int bmp380_press_coeffs[] = …;
const struct bmp280_chip_info bmp380_chip_info = …;
EXPORT_SYMBOL_NS(…);
static int bmp580_soft_reset(struct bmp280_data *data)
{ … }
static int bmp580_nvm_operation(struct bmp280_data *data, bool is_write)
{ … }
static int bmp580_read_temp(struct bmp280_data *data, s32 *raw_temp)
{ … }
static int bmp580_read_press(struct bmp280_data *data, u32 *raw_press)
{ … }
static const int bmp580_odr_table[][2] = …;
static const int bmp580_nvmem_addrs[] = …;
static int bmp580_nvmem_read_impl(void *priv, unsigned int offset, void *val,
size_t bytes)
{ … }
static int bmp580_nvmem_read(void *priv, unsigned int offset, void *val,
size_t bytes)
{ … }
static int bmp580_nvmem_write_impl(void *priv, unsigned int offset, void *val,
size_t bytes)
{ … }
static int bmp580_nvmem_write(void *priv, unsigned int offset, void *val,
size_t bytes)
{ … }
static int bmp580_preinit(struct bmp280_data *data)
{ … }
static int bmp580_chip_config(struct bmp280_data *data)
{ … }
static irqreturn_t bmp580_trigger_handler(int irq, void *p)
{ … }
static const int bmp580_oversampling_avail[] = …;
static const u8 bmp580_chip_ids[] = …;
static const int bmp580_temp_coeffs[] = …;
static const int bmp580_press_coeffs[] = …;
const struct bmp280_chip_info bmp580_chip_info = …;
EXPORT_SYMBOL_NS(…);
static int bmp180_wait_for_eoc(struct bmp280_data *data, u8 ctrl_meas)
{ … }
static int bmp180_read_temp_adc(struct bmp280_data *data, u32 *adc_temp)
{ … }
static int bmp180_read_calib(struct bmp280_data *data)
{ … }
static s32 bmp180_calc_t_fine(struct bmp280_data *data, u32 adc_temp)
{ … }
static int bmp180_get_t_fine(struct bmp280_data *data, s32 *t_fine)
{ … }
static s32 bmp180_compensate_temp(struct bmp280_data *data, u32 adc_temp)
{ … }
static int bmp180_read_temp(struct bmp280_data *data, s32 *comp_temp)
{ … }
static int bmp180_read_press_adc(struct bmp280_data *data, u32 *adc_press)
{ … }
static u32 bmp180_compensate_press(struct bmp280_data *data, u32 adc_press,
s32 t_fine)
{ … }
static int bmp180_read_press(struct bmp280_data *data, u32 *comp_press)
{ … }
static int bmp180_chip_config(struct bmp280_data *data)
{ … }
static irqreturn_t bmp180_trigger_handler(int irq, void *p)
{ … }
static const int bmp180_oversampling_temp_avail[] = …;
static const int bmp180_oversampling_press_avail[] = …;
static const u8 bmp180_chip_ids[] = …;
static const int bmp180_temp_coeffs[] = …;
static const int bmp180_press_coeffs[] = …;
const struct bmp280_chip_info bmp180_chip_info = …;
EXPORT_SYMBOL_NS(…);
static irqreturn_t bmp085_eoc_irq(int irq, void *d)
{ … }
static int bmp085_fetch_eoc_irq(struct device *dev,
const char *name,
int irq,
struct bmp280_data *data)
{ … }
static int bmp280_buffer_preenable(struct iio_dev *indio_dev)
{ … }
static int bmp280_buffer_postdisable(struct iio_dev *indio_dev)
{ … }
static const struct iio_buffer_setup_ops bmp280_buffer_setup_ops = …;
static void bmp280_pm_disable(void *data)
{ … }
static void bmp280_regulators_disable(void *data)
{ … }
int bmp280_common_probe(struct device *dev,
struct regmap *regmap,
const struct bmp280_chip_info *chip_info,
const char *name,
int irq)
{ … }
EXPORT_SYMBOL_NS(…);
static int bmp280_runtime_suspend(struct device *dev)
{ … }
static int bmp280_runtime_resume(struct device *dev)
{ … }
EXPORT_RUNTIME_DEV_PM_OPS(…);
MODULE_AUTHOR(…) …;
MODULE_DESCRIPTION(…) …;
MODULE_LICENSE(…) …;