#ifndef _LINUX_I2C_PNX_H
#define _LINUX_I2C_PNX_H

#include <linux/i2c.h>
#include <linux/i2c-algo-pca.h>
#include <linux/wait.h>

struct i2c_pnx_dev {
	unsigned long base;
	int irq;
	unsigned char clock;	/* value to write to freq bits of control reg */
	unsigned char bus_addr; /* bus address for slave mode; currently not supported */

	int timeout;		/* non-zero when timeout was detected */
	wait_queue_head_t wait;

	struct i2c_algo_pca_data algo_data;
	struct i2c_adapter adap;
};

/* Register area size */
#define I2C_PNX_IO_SIZE		0x1000

/* Register offsets */
#define I2C_PNX_CONTROL		0x0000
#define I2C_PNX_DAT		0x0004
#define I2C_PNX_STATUS		0x0008
#define I2C_PNX_ADDRESS		0x000C
#define I2C_PNX_STOP		0x0010
#define I2C_PNX_PD		0x0014
#define I2C_PNX_SET_PINS	0x0018
#define I2C_PNX_OBS_PINS	0x001C
#define I2C_PNX_INT_STATUS	0x0FE0
#define I2C_PNX_INT_ENABLE	0x0FE4
#define I2C_PNX_INT_CLEAR	0x0FE8
#define I2C_PNX_INT_SET		0x0FEC
#define I2C_PNX_POWER_DOWN	0x0FF4
#define I2C_PNX_MODULE_ID	0x0FFC

#endif
