i2c: fsl_i2c: Migrate to Kconfig
[platform/kernel/u-boot.git] / drivers / i2c / fsl_i2c.c
index 875d307..eafd801 100644 (file)
@@ -11,6 +11,7 @@
 #include <i2c.h>               /* Functional interface */
 #include <log.h>
 #include <time.h>
+#include <asm/global_data.h>
 #include <asm/io.h>
 #include <asm/fsl_i2c.h>       /* HW definitions */
 #include <clk.h>
@@ -39,7 +40,7 @@
 
 DECLARE_GLOBAL_DATA_PTR;
 
-#ifndef CONFIG_DM_I2C
+#if !CONFIG_IS_ENABLED(DM_I2C)
 static const struct fsl_i2c_base *i2c_base[4] = {
        (struct fsl_i2c_base *)(CONFIG_SYS_IMMR + CONFIG_SYS_FSL_I2C_OFFSET),
 #ifdef CONFIG_SYS_FSL_I2C2_OFFSET
@@ -202,7 +203,7 @@ static uint set_i2c_bus_speed(const struct fsl_i2c_base *base,
        return speed;
 }
 
-#ifndef CONFIG_DM_I2C
+#if !CONFIG_IS_ENABLED(DM_I2C)
 static uint get_i2c_clock(int bus)
 {
        if (bus)
@@ -496,7 +497,7 @@ static uint __i2c_set_bus_speed(const struct fsl_i2c_base *base,
        return 0;
 }
 
-#ifndef CONFIG_DM_I2C
+#if !CONFIG_IS_ENABLED(DM_I2C)
 static void fsl_i2c_init(struct i2c_adapter *adap, int speed, int slaveadd)
 {
        __i2c_init(i2c_base[adap->hwadapnr], speed, slaveadd,
@@ -537,24 +538,24 @@ static uint fsl_i2c_set_bus_speed(struct i2c_adapter *adap, uint speed)
  */
 U_BOOT_I2C_ADAP_COMPLETE(fsl_0, fsl_i2c_init, fsl_i2c_probe_chip, fsl_i2c_read,
                         fsl_i2c_write, fsl_i2c_set_bus_speed,
-                        CONFIG_SYS_FSL_I2C_SPEED, CONFIG_SYS_FSL_I2C_SLAVE,
+                        CONFIG_SYS_I2C_SPEED, CONFIG_SYS_I2C_SLAVE,
                         0)
 #ifdef CONFIG_SYS_FSL_I2C2_OFFSET
 U_BOOT_I2C_ADAP_COMPLETE(fsl_1, fsl_i2c_init, fsl_i2c_probe_chip, fsl_i2c_read,
                         fsl_i2c_write, fsl_i2c_set_bus_speed,
-                        CONFIG_SYS_FSL_I2C2_SPEED, CONFIG_SYS_FSL_I2C2_SLAVE,
+                        CONFIG_SYS_I2C_SPEED, CONFIG_SYS_I2C_SLAVE,
                         1)
 #endif
 #ifdef CONFIG_SYS_FSL_I2C3_OFFSET
 U_BOOT_I2C_ADAP_COMPLETE(fsl_2, fsl_i2c_init, fsl_i2c_probe_chip, fsl_i2c_read,
                         fsl_i2c_write, fsl_i2c_set_bus_speed,
-                        CONFIG_SYS_FSL_I2C3_SPEED, CONFIG_SYS_FSL_I2C3_SLAVE,
+                        CONFIG_SYS_I2C_SPEED, CONFIG_SYS_I2C_SLAVE,
                         2)
 #endif
 #ifdef CONFIG_SYS_FSL_I2C4_OFFSET
 U_BOOT_I2C_ADAP_COMPLETE(fsl_3, fsl_i2c_init, fsl_i2c_probe_chip, fsl_i2c_read,
                         fsl_i2c_write, fsl_i2c_set_bus_speed,
-                        CONFIG_SYS_FSL_I2C4_SPEED, CONFIG_SYS_FSL_I2C4_SLAVE,
+                        CONFIG_SYS_I2C_SPEED, CONFIG_SYS_I2C_SLAVE,
                         3)
 #endif
 #else /* CONFIG_DM_I2C */