linux/drivers/hwmon/nct6775-i2c.c

// SPDX-License-Identifier: GPL-2.0
/*
 * nct6775-i2c - I2C driver for the hardware monitoring functionality of
 *	         Nuvoton NCT677x Super-I/O chips
 *
 * Copyright (C) 2022 Zev Weiss <[email protected]>
 *
 * This driver interacts with the chip via it's "back door" i2c interface, as
 * is often exposed to a BMC.  Because the host may still be operating the
 * chip via the ("front door") LPC interface, this driver cannot assume that
 * it actually has full control of the chip, and in particular must avoid
 * making any changes that could confuse the host's LPC usage of it.  It thus
 * operates in a strictly read-only fashion, with the only exception being the
 * bank-select register (which seems, thankfully, to be replicated for the i2c
 * interface so it doesn't affect the LPC interface).
 */

#include <linux/module.h>
#include <linux/init.h>
#include <linux/i2c.h>
#include <linux/hwmon.h>
#include <linux/hwmon-sysfs.h>
#include <linux/err.h>
#include <linux/of.h>
#include <linux/regmap.h>
#include "nct6775.h"

static int nct6775_i2c_read(void *ctx, unsigned int reg, unsigned int *val)
{}

/*
 * The write operation is a dummy so as not to disturb anything being done
 * with the chip via LPC.
 */
static int nct6775_i2c_write(void *ctx, unsigned int reg, unsigned int value)
{}

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

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

static int nct6775_i2c_probe_init(struct nct6775_data *data)
{}

static const struct regmap_config nct6775_i2c_regmap_config =;

static int nct6775_i2c_probe(struct i2c_client *client)
{}

static struct i2c_driver nct6775_i2c_driver =;

module_i2c_driver();

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