#include <linux/clk.h>
#include <linux/clkdev.h>
#include <linux/err.h>
#include <linux/i2c.h>
#include <linux/iopoll.h>
#include <linux/interrupt.h>
#include <linux/module.h>
#include <linux/io.h>
#include <linux/kernel.h>
#include <linux/platform_device.h>
#define ALTR_I2C_TFR_CMD …
#define ALTR_I2C_TFR_CMD_STA …
#define ALTR_I2C_TFR_CMD_STO …
#define ALTR_I2C_TFR_CMD_RW_D …
#define ALTR_I2C_RX_DATA …
#define ALTR_I2C_CTRL …
#define ALTR_I2C_CTRL_RXT_SHFT …
#define ALTR_I2C_CTRL_TCT_SHFT …
#define ALTR_I2C_CTRL_BSPEED …
#define ALTR_I2C_CTRL_EN …
#define ALTR_I2C_ISER …
#define ALTR_I2C_ISER_RXOF_EN …
#define ALTR_I2C_ISER_ARB_EN …
#define ALTR_I2C_ISER_NACK_EN …
#define ALTR_I2C_ISER_RXRDY_EN …
#define ALTR_I2C_ISER_TXRDY_EN …
#define ALTR_I2C_ISR …
#define ALTR_I2C_ISR_RXOF …
#define ALTR_I2C_ISR_ARB …
#define ALTR_I2C_ISR_NACK …
#define ALTR_I2C_ISR_RXRDY …
#define ALTR_I2C_ISR_TXRDY …
#define ALTR_I2C_STATUS …
#define ALTR_I2C_STAT_CORE …
#define ALTR_I2C_TC_FIFO_LVL …
#define ALTR_I2C_RX_FIFO_LVL …
#define ALTR_I2C_SCL_LOW …
#define ALTR_I2C_SCL_HIGH …
#define ALTR_I2C_SDA_HOLD …
#define ALTR_I2C_ALL_IRQ …
#define ALTR_I2C_THRESHOLD …
#define ALTR_I2C_DFLT_FIFO_SZ …
#define ALTR_I2C_TIMEOUT …
#define ALTR_I2C_XFER_TIMEOUT …
struct altr_i2c_dev { … };
static void
altr_i2c_int_enable(struct altr_i2c_dev *idev, u32 mask, bool enable)
{ … }
static void altr_i2c_int_clear(struct altr_i2c_dev *idev, u32 mask)
{ … }
static void altr_i2c_core_disable(struct altr_i2c_dev *idev)
{ … }
static void altr_i2c_core_enable(struct altr_i2c_dev *idev)
{ … }
static void altr_i2c_reset(struct altr_i2c_dev *idev)
{ … }
static inline void altr_i2c_stop(struct altr_i2c_dev *idev)
{ … }
static void altr_i2c_init(struct altr_i2c_dev *idev)
{ … }
static void altr_i2c_transfer(struct altr_i2c_dev *idev, u32 data)
{ … }
static void altr_i2c_empty_rx_fifo(struct altr_i2c_dev *idev)
{ … }
static int altr_i2c_fill_tx_fifo(struct altr_i2c_dev *idev)
{ … }
static irqreturn_t altr_i2c_isr_quick(int irq, void *_dev)
{ … }
static irqreturn_t altr_i2c_isr(int irq, void *_dev)
{ … }
static int altr_i2c_xfer_msg(struct altr_i2c_dev *idev, struct i2c_msg *msg)
{ … }
static int
altr_i2c_xfer(struct i2c_adapter *adap, struct i2c_msg *msgs, int num)
{ … }
static u32 altr_i2c_func(struct i2c_adapter *adap)
{ … }
static const struct i2c_algorithm altr_i2c_algo = …;
static int altr_i2c_probe(struct platform_device *pdev)
{ … }
static void altr_i2c_remove(struct platform_device *pdev)
{ … }
static const struct of_device_id altr_i2c_of_match[] = …;
MODULE_DEVICE_TABLE(of, altr_i2c_of_match);
static struct platform_driver altr_i2c_driver = …;
module_platform_driver(…) …;
MODULE_DESCRIPTION(…) …;
MODULE_AUTHOR(…) …;
MODULE_LICENSE(…) …;