diff options
author | Nico Huber <nico.h@gmx.de> | 2024-06-01 04:00:56 +0200 |
---|---|---|
committer | Felix Held <felix-coreboot@felixheld.de> | 2024-07-11 00:06:22 +0000 |
commit | ae77d8afacb37f4ee1a0ee9942d9a0249c57ed8a (patch) | |
tree | 90b3179f2ad6dadd1a88a7d4cfc6e1ef216e35d2 /src/drivers/smbus/i2c_smbus_console.c | |
parent | 77ae8f0f249d54b992796e42dfc82392ca926266 (diff) |
console/i2c_smbus: Allow to send data w/o register offset
Not every I2C target requires a register address. Not sending one
for every console char saves us a lot of overhead.
Change-Id: I1c714768fdd4aea4885e40a85d21fa42414ce32c
Signed-off-by: Nico Huber <nico.h@gmx.de>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/82762
Reviewed-by: Elyes Haouas <ehaouas@noos.fr>
Reviewed-by: Angel Pons <th3fanbus@gmail.com>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Diffstat (limited to 'src/drivers/smbus/i2c_smbus_console.c')
-rw-r--r-- | src/drivers/smbus/i2c_smbus_console.c | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/src/drivers/smbus/i2c_smbus_console.c b/src/drivers/smbus/i2c_smbus_console.c index d651790694..00b53931e7 100644 --- a/src/drivers/smbus/i2c_smbus_console.c +++ b/src/drivers/smbus/i2c_smbus_console.c @@ -13,7 +13,12 @@ void i2c_smbus_console_init(void) void i2c_smbus_console_tx_byte(unsigned char c) { - do_smbus_write_byte(CONFIG_FIXED_SMBUS_IO_BASE, - CONFIG_CONSOLE_I2C_SMBUS_SLAVE_ADDRESS, - CONFIG_CONSOLE_I2C_SMBUS_SLAVE_DATA_REGISTER, c); + if (CONFIG(CONSOLE_I2C_SMBUS_HAVE_DATA_REGISTER)) { + do_smbus_write_byte(CONFIG_FIXED_SMBUS_IO_BASE, + CONFIG_CONSOLE_I2C_SMBUS_SLAVE_ADDRESS, + CONFIG_CONSOLE_I2C_SMBUS_SLAVE_DATA_REGISTER, c); + } else { + do_smbus_send_byte(CONFIG_FIXED_SMBUS_IO_BASE, + CONFIG_CONSOLE_I2C_SMBUS_SLAVE_ADDRESS, c); + } } |