linux/drivers/hwmon/smsc47m1.c

// SPDX-License-Identifier: GPL-2.0-or-later
/*
 * smsc47m1.c - Part of lm_sensors, Linux kernel modules
 *		for hardware monitoring
 *
 * Supports the SMSC LPC47B27x, LPC47M10x, LPC47M112, LPC47M13x,
 * LPC47M14x, LPC47M15x, LPC47M192, LPC47M292 and LPC47M997
 * Super-I/O chips.
 *
 * Copyright (C) 2002 Mark D. Studebaker <[email protected]>
 * Copyright (C) 2004-2007 Jean Delvare <[email protected]>
 * Ported to Linux 2.6 by Gabriele Gorla <[email protected]>
 *			and Jean Delvare
 */

#define pr_fmt(fmt)

#include <linux/module.h>
#include <linux/slab.h>
#include <linux/ioport.h>
#include <linux/jiffies.h>
#include <linux/platform_device.h>
#include <linux/hwmon.h>
#include <linux/hwmon-sysfs.h>
#include <linux/err.h>
#include <linux/init.h>
#include <linux/mutex.h>
#include <linux/sysfs.h>
#include <linux/acpi.h>
#include <linux/io.h>

static unsigned short force_id;
module_param(force_id, ushort, 0);
MODULE_PARM_DESC();

static struct platform_device *smsc47m1_pdev;

#define DRVNAME
enum chips {};

/* Super-I/0 registers and commands */

#define REG
#define VAL

static inline void
superio_outb(int reg, int val)
{}

static inline int
superio_inb(int reg)
{}

/* logical device for fans is 0x0A */
#define superio_select()

static inline int
superio_enter(void)
{}

static inline void
superio_exit(void)
{}

#define SUPERIO_REG_ACT
#define SUPERIO_REG_BASE
#define SUPERIO_REG_DEVID
#define SUPERIO_REG_DEVREV

/* Logical device registers */

#define SMSC_EXTENT

/* nr is 0 or 1 in the macros below */
#define SMSC47M1_REG_ALARM
#define SMSC47M1_REG_TPIN(nr)
#define SMSC47M1_REG_PPIN(nr)
#define SMSC47M1_REG_FANDIV

static const u8 SMSC47M1_REG_FAN[3]		=;
static const u8 SMSC47M1_REG_FAN_PRELOAD[3]	=;
static const u8 SMSC47M1_REG_PWM[3]		=;

#define SMSC47M2_REG_ALARM6
#define SMSC47M2_REG_TPIN1
#define SMSC47M2_REG_TPIN2
#define SMSC47M2_REG_TPIN3
#define SMSC47M2_REG_PPIN3
#define SMSC47M2_REG_FANDIV3

#define MIN_FROM_REG(reg, div)
#define FAN_FROM_REG(reg, div, preload)
#define DIV_FROM_REG(reg)
#define PWM_FROM_REG(reg)
#define PWM_EN_FROM_REG(reg)
#define PWM_TO_REG(reg)

struct smsc47m1_data {};

struct smsc47m1_sio_data {};

static inline int smsc47m1_read_value(struct smsc47m1_data *data, u8 reg)
{}

static inline void smsc47m1_write_value(struct smsc47m1_data *data, u8 reg,
		u8 value)
{}

static struct smsc47m1_data *smsc47m1_update_device(struct device *dev,
		int init)
{}

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

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

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

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

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

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

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

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

/*
 * Note: we save and restore the fan minimum here, because its value is
 * determined in part by the fan clock divider.  This follows the principle
 * of least surprise; the user doesn't expect the fan minimum to change just
 * because the divider changed.
 */
static ssize_t fan_div_store(struct device *dev,
			     struct device_attribute *devattr,
			     const char *buf, size_t count)
{}

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

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

static SENSOR_DEVICE_ATTR_RO(fan1_input, fan, 0);
static SENSOR_DEVICE_ATTR_RW(fan1_min, fan_min, 0);
static SENSOR_DEVICE_ATTR_RW(fan1_div, fan_div, 0);
static SENSOR_DEVICE_ATTR_RO(fan1_alarm, fan_alarm, 0);
static SENSOR_DEVICE_ATTR_RW(pwm1, pwm, 0);
static SENSOR_DEVICE_ATTR_RW(pwm1_enable, pwm_en, 0);
static SENSOR_DEVICE_ATTR_RO(fan2_input, fan, 1);
static SENSOR_DEVICE_ATTR_RW(fan2_min, fan_min, 1);
static SENSOR_DEVICE_ATTR_RW(fan2_div, fan_div, 1);
static SENSOR_DEVICE_ATTR_RO(fan2_alarm, fan_alarm, 1);
static SENSOR_DEVICE_ATTR_RW(pwm2, pwm, 1);
static SENSOR_DEVICE_ATTR_RW(pwm2_enable, pwm_en, 1);
static SENSOR_DEVICE_ATTR_RO(fan3_input, fan, 2);
static SENSOR_DEVICE_ATTR_RW(fan3_min, fan_min, 2);
static SENSOR_DEVICE_ATTR_RW(fan3_div, fan_div, 2);
static SENSOR_DEVICE_ATTR_RO(fan3_alarm, fan_alarm, 2);
static SENSOR_DEVICE_ATTR_RW(pwm3, pwm, 2);
static SENSOR_DEVICE_ATTR_RW(pwm3_enable, pwm_en, 2);

static DEVICE_ATTR_RO(alarms);

static ssize_t name_show(struct device *dev, struct device_attribute
			 *devattr, char *buf)
{}
static DEVICE_ATTR_RO(name);

static struct attribute *smsc47m1_attributes_fan1[] =;

static const struct attribute_group smsc47m1_group_fan1 =;

static struct attribute *smsc47m1_attributes_fan2[] =;

static const struct attribute_group smsc47m1_group_fan2 =;

static struct attribute *smsc47m1_attributes_fan3[] =;

static const struct attribute_group smsc47m1_group_fan3 =;

static struct attribute *smsc47m1_attributes_pwm1[] =;

static const struct attribute_group smsc47m1_group_pwm1 =;

static struct attribute *smsc47m1_attributes_pwm2[] =;

static const struct attribute_group smsc47m1_group_pwm2 =;

static struct attribute *smsc47m1_attributes_pwm3[] =;

static const struct attribute_group smsc47m1_group_pwm3 =;

static struct attribute *smsc47m1_attributes[] =;

static const struct attribute_group smsc47m1_group =;

static int __init smsc47m1_find(struct smsc47m1_sio_data *sio_data)
{}

/* Restore device to its initial state */
static void smsc47m1_restore(const struct smsc47m1_sio_data *sio_data)
{}

#define CHECK
#define REQUEST

/*
 * This function can be used to:
 *  - test for resource conflicts with ACPI
 *  - request the resources
 * We only allocate the I/O ports we really need, to minimize the risk of
 * conflicts with ACPI or with other drivers.
 */
static int __init smsc47m1_handle_resources(unsigned short address,
					    enum chips type, int action,
					    struct device *dev)
{}

static void smsc47m1_remove_files(struct device *dev)
{}

static int __init smsc47m1_probe(struct platform_device *pdev)
{}

static void __exit smsc47m1_remove(struct platform_device *pdev)
{}

/*
 * smsc47m1_remove() lives in .exit.text. For drivers registered via
 * module_platform_driver_probe() this ok because they cannot get unbound at
 * runtime. The driver needs to be marked with __refdata, otherwise modpost
 * triggers a section mismatch warning.
 */
static struct platform_driver smsc47m1_driver __refdata =;

static int __init smsc47m1_device_add(unsigned short address,
				      const struct smsc47m1_sio_data *sio_data)
{}

static int __init sm_smsc47m1_init(void)
{}

static void __exit sm_smsc47m1_exit(void)
{}

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

module_init();
module_exit(sm_smsc47m1_exit);