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

// SPDX-License-Identifier: GPL-2.0
/*
 * Copyright (C) 2012 FUJITSU SEMICONDUCTOR LIMITED
 */

#include <linux/acpi.h>
#include <linux/clk.h>
#include <linux/delay.h>
#include <linux/device.h>
#include <linux/err.h>
#include <linux/errno.h>
#include <linux/i2c.h>
#include <linux/interrupt.h>
#include <linux/io.h>
#include <linux/kernel.h>
#include <linux/module.h>
#include <linux/platform_device.h>
#include <linux/sched.h>
#include <linux/slab.h>
#include <linux/spinlock.h>

#define WAIT_PCLK(n, rate)

/* I2C register address definitions */
#define SYNQUACER_I2C_REG_BSR
#define SYNQUACER_I2C_REG_BCR
#define SYNQUACER_I2C_REG_CCR
#define SYNQUACER_I2C_REG_ADR
#define SYNQUACER_I2C_REG_DAR
#define SYNQUACER_I2C_REG_CSR
#define SYNQUACER_I2C_REG_FSR
#define SYNQUACER_I2C_REG_BC2R

/* I2C register bit definitions */
#define SYNQUACER_I2C_BSR_FBT
#define SYNQUACER_I2C_BSR_GCA
#define SYNQUACER_I2C_BSR_AAS
#define SYNQUACER_I2C_BSR_TRX
#define SYNQUACER_I2C_BSR_LRB
#define SYNQUACER_I2C_BSR_AL
#define SYNQUACER_I2C_BSR_RSC
#define SYNQUACER_I2C_BSR_BB

#define SYNQUACER_I2C_BCR_INT
#define SYNQUACER_I2C_BCR_INTE
#define SYNQUACER_I2C_BCR_GCAA
#define SYNQUACER_I2C_BCR_ACK
#define SYNQUACER_I2C_BCR_MSS
#define SYNQUACER_I2C_BCR_SCC
#define SYNQUACER_I2C_BCR_BEIE
#define SYNQUACER_I2C_BCR_BER

#define SYNQUACER_I2C_CCR_CS_MASK
#define SYNQUACER_I2C_CCR_EN
#define SYNQUACER_I2C_CCR_FM

#define SYNQUACER_I2C_CSR_CS_MASK

#define SYNQUACER_I2C_BC2R_SCLL
#define SYNQUACER_I2C_BC2R_SDAL
#define SYNQUACER_I2C_BC2R_SCLS
#define SYNQUACER_I2C_BC2R_SDAS

/* PCLK frequency */
#define SYNQUACER_I2C_BUS_CLK_FR(rate)

/* STANDARD MODE frequency */
#define SYNQUACER_I2C_CLK_MASTER_STD(rate)
/* FAST MODE frequency */
#define SYNQUACER_I2C_CLK_MASTER_FAST(rate)

/* (clkrate <= 18000000) */
/* calculate the value of CS bits in CCR register on standard mode */
#define SYNQUACER_I2C_CCR_CS_STD_MAX_18M(rate)

/* calculate the value of CS bits in CSR register on standard mode */
#define SYNQUACER_I2C_CSR_CS_STD_MAX_18M(rate)

/* calculate the value of CS bits in CCR register on fast mode */
#define SYNQUACER_I2C_CCR_CS_FAST_MAX_18M(rate)

/* calculate the value of CS bits in CSR register on fast mode */
#define SYNQUACER_I2C_CSR_CS_FAST_MAX_18M(rate)

/* (clkrate > 18000000) */
/* calculate the value of CS bits in CCR register on standard mode */
#define SYNQUACER_I2C_CCR_CS_STD_MIN_18M(rate)

/* calculate the value of CS bits in CSR register on standard mode */
#define SYNQUACER_I2C_CSR_CS_STD_MIN_18M(rate)

/* calculate the value of CS bits in CCR register on fast mode */
#define SYNQUACER_I2C_CCR_CS_FAST_MIN_18M(rate)

/* calculate the value of CS bits in CSR register on fast mode */
#define SYNQUACER_I2C_CSR_CS_FAST_MIN_18M(rate)

/* min I2C clock frequency 14M */
#define SYNQUACER_I2C_MIN_CLK_RATE
/* max I2C clock frequency 200M */
#define SYNQUACER_I2C_MAX_CLK_RATE
/* I2C clock frequency 18M */
#define SYNQUACER_I2C_CLK_RATE_18M

#define SYNQUACER_I2C_SPEED_FM
#define SYNQUACER_I2C_SPEED_SM

enum i2c_state {};

struct synquacer_i2c {};

static inline int is_lastmsg(struct synquacer_i2c *i2c)
{}

static inline int is_msglast(struct synquacer_i2c *i2c)
{}

static inline int is_msgend(struct synquacer_i2c *i2c)
{}

static inline unsigned long calc_timeout_ms(struct synquacer_i2c *i2c,
					    struct i2c_msg *msgs,
					    int num)
{}

static void synquacer_i2c_stop(struct synquacer_i2c *i2c, int ret)
{}

static void synquacer_i2c_hw_init(struct synquacer_i2c *i2c)
{}

static void synquacer_i2c_hw_reset(struct synquacer_i2c *i2c)
{}

static int synquacer_i2c_master_start(struct synquacer_i2c *i2c,
				      struct i2c_msg *pmsg)
{}

static int synquacer_i2c_doxfer(struct synquacer_i2c *i2c,
				struct i2c_msg *msgs, int num)
{}

static irqreturn_t synquacer_i2c_isr(int irq, void *dev_id)
{}

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

static u32 synquacer_i2c_functionality(struct i2c_adapter *adap)
{}

static const struct i2c_algorithm synquacer_i2c_algo =;

static const struct i2c_adapter synquacer_i2c_ops =;

static int synquacer_i2c_probe(struct platform_device *pdev)
{}

static void synquacer_i2c_remove(struct platform_device *pdev)
{
	struct synquacer_i2c *i2c = platform_get_drvdata(pdev);

	i2c_del_adapter(&i2c->adapter);
};

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

#ifdef CONFIG_ACPI
static const struct acpi_device_id synquacer_i2c_acpi_ids[] =;
MODULE_DEVICE_TABLE(acpi, synquacer_i2c_acpi_ids);
#endif

static struct platform_driver synquacer_i2c_driver =;
module_platform_driver();

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