blob: 997d20134105c78f0ee8f89e141097285f29ab03 [file] [log] [blame]
David Hendricksf4c35082012-12-27 14:15:51 -08001/*
David Hendrickscfb73602013-04-05 13:42:39 -07002 * This file is part of the coreboot project.
David Hendricksf4c35082012-12-27 14:15:51 -08003 *
David Hendrickscfb73602013-04-05 13:42:39 -07004 * Copyright (C) 2013 Google, Inc.
David Hendricksf4c35082012-12-27 14:15:51 -08005 *
David Hendrickscfb73602013-04-05 13:42:39 -07006 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; version 2 of the License.
David Hendricksf4c35082012-12-27 14:15:51 -08009 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, write to the Free Software
David Hendrickscfb73602013-04-05 13:42:39 -070017 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA, 02110-1301 USA
David Hendricksf4c35082012-12-27 14:15:51 -080018 */
19
David Hendrickscfb73602013-04-05 13:42:39 -070020#ifndef _DEVICE_I2C_H_
21#define _DEVICE_I2C_H_
David Hendricksf4c35082012-12-27 14:15:51 -080022
Gabe Blacka5dc0912013-06-30 03:47:33 -070023#include <stdint.h>
24
David Hendrickscfb73602013-04-05 13:42:39 -070025/* note: chip is the 7-bit I2C address */
26int i2c_read(unsigned bus, unsigned chip, unsigned addr,
Gabe Blacka5dc0912013-06-30 03:47:33 -070027 unsigned alen, uint8_t *buf, unsigned len);
David Hendrickscfb73602013-04-05 13:42:39 -070028int i2c_write(unsigned bus, unsigned chip, unsigned addr,
Gabe Blacka5dc0912013-06-30 03:47:33 -070029 unsigned alen, const uint8_t *buf, unsigned len);
David Hendricksf4c35082012-12-27 14:15:51 -080030
David Hendrickscfb73602013-04-05 13:42:39 -070031#endif /* _DEVICE_I2C_H_ */