linux/drivers/i2c/busses/i2c-microchip-corei2c.c

// SPDX-License-Identifier: GPL-2.0
/*
 * Microchip CoreI2C I2C controller driver
 *
 * Copyright (c) 2018-2022 Microchip Corporation. All rights reserved.
 *
 * Author: Daire McNamara <[email protected]>
 * Author: Conor Dooley <[email protected]>
 */
#include <linux/clk.h>
#include <linux/clkdev.h>
#include <linux/err.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>

#define CORE_I2C_CTRL
#define CTRL_CR0
#define CTRL_CR1
#define CTRL_AA
#define CTRL_SI
#define CTRL_STO
#define CTRL_STA
#define CTRL_ENS1
#define CTRL_CR2

#define STATUS_BUS_ERROR
#define STATUS_M_START_SENT
#define STATUS_M_REPEATED_START_SENT
#define STATUS_M_SLAW_ACK
#define STATUS_M_SLAW_NACK
#define STATUS_M_TX_DATA_ACK
#define STATUS_M_TX_DATA_NACK
#define STATUS_M_ARB_LOST
#define STATUS_M_SLAR_ACK
#define STATUS_M_SLAR_NACK
#define STATUS_M_RX_DATA_ACKED
#define STATUS_M_RX_DATA_NACKED
#define STATUS_S_SLAW_ACKED
#define STATUS_S_ARB_LOST_SLAW_ACKED
#define STATUS_S_GENERAL_CALL_ACKED
#define STATUS_S_ARB_LOST_GENERAL_CALL_ACKED
#define STATUS_S_RX_DATA_ACKED
#define STATUS_S_RX_DATA_NACKED
#define STATUS_S_GENERAL_CALL_RX_DATA_ACKED
#define STATUS_S_GENERAL_CALL_RX_DATA_NACKED
#define STATUS_S_RX_STOP
#define STATUS_S_SLAR_ACKED
#define STATUS_S_ARB_LOST_SLAR_ACKED
#define STATUS_S_TX_DATA_ACK
#define STATUS_S_TX_DATA_NACK
#define STATUS_LAST_DATA_ACK
#define STATUS_M_SMB_MASTER_RESET
#define STATUS_S_SCL_LOW_TIMEOUT
#define STATUS_NO_STATE_INFO

#define CORE_I2C_STATUS
#define CORE_I2C_DATA
#define WRITE_BIT
#define READ_BIT
#define SLAVE_ADDR_SHIFT
#define CORE_I2C_SLAVE0_ADDR
#define GENERAL_CALL_BIT
#define CORE_I2C_SMBUS
#define SMBALERT_INT_ENB
#define SMBSUS_INT_ENB
#define SMBUS_ENB
#define SMBALERT_NI_STATUS
#define SMBALERT_NO_CTRL
#define SMBSUS_NI_STATUS
#define SMBSUS_NO_CTRL
#define SMBUS_RESET
#define CORE_I2C_FREQ
#define CORE_I2C_GLITCHREG
#define CORE_I2C_SLAVE1_ADDR

#define PCLK_DIV_960
#define PCLK_DIV_256
#define PCLK_DIV_224
#define PCLK_DIV_192
#define PCLK_DIV_160
#define PCLK_DIV_120
#define PCLK_DIV_60
#define BCLK_DIV_8
#define CLK_MASK

/**
 * struct mchp_corei2c_dev - Microchip CoreI2C device private data
 *
 * @base:		pointer to register struct
 * @dev:		device reference
 * @i2c_clk:		clock reference for i2c input clock
 * @buf:		pointer to msg buffer for easier use
 * @msg_complete:	xfer completion object
 * @adapter:		core i2c abstraction
 * @msg_err:		error code for completed message
 * @bus_clk_rate:	current i2c bus clock rate
 * @isr_status:		cached copy of local ISR status
 * @msg_len:		number of bytes transferred in msg
 * @addr:		address of the current slave
 */
struct mchp_corei2c_dev {};

static void mchp_corei2c_core_disable(struct mchp_corei2c_dev *idev)
{}

static void mchp_corei2c_core_enable(struct mchp_corei2c_dev *idev)
{}

static void mchp_corei2c_reset(struct mchp_corei2c_dev *idev)
{}

static inline void mchp_corei2c_stop(struct mchp_corei2c_dev *idev)
{}

static inline int mchp_corei2c_set_divisor(u32 rate,
					   struct mchp_corei2c_dev *idev)
{}

static int mchp_corei2c_init(struct mchp_corei2c_dev *idev)
{}

static void mchp_corei2c_empty_rx(struct mchp_corei2c_dev *idev)
{}

static int mchp_corei2c_fill_tx(struct mchp_corei2c_dev *idev)
{}

static irqreturn_t mchp_corei2c_handle_isr(struct mchp_corei2c_dev *idev)
{}

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

static int mchp_corei2c_xfer_msg(struct mchp_corei2c_dev *idev,
				 struct i2c_msg *msg)
{}

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

static u32 mchp_corei2c_func(struct i2c_adapter *adap)
{}

static const struct i2c_algorithm mchp_corei2c_algo =;

static int mchp_corei2c_probe(struct platform_device *pdev)
{}

static void mchp_corei2c_remove(struct platform_device *pdev)
{}

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

static struct platform_driver mchp_corei2c_driver =;

module_platform_driver();

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