linux/drivers/iio/humidity/hts221_core.c

// SPDX-License-Identifier: GPL-2.0-only
/*
 * STMicroelectronics hts221 sensor driver
 *
 * Copyright 2016 STMicroelectronics Inc.
 *
 * Lorenzo Bianconi <[email protected]>
 */

#include <linux/kernel.h>
#include <linux/module.h>
#include <linux/device.h>
#include <linux/iio/sysfs.h>
#include <linux/delay.h>
#include <linux/pm.h>
#include <linux/regmap.h>
#include <linux/regulator/consumer.h>
#include <linux/bitfield.h>

#include "hts221.h"

#define HTS221_REG_WHOAMI_ADDR
#define HTS221_REG_WHOAMI_VAL

#define HTS221_REG_CNTRL1_ADDR
#define HTS221_REG_CNTRL2_ADDR

#define HTS221_ODR_MASK
#define HTS221_BDU_MASK
#define HTS221_ENABLE_MASK

/* calibration registers */
#define HTS221_REG_0RH_CAL_X_H
#define HTS221_REG_1RH_CAL_X_H
#define HTS221_REG_0RH_CAL_Y_H
#define HTS221_REG_1RH_CAL_Y_H
#define HTS221_REG_0T_CAL_X_L
#define HTS221_REG_1T_CAL_X_L
#define HTS221_REG_0T_CAL_Y_H
#define HTS221_REG_1T_CAL_Y_H
#define HTS221_REG_T1_T0_CAL_Y_H

struct hts221_odr {};

#define HTS221_AVG_DEPTH
struct hts221_avg {};

static const struct hts221_odr hts221_odr_table[] =;

static const struct hts221_avg hts221_avg_list[] =;

static const struct iio_chan_spec hts221_channels[] =;

static int hts221_check_whoami(struct hts221_hw *hw)
{}

static int hts221_update_odr(struct hts221_hw *hw, u8 odr)
{}

static int hts221_update_avg(struct hts221_hw *hw,
			     enum hts221_sensor_type type,
			     u16 val)
{}

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

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

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

int hts221_set_enable(struct hts221_hw *hw, bool enable)
{}

static int hts221_parse_temp_caldata(struct hts221_hw *hw)
{}

static int hts221_parse_rh_caldata(struct hts221_hw *hw)
{}

static int hts221_get_sensor_scale(struct hts221_hw *hw,
				   enum iio_chan_type ch_type,
				   int *val, int *val2)
{}

static int hts221_get_sensor_offset(struct hts221_hw *hw,
				    enum iio_chan_type ch_type,
				    int *val, int *val2)
{}

static int hts221_read_oneshot(struct hts221_hw *hw, u8 addr, int *val)
{}

static int hts221_read_raw(struct iio_dev *iio_dev,
			   struct iio_chan_spec const *ch,
			   int *val, int *val2, long mask)
{}

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

static int hts221_validate_trigger(struct iio_dev *iio_dev,
				   struct iio_trigger *trig)
{}

static IIO_DEVICE_ATTR(in_humidity_oversampling_ratio_available, S_IRUGO,
		       hts221_sysfs_rh_oversampling_avail, NULL, 0);
static IIO_DEVICE_ATTR(in_temp_oversampling_ratio_available, S_IRUGO,
		       hts221_sysfs_temp_oversampling_avail, NULL, 0);
static IIO_DEV_ATTR_SAMP_FREQ_AVAIL(hts221_sysfs_sampling_freq);

static struct attribute *hts221_attributes[] =;

static const struct attribute_group hts221_attribute_group =;

static const struct iio_info hts221_info =;

static const unsigned long hts221_scan_masks[] =;

static int hts221_init_regulators(struct device *dev)
{}

int hts221_probe(struct device *dev, int irq, const char *name,
		 struct regmap *regmap)
{}
EXPORT_SYMBOL_NS();

static int hts221_suspend(struct device *dev)
{}

static int hts221_resume(struct device *dev)
{}

EXPORT_NS_SIMPLE_DEV_PM_OPS(hts221_pm_ops, hts221_suspend, hts221_resume,
			    IIO_HTS221);

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