#include <linux/clk.h>
#include <linux/delay.h>
#include <linux/err.h>
#include <linux/i2c.h>
#include <linux/interrupt.h>
#include <linux/io.h>
#include <linux/iopoll.h>
#include <linux/module.h>
#include <linux/of_address.h>
#include <linux/of_irq.h>
#include <linux/of.h>
#include <linux/platform_device.h>
#include <linux/reset.h>
#include "i2c-stm32.h"
#define STM32F4_I2C_CR1 …
#define STM32F4_I2C_CR2 …
#define STM32F4_I2C_DR …
#define STM32F4_I2C_SR1 …
#define STM32F4_I2C_SR2 …
#define STM32F4_I2C_CCR …
#define STM32F4_I2C_TRISE …
#define STM32F4_I2C_FLTR …
#define STM32F4_I2C_CR1_POS …
#define STM32F4_I2C_CR1_ACK …
#define STM32F4_I2C_CR1_STOP …
#define STM32F4_I2C_CR1_START …
#define STM32F4_I2C_CR1_PE …
#define STM32F4_I2C_CR2_FREQ_MASK …
#define STM32F4_I2C_CR2_FREQ(n) …
#define STM32F4_I2C_CR2_ITBUFEN …
#define STM32F4_I2C_CR2_ITEVTEN …
#define STM32F4_I2C_CR2_ITERREN …
#define STM32F4_I2C_CR2_IRQ_MASK …
#define STM32F4_I2C_SR1_AF …
#define STM32F4_I2C_SR1_ARLO …
#define STM32F4_I2C_SR1_BERR …
#define STM32F4_I2C_SR1_TXE …
#define STM32F4_I2C_SR1_RXNE …
#define STM32F4_I2C_SR1_BTF …
#define STM32F4_I2C_SR1_ADDR …
#define STM32F4_I2C_SR1_SB …
#define STM32F4_I2C_SR1_ITEVTEN_MASK …
#define STM32F4_I2C_SR1_ITBUFEN_MASK …
#define STM32F4_I2C_SR1_ITERREN_MASK …
#define STM32F4_I2C_SR2_BUSY …
#define STM32F4_I2C_CCR_CCR_MASK …
#define STM32F4_I2C_CCR_CCR(n) …
#define STM32F4_I2C_CCR_FS …
#define STM32F4_I2C_CCR_DUTY …
#define STM32F4_I2C_TRISE_VALUE_MASK …
#define STM32F4_I2C_TRISE_VALUE(n) …
#define STM32F4_I2C_MIN_STANDARD_FREQ …
#define STM32F4_I2C_MIN_FAST_FREQ …
#define STM32F4_I2C_MAX_FREQ …
#define HZ_TO_MHZ …
struct stm32f4_i2c_msg { … };
struct stm32f4_i2c_dev { … };
static inline void stm32f4_i2c_set_bits(void __iomem *reg, u32 mask)
{ … }
static inline void stm32f4_i2c_clr_bits(void __iomem *reg, u32 mask)
{ … }
static void stm32f4_i2c_disable_irq(struct stm32f4_i2c_dev *i2c_dev)
{ … }
static int stm32f4_i2c_set_periph_clk_freq(struct stm32f4_i2c_dev *i2c_dev)
{ … }
static void stm32f4_i2c_set_rise_time(struct stm32f4_i2c_dev *i2c_dev)
{ … }
static void stm32f4_i2c_set_speed_mode(struct stm32f4_i2c_dev *i2c_dev)
{ … }
static int stm32f4_i2c_hw_config(struct stm32f4_i2c_dev *i2c_dev)
{ … }
static int stm32f4_i2c_wait_free_bus(struct stm32f4_i2c_dev *i2c_dev)
{ … }
static void stm32f4_i2c_write_byte(struct stm32f4_i2c_dev *i2c_dev, u8 byte)
{ … }
static void stm32f4_i2c_write_msg(struct stm32f4_i2c_dev *i2c_dev)
{ … }
static void stm32f4_i2c_read_msg(struct stm32f4_i2c_dev *i2c_dev)
{ … }
static void stm32f4_i2c_terminate_xfer(struct stm32f4_i2c_dev *i2c_dev)
{ … }
static void stm32f4_i2c_handle_write(struct stm32f4_i2c_dev *i2c_dev)
{ … }
static void stm32f4_i2c_handle_read(struct stm32f4_i2c_dev *i2c_dev)
{ … }
static void stm32f4_i2c_handle_rx_done(struct stm32f4_i2c_dev *i2c_dev)
{ … }
static void stm32f4_i2c_handle_rx_addr(struct stm32f4_i2c_dev *i2c_dev)
{ … }
static irqreturn_t stm32f4_i2c_isr_event(int irq, void *data)
{ … }
static irqreturn_t stm32f4_i2c_isr_error(int irq, void *data)
{ … }
static int stm32f4_i2c_xfer_msg(struct stm32f4_i2c_dev *i2c_dev,
struct i2c_msg *msg, bool is_first,
bool is_last)
{ … }
static int stm32f4_i2c_xfer(struct i2c_adapter *i2c_adap, struct i2c_msg msgs[],
int num)
{ … }
static u32 stm32f4_i2c_func(struct i2c_adapter *adap)
{ … }
static const struct i2c_algorithm stm32f4_i2c_algo = …;
static int stm32f4_i2c_probe(struct platform_device *pdev)
{ … }
static void stm32f4_i2c_remove(struct platform_device *pdev)
{ … }
static const struct of_device_id stm32f4_i2c_match[] = …;
MODULE_DEVICE_TABLE(of, stm32f4_i2c_match);
static struct platform_driver stm32f4_i2c_driver = …;
module_platform_driver(…) …;
MODULE_AUTHOR(…) …;
MODULE_DESCRIPTION(…) …;
MODULE_LICENSE(…) …;