summaryrefslogtreecommitdiffstats
path: root/src/include/device/smbus.h
diff options
context:
space:
mode:
authorAaron Durbin <adurbin@chromium.org>2018-01-22 21:24:35 -0700
committerAaron Durbin <adurbin@chromium.org>2018-01-24 05:02:50 +0000
commit439cee90984ed9b5b614af2707aa0017528890d0 (patch)
treef2891bff4409c6bd0b64756879ec0fb68e71bbb3 /src/include/device/smbus.h
parent11284d7d4374c15e81e805301d448de1a8576a18 (diff)
downloadcoreboot-439cee90984ed9b5b614af2707aa0017528890d0.tar.gz
coreboot-439cee90984ed9b5b614af2707aa0017528890d0.tar.bz2
coreboot-439cee90984ed9b5b614af2707aa0017528890d0.zip
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 <adurbin@chromium.org> Reviewed-on: https://review.coreboot.org/23370 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Martin Roth <martinroth@google.com> Reviewed-by: Furquan Shaikh <furquan@google.com>
Diffstat (limited to 'src/include/device/smbus.h')
-rw-r--r--src/include/device/smbus.h8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/include/device/smbus.h b/src/include/device/smbus.h
index 5e51b5d26787..50857fe85fb0 100644
--- a/src/include/device/smbus.h
+++ b/src/include/device/smbus.h
@@ -32,22 +32,22 @@ int smbus_set_link(device_t dev);
static inline int smbus_recv_byte(struct device *const dev)
{
- return i2c_readb(dev);
+ return i2c_dev_readb(dev);
}
static inline int smbus_send_byte(struct device *const dev, u8 byte)
{
- return i2c_writeb(dev, byte);
+ return i2c_dev_writeb(dev, byte);
}
static inline int smbus_read_byte(struct device *const dev, u8 addr)
{
- return i2c_readb_at(dev, addr);
+ return i2c_dev_readb_at(dev, addr);
}
static inline int smbus_write_byte(struct device *const dev, u8 addr, u8 val)
{
- return i2c_writeb_at(dev, addr, val);
+ return i2c_dev_writeb_at(dev, addr, val);
}
int smbus_block_read(device_t dev, u8 cmd, u8 bytes, u8 *buffer);