aboutsummaryrefslogtreecommitdiff
path: root/drivers/i2c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/i2c')
-rw-r--r--drivers/i2c/ast_i2c.c23
-rw-r--r--drivers/i2c/exynos_hs_i2c.c2
-rw-r--r--drivers/i2c/muxes/Kconfig2
-rw-r--r--drivers/i2c/s3c24x0_i2c.c4
4 files changed, 20 insertions, 11 deletions
diff --git a/drivers/i2c/ast_i2c.c b/drivers/i2c/ast_i2c.c
index 2d3fecaa14..c9ffe2d628 100644
--- a/drivers/i2c/ast_i2c.c
+++ b/drivers/i2c/ast_i2c.c
@@ -16,6 +16,7 @@
#include <asm/arch/scu_ast2500.h>
#include <linux/delay.h>
#include <linux/err.h>
+#include <reset.h>
#include "ast_i2c.h"
@@ -108,19 +109,26 @@ static int ast_i2c_of_to_plat(struct udevice *dev)
static int ast_i2c_probe(struct udevice *dev)
{
- struct ast2500_scu *scu;
+ struct reset_ctl reset_ctl;
+ int rc;
debug("Enabling I2C%u\n", dev_seq(dev));
/*
* Get all I2C devices out of Reset.
- * Only needs to be done once, but doing it for every
- * device does not hurt.
+ *
+ * Only needs to be done once so test before performing reset.
*/
- scu = ast_get_scu();
- ast_scu_unlock(scu);
- clrbits_le32(&scu->sysreset_ctrl1, SCU_SYSRESET_I2C);
- ast_scu_lock(scu);
+ rc = reset_get_by_index(dev, 0, &reset_ctl);
+ if (rc) {
+ printf("%s: Failed to get reset signal\n", __func__);
+ return rc;
+ }
+
+ if (reset_status(&reset_ctl) > 0) {
+ reset_assert(&reset_ctl);
+ reset_deassert(&reset_ctl);
+ }
ast_i2c_init_bus(dev);
@@ -343,6 +351,7 @@ static const struct dm_i2c_ops ast_i2c_ops = {
static const struct udevice_id ast_i2c_ids[] = {
{ .compatible = "aspeed,ast2400-i2c-bus" },
{ .compatible = "aspeed,ast2500-i2c-bus" },
+ { .compatible = "aspeed,ast2600-i2c-bus" },
{ },
};
diff --git a/drivers/i2c/exynos_hs_i2c.c b/drivers/i2c/exynos_hs_i2c.c
index 39bcacc17a..a7349e06cf 100644
--- a/drivers/i2c/exynos_hs_i2c.c
+++ b/drivers/i2c/exynos_hs_i2c.c
@@ -147,7 +147,7 @@ static int hsi2c_get_clk_details(struct s3c24x0_i2c_bus *i2c_bus)
unsigned int i = 0, utemp0 = 0, utemp1 = 0;
unsigned int t_ftl_cycle;
-#if (defined CONFIG_EXYNOS4 || defined CONFIG_EXYNOS5)
+#if defined(CONFIG_ARCH_EXYNOS4) || defined(CONFIG_ARCH_EXYNOS5)
clkin = get_i2c_clk();
#else
clkin = get_PCLK();
diff --git a/drivers/i2c/muxes/Kconfig b/drivers/i2c/muxes/Kconfig
index 39683fc43b..323c4fbe9c 100644
--- a/drivers/i2c/muxes/Kconfig
+++ b/drivers/i2c/muxes/Kconfig
@@ -9,7 +9,7 @@ config I2C_MUX
config SPL_I2C_MUX
bool "Support I2C multiplexers on SPL"
- depends on I2C_MUX
+ depends on SPL && I2C_MUX
help
This enables I2C buses to be multiplexed, so that you can select
one of several buses using some sort of control mechanism. The
diff --git a/drivers/i2c/s3c24x0_i2c.c b/drivers/i2c/s3c24x0_i2c.c
index aaccb3aa22..505e20bc61 100644
--- a/drivers/i2c/s3c24x0_i2c.c
+++ b/drivers/i2c/s3c24x0_i2c.c
@@ -8,7 +8,7 @@
#include <errno.h>
#include <dm.h>
#include <fdtdec.h>
-#if (defined CONFIG_EXYNOS4 || defined CONFIG_EXYNOS5)
+#if defined(CONFIG_ARCH_EXYNOS4) || defined(CONFIG_ARCH_EXYNOS5)
#include <log.h>
#include <asm/arch/clk.h>
#include <asm/arch/cpu.h>
@@ -53,7 +53,7 @@ static void read_write_byte(struct s3c24x0_i2c *i2c)
static void i2c_ch_init(struct s3c24x0_i2c *i2c, int speed, int slaveadd)
{
ulong freq, pres = 16, div;
-#if (defined CONFIG_EXYNOS4 || defined CONFIG_EXYNOS5)
+#if defined(CONFIG_ARCH_EXYNOS4) || defined(CONFIG_ARCH_EXYNOS5)
freq = get_i2c_clk();
#else
freq = get_PCLK();