#include <linux/delay.h>
#include <linux/i2c.h>
#include <linux/interrupt.h>
#include <linux/mod_devicetable.h>
#include <linux/module.h>
#include <linux/property.h>
#include <linux/wait.h>
#include <linux/log2.h>
#include <linux/iio/iio.h>
#include <linux/iio/sysfs.h>
#define NAU7802_REG_PUCTRL …
#define NAU7802_PUCTRL_RR(x) …
#define NAU7802_PUCTRL_RR_BIT …
#define NAU7802_PUCTRL_PUD(x) …
#define NAU7802_PUCTRL_PUD_BIT …
#define NAU7802_PUCTRL_PUA(x) …
#define NAU7802_PUCTRL_PUA_BIT …
#define NAU7802_PUCTRL_PUR(x) …
#define NAU7802_PUCTRL_PUR_BIT …
#define NAU7802_PUCTRL_CS(x) …
#define NAU7802_PUCTRL_CS_BIT …
#define NAU7802_PUCTRL_CR(x) …
#define NAU7802_PUCTRL_CR_BIT …
#define NAU7802_PUCTRL_AVDDS(x) …
#define NAU7802_PUCTRL_AVDDS_BIT …
#define NAU7802_REG_CTRL1 …
#define NAU7802_CTRL1_VLDO(x) …
#define NAU7802_CTRL1_GAINS(x) …
#define NAU7802_CTRL1_GAINS_BITS …
#define NAU7802_REG_CTRL2 …
#define NAU7802_CTRL2_CHS(x) …
#define NAU7802_CTRL2_CRS(x) …
#define NAU7802_SAMP_FREQ_320 …
#define NAU7802_CTRL2_CHS_BIT …
#define NAU7802_REG_ADC_B2 …
#define NAU7802_REG_ADC_B1 …
#define NAU7802_REG_ADC_B0 …
#define NAU7802_REG_ADC_CTRL …
#define NAU7802_MIN_CONVERSIONS …
struct nau7802_state { … };
#define NAU7802_CHANNEL(chan) …
static const struct iio_chan_spec nau7802_chan_array[] = …;
static const u16 nau7802_sample_freq_avail[] = …;
static ssize_t nau7802_show_scales(struct device *dev,
struct device_attribute *attr, char *buf)
{ … }
static IIO_CONST_ATTR_SAMP_FREQ_AVAIL("10 40 80 320");
static IIO_DEVICE_ATTR(in_voltage_scale_available, S_IRUGO, nau7802_show_scales,
NULL, 0);
static struct attribute *nau7802_attributes[] = …;
static const struct attribute_group nau7802_attribute_group = …;
static int nau7802_set_gain(struct nau7802_state *st, int gain)
{ … }
static int nau7802_read_conversion(struct nau7802_state *st)
{ … }
static int nau7802_sync(struct nau7802_state *st)
{ … }
static irqreturn_t nau7802_eoc_trigger(int irq, void *private)
{ … }
static int nau7802_read_irq(struct iio_dev *indio_dev,
struct iio_chan_spec const *chan,
int *val)
{ … }
static int nau7802_read_poll(struct iio_dev *indio_dev,
struct iio_chan_spec const *chan,
int *val)
{ … }
static int nau7802_read_raw(struct iio_dev *indio_dev,
struct iio_chan_spec const *chan,
int *val, int *val2, long mask)
{ … }
static int nau7802_write_raw(struct iio_dev *indio_dev,
struct iio_chan_spec const *chan,
int val, int val2, long mask)
{ … }
static int nau7802_write_raw_get_fmt(struct iio_dev *indio_dev,
struct iio_chan_spec const *chan,
long mask)
{ … }
static const struct iio_info nau7802_info = …;
static int nau7802_probe(struct i2c_client *client)
{ … }
static const struct i2c_device_id nau7802_i2c_id[] = …;
MODULE_DEVICE_TABLE(i2c, nau7802_i2c_id);
static const struct of_device_id nau7802_dt_ids[] = …;
MODULE_DEVICE_TABLE(of, nau7802_dt_ids);
static struct i2c_driver nau7802_driver = …;
module_i2c_driver(…) …;
MODULE_LICENSE(…) …;
MODULE_DESCRIPTION(…) …;
MODULE_AUTHOR(…) …;
MODULE_AUTHOR(…) …;