#include <linux/clk.h>
#include <linux/completion.h>
#include <linux/delay.h>
#include <linux/err.h>
#include <linux/errno.h>
#include <linux/i2c.h>
#include <linux/init.h>
#include <linux/interrupt.h>
#include <linux/io.h>
#include <linux/kernel.h>
#include <linux/module.h>
#include <linux/of.h>
#include <linux/pinctrl/consumer.h>
#include <linux/platform_device.h>
#include <linux/pm_runtime.h>
#include <linux/sched.h>
#include <linux/slab.h>
#define DRIVER_NAME …
#define LPI2C_PARAM …
#define LPI2C_MCR …
#define LPI2C_MSR …
#define LPI2C_MIER …
#define LPI2C_MCFGR0 …
#define LPI2C_MCFGR1 …
#define LPI2C_MCFGR2 …
#define LPI2C_MCFGR3 …
#define LPI2C_MCCR0 …
#define LPI2C_MCCR1 …
#define LPI2C_MFCR …
#define LPI2C_MFSR …
#define LPI2C_MTDR …
#define LPI2C_MRDR …
#define TRAN_DATA …
#define RECV_DATA …
#define GEN_STOP …
#define RECV_DISCARD …
#define GEN_START …
#define START_NACK …
#define START_HIGH …
#define START_HIGH_NACK …
#define MCR_MEN …
#define MCR_RST …
#define MCR_DOZEN …
#define MCR_DBGEN …
#define MCR_RTF …
#define MCR_RRF …
#define MSR_TDF …
#define MSR_RDF …
#define MSR_SDF …
#define MSR_NDF …
#define MSR_ALF …
#define MSR_MBF …
#define MSR_BBF …
#define MIER_TDIE …
#define MIER_RDIE …
#define MIER_SDIE …
#define MIER_NDIE …
#define MCFGR1_AUTOSTOP …
#define MCFGR1_IGNACK …
#define MRDR_RXEMPTY …
#define I2C_CLK_RATIO …
#define CHUNK_DATA …
#define I2C_PM_TIMEOUT …
enum lpi2c_imx_mode { … };
enum lpi2c_imx_pincfg { … };
struct lpi2c_imx_struct { … };
static void lpi2c_imx_intctrl(struct lpi2c_imx_struct *lpi2c_imx,
unsigned int enable)
{ … }
static int lpi2c_imx_bus_busy(struct lpi2c_imx_struct *lpi2c_imx)
{ … }
static void lpi2c_imx_set_mode(struct lpi2c_imx_struct *lpi2c_imx)
{ … }
static int lpi2c_imx_start(struct lpi2c_imx_struct *lpi2c_imx,
struct i2c_msg *msgs)
{ … }
static void lpi2c_imx_stop(struct lpi2c_imx_struct *lpi2c_imx)
{ … }
static int lpi2c_imx_config(struct lpi2c_imx_struct *lpi2c_imx)
{ … }
static int lpi2c_imx_master_enable(struct lpi2c_imx_struct *lpi2c_imx)
{ … }
static int lpi2c_imx_master_disable(struct lpi2c_imx_struct *lpi2c_imx)
{ … }
static int lpi2c_imx_msg_complete(struct lpi2c_imx_struct *lpi2c_imx)
{ … }
static int lpi2c_imx_txfifo_empty(struct lpi2c_imx_struct *lpi2c_imx)
{ … }
static void lpi2c_imx_set_tx_watermark(struct lpi2c_imx_struct *lpi2c_imx)
{ … }
static void lpi2c_imx_set_rx_watermark(struct lpi2c_imx_struct *lpi2c_imx)
{ … }
static void lpi2c_imx_write_txfifo(struct lpi2c_imx_struct *lpi2c_imx)
{ … }
static void lpi2c_imx_read_rxfifo(struct lpi2c_imx_struct *lpi2c_imx)
{ … }
static void lpi2c_imx_write(struct lpi2c_imx_struct *lpi2c_imx,
struct i2c_msg *msgs)
{ … }
static void lpi2c_imx_read(struct lpi2c_imx_struct *lpi2c_imx,
struct i2c_msg *msgs)
{ … }
static int lpi2c_imx_xfer(struct i2c_adapter *adapter,
struct i2c_msg *msgs, int num)
{ … }
static irqreturn_t lpi2c_imx_isr(int irq, void *dev_id)
{ … }
static int lpi2c_imx_init_recovery_info(struct lpi2c_imx_struct *lpi2c_imx,
struct platform_device *pdev)
{ … }
static u32 lpi2c_imx_func(struct i2c_adapter *adapter)
{ … }
static const struct i2c_algorithm lpi2c_imx_algo = …;
static const struct of_device_id lpi2c_imx_of_match[] = …;
MODULE_DEVICE_TABLE(of, lpi2c_imx_of_match);
static int lpi2c_imx_probe(struct platform_device *pdev)
{ … }
static void lpi2c_imx_remove(struct platform_device *pdev)
{ … }
static int __maybe_unused lpi2c_runtime_suspend(struct device *dev)
{ … }
static int __maybe_unused lpi2c_runtime_resume(struct device *dev)
{ … }
static const struct dev_pm_ops lpi2c_pm_ops = …;
static struct platform_driver lpi2c_imx_driver = …;
module_platform_driver(…) …;
MODULE_AUTHOR(…) …;
MODULE_DESCRIPTION(…) …;
MODULE_LICENSE(…) …;