linux/drivers/iio/humidity/si7020.c

// SPDX-License-Identifier: GPL-2.0-only
/*
 * si7020.c - Silicon Labs Si7013/20/21 Relative Humidity and Temp Sensors
 * Copyright (c) 2013,2014  Uplogix, Inc.
 * David Barksdale <[email protected]>
 */

/*
 * The Silicon Labs Si7013/20/21 Relative Humidity and Temperature Sensors
 * are i2c devices which have an identical programming interface for
 * measuring relative humidity and temperature. The Si7013 has an additional
 * temperature input which this driver does not support.
 *
 * Data Sheets:
 *   Si7013: http://www.silabs.com/Support%20Documents/TechnicalDocs/Si7013.pdf
 *   Si7020: http://www.silabs.com/Support%20Documents/TechnicalDocs/Si7020.pdf
 *   Si7021: http://www.silabs.com/Support%20Documents/TechnicalDocs/Si7021.pdf
 */

#include <linux/delay.h>
#include <linux/i2c.h>
#include <linux/module.h>
#include <linux/mod_devicetable.h>
#include <linux/slab.h>
#include <linux/sysfs.h>
#include <linux/stat.h>

#include <linux/iio/iio.h>
#include <linux/iio/sysfs.h>

/* Measure Relative Humidity, Hold Master Mode */
#define SI7020CMD_RH_HOLD
/* Measure Temperature, Hold Master Mode */
#define SI7020CMD_TEMP_HOLD
/* Software Reset */
#define SI7020CMD_RESET
#define SI7020CMD_USR_WRITE
/* "Heater Enabled" bit in the User Register */
#define SI7020_USR_HEATER_EN
#define SI7020CMD_HEATER_WRITE
/* Heater current configuration bits */
#define SI7020_HEATER_VAL

struct si7020_data {};

static const int si7020_heater_vals[] =;

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

static const struct iio_chan_spec si7020_channels[] =;

static int si7020_update_reg(struct si7020_data *data,
				u8 *reg, u8 cmd, u8 mask, u8 val)
{}

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

static int si7020_read_available(struct iio_dev *indio_dev,
				  struct iio_chan_spec const *chan,
				  const int **vals,
				  int *type, int *length, long mask)
{}

static ssize_t si7020_show_heater_en(struct device *dev,
				 struct device_attribute *attr, char *buf)
{}

static ssize_t si7020_store_heater_en(struct device *dev,
				  struct device_attribute *attr,
				  const char *buf, size_t len)
{}

static IIO_DEVICE_ATTR(heater_enable, 0644,
		       si7020_show_heater_en, si7020_store_heater_en, 0);

static struct attribute *si7020_attributes[] =;

static const struct attribute_group si7020_attribute_group =;

static const struct iio_info si7020_info =;

static int si7020_probe(struct i2c_client *client)
{}

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

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

static struct i2c_driver si7020_driver =;

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