linux/drivers/iio/humidity/ens210.c

// SPDX-License-Identifier: GPL-2.0+
/*
 * ens210.c - Support for ScioSense ens210 temperature & humidity sensor family
 *
 * (7-bit I2C slave address 0x43 ENS210)
 * (7-bit I2C slave address 0x43 ENS210A)
 * (7-bit I2C slave address 0x44 ENS211)
 * (7-bit I2C slave address 0x45 ENS212)
 * (7-bit I2C slave address 0x46 ENS213A)
 * (7-bit I2C slave address 0x47 ENS215)
 *
 * Datasheet:
 *  https://www.sciosense.com/wp-content/uploads/2024/04/ENS21x-Datasheet.pdf
 *  https://www.sciosense.com/wp-content/uploads/2023/12/ENS210-Datasheet.pdf
 */

#include <linux/crc7.h>
#include <linux/delay.h>
#include <linux/i2c.h>
#include <linux/iio/iio.h>
#include <linux/mod_devicetable.h>
#include <linux/module.h>
#include <linux/types.h>

#include <linux/unaligned.h>

/* register definitions */
#define ENS210_REG_PART_ID
#define ENS210_REG_DIE_REV
#define ENS210_REG_UID
#define ENS210_REG_SYS_CTRL
#define ENS210_REG_SYS_STAT
#define ENS210_REG_SENS_RUN
#define ENS210_REG_SENS_START
#define ENS210_REG_SENS_STOP
#define ENS210_REG_SENS_STAT
#define ENS210_REG_T_VAL
#define ENS210_REG_H_VAL

/* value definitions */
#define ENS210_SENS_START_T_START
#define ENS210_SENS_START_H_START

#define ENS210_SENS_STAT_T_ACTIVE
#define ENS210_SENS_STAT_H_ACTIVE

#define ENS210_SYS_CTRL_LOW_POWER_ENABLE
#define ENS210_SYS_CTRL_SYS_RESET

#define ENS210_SYS_STAT_SYS_ACTIVE

enum ens210_partnumber {};

/**
 * struct ens210_chip_info - Humidity/Temperature chip specific information
 * @name:		name of device
 * @part_id:		chip identifier
 * @conv_time_msec:	time for conversion calculation in m/s
 */
struct ens210_chip_info {};

/**
 * struct ens210_data - Humidity/Temperature sensor device structure
 * @client:	i2c client
 * @chip_info:	chip specific information
 * @lock:	lock protecting against simultaneous callers of get_measurement
 *		since multiple uninterrupted transactions are required
 */
struct ens210_data {};

/* calculate 17-bit crc7 */
static u8 ens210_crc7(u32 val)
{}

static int ens210_get_measurement(struct iio_dev *indio_dev, bool temp, int *val)
{}

static int ens210_read_raw(struct iio_dev *indio_dev,
			   struct iio_chan_spec const *channel, int *val,
			   int *val2, long mask)
{}

static const struct iio_chan_spec ens210_channels[] =;

static const struct iio_info ens210_info =;

static int ens210_probe(struct i2c_client *client)
{}

static const struct ens210_chip_info ens210_chip_info_data =;

static const struct ens210_chip_info ens210a_chip_info_data =;

static const struct ens210_chip_info ens211_chip_info_data =;

static const struct ens210_chip_info ens212_chip_info_data =;

static const struct ens210_chip_info ens213a_chip_info_data =;

static const struct ens210_chip_info ens215_chip_info_data =;

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

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

static struct i2c_driver ens210_driver =;
module_i2c_driver();

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