#include <linux/delay.h>
#include <linux/i2c.h>
#include <linux/init.h>
#include <linux/io.h>
#include <linux/kernel.h>
#include <linux/module.h>
#include <linux/platform_data/mlxreg.h>
#include <linux/platform_device.h>
#include <linux/regmap.h>
#define MLXPLAT_CPLD_LPC_I2C_BASE_ADDR …
#define MLXCPLD_I2C_DEVICE_NAME …
#define MLXCPLD_I2C_VALID_FLAG …
#define MLXCPLD_I2C_BUS_NUM …
#define MLXCPLD_I2C_DATA_REG_SZ …
#define MLXCPLD_I2C_DATA_SZ_BIT …
#define MLXCPLD_I2C_DATA_EXT2_SZ_BIT …
#define MLXCPLD_I2C_DATA_SZ_MASK …
#define MLXCPLD_I2C_SMBUS_BLK_BIT …
#define MLXCPLD_I2C_MAX_ADDR_LEN …
#define MLXCPLD_I2C_RETR_NUM …
#define MLXCPLD_I2C_XFER_TO …
#define MLXCPLD_I2C_POLL_TIME …
#define MLXCPLD_LPCI2C_CPBLTY_REG …
#define MLXCPLD_LPCI2C_CTRL_REG …
#define MLXCPLD_LPCI2C_HALF_CYC_REG …
#define MLXCPLD_LPCI2C_I2C_HOLD_REG …
#define MLXCPLD_LPCI2C_CMD_REG …
#define MLXCPLD_LPCI2C_NUM_DAT_REG …
#define MLXCPLD_LPCI2C_NUM_ADDR_REG …
#define MLXCPLD_LPCI2C_STATUS_REG …
#define MLXCPLD_LPCI2C_DATA_REG …
#define MLXCPLD_LPCI2C_RST_SEL_MASK …
#define MLXCPLD_LPCI2C_TRANS_END …
#define MLXCPLD_LPCI2C_STATUS_NACK …
#define MLXCPLD_LPCI2C_NO_IND …
#define MLXCPLD_LPCI2C_ACK_IND …
#define MLXCPLD_LPCI2C_NACK_IND …
#define MLXCPLD_I2C_FREQ_1000KHZ_SET …
#define MLXCPLD_I2C_FREQ_400KHZ_SET …
#define MLXCPLD_I2C_FREQ_100KHZ_SET …
enum mlxcpld_i2c_frequency { … };
struct mlxcpld_i2c_curr_xfer { … };
struct mlxcpld_i2c_priv { … };
static void mlxcpld_i2c_lpc_write_buf(u8 *data, u8 len, u32 addr)
{ … }
static void mlxcpld_i2c_lpc_read_buf(u8 *data, u8 len, u32 addr)
{ … }
static void mlxcpld_i2c_read_comm(struct mlxcpld_i2c_priv *priv, u8 offs,
u8 *data, u8 datalen)
{ … }
static void mlxcpld_i2c_write_comm(struct mlxcpld_i2c_priv *priv, u8 offs,
u8 *data, u8 datalen)
{ … }
static int mlxcpld_i2c_check_msg_params(struct mlxcpld_i2c_priv *priv,
struct i2c_msg *msgs, int num)
{ … }
static int mlxcpld_i2c_check_status(struct mlxcpld_i2c_priv *priv, int *status)
{ … }
static void mlxcpld_i2c_set_transf_data(struct mlxcpld_i2c_priv *priv,
struct i2c_msg *msgs, int num,
u8 comm_len)
{ … }
static void mlxcpld_i2c_reset(struct mlxcpld_i2c_priv *priv)
{ … }
static int mlxcpld_i2c_check_busy(struct mlxcpld_i2c_priv *priv)
{ … }
static int mlxcpld_i2c_wait_for_free(struct mlxcpld_i2c_priv *priv)
{ … }
static int mlxcpld_i2c_wait_for_tc(struct mlxcpld_i2c_priv *priv)
{ … }
static void mlxcpld_i2c_xfer_msg(struct mlxcpld_i2c_priv *priv)
{ … }
static int mlxcpld_i2c_xfer(struct i2c_adapter *adap, struct i2c_msg *msgs,
int num)
{ … }
static u32 mlxcpld_i2c_func(struct i2c_adapter *adap)
{ … }
static const struct i2c_algorithm mlxcpld_i2c_algo = …;
static const struct i2c_adapter_quirks mlxcpld_i2c_quirks = …;
static const struct i2c_adapter_quirks mlxcpld_i2c_quirks_ext = …;
static const struct i2c_adapter_quirks mlxcpld_i2c_quirks_ext2 = …;
static struct i2c_adapter mlxcpld_i2c_adapter = …;
static int
mlxcpld_i2c_set_frequency(struct mlxcpld_i2c_priv *priv,
struct mlxreg_core_hotplug_platform_data *pdata)
{ … }
static int mlxcpld_i2c_probe(struct platform_device *pdev)
{ … }
static void mlxcpld_i2c_remove(struct platform_device *pdev)
{ … }
static struct platform_driver mlxcpld_i2c_driver = …;
module_platform_driver(…) …;
MODULE_AUTHOR(…) …;
MODULE_DESCRIPTION(…) …;
MODULE_LICENSE(…) …;
MODULE_ALIAS(…) …;