linux/drivers/i2c/busses/i2c-designware-common.c

// SPDX-License-Identifier: GPL-2.0-or-later
/*
 * Synopsys DesignWare I2C adapter driver.
 *
 * Based on the TI DAVINCI I2C adapter driver.
 *
 * Copyright (C) 2006 Texas Instruments.
 * Copyright (C) 2007 MontaVista Software Inc.
 * Copyright (C) 2009 Provigent Ltd.
 */
#include <linux/acpi.h>
#include <linux/clk.h>
#include <linux/delay.h>
#include <linux/device.h>
#include <linux/err.h>
#include <linux/errno.h>
#include <linux/export.h>
#include <linux/i2c.h>
#include <linux/interrupt.h>
#include <linux/io.h>
#include <linux/kernel.h>
#include <linux/module.h>
#include <linux/pm_runtime.h>
#include <linux/regmap.h>
#include <linux/swab.h>
#include <linux/types.h>
#include <linux/units.h>

#include "i2c-designware-core.h"

static char *abort_sources[] =;

static int dw_reg_read(void *context, unsigned int reg, unsigned int *val)
{}

static int dw_reg_write(void *context, unsigned int reg, unsigned int val)
{}

static int dw_reg_read_swab(void *context, unsigned int reg, unsigned int *val)
{}

static int dw_reg_write_swab(void *context, unsigned int reg, unsigned int val)
{}

static int dw_reg_read_word(void *context, unsigned int reg, unsigned int *val)
{}

static int dw_reg_write_word(void *context, unsigned int reg, unsigned int val)
{}

/**
 * i2c_dw_init_regmap() - Initialize registers map
 * @dev: device private data
 *
 * Autodetects needed register access mode and creates the regmap with
 * corresponding read/write callbacks. This must be called before doing any
 * other register access.
 */
int i2c_dw_init_regmap(struct dw_i2c_dev *dev)
{}

static const u32 supported_speeds[] =;

int i2c_dw_validate_speed(struct dw_i2c_dev *dev)
{}
EXPORT_SYMBOL_GPL();

#ifdef CONFIG_ACPI

#include <linux/dmi.h>

/*
 * The HCNT/LCNT information coming from ACPI should be the most accurate
 * for given platform. However, some systems get it wrong. On such systems
 * we get better results by calculating those based on the input clock.
 */
static const struct dmi_system_id i2c_dw_no_acpi_params[] =;

static void i2c_dw_acpi_params(struct device *device, char method[],
			       u16 *hcnt, u16 *lcnt, u32 *sda_hold)
{}

int i2c_dw_acpi_configure(struct device *device)
{}
EXPORT_SYMBOL_GPL();

static u32 i2c_dw_acpi_round_bus_speed(struct device *device)
{}

#else	/* CONFIG_ACPI */

static inline u32 i2c_dw_acpi_round_bus_speed(struct device *device) { return 0; }

#endif	/* CONFIG_ACPI */

void i2c_dw_adjust_bus_speed(struct dw_i2c_dev *dev)
{}
EXPORT_SYMBOL_GPL();

u32 i2c_dw_scl_hcnt(u32 ic_clk, u32 tSYMBOL, u32 tf, int cond, int offset)
{}

u32 i2c_dw_scl_lcnt(u32 ic_clk, u32 tLOW, u32 tf, int offset)
{}

int i2c_dw_set_sda_hold(struct dw_i2c_dev *dev)
{}

void __i2c_dw_disable(struct dw_i2c_dev *dev)
{}

u32 i2c_dw_clk_rate(struct dw_i2c_dev *dev)
{}

int i2c_dw_prepare_clk(struct dw_i2c_dev *dev, bool prepare)
{}
EXPORT_SYMBOL_GPL();

int i2c_dw_acquire_lock(struct dw_i2c_dev *dev)
{}

void i2c_dw_release_lock(struct dw_i2c_dev *dev)
{}

/*
 * Waiting for bus not busy
 */
int i2c_dw_wait_bus_not_busy(struct dw_i2c_dev *dev)
{}

int i2c_dw_handle_tx_abort(struct dw_i2c_dev *dev)
{}

int i2c_dw_set_fifo_size(struct dw_i2c_dev *dev)
{}

u32 i2c_dw_func(struct i2c_adapter *adap)
{}

void i2c_dw_disable(struct dw_i2c_dev *dev)
{}

MODULE_DESCRIPTION();
MODULE_LICENSE();