linux/drivers/iio/temperature/max31856.c

// SPDX-License-Identifier: GPL-2.0
/* max31856.c
 *
 * Maxim MAX31856 thermocouple sensor driver
 *
 * Copyright (C) 2018-2019 Rockwell Collins
 */

#include <linux/ctype.h>
#include <linux/mod_devicetable.h>
#include <linux/module.h>
#include <linux/init.h>
#include <linux/err.h>
#include <linux/property.h>
#include <linux/spi/spi.h>
#include <linux/iio/iio.h>
#include <linux/iio/sysfs.h>
#include <linux/util_macros.h>
#include <asm/unaligned.h>
#include <dt-bindings/iio/temperature/thermocouple.h>
/*
 * The MSB of the register value determines whether the following byte will
 * be written or read. If it is 0, one or more byte reads will follow.
 */
#define MAX31856_RD_WR_BIT

#define MAX31856_CR0_AUTOCONVERT
#define MAX31856_CR0_1SHOT
#define MAX31856_CR0_OCFAULT
#define MAX31856_CR0_OCFAULT_MASK
#define MAX31856_CR0_FILTER_50HZ
#define MAX31856_AVERAGING_MASK
#define MAX31856_AVERAGING_SHIFT
#define MAX31856_TC_TYPE_MASK
#define MAX31856_FAULT_OVUV
#define MAX31856_FAULT_OPEN

/* The MAX31856 registers */
#define MAX31856_CR0_REG
#define MAX31856_CR1_REG
#define MAX31856_MASK_REG
#define MAX31856_CJHF_REG
#define MAX31856_CJLF_REG
#define MAX31856_LTHFTH_REG
#define MAX31856_LTHFTL_REG
#define MAX31856_LTLFTH_REG
#define MAX31856_LTLFTL_REG
#define MAX31856_CJTO_REG
#define MAX31856_CJTH_REG
#define MAX31856_CJTL_REG
#define MAX31856_LTCBH_REG
#define MAX31856_LTCBM_REG
#define MAX31856_LTCBL_REG
#define MAX31856_SR_REG

static const struct iio_chan_spec max31856_channels[] =;

struct max31856_data {};

static const char max31856_tc_types[] =;

static int max31856_read(struct max31856_data *data, u8 reg,
			 u8 val[], unsigned int read_size)
{}

static int max31856_write(struct max31856_data *data, u8 reg,
			  unsigned int val)
{}

static int max31856_init(struct max31856_data *data)
{}

static int max31856_thermocouple_read(struct max31856_data *data,
				      struct iio_chan_spec const *chan,
				      int *val)
{}

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

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

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

static ssize_t show_fault(struct device *dev, u8 faultbit, char *buf)
{}

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

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

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

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

static IIO_DEVICE_ATTR(fault_ovuv, 0444, show_fault_ovuv, NULL, 0);
static IIO_DEVICE_ATTR(fault_oc, 0444, show_fault_oc, NULL, 0);
static IIO_DEVICE_ATTR(in_temp_filter_notch_center_frequency, 0644,
		       show_filter, set_filter, 0);

static struct attribute *max31856_attributes[] =;

static const struct attribute_group max31856_group =;

static const struct iio_info max31856_info =;

static int max31856_probe(struct spi_device *spi)
{}

static const struct spi_device_id max31856_id[] =;
MODULE_DEVICE_TABLE(spi, max31856_id);

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

static struct spi_driver max31856_driver =;
module_spi_driver();

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