#include <linux/module.h>
#include <linux/interrupt.h>
#include <linux/ioport.h>
#include <linux/delay.h>
#include <linux/i2c.h>
#include <linux/completion.h>
#include <linux/platform_device.h>
#include <linux/io.h>
#include <linux/err.h>
#include <linux/clk.h>
#include <linux/slab.h>
#include <linux/of.h>
#define I2C_PNX_TIMEOUT_DEFAULT …
#define I2C_PNX_SPEED_KHZ_DEFAULT …
#define I2C_PNX_REGION_SIZE …
struct i2c_pnx_mif { … };
struct i2c_pnx_algo_data { … };
enum { … };
enum { … };
enum { … };
#define I2C_REG_RX(a) …
#define I2C_REG_TX(a) …
#define I2C_REG_STS(a) …
#define I2C_REG_CTL(a) …
#define I2C_REG_CKL(a) …
#define I2C_REG_CKH(a) …
#define I2C_REG_ADR(a) …
#define I2C_REG_RFL(a) …
#define I2C_REG_TFL(a) …
#define I2C_REG_RXB(a) …
#define I2C_REG_TXB(a) …
#define I2C_REG_TXS(a) …
#define I2C_REG_STFL(a) …
static inline int wait_timeout(struct i2c_pnx_algo_data *data)
{ … }
static inline int wait_reset(struct i2c_pnx_algo_data *data)
{ … }
static int i2c_pnx_start(unsigned char slave_addr,
struct i2c_pnx_algo_data *alg_data)
{ … }
static void i2c_pnx_stop(struct i2c_pnx_algo_data *alg_data)
{ … }
static int i2c_pnx_master_xmit(struct i2c_pnx_algo_data *alg_data)
{ … }
static int i2c_pnx_master_rcv(struct i2c_pnx_algo_data *alg_data)
{ … }
static irqreturn_t i2c_pnx_interrupt(int irq, void *dev_id)
{ … }
static void i2c_pnx_timeout(struct i2c_pnx_algo_data *alg_data)
{ … }
static inline void bus_reset_if_active(struct i2c_pnx_algo_data *alg_data)
{ … }
static int
i2c_pnx_xfer(struct i2c_adapter *adap, struct i2c_msg *msgs, int num)
{ … }
static u32 i2c_pnx_func(struct i2c_adapter *adapter)
{ … }
static const struct i2c_algorithm pnx_algorithm = …;
static int i2c_pnx_controller_suspend(struct device *dev)
{ … }
static int i2c_pnx_controller_resume(struct device *dev)
{ … }
static DEFINE_SIMPLE_DEV_PM_OPS(i2c_pnx_pm,
i2c_pnx_controller_suspend,
i2c_pnx_controller_resume);
static int i2c_pnx_probe(struct platform_device *pdev)
{ … }
static void i2c_pnx_remove(struct platform_device *pdev)
{ … }
#ifdef CONFIG_OF
static const struct of_device_id i2c_pnx_of_match[] = …;
MODULE_DEVICE_TABLE(of, i2c_pnx_of_match);
#endif
static struct platform_driver i2c_pnx_driver = …;
static int __init i2c_adap_pnx_init(void)
{ … }
static void __exit i2c_adap_pnx_exit(void)
{ … }
MODULE_AUTHOR(…) …;
MODULE_AUTHOR(…) …;
MODULE_DESCRIPTION(…) …;
MODULE_LICENSE(…) …;
MODULE_ALIAS(…) …;
subsys_initcall(i2c_adap_pnx_init);
module_exit(i2c_adap_pnx_exit);