#include <linux/acpi.h>
#include <linux/atomic.h>
#include <linux/clk.h>
#include <linux/delay.h>
#include <linux/dmaengine.h>
#include <linux/dmapool.h>
#include <linux/dma-mapping.h>
#include <linux/err.h>
#include <linux/i2c.h>
#include <linux/interrupt.h>
#include <linux/io.h>
#include <linux/module.h>
#include <linux/of.h>
#include <linux/platform_device.h>
#include <linux/pm_runtime.h>
#include <linux/scatterlist.h>
#define QUP_CONFIG …
#define QUP_STATE …
#define QUP_IO_MODE …
#define QUP_SW_RESET …
#define QUP_OPERATIONAL …
#define QUP_ERROR_FLAGS …
#define QUP_ERROR_FLAGS_EN …
#define QUP_OPERATIONAL_MASK …
#define QUP_HW_VERSION …
#define QUP_MX_OUTPUT_CNT …
#define QUP_OUT_FIFO_BASE …
#define QUP_MX_WRITE_CNT …
#define QUP_MX_INPUT_CNT …
#define QUP_MX_READ_CNT …
#define QUP_IN_FIFO_BASE …
#define QUP_I2C_CLK_CTL …
#define QUP_I2C_STATUS …
#define QUP_I2C_MASTER_GEN …
#define QUP_RESET_STATE …
#define QUP_RUN_STATE …
#define QUP_PAUSE_STATE …
#define QUP_STATE_MASK …
#define QUP_STATE_VALID …
#define QUP_I2C_MAST_GEN …
#define QUP_I2C_FLUSH …
#define QUP_OPERATIONAL_RESET …
#define QUP_I2C_STATUS_RESET …
#define QUP_I2C_NACK_FLAG …
#define QUP_OUT_NOT_EMPTY …
#define QUP_IN_NOT_EMPTY …
#define QUP_OUT_FULL …
#define QUP_OUT_SVC_FLAG …
#define QUP_IN_SVC_FLAG …
#define QUP_MX_OUTPUT_DONE …
#define QUP_MX_INPUT_DONE …
#define OUT_BLOCK_WRITE_REQ …
#define IN_BLOCK_READ_REQ …
#define QUP_NO_INPUT …
#define QUP_CLOCK_AUTO_GATE …
#define I2C_MINI_CORE …
#define I2C_N_VAL …
#define I2C_N_VAL_V2 …
#define QUP_MSW_SHIFT …
#define QUP_OUTPUT_BLK_MODE …
#define QUP_OUTPUT_BAM_MODE …
#define QUP_INPUT_BLK_MODE …
#define QUP_INPUT_BAM_MODE …
#define QUP_BAM_MODE …
#define QUP_UNPACK_EN …
#define QUP_PACK_EN …
#define QUP_REPACK_EN …
#define QUP_V2_TAGS_EN …
#define QUP_OUTPUT_BLOCK_SIZE(x) …
#define QUP_OUTPUT_FIFO_SIZE(x) …
#define QUP_INPUT_BLOCK_SIZE(x) …
#define QUP_INPUT_FIFO_SIZE(x) …
#define QUP_TAG_START …
#define QUP_TAG_DATA …
#define QUP_TAG_STOP …
#define QUP_TAG_REC …
#define QUP_BAM_INPUT_EOT …
#define QUP_BAM_FLUSH_STOP …
#define QUP_TAG_V2_START …
#define QUP_TAG_V2_DATAWR …
#define QUP_TAG_V2_DATAWR_STOP …
#define QUP_TAG_V2_DATARD …
#define QUP_TAG_V2_DATARD_NACK …
#define QUP_TAG_V2_DATARD_STOP …
#define I2C_STATUS_WR_BUFFER_FULL …
#define I2C_STATUS_BUS_ACTIVE …
#define I2C_STATUS_ERROR_MASK …
#define QUP_STATUS_ERROR_FLAGS …
#define QUP_READ_LIMIT …
#define SET_BIT …
#define RESET_BIT …
#define ONE_BYTE …
#define QUP_I2C_MX_CONFIG_DURING_RUN …
#define MX_TX_RX_LEN …
#define MX_BLOCKS …
#define MX_DMA_TX_RX_LEN …
#define MX_DMA_BLOCKS …
#define TOUT_MIN …
#define DEFAULT_CLK_FREQ …
#define DEFAULT_SRC_CLK …
#define QUP_MAX_TAGS_LEN …
#define RECV_MAX_DATA_LEN …
#define READ_RX_TAGS_LEN …
static unsigned int scl_freq;
module_param_named(scl_freq, scl_freq, uint, 0444);
MODULE_PARM_DESC(…) …;
struct qup_i2c_block { … };
struct qup_i2c_tag { … };
struct qup_i2c_bam { … };
struct qup_i2c_dev { … };
static irqreturn_t qup_i2c_interrupt(int irq, void *dev)
{ … }
static int qup_i2c_poll_state_mask(struct qup_i2c_dev *qup,
u32 req_state, u32 req_mask)
{ … }
static int qup_i2c_poll_state(struct qup_i2c_dev *qup, u32 req_state)
{ … }
static void qup_i2c_flush(struct qup_i2c_dev *qup)
{ … }
static int qup_i2c_poll_state_valid(struct qup_i2c_dev *qup)
{ … }
static int qup_i2c_poll_state_i2c_master(struct qup_i2c_dev *qup)
{ … }
static int qup_i2c_change_state(struct qup_i2c_dev *qup, u32 state)
{ … }
static int qup_i2c_bus_active(struct qup_i2c_dev *qup, int len)
{ … }
static void qup_i2c_write_tx_fifo_v1(struct qup_i2c_dev *qup)
{ … }
static void qup_i2c_set_blk_data(struct qup_i2c_dev *qup,
struct i2c_msg *msg)
{ … }
static int qup_i2c_get_data_len(struct qup_i2c_dev *qup)
{ … }
static bool qup_i2c_check_msg_len(struct i2c_msg *msg)
{ … }
static int qup_i2c_set_tags_smb(u16 addr, u8 *tags, struct qup_i2c_dev *qup,
struct i2c_msg *msg)
{ … }
static int qup_i2c_set_tags(u8 *tags, struct qup_i2c_dev *qup,
struct i2c_msg *msg)
{ … }
static void qup_i2c_bam_cb(void *data)
{ … }
static int qup_sg_set_buf(struct scatterlist *sg, void *buf,
unsigned int buflen, struct qup_i2c_dev *qup,
int dir)
{ … }
static void qup_i2c_rel_dma(struct qup_i2c_dev *qup)
{ … }
static int qup_i2c_req_dma(struct qup_i2c_dev *qup)
{ … }
static int qup_i2c_bam_make_desc(struct qup_i2c_dev *qup, struct i2c_msg *msg)
{ … }
static int qup_i2c_bam_schedule_desc(struct qup_i2c_dev *qup)
{ … }
static void qup_i2c_bam_clear_tag_buffers(struct qup_i2c_dev *qup)
{ … }
static int qup_i2c_bam_xfer(struct i2c_adapter *adap, struct i2c_msg *msg,
int num)
{ … }
static int qup_i2c_wait_for_complete(struct qup_i2c_dev *qup,
struct i2c_msg *msg)
{ … }
static void qup_i2c_read_rx_fifo_v1(struct qup_i2c_dev *qup)
{ … }
static void qup_i2c_write_rx_tags_v1(struct qup_i2c_dev *qup)
{ … }
static void qup_i2c_conf_v1(struct qup_i2c_dev *qup)
{ … }
static void qup_i2c_clear_blk_v1(struct qup_i2c_block *blk)
{ … }
static int qup_i2c_conf_xfer_v1(struct qup_i2c_dev *qup, bool is_rx)
{ … }
static int qup_i2c_write_one(struct qup_i2c_dev *qup)
{ … }
static int qup_i2c_read_one(struct qup_i2c_dev *qup)
{ … }
static int qup_i2c_xfer(struct i2c_adapter *adap,
struct i2c_msg msgs[],
int num)
{ … }
static void qup_i2c_conf_count_v2(struct qup_i2c_dev *qup)
{ … }
static void qup_i2c_conf_mode_v2(struct qup_i2c_dev *qup)
{ … }
static void qup_i2c_clear_blk_v2(struct qup_i2c_block *blk)
{ … }
static void qup_i2c_recv_data(struct qup_i2c_dev *qup)
{ … }
static void qup_i2c_recv_tags(struct qup_i2c_dev *qup)
{ … }
static void qup_i2c_read_rx_fifo_v2(struct qup_i2c_dev *qup)
{ … }
static void
qup_i2c_write_blk_data(struct qup_i2c_dev *qup, u8 **data, unsigned int *len)
{ … }
static void qup_i2c_write_rx_tags_v2(struct qup_i2c_dev *qup)
{ … }
static void qup_i2c_write_tx_fifo_v2(struct qup_i2c_dev *qup)
{ … }
static int
qup_i2c_conf_xfer_v2(struct qup_i2c_dev *qup, bool is_rx, bool is_first,
bool change_pause_state)
{ … }
static int qup_i2c_xfer_v2_msg(struct qup_i2c_dev *qup, int msg_id, bool is_rx)
{ … }
static int
qup_i2c_determine_mode_v2(struct qup_i2c_dev *qup,
struct i2c_msg msgs[], int num)
{ … }
static int qup_i2c_xfer_v2(struct i2c_adapter *adap,
struct i2c_msg msgs[],
int num)
{ … }
static u32 qup_i2c_func(struct i2c_adapter *adap)
{ … }
static const struct i2c_algorithm qup_i2c_algo = …;
static const struct i2c_algorithm qup_i2c_algo_v2 = …;
static const struct i2c_adapter_quirks qup_i2c_quirks = …;
static const struct i2c_adapter_quirks qup_i2c_quirks_v2 = …;
static void qup_i2c_enable_clocks(struct qup_i2c_dev *qup)
{ … }
static void qup_i2c_disable_clocks(struct qup_i2c_dev *qup)
{ … }
static const struct acpi_device_id qup_i2c_acpi_match[] = …;
MODULE_DEVICE_TABLE(acpi, qup_i2c_acpi_match);
static int qup_i2c_probe(struct platform_device *pdev)
{ … }
static void qup_i2c_remove(struct platform_device *pdev)
{ … }
static int qup_i2c_pm_suspend_runtime(struct device *device)
{ … }
static int qup_i2c_pm_resume_runtime(struct device *device)
{ … }
static int qup_i2c_suspend(struct device *device)
{ … }
static int qup_i2c_resume(struct device *device)
{ … }
static const struct dev_pm_ops qup_i2c_qup_pm_ops = …;
static const struct of_device_id qup_i2c_dt_match[] = …;
MODULE_DEVICE_TABLE(of, qup_i2c_dt_match);
static struct platform_driver qup_i2c_driver = …;
module_platform_driver(…) …;
MODULE_DESCRIPTION(…) …;
MODULE_LICENSE(…) …;
MODULE_ALIAS(…) …;