linux/drivers/hwmon/max31827.c

// SPDX-License-Identifier: GPL-2.0
/*
 * max31827.c - Support for Maxim Low-Power Switch
 *
 * Copyright (c) 2023 Daniel Matyas <[email protected]>
 */

#include <linux/bitfield.h>
#include <linux/bitops.h>
#include <linux/delay.h>
#include <linux/hwmon.h>
#include <linux/i2c.h>
#include <linux/mutex.h>
#include <linux/of_device.h>
#include <linux/regmap.h>
#include <linux/regulator/consumer.h>

#define MAX31827_T_REG
#define MAX31827_CONFIGURATION_REG
#define MAX31827_TH_REG
#define MAX31827_TL_REG
#define MAX31827_TH_HYST_REG
#define MAX31827_TL_HYST_REG

#define MAX31827_CONFIGURATION_1SHOT_MASK
#define MAX31827_CONFIGURATION_CNV_RATE_MASK
#define MAX31827_CONFIGURATION_PEC_EN_MASK
#define MAX31827_CONFIGURATION_TIMEOUT_MASK
#define MAX31827_CONFIGURATION_RESOLUTION_MASK
#define MAX31827_CONFIGURATION_ALRM_POL_MASK
#define MAX31827_CONFIGURATION_COMP_INT_MASK
#define MAX31827_CONFIGURATION_FLT_Q_MASK
#define MAX31827_CONFIGURATION_U_TEMP_STAT_MASK
#define MAX31827_CONFIGURATION_O_TEMP_STAT_MASK

#define MAX31827_ALRM_POL_LOW
#define MAX31827_ALRM_POL_HIGH
#define MAX31827_FLT_Q_1
#define MAX31827_FLT_Q_4

#define MAX31827_8_BIT_CNV_TIME
#define MAX31827_9_BIT_CNV_TIME
#define MAX31827_10_BIT_CNV_TIME
#define MAX31827_12_BIT_CNV_TIME

#define MAX31827_16_BIT_TO_M_DGR(x)
#define MAX31827_M_DGR_TO_16_BIT(x)
#define MAX31827_DEVICE_ENABLE(x)

/*
 * The enum passed in the .data pointer of struct of_device_id must
 * start with a value != 0 since that is a requirement for using
 * device_get_match_data().
 */
enum chips {};

enum max31827_cnv {};

static const u16 max31827_conversions[] =;

enum max31827_resolution {};

static const u16 max31827_resolutions[] =;

static const u16 max31827_conv_times[] =;

struct max31827_state {};

static const struct regmap_config max31827_regmap =;

static int shutdown_write(struct max31827_state *st, unsigned int reg,
			  unsigned int mask, unsigned int val)
{}

static int write_alarm_val(struct max31827_state *st, unsigned int reg,
			   long val)
{}

static umode_t max31827_is_visible(const void *state,
				   enum hwmon_sensor_types type, u32 attr,
				   int channel)
{}

static int max31827_read(struct device *dev, enum hwmon_sensor_types type,
			 u32 attr, int channel, long *val)
{}

static int max31827_write(struct device *dev, enum hwmon_sensor_types type,
			  u32 attr, int channel, long val)
{}

static ssize_t temp1_resolution_show(struct device *dev,
				     struct device_attribute *devattr,
				     char *buf)
{}

static ssize_t temp1_resolution_store(struct device *dev,
				      struct device_attribute *devattr,
				      const char *buf, size_t count)
{}

static DEVICE_ATTR_RW(temp1_resolution);

static struct attribute *max31827_attrs[] =;
ATTRIBUTE_GROUPS();

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

static int max31827_init_client(struct max31827_state *st,
				struct device *dev)
{}

static const struct hwmon_channel_info *max31827_info[] =;

static const struct hwmon_ops max31827_hwmon_ops =;

static const struct hwmon_chip_info max31827_chip_info =;

static int max31827_probe(struct i2c_client *client)
{}

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

static struct i2c_driver max31827_driver =;
module_i2c_driver();

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