summaryrefslogtreecommitdiff
path: root/src/drivers/i2c
diff options
context:
space:
mode:
authorNico Huber <nico.huber@secunet.com>2017-07-03 15:08:08 +0200
committerMartin Roth <martinroth@google.com>2017-08-18 15:33:58 +0000
commit0594c5973ca6612e151d206a5a68ca4b0dcb955e (patch)
tree5bb877f6edfe9ee3ad67ded76624b5e3f09e4435 /src/drivers/i2c
parent581738642fbeacdf97fc737a41b3128d72cf1a1c (diff)
downloadcoreboot-0594c5973ca6612e151d206a5a68ca4b0dcb955e.tar.xz
drivers/i2c/rx6110sa: Drop I2C interface arbitration
Change-Id: Ib31e77eec639c231520198c0b978d6c3c1eadaed Signed-off-by: Nico Huber <nico.huber@secunet.com> Reviewed-on: https://review.coreboot.org/20454 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Aaron Durbin <adurbin@chromium.org>
Diffstat (limited to 'src/drivers/i2c')
-rw-r--r--src/drivers/i2c/rx6110sa/Kconfig7
-rw-r--r--src/drivers/i2c/rx6110sa/rx6110sa.c19
2 files changed, 3 insertions, 23 deletions
diff --git a/src/drivers/i2c/rx6110sa/Kconfig b/src/drivers/i2c/rx6110sa/Kconfig
index 48654c6083..a5608f82f7 100644
--- a/src/drivers/i2c/rx6110sa/Kconfig
+++ b/src/drivers/i2c/rx6110sa/Kconfig
@@ -3,10 +3,3 @@ config DRIVERS_I2C_RX6110SA
default n
help
Enable support for external RTC chip RX6110 SA.
-
-config RX6110SA_USE_SMBUS
- bool
- default n
- help
- Select this option if the RTC RX6110SA is connected to a SMBus controller.
- If not selected I2C controller is used instead.
diff --git a/src/drivers/i2c/rx6110sa/rx6110sa.c b/src/drivers/i2c/rx6110sa/rx6110sa.c
index 2402d59ebf..aad109781d 100644
--- a/src/drivers/i2c/rx6110sa/rx6110sa.c
+++ b/src/drivers/i2c/rx6110sa/rx6110sa.c
@@ -13,8 +13,7 @@
* GNU General Public License for more details.
*/
-#include <device/i2c_simple.h>
-#include <device/smbus.h>
+#include <device/i2c_bus.h>
#include <device/device.h>
#include <version.h>
#include <console/console.h>
@@ -23,28 +22,16 @@
#include "chip.h"
#include "rx6110sa.h"
-#define I2C_BUS_NUM (dev->bus->secondary - 1)
-#define I2C_DEV_NUM (dev->path.i2c.device)
-
/* 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)
{
- if (IS_ENABLED(CONFIG_RX6110SA_USE_SMBUS))
- smbus_write_byte(dev, reg, val);
- else
- i2c_writeb(I2C_BUS_NUM, I2C_DEV_NUM, reg, val);
+ i2c_writeb_at(dev, reg, val);
}
/* Function to read a register in the RTC. */
static uint8_t rx6110sa_read(struct device *dev, uint8_t reg)
{
- uint8_t val = 0;
-
- if (IS_ENABLED(CONFIG_RX6110SA_USE_SMBUS))
- val = smbus_read_byte(dev, reg);
- else
- i2c_readb(I2C_BUS_NUM, I2C_DEV_NUM, reg, &val);
- return val;
+ return (uint8_t)i2c_readb_at(dev, reg);
}
/* Set RTC date from coreboot build date. */