linux/drivers/iio/humidity/htu21.c

// SPDX-License-Identifier: GPL-2.0-only
/*
 * htu21.c - Support for Measurement-Specialties
 *           htu21 temperature & humidity sensor
 *	     and humidity part of MS8607 sensor
 *
 * Copyright (c) 2014 Measurement-Specialties
 *
 * (7-bit I2C slave address 0x40)
 *
 * Datasheet:
 *  http://www.meas-spec.com/downloads/HTU21D.pdf
 * Datasheet:
 *  http://www.meas-spec.com/downloads/MS8607-02BA01.pdf
 */

#include <linux/init.h>
#include <linux/device.h>
#include <linux/kernel.h>
#include <linux/stat.h>
#include <linux/module.h>
#include <linux/mod_devicetable.h>
#include <linux/iio/iio.h>
#include <linux/iio/sysfs.h>

#include "../common/ms_sensors/ms_sensors_i2c.h"

#define HTU21_RESET

enum {};

static const int htu21_samp_freq[4] =;
/* String copy of the above const for readability purpose */
static const char htu21_show_samp_freq[] =;

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

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

static const struct iio_chan_spec htu21_channels[] =;

/*
 * Meas Spec recommendation is to not read temperature
 * on this driver part for MS8607
 */
static const struct iio_chan_spec ms8607_channels[] =;

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

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

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

static IIO_CONST_ATTR_SAMP_FREQ_AVAIL(htu21_show_samp_freq);
static IIO_DEVICE_ATTR(battery_low, S_IRUGO,
		       htu21_show_battery_low, NULL, 0);
static IIO_DEVICE_ATTR(heater_enable, S_IRUGO | S_IWUSR,
		       htu21_show_heater, htu21_write_heater, 0);

static struct attribute *htu21_attributes[] =;

static const struct attribute_group htu21_attribute_group =;

static const struct iio_info htu21_info =;

static int htu21_probe(struct i2c_client *client)
{}

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

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

static struct i2c_driver htu21_driver =;

module_i2c_driver();

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