#include <linux/acpi.h>
#include <linux/clk.h>
#include <linux/completion.h>
#include <linux/delay.h>
#include <linux/dma-mapping.h>
#include <linux/dmaengine.h>
#include <linux/dmapool.h>
#include <linux/err.h>
#include <linux/errno.h>
#include <linux/gpio/consumer.h>
#include <linux/i2c.h>
#include <linux/init.h>
#include <linux/interrupt.h>
#include <linux/io.h>
#include <linux/iopoll.h>
#include <linux/kernel.h>
#include <linux/spinlock.h>
#include <linux/hrtimer.h>
#include <linux/module.h>
#include <linux/of.h>
#include <linux/of_dma.h>
#include <linux/pinctrl/consumer.h>
#include <linux/platform_data/i2c-imx.h>
#include <linux/platform_device.h>
#include <linux/pm_runtime.h>
#include <linux/sched.h>
#include <linux/slab.h>
#define DRIVER_NAME …
#define I2C_IMX_CHECK_DELAY …
#define DMA_THRESHOLD …
#define DMA_TIMEOUT …
#define IMX_I2C_IADR …
#define IMX_I2C_IFDR …
#define IMX_I2C_I2CR …
#define IMX_I2C_I2SR …
#define IMX_I2C_I2DR …
#define IMX_I2C_IBIC …
#define IMX_I2C_REGSHIFT …
#define VF610_I2C_REGSHIFT …
#define I2SR_RXAK …
#define I2SR_IIF …
#define I2SR_SRW …
#define I2SR_IAL …
#define I2SR_IBB …
#define I2SR_IAAS …
#define I2SR_ICF …
#define I2CR_DMAEN …
#define I2CR_RSTA …
#define I2CR_TXAK …
#define I2CR_MTX …
#define I2CR_MSTA …
#define I2CR_IIEN …
#define I2CR_IEN …
#define IBIC_BIIE …
#define I2SR_CLR_OPCODE_W0C …
#define I2SR_CLR_OPCODE_W1C …
#define I2CR_IEN_OPCODE_0 …
#define I2CR_IEN_OPCODE_1 …
#define I2C_PM_TIMEOUT …
struct imx_i2c_clk_pair { … };
static struct imx_i2c_clk_pair imx_i2c_clk_div[] = …;
static struct imx_i2c_clk_pair vf610_i2c_clk_div[] = …;
enum imx_i2c_type { … };
struct imx_i2c_hwdata { … };
struct imx_i2c_dma { … };
struct imx_i2c_struct { … };
static const struct imx_i2c_hwdata imx1_i2c_hwdata = …;
static const struct imx_i2c_hwdata imx21_i2c_hwdata = …;
static const struct imx_i2c_hwdata imx6_i2c_hwdata = …;
static struct imx_i2c_hwdata vf610_i2c_hwdata = …;
static const struct platform_device_id imx_i2c_devtype[] = …;
MODULE_DEVICE_TABLE(platform, imx_i2c_devtype);
static const struct of_device_id i2c_imx_dt_ids[] = …;
MODULE_DEVICE_TABLE(of, i2c_imx_dt_ids);
static const struct acpi_device_id i2c_imx_acpi_ids[] = …;
MODULE_DEVICE_TABLE(acpi, i2c_imx_acpi_ids);
static inline int is_imx1_i2c(struct imx_i2c_struct *i2c_imx)
{ … }
static inline int is_vf610_i2c(struct imx_i2c_struct *i2c_imx)
{ … }
static inline void imx_i2c_write_reg(unsigned int val,
struct imx_i2c_struct *i2c_imx, unsigned int reg)
{ … }
static inline unsigned char imx_i2c_read_reg(struct imx_i2c_struct *i2c_imx,
unsigned int reg)
{ … }
static void i2c_imx_clear_irq(struct imx_i2c_struct *i2c_imx, unsigned int bits)
{ … }
static void i2c_imx_reset_regs(struct imx_i2c_struct *i2c_imx)
{ … }
static void i2c_imx_dma_request(struct imx_i2c_struct *i2c_imx,
dma_addr_t phy_addr)
{ … }
static void i2c_imx_dma_callback(void *arg)
{ … }
static int i2c_imx_dma_xfer(struct imx_i2c_struct *i2c_imx,
struct i2c_msg *msgs)
{ … }
static void i2c_imx_dma_free(struct imx_i2c_struct *i2c_imx)
{ … }
static int i2c_imx_bus_busy(struct imx_i2c_struct *i2c_imx, int for_busy, bool atomic)
{ … }
static int i2c_imx_trx_complete(struct imx_i2c_struct *i2c_imx, bool atomic)
{ … }
static int i2c_imx_acked(struct imx_i2c_struct *i2c_imx)
{ … }
static void i2c_imx_set_clk(struct imx_i2c_struct *i2c_imx,
unsigned int i2c_clk_rate)
{ … }
static int i2c_imx_clk_notifier_call(struct notifier_block *nb,
unsigned long action, void *data)
{ … }
static int i2c_imx_start(struct imx_i2c_struct *i2c_imx, bool atomic)
{ … }
static void i2c_imx_stop(struct imx_i2c_struct *i2c_imx, bool atomic)
{ … }
static void i2c_imx_enable_bus_idle(struct imx_i2c_struct *i2c_imx)
{ … }
static void i2c_imx_slave_event(struct imx_i2c_struct *i2c_imx,
enum i2c_slave_event event, u8 *val)
{ … }
static void i2c_imx_slave_finish_op(struct imx_i2c_struct *i2c_imx)
{ … }
static irqreturn_t i2c_imx_slave_handle(struct imx_i2c_struct *i2c_imx,
unsigned int status, unsigned int ctl)
{ … }
static enum hrtimer_restart i2c_imx_slave_timeout(struct hrtimer *t)
{ … }
static void i2c_imx_slave_init(struct imx_i2c_struct *i2c_imx)
{ … }
static int i2c_imx_reg_slave(struct i2c_client *client)
{ … }
static int i2c_imx_unreg_slave(struct i2c_client *client)
{ … }
static irqreturn_t i2c_imx_master_isr(struct imx_i2c_struct *i2c_imx, unsigned int status)
{ … }
static irqreturn_t i2c_imx_isr(int irq, void *dev_id)
{ … }
static int i2c_imx_dma_write(struct imx_i2c_struct *i2c_imx,
struct i2c_msg *msgs)
{ … }
static int i2c_imx_dma_read(struct imx_i2c_struct *i2c_imx,
struct i2c_msg *msgs, bool is_lastmsg)
{ … }
static int i2c_imx_write(struct imx_i2c_struct *i2c_imx, struct i2c_msg *msgs,
bool atomic)
{ … }
static int i2c_imx_read(struct imx_i2c_struct *i2c_imx, struct i2c_msg *msgs,
bool is_lastmsg, bool atomic)
{ … }
static int i2c_imx_xfer_common(struct i2c_adapter *adapter,
struct i2c_msg *msgs, int num, bool atomic)
{ … }
static int i2c_imx_xfer(struct i2c_adapter *adapter,
struct i2c_msg *msgs, int num)
{ … }
static int i2c_imx_xfer_atomic(struct i2c_adapter *adapter,
struct i2c_msg *msgs, int num)
{ … }
static int i2c_imx_init_recovery_info(struct imx_i2c_struct *i2c_imx,
struct platform_device *pdev)
{ … }
static u32 i2c_imx_func(struct i2c_adapter *adapter)
{ … }
static const struct i2c_algorithm i2c_imx_algo = …;
static int i2c_imx_probe(struct platform_device *pdev)
{ … }
static void i2c_imx_remove(struct platform_device *pdev)
{ … }
static int __maybe_unused i2c_imx_runtime_suspend(struct device *dev)
{ … }
static int __maybe_unused i2c_imx_runtime_resume(struct device *dev)
{ … }
static const struct dev_pm_ops i2c_imx_pm_ops = …;
static struct platform_driver i2c_imx_driver = …;
static int __init i2c_adap_imx_init(void)
{ … }
subsys_initcall(i2c_adap_imx_init);
static void __exit i2c_adap_imx_exit(void)
{ … }
module_exit(i2c_adap_imx_exit);
MODULE_LICENSE(…) …;
MODULE_AUTHOR(…) …;
MODULE_DESCRIPTION(…) …;
MODULE_ALIAS(…) …;