linux/drivers/iio/chemical/sps30_i2c.c

// SPDX-License-Identifier: GPL-2.0
/*
 * Sensirion SPS30 particulate matter sensor i2c driver
 *
 * Copyright (c) 2020 Tomasz Duszynski <[email protected]>
 *
 * I2C slave address: 0x69
 */
#include <asm/unaligned.h>
#include <linux/crc8.h>
#include <linux/delay.h>
#include <linux/device.h>
#include <linux/errno.h>
#include <linux/i2c.h>
#include <linux/mod_devicetable.h>
#include <linux/module.h>
#include <linux/types.h>

#include "sps30.h"

#define SPS30_I2C_CRC8_POLYNOMIAL
/* max number of bytes needed to store PM measurements or serial string */
#define SPS30_I2C_MAX_BUF_SIZE

DECLARE_CRC8_TABLE(sps30_i2c_crc8_table);

#define SPS30_I2C_START_MEAS
#define SPS30_I2C_STOP_MEAS
#define SPS30_I2C_READ_MEAS
#define SPS30_I2C_MEAS_READY
#define SPS30_I2C_RESET
#define SPS30_I2C_CLEAN_FAN
#define SPS30_I2C_PERIOD
#define SPS30_I2C_READ_SERIAL
#define SPS30_I2C_READ_VERSION

static int sps30_i2c_xfer(struct sps30_state *state, unsigned char *txbuf, size_t txsize,
			  unsigned char *rxbuf, size_t rxsize)
{}

static int sps30_i2c_command(struct sps30_state *state, u16 cmd, void *arg, size_t arg_size,
			     void *rsp, size_t rsp_size)
{}

static int sps30_i2c_start_meas(struct sps30_state *state)
{}

static int sps30_i2c_stop_meas(struct sps30_state *state)
{}

static int sps30_i2c_reset(struct sps30_state *state)
{}

static bool sps30_i2c_meas_ready(struct sps30_state *state)
{}

static int sps30_i2c_read_meas(struct sps30_state *state, __be32 *meas, size_t num)
{}

static int sps30_i2c_clean_fan(struct sps30_state *state)
{}

static int sps30_i2c_read_cleaning_period(struct sps30_state *state, __be32 *period)
{}

static int sps30_i2c_write_cleaning_period(struct sps30_state *state, __be32 period)
{}

static int sps30_i2c_show_info(struct sps30_state *state)
{}

static const struct sps30_ops sps30_i2c_ops =;

static int sps30_i2c_probe(struct i2c_client *client)
{}

static const struct i2c_device_id sps30_i2c_id[] =;
MODULE_DEVICE_TABLE(i2c, sps30_i2c_id);

static const struct of_device_id sps30_i2c_of_match[] =;
MODULE_DEVICE_TABLE(of, sps30_i2c_of_match);

static struct i2c_driver sps30_i2c_driver =;
module_i2c_driver();

MODULE_AUTHOR();
MODULE_DESCRIPTION();
MODULE_LICENSE();
MODULE_IMPORT_NS();