2012-12-27 23:15:51 +01:00
|
|
|
/*
|
2013-04-05 22:42:39 +02:00
|
|
|
* This file is part of the coreboot project.
|
2012-12-27 23:15:51 +01:00
|
|
|
*
|
2013-04-05 22:42:39 +02:00
|
|
|
* Copyright (C) 2013 Google, Inc.
|
2012-12-27 23:15:51 +01:00
|
|
|
*
|
2013-04-05 22:42:39 +02:00
|
|
|
* This program is free software; you can redistribute it and/or modify
|
|
|
|
* it under the terms of the GNU General Public License as published by
|
|
|
|
* the Free Software Foundation; version 2 of the License.
|
2012-12-27 23:15:51 +01:00
|
|
|
*
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
* along with this program; if not, write to the Free Software
|
2013-04-05 22:42:39 +02:00
|
|
|
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA, 02110-1301 USA
|
2012-12-27 23:15:51 +01:00
|
|
|
*/
|
|
|
|
|
2013-04-05 22:42:39 +02:00
|
|
|
#ifndef _DEVICE_I2C_H_
|
|
|
|
#define _DEVICE_I2C_H_
|
2012-12-27 23:15:51 +01:00
|
|
|
|
2013-06-30 12:47:33 +02:00
|
|
|
#include <stdint.h>
|
|
|
|
|
2013-04-05 22:42:39 +02:00
|
|
|
/* note: chip is the 7-bit I2C address */
|
|
|
|
int i2c_read(unsigned bus, unsigned chip, unsigned addr,
|
2013-06-30 12:47:33 +02:00
|
|
|
unsigned alen, uint8_t *buf, unsigned len);
|
2013-04-05 22:42:39 +02:00
|
|
|
int i2c_write(unsigned bus, unsigned chip, unsigned addr,
|
2013-06-30 12:47:33 +02:00
|
|
|
unsigned alen, const uint8_t *buf, unsigned len);
|
2012-12-27 23:15:51 +01:00
|
|
|
|
2013-04-05 22:42:39 +02:00
|
|
|
#endif /* _DEVICE_I2C_H_ */
|