blob: 47a9edc81b3a4d9e4d1eb874cdc74895b1af114f [file] [log] [blame]
Troy Kiskyd4fdc992012-07-19 08:18:25 +00001/*
2 * Copyright (C) 2011 Freescale Semiconductor, Inc. All Rights Reserved.
3 *
Wolfgang Denkd79de1d2013-07-08 09:37:19 +02004 * SPDX-License-Identifier: GPL-2.0+
Troy Kiskyd4fdc992012-07-19 08:18:25 +00005 */
6#ifndef __ASM_ARCH_MXC_MXC_I2C_H__
7#define __ASM_ARCH_MXC_MXC_I2C_H__
8#include <asm/imx-common/iomux-v3.h>
9
10struct i2c_pin_ctrl {
11 iomux_v3_cfg_t i2c_mode;
12 iomux_v3_cfg_t gpio_mode;
13 unsigned char gp;
14 unsigned char spare;
15};
16
17struct i2c_pads_info {
18 struct i2c_pin_ctrl scl;
19 struct i2c_pin_ctrl sda;
20};
21
22void setup_i2c(unsigned i2c_index, int speed, int slave_addr,
23 struct i2c_pads_info *p);
24void bus_i2c_init(void *base, int speed, int slave_addr,
25 int (*idle_bus_fn)(void *p), void *p);
26int bus_i2c_read(void *base, uchar chip, uint addr, int alen, uchar *buf,
27 int len);
28int bus_i2c_write(void *base, uchar chip, uint addr, int alen,
29 const uchar *buf, int len);
30#endif