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>
This commit is contained in:
@ -3,10 +3,3 @@ config DRIVERS_I2C_RX6110SA
|
|||||||
default n
|
default n
|
||||||
help
|
help
|
||||||
Enable support for external RTC chip RX6110 SA.
|
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.
|
|
||||||
|
@ -13,8 +13,7 @@
|
|||||||
* GNU General Public License for more details.
|
* GNU General Public License for more details.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <device/i2c_simple.h>
|
#include <device/i2c_bus.h>
|
||||||
#include <device/smbus.h>
|
|
||||||
#include <device/device.h>
|
#include <device/device.h>
|
||||||
#include <version.h>
|
#include <version.h>
|
||||||
#include <console/console.h>
|
#include <console/console.h>
|
||||||
@ -23,28 +22,16 @@
|
|||||||
#include "chip.h"
|
#include "chip.h"
|
||||||
#include "rx6110sa.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. */
|
/* 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)
|
static void rx6110sa_write(struct device *dev, uint8_t reg, uint8_t val)
|
||||||
{
|
{
|
||||||
if (IS_ENABLED(CONFIG_RX6110SA_USE_SMBUS))
|
i2c_writeb_at(dev, reg, val);
|
||||||
smbus_write_byte(dev, reg, val);
|
|
||||||
else
|
|
||||||
i2c_writeb(I2C_BUS_NUM, I2C_DEV_NUM, reg, val);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Function to read a register in the RTC. */
|
/* Function to read a register in the RTC. */
|
||||||
static uint8_t rx6110sa_read(struct device *dev, uint8_t reg)
|
static uint8_t rx6110sa_read(struct device *dev, uint8_t reg)
|
||||||
{
|
{
|
||||||
uint8_t val = 0;
|
return (uint8_t)i2c_readb_at(dev, reg);
|
||||||
|
|
||||||
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;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Set RTC date from coreboot build date. */
|
/* Set RTC date from coreboot build date. */
|
||||||
|
@ -13,7 +13,6 @@ config BOARD_SPECIFIC_OPTIONS
|
|||||||
select DRIVER_INTEL_I210
|
select DRIVER_INTEL_I210
|
||||||
select DRIVER_SIEMENS_NC_FPGA
|
select DRIVER_SIEMENS_NC_FPGA
|
||||||
select DRIVERS_I2C_RX6110SA
|
select DRIVERS_I2C_RX6110SA
|
||||||
select RX6110SA_USE_SMBUS
|
|
||||||
|
|
||||||
config MAINBOARD_DIR
|
config MAINBOARD_DIR
|
||||||
string
|
string
|
||||||
|
Reference in New Issue
Block a user