#include <linux/module.h>
#include <linux/moduleparam.h>
#include <linux/pci.h>
#include <linux/kernel.h>
#include <linux/delay.h>
#include <linux/stddef.h>
#include <linux/ioport.h>
#include <linux/i2c.h>
#include <linux/i2c-smbus.h>
#include <linux/slab.h>
#include <linux/dmi.h>
#include <linux/acpi.h>
#include <linux/io.h>
#define SMBHSTSTS …
#define SMBHSLVSTS …
#define SMBHSTCNT …
#define SMBHSTCMD …
#define SMBHSTADD …
#define SMBHSTDAT0 …
#define SMBHSTDAT1 …
#define SMBBLKDAT …
#define SMBSLVCNT …
#define SMBSHDWCMD …
#define SMBSLVEVT …
#define SMBSLVDAT …
#define SMBIOSIZE …
#define SMBBA …
#define SMBHSTCFG …
#define SMBSLVC …
#define SMBSHDW1 …
#define SMBSHDW2 …
#define SMBREV …
#define MAX_TIMEOUT …
#define ENABLE_INT9 …
#define PIIX4_QUICK …
#define PIIX4_BYTE …
#define PIIX4_BYTE_DATA …
#define PIIX4_WORD_DATA …
#define PIIX4_BLOCK_DATA …
#define PIIX4_MAX_ADAPTERS …
#define HUDSON2_MAIN_PORTS …
#define SB800_PIIX4_SMB_IDX …
#define SB800_PIIX4_SMB_MAP_SIZE …
#define KERNCZ_IMC_IDX …
#define KERNCZ_IMC_DATA …
#define SB800_PIIX4_PORT_IDX …
#define SB800_PIIX4_PORT_IDX_ALT …
#define SB800_PIIX4_PORT_IDX_SEL …
#define SB800_PIIX4_PORT_IDX_MASK …
#define SB800_PIIX4_PORT_IDX_SHIFT …
#define SB800_PIIX4_PORT_IDX_KERNCZ …
#define SB800_PIIX4_PORT_IDX_MASK_KERNCZ …
#define SB800_PIIX4_PORT_IDX_SHIFT_KERNCZ …
#define SB800_PIIX4_FCH_PM_ADDR …
#define SB800_PIIX4_FCH_PM_SIZE …
static int force;
module_param (force, int, 0);
MODULE_PARM_DESC(…) …;
static int force_addr;
module_param_hw(force_addr, int, ioport, 0);
MODULE_PARM_DESC(…) …;
static int srvrworks_csb5_delay;
static struct pci_driver piix4_driver;
static const struct dmi_system_id piix4_dmi_blacklist[] = …;
static const struct dmi_system_id piix4_dmi_ibm[] = …;
static u8 piix4_port_sel_sb800;
static u8 piix4_port_mask_sb800;
static u8 piix4_port_shift_sb800;
static const char *piix4_main_port_names_sb800[PIIX4_MAX_ADAPTERS] = …;
static const char *piix4_aux_port_name_sb800 = …;
struct sb800_mmio_cfg { … };
struct i2c_piix4_adapdata { … };
static int piix4_sb800_region_request(struct device *dev,
struct sb800_mmio_cfg *mmio_cfg)
{ … }
static void piix4_sb800_region_release(struct device *dev,
struct sb800_mmio_cfg *mmio_cfg)
{ … }
static bool piix4_sb800_use_mmio(struct pci_dev *PIIX4_dev)
{ … }
static int piix4_setup(struct pci_dev *PIIX4_dev,
const struct pci_device_id *id)
{ … }
static int piix4_setup_sb800_smba(struct pci_dev *PIIX4_dev,
u8 smb_en,
u8 aux,
u8 *smb_en_status,
unsigned short *piix4_smba)
{ … }
static int piix4_setup_sb800(struct pci_dev *PIIX4_dev,
const struct pci_device_id *id, u8 aux)
{ … }
static int piix4_setup_aux(struct pci_dev *PIIX4_dev,
const struct pci_device_id *id,
unsigned short base_reg_addr)
{ … }
static int piix4_transaction(struct i2c_adapter *piix4_adapter)
{ … }
static s32 piix4_access(struct i2c_adapter * adap, u16 addr,
unsigned short flags, char read_write,
u8 command, int size, union i2c_smbus_data * data)
{ … }
static uint8_t piix4_imc_read(uint8_t idx)
{ … }
static void piix4_imc_write(uint8_t idx, uint8_t value)
{ … }
static int piix4_imc_sleep(void)
{ … }
static void piix4_imc_wakeup(void)
{ … }
static int piix4_sb800_port_sel(u8 port, struct sb800_mmio_cfg *mmio_cfg)
{ … }
static s32 piix4_access_sb800(struct i2c_adapter *adap, u16 addr,
unsigned short flags, char read_write,
u8 command, int size, union i2c_smbus_data *data)
{ … }
static u32 piix4_func(struct i2c_adapter *adapter)
{ … }
static const struct i2c_algorithm smbus_algorithm = …;
static const struct i2c_algorithm piix4_smbus_algorithm_sb800 = …;
static const struct pci_device_id piix4_ids[] = …;
MODULE_DEVICE_TABLE (pci, piix4_ids);
static struct i2c_adapter *piix4_main_adapters[PIIX4_MAX_ADAPTERS];
static struct i2c_adapter *piix4_aux_adapter;
static int piix4_adapter_count;
static int piix4_add_adapter(struct pci_dev *dev, unsigned short smba,
bool sb800_main, u8 port, bool notify_imc,
u8 hw_port_nr, const char *name,
struct i2c_adapter **padap)
{ … }
static int piix4_add_adapters_sb800(struct pci_dev *dev, unsigned short smba,
bool notify_imc)
{ … }
static int piix4_probe(struct pci_dev *dev, const struct pci_device_id *id)
{ … }
static void piix4_adap_remove(struct i2c_adapter *adap)
{ … }
static void piix4_remove(struct pci_dev *dev)
{ … }
static struct pci_driver piix4_driver = …;
module_pci_driver(…) …;
MODULE_AUTHOR(…) …;
MODULE_AUTHOR(…) …;
MODULE_DESCRIPTION(…) …;
MODULE_LICENSE(…) …;