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

// SPDX-License-Identifier: GPL-2.0-or-later
/*
 * Copyright (c) 2000  Frodo Looijaard <[email protected]>,
 *                      Philip Edelbrock <[email protected]>,
 *                      Mark D. Studebaker <[email protected]>,
 *                      Dan Eaton <[email protected]> and
 *                      Stephen Rousset <[email protected]>
*/

/*
    This is the driver for the SMB Host controller on
    Acer Labs Inc. (ALI) M1535 South Bridge.

    The M1535 is a South bridge for portable systems.
    It is very similar to the M15x3 South bridges also produced
    by Acer Labs Inc.  Some of the registers within the part
    have moved and some have been redefined slightly. Additionally,
    the sequencing of the SMBus transactions has been modified
    to be more consistent with the sequencing recommended by
    the manufacturer and observed through testing.  These
    changes are reflected in this driver and can be identified
    by comparing this driver to the i2c-ali15x3 driver.
    For an overview of these chips see http://www.acerlabs.com

    The SMB controller is part of the 7101 device, which is an
    ACPI-compliant Power Management Unit (PMU).

    The whole 7101 device has to be enabled for the SMB to work.
    You can't just enable the SMB alone.
    The SMB and the ACPI have separate I/O spaces.
    We make sure that the SMB is enabled. We leave the ACPI alone.

    This driver controls the SMB Host only.

    This driver does not use interrupts.
*/


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

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


/* ALI1535 SMBus address offsets */
#define SMBHSTSTS
#define SMBHSTTYP
#define SMBHSTPORT
#define SMBHSTCMD
#define SMBHSTADD
#define SMBHSTDAT0
#define SMBHSTDAT1
#define SMBBLKDAT

/* PCI Address Constants */
#define SMBCOM
#define SMBREV
#define SMBCFG
#define SMBBA
#define SMBHSTCFG
#define SMBCLK

/* Other settings */
#define MAX_TIMEOUT
#define ALI1535_SMB_IOSIZE

#define ALI1535_SMB_DEFAULTBASE

/* ALI1535 address lock bits */
#define ALI1535_LOCK

/* ALI1535 command constants */
#define ALI1535_QUICK
#define ALI1535_BYTE
#define ALI1535_BYTE_DATA
#define ALI1535_WORD_DATA
#define ALI1535_BLOCK_DATA
#define ALI1535_I2C_READ

#define ALI1535_DEV10B_EN
					/*  I2C read			*/
#define ALI1535_T_OUT
#define ALI1535_A_HIGH_BIT9
					/* Alert-Response-Address	*/
					/* (read)			*/
#define ALI1535_KILL
#define ALI1535_A_HIGH_BIT8
					/*  Alert-Response-Address	*/
					/*  (read)			*/

#define ALI1535_D_HI_MASK
					/*  of 10-bit address in I2C	*/
					/*  Read Command		*/

/* ALI1535 status register bits */
#define ALI1535_STS_IDLE
#define ALI1535_STS_BUSY
#define ALI1535_STS_DONE
#define ALI1535_STS_DEV
#define ALI1535_STS_BUSERR
#define ALI1535_STS_FAIL
#define ALI1535_STS_ERR

#define ALI1535_BLOCK_CLR

/* ALI1535 device address register bits */
#define ALI1535_RD_ADDR
					/*  Address field		*/
					/*  -> Write = 0		*/
					/*  -> Read  = 1		*/
#define ALI1535_SMBIO_EN

static struct pci_driver ali1535_driver;
static unsigned long ali1535_smba;
static unsigned short ali1535_offset;

/* Detect whether a ALI1535 can be found, and initialize it, where necessary.
   Note the differences between kernels with the old PCI BIOS interface and
   newer kernels with the real PCI interface. In compat.h some things are
   defined to make the transition easier. */
static int ali1535_setup(struct pci_dev *dev)
{}

static int ali1535_transaction(struct i2c_adapter *adap)
{}

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


static u32 ali1535_func(struct i2c_adapter *adapter)
{}

static const struct i2c_algorithm smbus_algorithm =;

static struct i2c_adapter ali1535_adapter =;

static const struct pci_device_id ali1535_ids[] =;

MODULE_DEVICE_TABLE(pci, ali1535_ids);

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

static void ali1535_remove(struct pci_dev *dev)
{}

static struct pci_driver ali1535_driver =;

module_pci_driver();

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