#include <linux/bitops.h>
#include <linux/clk.h>
#include <linux/completion.h>
#include <linux/err.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_platform.h>
#include <linux/platform_device.h>
#include <linux/pm_runtime.h>
#include <linux/slab.h>
#include <linux/timer.h>
#define SCB_STATUS_REG …
#define SCB_OVERRIDE_REG …
#define SCB_READ_ADDR_REG …
#define SCB_READ_COUNT_REG …
#define SCB_WRITE_ADDR_REG …
#define SCB_READ_DATA_REG …
#define SCB_WRITE_DATA_REG …
#define SCB_FIFO_STATUS_REG …
#define SCB_CONTROL_SOFT_RESET …
#define SCB_CLK_SET_REG …
#define SCB_INT_STATUS_REG …
#define SCB_INT_CLEAR_REG …
#define SCB_INT_MASK_REG …
#define SCB_CONTROL_REG …
#define SCB_TIME_TPL_REG …
#define SCB_TIME_TPH_REG …
#define SCB_TIME_TP2S_REG …
#define SCB_TIME_TBI_REG …
#define SCB_TIME_TSL_REG …
#define SCB_TIME_TDL_REG …
#define SCB_TIME_TSDL_REG …
#define SCB_TIME_TSDH_REG …
#define SCB_READ_XADDR_REG …
#define SCB_WRITE_XADDR_REG …
#define SCB_WRITE_COUNT_REG …
#define SCB_CORE_REV_REG …
#define SCB_TIME_TCKH_REG …
#define SCB_TIME_TCKL_REG …
#define SCB_FIFO_FLUSH_REG …
#define SCB_READ_FIFO_REG …
#define SCB_CLEAR_REG …
#define SCB_CONTROL_CLK_ENABLE …
#define SCB_CONTROL_TRANSACTION_HALT …
#define FIFO_READ_FULL …
#define FIFO_READ_EMPTY …
#define FIFO_WRITE_FULL …
#define FIFO_WRITE_EMPTY …
#define SCB_FILT_DISABLE …
#define SCB_FILT_BYPASS …
#define SCB_FILT_INC_MASK …
#define SCB_FILT_INC_SHIFT …
#define SCB_INC_MASK …
#define SCB_INC_SHIFT …
#define INT_BUS_INACTIVE …
#define INT_UNEXPECTED_START …
#define INT_SCLK_LOW_TIMEOUT …
#define INT_SDAT_LOW_TIMEOUT …
#define INT_WRITE_ACK_ERR …
#define INT_ADDR_ACK_ERR …
#define INT_FIFO_FULL …
#define INT_FIFO_FILLING …
#define INT_FIFO_EMPTY …
#define INT_FIFO_EMPTYING …
#define INT_TRANSACTION_DONE …
#define INT_SLAVE_EVENT …
#define INT_MASTER_HALTED …
#define INT_TIMING …
#define INT_STOP_DETECTED …
#define INT_FIFO_FULL_FILLING …
#define INT_LEVEL …
#define INT_ENABLE_MASK_INACTIVE …
#define INT_ENABLE_MASK_RAW …
#define INT_ENABLE_MASK_ATOMIC …
#define INT_ENABLE_MASK_AUTOMATIC …
#define INT_ENABLE_MASK_WAITSTOP …
#define LINESTAT_SCLK_LINE_STATUS …
#define LINESTAT_SCLK_EN …
#define LINESTAT_SDAT_LINE_STATUS …
#define LINESTAT_SDAT_EN …
#define LINESTAT_DET_START_STATUS …
#define LINESTAT_DET_STOP_STATUS …
#define LINESTAT_DET_ACK_STATUS …
#define LINESTAT_DET_NACK_STATUS …
#define LINESTAT_BUS_IDLE …
#define LINESTAT_T_DONE_STATUS …
#define LINESTAT_SCLK_OUT_STATUS …
#define LINESTAT_SDAT_OUT_STATUS …
#define LINESTAT_GEN_LINE_MASK_STATUS …
#define LINESTAT_START_BIT_DET …
#define LINESTAT_STOP_BIT_DET …
#define LINESTAT_ACK_DET …
#define LINESTAT_NACK_DET …
#define LINESTAT_INPUT_HELD_V …
#define LINESTAT_ABORT_DET …
#define LINESTAT_ACK_OR_NACK_DET …
#define LINESTAT_INPUT_DATA …
#define LINESTAT_INPUT_DATA_SHIFT …
#define LINESTAT_CLEAR_SHIFT …
#define LINESTAT_LATCHED …
#define OVERRIDE_SCLK_OVR …
#define OVERRIDE_SCLKEN_OVR …
#define OVERRIDE_SDAT_OVR …
#define OVERRIDE_SDATEN_OVR …
#define OVERRIDE_MASTER …
#define OVERRIDE_LINE_OVR_EN …
#define OVERRIDE_DIRECT …
#define OVERRIDE_CMD_SHIFT …
#define OVERRIDE_CMD_MASK …
#define OVERRIDE_DATA_SHIFT …
#define OVERRIDE_SCLK_DOWN …
#define OVERRIDE_SCLK_UP …
#define OVERRIDE_SDAT_DOWN …
#define OVERRIDE_SDAT_UP …
#define CMD_PAUSE …
#define CMD_GEN_DATA …
#define CMD_GEN_START …
#define CMD_GEN_STOP …
#define CMD_GEN_ACK …
#define CMD_GEN_NACK …
#define CMD_RET_DATA …
#define CMD_RET_ACK …
#define TIMEOUT_TBI …
#define TIMEOUT_TSL …
#define TIMEOUT_TDL …
#define IMG_I2C_TIMEOUT …
#define SCB_OPT_INC …
#define SCB_FILT_GLITCH …
#define ISR_COMPLETE_M …
#define ISR_FATAL_M …
#define ISR_WAITSTOP …
#define ISR_STATUS_M …
#define ISR_COMPLETE(err) …
#define ISR_FATAL(err) …
#define IMG_I2C_PM_TIMEOUT …
enum img_i2c_mode { … };
struct img_i2c_timings { … };
static struct img_i2c_timings timings[] = …;
static u8 img_i2c_reset_seq[] = …;
static u8 img_i2c_stop_seq[] = …;
static unsigned int img_i2c_int_enable_by_mode[] = …;
static const char * const img_i2c_atomic_cmd_names[] = …;
struct img_i2c { … };
static int img_i2c_runtime_suspend(struct device *dev);
static int img_i2c_runtime_resume(struct device *dev);
static void img_i2c_writel(struct img_i2c *i2c, u32 offset, u32 value)
{ … }
static u32 img_i2c_readl(struct img_i2c *i2c, u32 offset)
{ … }
static void img_i2c_wr_rd_fence(struct img_i2c *i2c)
{ … }
static void img_i2c_switch_mode(struct img_i2c *i2c, enum img_i2c_mode mode)
{ … }
static void img_i2c_raw_op(struct img_i2c *i2c)
{ … }
static const char *img_i2c_atomic_op_name(unsigned int cmd)
{ … }
static void img_i2c_atomic_op(struct img_i2c *i2c, int cmd, u8 data)
{ … }
static void img_i2c_atomic_start(struct img_i2c *i2c)
{ … }
static void img_i2c_soft_reset(struct img_i2c *i2c)
{ … }
static void img_i2c_transaction_halt(struct img_i2c *i2c, bool t_halt)
{ … }
static void img_i2c_read_fifo(struct img_i2c *i2c)
{ … }
static void img_i2c_write_fifo(struct img_i2c *i2c)
{ … }
static void img_i2c_read(struct img_i2c *i2c)
{ … }
static void img_i2c_write(struct img_i2c *i2c)
{ … }
static void img_i2c_complete_transaction(struct img_i2c *i2c, int status)
{ … }
static unsigned int img_i2c_raw_atomic_delay_handler(struct img_i2c *i2c,
u32 int_status, u32 line_status)
{ … }
static unsigned int img_i2c_raw(struct img_i2c *i2c, u32 int_status,
u32 line_status)
{ … }
static unsigned int img_i2c_sequence(struct img_i2c *i2c, u32 int_status)
{ … }
static void img_i2c_reset_start(struct img_i2c *i2c)
{ … }
static void img_i2c_stop_start(struct img_i2c *i2c)
{ … }
static unsigned int img_i2c_atomic(struct img_i2c *i2c,
u32 int_status,
u32 line_status)
{ … }
static void img_i2c_check_timer(struct timer_list *t)
{ … }
static unsigned int img_i2c_auto(struct img_i2c *i2c,
unsigned int int_status,
unsigned int line_status)
{ … }
static irqreturn_t img_i2c_isr(int irq, void *dev_id)
{ … }
static int img_i2c_reset_bus(struct img_i2c *i2c)
{ … }
static int img_i2c_xfer(struct i2c_adapter *adap, struct i2c_msg *msgs,
int num)
{ … }
static u32 img_i2c_func(struct i2c_adapter *adap)
{ … }
static const struct i2c_algorithm img_i2c_algo = …;
static int img_i2c_init(struct img_i2c *i2c)
{ … }
static int img_i2c_probe(struct platform_device *pdev)
{ … }
static void img_i2c_remove(struct platform_device *dev)
{ … }
static int img_i2c_runtime_suspend(struct device *dev)
{ … }
static int img_i2c_runtime_resume(struct device *dev)
{ … }
static int img_i2c_suspend(struct device *dev)
{ … }
static int img_i2c_resume(struct device *dev)
{ … }
static const struct dev_pm_ops img_i2c_pm = …;
static const struct of_device_id img_scb_i2c_match[] = …;
MODULE_DEVICE_TABLE(of, img_scb_i2c_match);
static struct platform_driver img_scb_i2c_driver = …;
module_platform_driver(…) …;
MODULE_AUTHOR(…) …;
MODULE_DESCRIPTION(…) …;
MODULE_LICENSE(…) …;