From 439cee90984ed9b5b614af2707aa0017528890d0 Mon Sep 17 00:00:00 2001 From: Aaron Durbin Date: Mon, 22 Jan 2018 21:24:35 -0700 Subject: device/i2c_bus: allow i2c_bus and i2c_simple to coexist If one wants to implement both i2c_bus.h and i2c_simple.h APIs the compilation unit needs to be guarded or coordinated carefully with different compilation units. Instead, name the i2c_bus functions with _dev such that it indicates that they operate on struct device. One other change to allow i2c_bus.h to be built in non-ramstage environments is to ensure DEVTREE_CONST is used for the dev field in struct bus. BUG=b:72121803 Change-Id: I267e27e62c95013e8ff8b0728dbe9e7b523de453 Signed-off-by: Aaron Durbin Reviewed-on: https://review.coreboot.org/23370 Tested-by: build bot (Jenkins) Reviewed-by: Martin Roth Reviewed-by: Furquan Shaikh --- src/drivers/i2c/rx6110sa/rx6110sa.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/drivers') diff --git a/src/drivers/i2c/rx6110sa/rx6110sa.c b/src/drivers/i2c/rx6110sa/rx6110sa.c index d793c4dd9c..266b5a8ac5 100644 --- a/src/drivers/i2c/rx6110sa/rx6110sa.c +++ b/src/drivers/i2c/rx6110sa/rx6110sa.c @@ -25,13 +25,13 @@ /* Function to write a register in the RTC with the given value. */ static void rx6110sa_write(struct device *dev, uint8_t reg, uint8_t val) { - i2c_writeb_at(dev, reg, val); + i2c_dev_writeb_at(dev, reg, val); } /* Function to read a register in the RTC. */ static uint8_t rx6110sa_read(struct device *dev, uint8_t reg) { - return (uint8_t)i2c_readb_at(dev, reg); + return (uint8_t)i2c_dev_readb_at(dev, reg); } /* Set RTC date from coreboot build date. */ -- cgit v1.2.3