#include <linux/clk.h>
#include <linux/delay.h>
#include <linux/dmaengine.h>
#include <linux/dma-mapping.h>
#include <linux/err.h>
#include <linux/i2c.h>
#include <linux/init.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/pm_runtime.h>
#include <linux/slab.h>
enum sh_mobile_i2c_op { … };
struct sh_mobile_i2c_data { … };
struct sh_mobile_dt_config { … };
#define IIC_FLAG_HAS_ICIC67 …
#define ICDR …
#define ICCR …
#define ICSR …
#define ICIC …
#define ICCL …
#define ICCH …
#define ICSTART …
#define ICCR_ICE …
#define ICCR_RACK …
#define ICCR_TRS …
#define ICCR_BBSY …
#define ICCR_SCP …
#define ICSR_SCLM …
#define ICSR_SDAM …
#define SW_DONE …
#define ICSR_BUSY …
#define ICSR_AL …
#define ICSR_TACK …
#define ICSR_WAIT …
#define ICSR_DTE …
#define ICIC_ICCLB8 …
#define ICIC_ICCHB8 …
#define ICIC_TDMAE …
#define ICIC_RDMAE …
#define ICIC_ALE …
#define ICIC_TACKE …
#define ICIC_WAITE …
#define ICIC_DTEE …
#define ICSTART_ICSTART …
static void iic_wr(struct sh_mobile_i2c_data *pd, int offs, unsigned char data)
{ … }
static unsigned char iic_rd(struct sh_mobile_i2c_data *pd, int offs)
{ … }
static void iic_set_clr(struct sh_mobile_i2c_data *pd, int offs,
unsigned char set, unsigned char clr)
{ … }
static u32 sh_mobile_i2c_iccl(unsigned long count_khz, u32 tLOW, u32 tf)
{ … }
static u32 sh_mobile_i2c_icch(unsigned long count_khz, u32 tHIGH, u32 tf)
{ … }
static int sh_mobile_i2c_check_timing(struct sh_mobile_i2c_data *pd)
{ … }
static int sh_mobile_i2c_init(struct sh_mobile_i2c_data *pd)
{ … }
static int sh_mobile_i2c_v2_init(struct sh_mobile_i2c_data *pd)
{ … }
static unsigned char i2c_op(struct sh_mobile_i2c_data *pd, enum sh_mobile_i2c_op op)
{ … }
static int sh_mobile_i2c_isr_tx(struct sh_mobile_i2c_data *pd)
{ … }
static int sh_mobile_i2c_isr_rx(struct sh_mobile_i2c_data *pd)
{ … }
static irqreturn_t sh_mobile_i2c_isr(int irq, void *dev_id)
{ … }
static void sh_mobile_i2c_cleanup_dma(struct sh_mobile_i2c_data *pd, bool terminate)
{ … }
static void sh_mobile_i2c_dma_callback(void *data)
{ … }
static struct dma_chan *sh_mobile_i2c_request_dma_chan(struct device *dev,
enum dma_transfer_direction dir, dma_addr_t port_addr)
{ … }
static void sh_mobile_i2c_xfer_dma(struct sh_mobile_i2c_data *pd)
{ … }
static void start_ch(struct sh_mobile_i2c_data *pd, struct i2c_msg *usr_msg,
bool do_init)
{ … }
static int poll_dte(struct sh_mobile_i2c_data *pd)
{ … }
static int poll_busy(struct sh_mobile_i2c_data *pd)
{ … }
static int sh_mobile_xfer(struct sh_mobile_i2c_data *pd,
struct i2c_msg *msgs, int num)
{ … }
static int sh_mobile_i2c_xfer(struct i2c_adapter *adapter,
struct i2c_msg *msgs,
int num)
{ … }
static int sh_mobile_i2c_xfer_atomic(struct i2c_adapter *adapter,
struct i2c_msg *msgs,
int num)
{ … }
static u32 sh_mobile_i2c_func(struct i2c_adapter *adapter)
{ … }
static const struct i2c_algorithm sh_mobile_i2c_algorithm = …;
static const struct i2c_adapter_quirks sh_mobile_i2c_quirks = …;
static int sh_mobile_i2c_r8a7740_workaround(struct sh_mobile_i2c_data *pd)
{ … }
static const struct sh_mobile_dt_config default_dt_config = …;
static const struct sh_mobile_dt_config fast_clock_dt_config = …;
static const struct sh_mobile_dt_config r8a7740_dt_config = …;
static const struct of_device_id sh_mobile_i2c_dt_ids[] = …;
MODULE_DEVICE_TABLE(of, sh_mobile_i2c_dt_ids);
static void sh_mobile_i2c_release_dma(struct sh_mobile_i2c_data *pd)
{ … }
static int sh_mobile_i2c_hook_irqs(struct platform_device *dev, struct sh_mobile_i2c_data *pd)
{ … }
static int sh_mobile_i2c_probe(struct platform_device *dev)
{ … }
static void sh_mobile_i2c_remove(struct platform_device *dev)
{ … }
static int sh_mobile_i2c_suspend(struct device *dev)
{ … }
static int sh_mobile_i2c_resume(struct device *dev)
{ … }
static const struct dev_pm_ops sh_mobile_i2c_pm_ops = …;
static struct platform_driver sh_mobile_i2c_driver = …;
static int __init sh_mobile_i2c_adap_init(void)
{ … }
subsys_initcall(sh_mobile_i2c_adap_init);
static void __exit sh_mobile_i2c_adap_exit(void)
{ … }
module_exit(sh_mobile_i2c_adap_exit);
MODULE_DESCRIPTION(…) …;
MODULE_AUTHOR(…) …;
MODULE_AUTHOR(…) …;
MODULE_LICENSE(…) …;
MODULE_ALIAS(…) …;