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

// SPDX-License-Identifier: GPL-2.0-or-later
/*
    Copyright (c) 1998, 1999  Frodo Looijaard <[email protected]> and
    Philip Edelbrock <[email protected]>

*/

/* Note: we assume there can only be one SIS5595 with one SMBus interface */

/*
   Note: all have mfr. ID 0x1039.
   SUPPORTED		PCI ID		
	5595		0008

   Note: these chips contain a 0008 device which is incompatible with the
         5595. We recognize these by the presence of the listed
         "blacklist" PCI ID and refuse to load.

   NOT SUPPORTED	PCI ID		BLACKLIST PCI ID	
	 540		0008		0540
	 550		0008		0550
	5513		0008		5511
	5581		0008		5597
	5582		0008		5597
	5597		0008		5597
	5598		0008		5597/5598
	 630		0008		0630
	 645		0008		0645
	 646		0008		0646
	 648		0008		0648
	 650		0008		0650
	 651		0008		0651
	 730		0008		0730
	 735		0008		0735
	 745		0008		0745
	 746		0008		0746
*/

/* TO DO: 
 * Add Block Transfers (ugly, but supported by the adapter)
 * Add adapter resets
 */

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

static int blacklist[] =;

/* Length of ISA address segment */
#define SIS5595_EXTENT
/* SIS5595 SMBus registers */
#define SMB_STS_LO
#define SMB_STS_HI
#define SMB_CTL_LO
#define SMB_CTL_HI
#define SMB_ADDR
#define SMB_CMD
#define SMB_PCNT
#define SMB_CNT
#define SMB_BYTE
#define SMB_DEV
#define SMB_DB0
#define SMB_DB1
#define SMB_HAA

/* PCI Address Constants */
#define SMB_INDEX
#define SMB_DAT
#define SIS5595_ENABLE_REG
#define ACPI_BASE

/* Other settings */
#define MAX_TIMEOUT

/* SIS5595 constants */
#define SIS5595_QUICK
#define SIS5595_BYTE
#define SIS5595_BYTE_DATA
#define SIS5595_WORD_DATA
#define SIS5595_PROC_CALL
#define SIS5595_BLOCK_DATA

/* insmod parameters */

/* If force_addr is set to anything different from 0, we forcibly enable
   the device at the given address. */
static u16 force_addr;
module_param_hw(force_addr, ushort, ioport, 0);
MODULE_PARM_DESC();

static struct pci_driver sis5595_driver;
static unsigned short sis5595_base;
static struct pci_dev *sis5595_pdev;

static u8 sis5595_read(u8 reg)
{}

static void sis5595_write(u8 reg, u8 data)
{}

static int sis5595_setup(struct pci_dev *SIS5595_dev)
{}

static int sis5595_transaction(struct i2c_adapter *adap)
{}

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

static u32 sis5595_func(struct i2c_adapter *adapter)
{}

static const struct i2c_algorithm smbus_algorithm =;

static struct i2c_adapter sis5595_adapter =;

static const struct pci_device_id sis5595_ids[] =;

MODULE_DEVICE_TABLE (pci, sis5595_ids);

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

static struct pci_driver sis5595_driver =;

static int __init i2c_sis5595_init(void)
{}

static void __exit i2c_sis5595_exit(void)
{}

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

module_init();
module_exit(i2c_sis5595_exit);