linux/drivers/hwmon/shtc1.c

// SPDX-License-Identifier: GPL-2.0-or-later
/* Sensirion SHTC1 humidity and temperature sensor driver
 *
 * Copyright (C) 2014 Sensirion AG, Switzerland
 * Author: Johannes Winkelmann <[email protected]>
 */

#include <linux/module.h>
#include <linux/init.h>
#include <linux/slab.h>
#include <linux/i2c.h>
#include <linux/hwmon.h>
#include <linux/hwmon-sysfs.h>
#include <linux/err.h>
#include <linux/delay.h>
#include <linux/platform_data/shtc1.h>
#include <linux/of.h>

/* commands (high precision mode) */
static const unsigned char shtc1_cmd_measure_blocking_hpm[]    =;
static const unsigned char shtc1_cmd_measure_nonblocking_hpm[] =;

/* commands (low precision mode) */
static const unsigned char shtc1_cmd_measure_blocking_lpm[]    =;
static const unsigned char shtc1_cmd_measure_nonblocking_lpm[] =;

/* command for reading the ID register */
static const unsigned char shtc1_cmd_read_id_reg[]             =;

/*
 * constants for reading the ID register
 * SHTC1: 0x0007 with mask 0x003f
 * SHTW1: 0x0007 with mask 0x003f
 * SHTC3: 0x0807 with mask 0x083f
 */
#define SHTC3_ID
#define SHTC3_ID_MASK
#define SHTC1_ID
#define SHTC1_ID_MASK

/* delays for non-blocking i2c commands, both in us */
#define SHTC1_NONBLOCKING_WAIT_TIME_HPM
#define SHTC1_NONBLOCKING_WAIT_TIME_LPM
#define SHTC3_NONBLOCKING_WAIT_TIME_HPM
#define SHTC3_NONBLOCKING_WAIT_TIME_LPM

#define SHTC1_CMD_LENGTH
#define SHTC1_RESPONSE_LENGTH

enum shtcx_chips {};

struct shtc1_data {};

static int shtc1_update_values(struct i2c_client *client,
			       struct shtc1_data *data,
			       char *buf, int bufsize)
{}

/* sysfs attributes */
static struct shtc1_data *shtc1_update_client(struct device *dev)
{}

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

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

static DEVICE_ATTR_RO(temp1_input);
static DEVICE_ATTR_RO(humidity1_input);

static struct attribute *shtc1_attrs[] =;

ATTRIBUTE_GROUPS();

static void shtc1_select_command(struct shtc1_data *data)
{}

static int shtc1_probe(struct i2c_client *client)
{}

/* device ID table */
static const struct i2c_device_id shtc1_id[] =;
MODULE_DEVICE_TABLE(i2c, shtc1_id);

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

static struct i2c_driver shtc1_i2c_driver =;

module_i2c_driver();

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