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

// SPDX-License-Identifier: GPL-2.0-or-later
/*
 * Actions Semiconductor Owl SoC's I2C driver
 *
 * Copyright (c) 2014 Actions Semi Inc.
 * Author: David Liu <[email protected]>
 *
 * Copyright (c) 2018 Linaro Ltd.
 * Author: Manivannan Sadhasivam <[email protected]>
 */

#include <linux/clk.h>
#include <linux/delay.h>
#include <linux/i2c.h>
#include <linux/interrupt.h>
#include <linux/io.h>
#include <linux/iopoll.h>
#include <linux/module.h>
#include <linux/of.h>
#include <linux/platform_device.h>

/* I2C registers */
#define OWL_I2C_REG_CTL
#define OWL_I2C_REG_CLKDIV
#define OWL_I2C_REG_STAT
#define OWL_I2C_REG_ADDR
#define OWL_I2C_REG_TXDAT
#define OWL_I2C_REG_RXDAT
#define OWL_I2C_REG_CMD
#define OWL_I2C_REG_FIFOCTL
#define OWL_I2C_REG_FIFOSTAT
#define OWL_I2C_REG_DATCNT
#define OWL_I2C_REG_RCNT

/* I2Cx_CTL Bit Mask */
#define OWL_I2C_CTL_RB
#define OWL_I2C_CTL_GBCC(x)
#define OWL_I2C_CTL_GBCC_NONE
#define OWL_I2C_CTL_GBCC_START
#define OWL_I2C_CTL_GBCC_STOP
#define OWL_I2C_CTL_GBCC_RSTART
#define OWL_I2C_CTL_IRQE
#define OWL_I2C_CTL_EN
#define OWL_I2C_CTL_AE
#define OWL_I2C_CTL_SHSM

#define OWL_I2C_DIV_FACTOR(x)

/* I2Cx_STAT Bit Mask */
#define OWL_I2C_STAT_RACK
#define OWL_I2C_STAT_BEB
#define OWL_I2C_STAT_IRQP
#define OWL_I2C_STAT_LAB
#define OWL_I2C_STAT_STPD
#define OWL_I2C_STAT_STAD
#define OWL_I2C_STAT_BBB
#define OWL_I2C_STAT_TCB
#define OWL_I2C_STAT_LBST
#define OWL_I2C_STAT_SAMB
#define OWL_I2C_STAT_SRGC

/* I2Cx_CMD Bit Mask */
#define OWL_I2C_CMD_SBE
#define OWL_I2C_CMD_RBE
#define OWL_I2C_CMD_DE
#define OWL_I2C_CMD_NS
#define OWL_I2C_CMD_SE
#define OWL_I2C_CMD_MSS
#define OWL_I2C_CMD_WRS
#define OWL_I2C_CMD_SECL

#define OWL_I2C_CMD_AS(x)
#define OWL_I2C_CMD_SAS(x)

/* I2Cx_FIFOCTL Bit Mask */
#define OWL_I2C_FIFOCTL_NIB
#define OWL_I2C_FIFOCTL_RFR
#define OWL_I2C_FIFOCTL_TFR

/* I2Cc_FIFOSTAT Bit Mask */
#define OWL_I2C_FIFOSTAT_CECB
#define OWL_I2C_FIFOSTAT_RNB
#define OWL_I2C_FIFOSTAT_RFE
#define OWL_I2C_FIFOSTAT_TFF
#define OWL_I2C_FIFOSTAT_TFD
#define OWL_I2C_FIFOSTAT_RFD

/* I2C bus timeout */
#define OWL_I2C_TIMEOUT_MS
#define OWL_I2C_TIMEOUT

#define OWL_I2C_MAX_RETRIES

struct owl_i2c_dev {};

static void owl_i2c_update_reg(void __iomem *reg, unsigned int val, bool state)
{}

static void owl_i2c_reset(struct owl_i2c_dev *i2c_dev)
{}

static int owl_i2c_reset_fifo(struct owl_i2c_dev *i2c_dev)
{}

static void owl_i2c_set_freq(struct owl_i2c_dev *i2c_dev)
{}

static void owl_i2c_xfer_data(struct owl_i2c_dev *i2c_dev)
{}

static irqreturn_t owl_i2c_interrupt(int irq, void *_dev)
{}

static u32 owl_i2c_func(struct i2c_adapter *adap)
{}

static int owl_i2c_check_bus_busy(struct i2c_adapter *adap)
{}

static int owl_i2c_xfer_common(struct i2c_adapter *adap, struct i2c_msg *msgs,
			       int num, bool atomic)
{}

static int owl_i2c_xfer(struct i2c_adapter *adap, struct i2c_msg *msgs,
			int num)
{}

static int owl_i2c_xfer_atomic(struct i2c_adapter *adap,
			       struct i2c_msg *msgs, int num)
{}

static const struct i2c_algorithm owl_i2c_algorithm =;

static const struct i2c_adapter_quirks owl_i2c_quirks =;

static int owl_i2c_probe(struct platform_device *pdev)
{}

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

static struct platform_driver owl_i2c_driver =;
module_platform_driver();

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