linux/drivers/iio/temperature/max31865.c

// SPDX-License-Identifier: GPL-2.0-only

/*
 * Copyright (c) Linumiz 2021
 *
 * max31865.c - Maxim MAX31865 RTD-to-Digital Converter sensor driver
 *
 * Author: Navin Sankar Velliangiri <[email protected]>
 */

#include <linux/ctype.h>
#include <linux/delay.h>
#include <linux/err.h>
#include <linux/init.h>
#include <linux/mod_devicetable.h>
#include <linux/module.h>
#include <linux/iio/iio.h>
#include <linux/iio/sysfs.h>
#include <linux/property.h>
#include <linux/spi/spi.h>
#include <asm/unaligned.h>

/*
 * The MSB of the register value determines whether the following byte will
 * be written or read. If it is 0, read will follow and if it is 1, write
 * will follow.
 */
#define MAX31865_RD_WR_BIT

#define MAX31865_CFG_VBIAS
#define MAX31865_CFG_1SHOT
#define MAX31865_3WIRE_RTD
#define MAX31865_FAULT_STATUS_CLEAR
#define MAX31865_FILTER_50HZ

/* The MAX31865 registers */
#define MAX31865_CFG_REG
#define MAX31865_RTD_MSB
#define MAX31865_FAULT_STATUS

#define MAX31865_FAULT_OVUV

static const char max31865_show_samp_freq[] =;

static const struct iio_chan_spec max31865_channels[] =;

struct max31865_data {};

static int max31865_read(struct max31865_data *data, u8 reg,
			 unsigned int read_size)
{}

static int max31865_write(struct max31865_data *data, size_t len)
{}

static int enable_bias(struct max31865_data *data)
{}

static int disable_bias(struct max31865_data *data)
{}

static int max31865_rtd_read(struct max31865_data *data, int *val)
{}

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

static int max31865_init(struct max31865_data *data)
{}

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_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_CONST_ATTR_SAMP_FREQ_AVAIL(max31865_show_samp_freq);
static IIO_DEVICE_ATTR(fault_ovuv, 0444, show_fault_ovuv, NULL, 0);
static IIO_DEVICE_ATTR(in_filter_notch_center_frequency, 0644,
		    show_filter, set_filter, 0);

static struct attribute *max31865_attributes[] =;

static const struct attribute_group max31865_group =;

static const struct iio_info max31865_info =;

static int max31865_probe(struct spi_device *spi)
{}

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

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

static struct spi_driver max31865_driver =;
module_spi_driver();

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