linux/drivers/i2c/busses/i2c-jz4780.c

// SPDX-License-Identifier: GPL-2.0-or-later
/*
 * Ingenic JZ4780 I2C bus driver
 *
 * Copyright (C) 2006 - 2009 Ingenic Semiconductor Inc.
 * Copyright (C) 2015 Imagination Technologies
 * Copyright (C) 2019 周琰杰 (Zhou Yanjie) <[email protected]>
 */

#include <linux/bitops.h>
#include <linux/clk.h>
#include <linux/completion.h>
#include <linux/delay.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/platform_device.h>
#include <linux/sched.h>
#include <linux/slab.h>
#include <linux/time.h>

#define JZ4780_I2C_CTRL
#define JZ4780_I2C_TAR
#define JZ4780_I2C_SAR
#define JZ4780_I2C_DC
#define JZ4780_I2C_SHCNT
#define JZ4780_I2C_SLCNT
#define JZ4780_I2C_FHCNT
#define JZ4780_I2C_FLCNT
#define JZ4780_I2C_INTST
#define JZ4780_I2C_INTM
#define JZ4780_I2C_RXTL
#define JZ4780_I2C_TXTL
#define JZ4780_I2C_CINTR
#define JZ4780_I2C_CRXUF
#define JZ4780_I2C_CRXOF
#define JZ4780_I2C_CTXOF
#define JZ4780_I2C_CRXREQ
#define JZ4780_I2C_CTXABRT
#define JZ4780_I2C_CRXDONE
#define JZ4780_I2C_CACT
#define JZ4780_I2C_CSTP
#define JZ4780_I2C_CSTT
#define JZ4780_I2C_CGC
#define JZ4780_I2C_ENB
#define JZ4780_I2C_STA
#define JZ4780_I2C_TXABRT
#define JZ4780_I2C_DMACR
#define JZ4780_I2C_DMATDLR
#define JZ4780_I2C_DMARDLR
#define JZ4780_I2C_SDASU
#define JZ4780_I2C_ACKGC
#define JZ4780_I2C_ENSTA
#define JZ4780_I2C_SDAHD
#define X1000_I2C_SDAHD

#define JZ4780_I2C_CTRL_STPHLD
#define JZ4780_I2C_CTRL_SLVDIS
#define JZ4780_I2C_CTRL_REST
#define JZ4780_I2C_CTRL_MATP
#define JZ4780_I2C_CTRL_SATP
#define JZ4780_I2C_CTRL_SPDF
#define JZ4780_I2C_CTRL_SPDS
#define JZ4780_I2C_CTRL_MD

#define JZ4780_I2C_STA_SLVACT
#define JZ4780_I2C_STA_MSTACT
#define JZ4780_I2C_STA_RFF
#define JZ4780_I2C_STA_RFNE
#define JZ4780_I2C_STA_TFE
#define JZ4780_I2C_STA_TFNF
#define JZ4780_I2C_STA_ACT

#define X1000_I2C_DC_STOP

#define JZ4780_I2C_INTST_IGC
#define JZ4780_I2C_INTST_ISTT
#define JZ4780_I2C_INTST_ISTP
#define JZ4780_I2C_INTST_IACT
#define JZ4780_I2C_INTST_RXDN
#define JZ4780_I2C_INTST_TXABT
#define JZ4780_I2C_INTST_RDREQ
#define JZ4780_I2C_INTST_TXEMP
#define JZ4780_I2C_INTST_TXOF
#define JZ4780_I2C_INTST_RXFL
#define JZ4780_I2C_INTST_RXOF
#define JZ4780_I2C_INTST_RXUF

#define JZ4780_I2C_INTM_MIGC
#define JZ4780_I2C_INTM_MISTT
#define JZ4780_I2C_INTM_MISTP
#define JZ4780_I2C_INTM_MIACT
#define JZ4780_I2C_INTM_MRXDN
#define JZ4780_I2C_INTM_MTXABT
#define JZ4780_I2C_INTM_MRDREQ
#define JZ4780_I2C_INTM_MTXEMP
#define JZ4780_I2C_INTM_MTXOF
#define JZ4780_I2C_INTM_MRXFL
#define JZ4780_I2C_INTM_MRXOF
#define JZ4780_I2C_INTM_MRXUF

#define JZ4780_I2C_DC_READ

#define JZ4780_I2C_SDAHD_HDENB

#define JZ4780_I2C_ENB_I2C

#define JZ4780_I2CSHCNT_ADJUST(n)
#define JZ4780_I2CSLCNT_ADJUST(n)
#define JZ4780_I2CFHCNT_ADJUST(n)
#define JZ4780_I2CFLCNT_ADJUST(n)

#define JZ4780_I2C_FIFO_LEN

#define X1000_I2C_FIFO_LEN

#define JZ4780_I2C_TIMEOUT

#define BUFSIZE

enum ingenic_i2c_version {};

/* ingenic_i2c_config: SoC specific config data. */
struct ingenic_i2c_config {};

struct jz4780_i2c {};

static inline unsigned short jz4780_i2c_readw(struct jz4780_i2c *i2c,
					      unsigned long offset)
{}

static inline void jz4780_i2c_writew(struct jz4780_i2c *i2c,
				     unsigned long offset, unsigned short val)
{}

static int jz4780_i2c_disable(struct jz4780_i2c *i2c)
{}

static int jz4780_i2c_enable(struct jz4780_i2c *i2c)
{}

static int jz4780_i2c_set_target(struct jz4780_i2c *i2c, unsigned char address)
{}

static int jz4780_i2c_set_speed(struct jz4780_i2c *i2c)
{}

static int jz4780_i2c_cleanup(struct jz4780_i2c *i2c)
{}

static int jz4780_i2c_prepare(struct jz4780_i2c *i2c)
{}

static void jz4780_i2c_send_rcmd(struct jz4780_i2c *i2c,
								 int cmd_count,
								 int cmd_left)
{}

static void jz4780_i2c_trans_done(struct jz4780_i2c *i2c)
{}

static irqreturn_t jz4780_i2c_irq(int irqno, void *dev_id)
{}

static void jz4780_i2c_txabrt(struct jz4780_i2c *i2c, int src)
{}

static inline int jz4780_i2c_xfer_read(struct jz4780_i2c *i2c,
				       unsigned char *buf, int len, int cnt,
				       int idx)
{}

static inline int jz4780_i2c_xfer_write(struct jz4780_i2c *i2c,
					unsigned char *buf, int len,
					int cnt, int idx)
{}

static int jz4780_i2c_xfer(struct i2c_adapter *adap, struct i2c_msg *msg,
			   int count)
{}

static u32 jz4780_i2c_functionality(struct i2c_adapter *adap)
{}

static const struct i2c_algorithm jz4780_i2c_algorithm =;

static const struct ingenic_i2c_config jz4780_i2c_config =;

static const struct ingenic_i2c_config x1000_i2c_config =;

static const struct of_device_id jz4780_i2c_of_matches[] =;
MODULE_DEVICE_TABLE(of, jz4780_i2c_of_matches);

static int jz4780_i2c_probe(struct platform_device *pdev)
{}

static void jz4780_i2c_remove(struct platform_device *pdev)
{}

static struct platform_driver jz4780_i2c_driver =;

module_platform_driver();

MODULE_LICENSE();
MODULE_AUTHOR();
MODULE_DESCRIPTION();