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

// SPDX-License-Identifier: GPL-2.0-or-later
/*
    Copyright (c) 2002,2003 Alexander Malysh <[email protected]>

*/

/*
   Status: beta

   Supports:
	SIS 630
	SIS 730
	SIS 964

   Notable differences between chips:
	+------------------------+--------------------+-------------------+
	|                        |     SIS630/730     |      SIS964       |
	+------------------------+--------------------+-------------------+
	| Clock                  | 14kHz/56kHz        | 55.56kHz/27.78kHz |
	| SMBus registers offset | 0x80               | 0xE0              |
	| SMB_CNT                | Bit 1 = Slave Busy | Bit 1 = Bus probe |
	|         (not used yet) | Bit 3 is reserved  | Bit 3 = Last byte |
	| SMB_PCOUNT		 | Offset + 0x06      | Offset + 0x14     |
	| SMB_COUNT              | 4:0 bits           | 5:0 bits          |
	+------------------------+--------------------+-------------------+
	(Other differences don't affect the functions provided by the driver)

   Note: we assume there can only be one device, with one SMBus interface.
*/

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

/* SIS964 id is defined here as we are the only file using it */
#define PCI_DEVICE_ID_SI_964

/* SIS630/730/964 SMBus registers */
#define SMB_STS
#define SMB_CNT
#define SMBHOST_CNT
#define SMB_ADDR
#define SMB_CMD
#define SMB_COUNT
#define SMB_BYTE

/* SMB_STS register */
#define BYTE_DONE_STS
#define SMBCOL_STS
#define SMBERR_STS

/* SMB_CNT register */
#define MSTO_EN
#define SMBCLK_SEL
#define SMB_PROBE
#define SMB_HOSTBUSY

/* SMBHOST_CNT register */
#define SMB_KILL
#define SMB_START

/* register count for request_region
 * As we don't use SMB_PCOUNT, 20 is ok for SiS630 and SiS964
 */
#define SIS630_SMB_IOREGION

/* PCI address constants */
/* acpi base address register  */
#define SIS630_ACPI_BASE_REG
/* bios control register */
#define SIS630_BIOS_CTL_REG

/* Other settings */
#define MAX_TIMEOUT

/* SIS630 constants */
#define SIS630_QUICK
#define SIS630_BYTE
#define SIS630_BYTE_DATA
#define SIS630_WORD_DATA
#define SIS630_PCALL
#define SIS630_BLOCK_DATA

static struct pci_driver sis630_driver;

/* insmod parameters */
static bool high_clock;
static bool force;
module_param(high_clock, bool, 0);
MODULE_PARM_DESC();
module_param(force, bool, 0);
MODULE_PARM_DESC();

/* SMBus base address */
static unsigned short smbus_base;

/* supported chips */
static int supported[] =;

static inline u8 sis630_read(u8 reg)
{}

static inline void sis630_write(u8 reg, u8 data)
{}

static int sis630_transaction_start(struct i2c_adapter *adap, int size,
				    u8 *oldclock)
{}

static int sis630_transaction_wait(struct i2c_adapter *adap, int size)
{}

static void sis630_transaction_end(struct i2c_adapter *adap, u8 oldclock)
{}

static int sis630_transaction(struct i2c_adapter *adap, int size)
{}

static int sis630_block_data(struct i2c_adapter *adap,
			     union i2c_smbus_data *data, int read_write)
{}

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

static u32 sis630_func(struct i2c_adapter *adapter)
{}

static int sis630_setup(struct pci_dev *sis630_dev)
{}


static const struct i2c_algorithm smbus_algorithm =;

static struct i2c_adapter sis630_adapter =;

static const struct pci_device_id sis630_ids[] =;

MODULE_DEVICE_TABLE(pci, sis630_ids);

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

static void sis630_remove(struct pci_dev *dev)
{}


static struct pci_driver sis630_driver =;

module_pci_driver();

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