linux/drivers/i2c/busses/i2c-nforce2.c

// SPDX-License-Identifier: GPL-2.0-or-later
/*
    SMBus driver for nVidia nForce2 MCP

    Added nForce3 Pro 150  Thomas Leibold <[email protected]>,
	Ported to 2.5 Patrick Dreker <[email protected]>,
    Copyright (c) 2003  Hans-Frieder Vogt <[email protected]>,
    Based on
    SMBus 2.0 driver for AMD-8111 IO-Hub
    Copyright (c) 2002 Vojtech Pavlik

*/

/*
    SUPPORTED DEVICES		PCI ID
    nForce2 MCP			0064
    nForce2 Ultra 400 MCP	0084
    nForce3 Pro150 MCP		00D4
    nForce3 250Gb MCP		00E4
    nForce4 MCP			0052
    nForce4 MCP-04		0034
    nForce MCP51		0264
    nForce MCP55		0368
    nForce MCP61		03EB
    nForce MCP65		0446
    nForce MCP67		0542
    nForce MCP73		07D8
    nForce MCP78S		0752
    nForce MCP79		0AA2

    This driver supports the 2 SMBuses that are included in the MCP of the
    nForce2/3/4/5xx chipsets.
*/

/* Note: we assume there can only be one nForce2, with two SMBus interfaces */

#include <linux/module.h>
#include <linux/pci.h>
#include <linux/kernel.h>
#include <linux/stddef.h>
#include <linux/ioport.h>
#include <linux/i2c.h>
#include <linux/delay.h>
#include <linux/dmi.h>
#include <linux/acpi.h>
#include <linux/slab.h>
#include <linux/io.h>

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


struct nforce2_smbus {};


/*
 * nVidia nForce2 SMBus control register definitions
 * (Newer incarnations use standard BARs 4 and 5 instead)
 */
#define NFORCE_PCI_SMB1
#define NFORCE_PCI_SMB2


/*
 * ACPI 2.0 chapter 13 SMBus 2.0 EC register model
 */
#define NVIDIA_SMB_PRTCL
#define NVIDIA_SMB_STS
#define NVIDIA_SMB_ADDR
#define NVIDIA_SMB_CMD
#define NVIDIA_SMB_DATA
#define NVIDIA_SMB_BCNT
#define NVIDIA_SMB_STATUS_ABRT
#define NVIDIA_SMB_CTRL

#define NVIDIA_SMB_STATUS_ABRT_STS
#define NVIDIA_SMB_CTRL_ABORT
#define NVIDIA_SMB_STS_DONE
#define NVIDIA_SMB_STS_ALRM
#define NVIDIA_SMB_STS_RES
#define NVIDIA_SMB_STS_STATUS

#define NVIDIA_SMB_PRTCL_WRITE
#define NVIDIA_SMB_PRTCL_READ
#define NVIDIA_SMB_PRTCL_QUICK
#define NVIDIA_SMB_PRTCL_BYTE
#define NVIDIA_SMB_PRTCL_BYTE_DATA
#define NVIDIA_SMB_PRTCL_WORD_DATA
#define NVIDIA_SMB_PRTCL_BLOCK_DATA
#define NVIDIA_SMB_PRTCL_PEC

/* Misc definitions */
#define MAX_TIMEOUT

/* We disable the second SMBus channel on these boards */
static const struct dmi_system_id nforce2_dmi_blacklist2[] =;

static struct pci_driver nforce2_driver;

/* For multiplexing support, we need a global reference to the 1st
   SMBus channel */
#if IS_ENABLED(CONFIG_I2C_NFORCE2_S4985)
struct i2c_adapter *nforce2_smbus;
EXPORT_SYMBOL_GPL();

static void nforce2_set_reference(struct i2c_adapter *adap)
{}
#else
static inline void nforce2_set_reference(struct i2c_adapter *adap) { }
#endif

static void nforce2_abort(struct i2c_adapter *adap)
{}

static int nforce2_check_status(struct i2c_adapter *adap)
{}

/* Return negative errno on error */
static s32 nforce2_access(struct i2c_adapter *adap, u16 addr,
		unsigned short flags, char read_write,
		u8 command, int size, union i2c_smbus_data *data)
{}


static u32 nforce2_func(struct i2c_adapter *adapter)
{}

static const struct i2c_algorithm smbus_algorithm =;


static const struct pci_device_id nforce2_ids[] =;

MODULE_DEVICE_TABLE(pci, nforce2_ids);


static int nforce2_probe_smb(struct pci_dev *dev, int bar, int alt_reg,
			     struct nforce2_smbus *smbus, const char *name)
{}


static int nforce2_probe(struct pci_dev *dev, const struct pci_device_id *id)
{}


static void nforce2_remove(struct pci_dev *dev)
{}

static struct pci_driver nforce2_driver =;

module_pci_driver();