summaryrefslogtreecommitdiff
path: root/src/drivers/smbus/i2c_smbus_console.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/drivers/smbus/i2c_smbus_console.c')
-rw-r--r--src/drivers/smbus/i2c_smbus_console.c11
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);
+ }
}