#include <linux/module.h>
#include <linux/delay.h>
#include <linux/pci.h>
#include <linux/kernel.h>
#include <linux/stddef.h>
#include <linux/ioport.h>
#include <linux/i2c.h>
#include <linux/init.h>
#include <linux/acpi.h>
#include <linux/io.h>
static struct pci_dev *vt596_pdev;
#define SMBBA1 …
#define SMBBA2 …
#define SMBBA3 …
static unsigned short vt596_smba;
#define SMBHSTSTS …
#define SMBHSTCNT …
#define SMBHSTCMD …
#define SMBHSTADD …
#define SMBHSTDAT0 …
#define SMBHSTDAT1 …
#define SMBBLKDAT …
static unsigned short SMBHSTCFG = …;
#define MAX_TIMEOUT …
#define VT596_QUICK …
#define VT596_BYTE …
#define VT596_BYTE_DATA …
#define VT596_WORD_DATA …
#define VT596_PROC_CALL …
#define VT596_BLOCK_DATA …
#define VT596_I2C_BLOCK_DATA …
static bool force;
module_param(force, bool, 0);
MODULE_PARM_DESC(…) …;
static u16 force_addr;
module_param_hw(force_addr, ushort, ioport, 0);
MODULE_PARM_DESC(…) …;
static struct pci_driver vt596_driver;
static struct i2c_adapter vt596_adapter;
#define FEATURE_I2CBLOCK …
static unsigned int vt596_features;
#ifdef DEBUG
static void vt596_dump_regs(const char *msg, u8 size)
{ … }
#else
static inline void vt596_dump_regs(const char *msg, u8 size) { }
#endif
static int vt596_transaction(u8 size)
{ … }
static s32 vt596_access(struct i2c_adapter *adap, u16 addr,
unsigned short flags, char read_write, u8 command,
int size, union i2c_smbus_data *data)
{ … }
static u32 vt596_func(struct i2c_adapter *adapter)
{ … }
static const struct i2c_algorithm smbus_algorithm = …;
static struct i2c_adapter vt596_adapter = …;
static int vt596_probe(struct pci_dev *pdev,
const struct pci_device_id *id)
{ … }
static const struct pci_device_id vt596_ids[] = …;
MODULE_DEVICE_TABLE(pci, vt596_ids);
static struct pci_driver vt596_driver = …;
static int __init i2c_vt596_init(void)
{ … }
static void __exit i2c_vt596_exit(void)
{ … }
MODULE_AUTHOR(…) …;
MODULE_AUTHOR(…) …;
MODULE_AUTHOR(…) …;
MODULE_DESCRIPTION(…) …;
MODULE_LICENSE(…) …;
module_init(…) …;
module_exit(i2c_vt596_exit);