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

// SPDX-License-Identifier: GPL-2.0-or-later
/*
 * Copyright (C) 2011 NXP Semiconductors
 *
 * Code portions referenced from the i2x-pxa and i2c-pnx drivers
 *
 * Make SMBus byte and word transactions work on LPC178x/7x
 * Copyright (c) 2012
 * Alexander Potashev, Emcraft Systems, [email protected]
 * Anton Protopopov, Emcraft Systems, [email protected]
 *
 * Copyright (C) 2015 Joachim Eastwood <[email protected]>
 */

#include <linux/clk.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/of.h>
#include <linux/platform_device.h>
#include <linux/sched.h>
#include <linux/time.h>

/* LPC24xx register offsets and bits */
#define LPC24XX_I2CONSET
#define LPC24XX_I2STAT
#define LPC24XX_I2DAT
#define LPC24XX_I2ADDR
#define LPC24XX_I2SCLH
#define LPC24XX_I2SCLL
#define LPC24XX_I2CONCLR

#define LPC24XX_AA
#define LPC24XX_SI
#define LPC24XX_STO
#define LPC24XX_STA
#define LPC24XX_I2EN

#define LPC24XX_STO_AA
#define LPC24XX_CLEAR_ALL

/* I2C SCL clock has different duty cycle depending on mode */
#define I2C_STD_MODE_DUTY
#define I2C_FAST_MODE_DUTY
#define I2C_FAST_MODE_PLUS_DUTY

/*
 * 26 possible I2C status codes, but codes applicable only
 * to controller mode are listed here and used in this driver
 */
enum {};

struct lpc2k_i2c {};

static void i2c_lpc2k_reset(struct lpc2k_i2c *i2c)
{}

static int i2c_lpc2k_clear_arb(struct lpc2k_i2c *i2c)
{}

static void i2c_lpc2k_pump_msg(struct lpc2k_i2c *i2c)
{}

static int lpc2k_process_msg(struct lpc2k_i2c *i2c, int msgidx)
{}

static int i2c_lpc2k_xfer(struct i2c_adapter *adap, struct i2c_msg *msgs,
			  int msg_num)
{}

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

static u32 i2c_lpc2k_functionality(struct i2c_adapter *adap)
{}

static const struct i2c_algorithm i2c_lpc2k_algorithm =;

static int i2c_lpc2k_probe(struct platform_device *pdev)
{}

static void i2c_lpc2k_remove(struct platform_device *dev)
{}

static int i2c_lpc2k_suspend(struct device *dev)
{}

static int i2c_lpc2k_resume(struct device *dev)
{}

static const struct dev_pm_ops i2c_lpc2k_dev_pm_ops =;

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

static struct platform_driver i2c_lpc2k_driver =;
module_platform_driver();

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