]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
ti: i2c: Convert CONFIG_SYS_OMAP24_I2C to CONFIG_SYS_I2C namespace
authorTom Rini <trini@konsulko.com>
Thu, 19 Aug 2021 03:12:29 +0000 (23:12 -0400)
committerTom Rini <trini@konsulko.com>
Mon, 30 Aug 2021 18:10:07 +0000 (14:10 -0400)
The omap24xx I2C driver uses its own CONFIG namespace for common I2C
variables.  Rather than convert more of them to Kconfig, rename these to
the common I2C ones and remove the entirely unused functionality.  As
part of this, we make the am335x_shc platforms consistent with their
intended speed values.

Signed-off-by: Tom Rini <trini@konsulko.com>
17 files changed:
README
arch/arm/mach-omap2/boot-common.c
arch/arm/mach-omap2/clocks-common.c
board/bosch/guardian/board.c
board/compulab/cm_t43/cm_t43.c
board/compulab/cm_t43/spl.c
board/tcl/sl50/board.c
board/vscom/baltos/board.c
configs/am335x_baltos_defconfig
configs/am335x_shc_defconfig
configs/am335x_shc_ict_defconfig
configs/am335x_shc_netboot_defconfig
configs/am335x_shc_sdboot_defconfig
configs/sniper_defconfig
drivers/i2c/Kconfig
drivers/i2c/omap24xx_i2c.c
include/configs/tam3517-common.h

diff --git a/README b/README
index 8c48b0bbaa7d87bcd90c9c9feb5774928d0fb075..21dc26707b98711b33b02870d86b09f77b16b8ca 100644 (file)
--- a/README
+++ b/README
@@ -1521,19 +1521,6 @@ The following options need to be configured:
                  - CONFIG_SYS_I2C_SH_SPEED4 for for the speed channel 4
                  - CONFIG_SYS_I2C_SH_NUM_CONTROLLERS for number of i2c buses
 
-               - drivers/i2c/omap24xx_i2c.c
-                 - activate this driver with CONFIG_SYS_I2C_OMAP24XX
-                 - CONFIG_SYS_OMAP24_I2C_SPEED speed channel 0
-                 - CONFIG_SYS_OMAP24_I2C_SLAVE slave addr channel 0
-                 - CONFIG_SYS_OMAP24_I2C_SPEED1 speed channel 1
-                 - CONFIG_SYS_OMAP24_I2C_SLAVE1 slave addr channel 1
-                 - CONFIG_SYS_OMAP24_I2C_SPEED2 speed channel 2
-                 - CONFIG_SYS_OMAP24_I2C_SLAVE2 slave addr channel 2
-                 - CONFIG_SYS_OMAP24_I2C_SPEED3 speed channel 3
-                 - CONFIG_SYS_OMAP24_I2C_SLAVE3 slave addr channel 3
-                 - CONFIG_SYS_OMAP24_I2C_SPEED4 speed channel 4
-                 - CONFIG_SYS_OMAP24_I2C_SLAVE4 slave addr channel 4
-
                - drivers/i2c/s3c24x0_i2c.c:
                  - activate this driver with CONFIG_SYS_I2C_S3C24X0
                  - This driver adds i2c buses (11 for Exynos5250, Exynos5420
index 7cdf7f158981ff8865ddb47cd7898894f4da910a..fdb8b479ea014b3d172481c94045c29c9c97fcaa 100644 (file)
@@ -203,7 +203,7 @@ void spl_board_init(void)
        gpmc_init();
 #endif
 #if defined(CONFIG_SPL_I2C) && !CONFIG_IS_ENABLED(DM_I2C)
-       i2c_init(CONFIG_SYS_OMAP24_I2C_SPEED, CONFIG_SYS_OMAP24_I2C_SLAVE);
+       i2c_init(CONFIG_SYS_I2C_SPEED, CONFIG_SYS_I2C_SLAVE);
 #endif
 #if defined(CONFIG_AM33XX) && defined(CONFIG_SPL_MUSB_NEW)
        arch_misc_init();
index 14b638a65136c5a5a6e92508bb737edf616a7917..73ab5fbfaebfd1c1c792f013901d7340fd8f525e 100644 (file)
@@ -918,8 +918,8 @@ void gpi2c_init(void)
        static int gpi2c = 1;
 
        if (gpi2c) {
-               i2c_init(CONFIG_SYS_OMAP24_I2C_SPEED,
-                        CONFIG_SYS_OMAP24_I2C_SLAVE);
+               i2c_init(CONFIG_SYS_I2C_SPEED,
+                        CONFIG_SYS_I2C_SLAVE);
                gpi2c = 0;
        }
 }
index 179511a670788cb7c276bff9205cdba15f9fe485..01d72d6a7bba867785fd54ca79602d906f4a441c 100644 (file)
@@ -142,7 +142,7 @@ void am33xx_spl_board_init(void)
 const struct dpll_params *get_dpll_ddr_params(void)
 {
        enable_i2c0_pin_mux();
-       i2c_init(CONFIG_SYS_OMAP24_I2C_SPEED, CONFIG_SYS_OMAP24_I2C_SLAVE);
+       i2c_init(CONFIG_SYS_I2C_SPEED, CONFIG_SYS_I2C_SLAVE);
 
        return &dpll_ddr;
 }
index efdade155b57d23bb581a500e1595003d03b94f1..bcfe1bfaf67072711a185bb85b246c878f8a934d 100644 (file)
@@ -48,7 +48,7 @@ int board_init(void)
        gd->bd->bi_boot_params = CONFIG_SYS_SDRAM_BASE + 0x100;
        gpmc_init();
        set_i2c_pin_mux();
-       i2c_init(CONFIG_SYS_OMAP24_I2C_SPEED, CONFIG_SYS_OMAP24_I2C_SLAVE);
+       i2c_init(CONFIG_SYS_I2C_SPEED, CONFIG_SYS_I2C_SLAVE);
        i2c_probe(TPS65218_CHIP_PM);
 
        return 0;
index 016c63a509a5623d8bf78f94364099796622268e..9c6806c32f427c570c8b0b7ba0cda0e18c250251 100644 (file)
@@ -106,7 +106,7 @@ const struct dpll_params *get_dpll_per_params(void)
 void scale_vcores(void)
 {
        set_i2c_pin_mux();
-       i2c_init(CONFIG_SYS_OMAP24_I2C_SPEED, CONFIG_SYS_OMAP24_I2C_SLAVE);
+       i2c_init(CONFIG_SYS_I2C_SPEED, CONFIG_SYS_I2C_SLAVE);
        if (i2c_probe(TPS65218_CHIP_PM))
                return;
 
index d2136084991ddf51f945f85e1c87dad0c3d0ffe3..24bbcd471a2a79a9c35cdbd1b5b0eb12ed38e740 100644 (file)
@@ -161,7 +161,7 @@ void am33xx_spl_board_init(void)
 const struct dpll_params *get_dpll_ddr_params(void)
 {
        enable_i2c0_pin_mux();
-       i2c_init(CONFIG_SYS_OMAP24_I2C_SPEED, CONFIG_SYS_OMAP24_I2C_SLAVE);
+       i2c_init(CONFIG_SYS_I2C_SPEED, CONFIG_SYS_I2C_SLAVE);
 
        return &dpll_ddr_sl50;
 }
index 0007cac1aaa7120701f23178a73eecf100c7b9fd..07fe45447186699aed29b654c0c8fbc0735f080b 100644 (file)
@@ -187,7 +187,7 @@ void am33xx_spl_board_init(void)
         */
        i2c_set_bus_num(1);
 
-       printf("I2C speed: %d Hz\n", CONFIG_SYS_OMAP24_I2C_SPEED);
+       printf("I2C speed: %d Hz\n", CONFIG_SYS_I2C_SPEED);
 
        if (i2c_probe(TPS65910_CTRL_I2C_ADDR)) {
                puts("i2c: cannot access TPS65910\n");
index 48caa0326bb4c0da9996b07083e501020487e539..87a29e67ccec3f71a87fa863d9408e03a81ecbdf 100644 (file)
@@ -53,7 +53,7 @@ CONFIG_BOOTP_SEND_HOSTNAME=y
 CONFIG_BOOTCOUNT_LIMIT=y
 CONFIG_SYS_I2C_LEGACY=y
 CONFIG_SPL_SYS_I2C_LEGACY=y
-CONFIG_SYS_OMAP24_I2C_SPEED=1000
+CONFIG_SYS_I2C_SPEED=1000
 CONFIG_SYS_I2C_EEPROM_ADDR=0x50
 CONFIG_MMC_OMAP_HS=y
 CONFIG_MMC_OMAP_HS_ADMA=y
index c23cac734e73f32eed0897a9e86e59ef349cadcf..2f8c4b52a320df9b634194c519b158fc603d3d35 100644 (file)
@@ -53,6 +53,7 @@ CONFIG_VERSION_VARIABLE=y
 CONFIG_BOOTP_SEND_HOSTNAME=y
 CONFIG_SYS_I2C_LEGACY=y
 CONFIG_SPL_SYS_I2C_LEGACY=y
+CONFIG_SYS_I2C_SPEED=400000
 CONFIG_MMC_OMAP_HS=y
 CONFIG_PHY_ADDR_ENABLE=y
 CONFIG_PHY_SMSC=y
index 3591ab0248f2b38f5522a1124853bdaee3be7740..4f8ca9242535b2f3bb9cfa25e231caa6c3047d4b 100644 (file)
@@ -54,6 +54,7 @@ CONFIG_VERSION_VARIABLE=y
 CONFIG_BOOTP_SEND_HOSTNAME=y
 CONFIG_SYS_I2C_LEGACY=y
 CONFIG_SPL_SYS_I2C_LEGACY=y
+CONFIG_SYS_I2C_SPEED=400000
 CONFIG_MMC_OMAP_HS=y
 CONFIG_PHY_ADDR_ENABLE=y
 CONFIG_PHY_SMSC=y
index 67f1ea72cceba3e16a389250425aecc60879f188..1ed482940094bf7154f98865b835c02fdc53a16b 100644 (file)
@@ -54,6 +54,7 @@ CONFIG_VERSION_VARIABLE=y
 CONFIG_BOOTP_SEND_HOSTNAME=y
 CONFIG_SYS_I2C_LEGACY=y
 CONFIG_SPL_SYS_I2C_LEGACY=y
+CONFIG_SYS_I2C_SPEED=400000
 CONFIG_MMC_OMAP_HS=y
 CONFIG_PHY_ADDR_ENABLE=y
 CONFIG_PHY_SMSC=y
index 503b986549bf4b99b771dfb97c670b533240460f..a82972fcd3eb4d85d620d2dd82487a92bb1f90a1 100644 (file)
@@ -53,6 +53,7 @@ CONFIG_VERSION_VARIABLE=y
 CONFIG_BOOTP_SEND_HOSTNAME=y
 CONFIG_SYS_I2C_LEGACY=y
 CONFIG_SPL_SYS_I2C_LEGACY=y
+CONFIG_SYS_I2C_SPEED=400000
 CONFIG_MMC_OMAP_HS=y
 CONFIG_PHY_ADDR_ENABLE=y
 CONFIG_PHY_SMSC=y
index 3cb524b3be2dfc96d7c363fc2aa810fdb1a63fdf..bdbdb5ab0cd9bc2e20ed504b76b253bd58253f5e 100644 (file)
@@ -24,7 +24,7 @@ CONFIG_ENV_OVERWRITE=y
 CONFIG_SYS_RELOC_GD_ENV_ADDR=y
 CONFIG_SYS_I2C_LEGACY=y
 CONFIG_SPL_SYS_I2C_LEGACY=y
-CONFIG_SYS_OMAP24_I2C_SPEED=400000
+CONFIG_SYS_I2C_SPEED=400000
 CONFIG_TWL4030_INPUT=y
 CONFIG_MMC_OMAP_HS=y
 CONFIG_CONS_INDEX=3
index f4df4bac5e67d89918a6f98ad484f2ec0f51d84e..7bc0740f93d1aa533e046349687331e8d48758f5 100644 (file)
@@ -424,13 +424,13 @@ config SYS_I2C_OMAP24XX
          Add support for the OMAP2+ I2C driver.
 
 if SYS_I2C_OMAP24XX
-config SYS_OMAP24_I2C_SLAVE
+config SYS_I2C_SLAVE
        int "I2C Slave addr channel 0"
        default 1
        help
          OMAP24xx I2C Slave address channel 0
 
-config SYS_OMAP24_I2C_SPEED
+config SYS_I2C_SPEED
        int "I2C Slave channel 0 speed"
        default 100000
        help
index 71f6f5f7ac8ad60512ef5d1e0921e02fdfb0c0dc..e2c8c005d92dc10d5f5c5f09d04b32aae8ed2f7c 100644 (file)
@@ -936,62 +936,34 @@ static int omap24_i2c_probe(struct i2c_adapter *adap, uchar chip)
        return __omap24_i2c_probe(i2c_base, ip_rev, adap->waitdelay, chip);
 }
 
-#if !defined(CONFIG_SYS_OMAP24_I2C_SPEED1)
-#define CONFIG_SYS_OMAP24_I2C_SPEED1 CONFIG_SYS_OMAP24_I2C_SPEED
-#endif
-#if !defined(CONFIG_SYS_OMAP24_I2C_SLAVE1)
-#define CONFIG_SYS_OMAP24_I2C_SLAVE1 CONFIG_SYS_OMAP24_I2C_SLAVE
-#endif
-
 U_BOOT_I2C_ADAP_COMPLETE(omap24_0, omap24_i2c_init, omap24_i2c_probe,
                         omap24_i2c_read, omap24_i2c_write, omap24_i2c_setspeed,
-                        CONFIG_SYS_OMAP24_I2C_SPEED,
-                        CONFIG_SYS_OMAP24_I2C_SLAVE,
+                        CONFIG_SYS_I2C_SPEED,
+                        CONFIG_SYS_I2C_SLAVE,
                         0)
 U_BOOT_I2C_ADAP_COMPLETE(omap24_1, omap24_i2c_init, omap24_i2c_probe,
                         omap24_i2c_read, omap24_i2c_write, omap24_i2c_setspeed,
-                        CONFIG_SYS_OMAP24_I2C_SPEED1,
-                        CONFIG_SYS_OMAP24_I2C_SLAVE1,
+                        CONFIG_SYS_I2C_SPEED,
+                        CONFIG_SYS_I2C_SLAVE,
                         1)
 
 #if (CONFIG_SYS_I2C_BUS_MAX > 2)
-#if !defined(CONFIG_SYS_OMAP24_I2C_SPEED2)
-#define CONFIG_SYS_OMAP24_I2C_SPEED2 CONFIG_SYS_OMAP24_I2C_SPEED
-#endif
-#if !defined(CONFIG_SYS_OMAP24_I2C_SLAVE2)
-#define CONFIG_SYS_OMAP24_I2C_SLAVE2 CONFIG_SYS_OMAP24_I2C_SLAVE
-#endif
-
 U_BOOT_I2C_ADAP_COMPLETE(omap24_2, omap24_i2c_init, omap24_i2c_probe,
                         omap24_i2c_read, omap24_i2c_write, NULL,
-                        CONFIG_SYS_OMAP24_I2C_SPEED2,
-                        CONFIG_SYS_OMAP24_I2C_SLAVE2,
+                        CONFIG_SYS_I2C_SPEED,
+                        CONFIG_SYS_I2C_SLAVE,
                         2)
 #if (CONFIG_SYS_I2C_BUS_MAX > 3)
-#if !defined(CONFIG_SYS_OMAP24_I2C_SPEED3)
-#define CONFIG_SYS_OMAP24_I2C_SPEED3 CONFIG_SYS_OMAP24_I2C_SPEED
-#endif
-#if !defined(CONFIG_SYS_OMAP24_I2C_SLAVE3)
-#define CONFIG_SYS_OMAP24_I2C_SLAVE3 CONFIG_SYS_OMAP24_I2C_SLAVE
-#endif
-
 U_BOOT_I2C_ADAP_COMPLETE(omap24_3, omap24_i2c_init, omap24_i2c_probe,
                         omap24_i2c_read, omap24_i2c_write, NULL,
-                        CONFIG_SYS_OMAP24_I2C_SPEED3,
-                        CONFIG_SYS_OMAP24_I2C_SLAVE3,
+                        CONFIG_SYS_I2C_SPEED,
+                        CONFIG_SYS_I2C_SLAVE,
                         3)
 #if (CONFIG_SYS_I2C_BUS_MAX > 4)
-#if !defined(CONFIG_SYS_OMAP24_I2C_SPEED4)
-#define CONFIG_SYS_OMAP24_I2C_SPEED4 CONFIG_SYS_OMAP24_I2C_SPEED
-#endif
-#if !defined(CONFIG_SYS_OMAP24_I2C_SLAVE4)
-#define CONFIG_SYS_OMAP24_I2C_SLAVE4 CONFIG_SYS_OMAP24_I2C_SLAVE
-#endif
-
 U_BOOT_I2C_ADAP_COMPLETE(omap24_4, omap24_i2c_init, omap24_i2c_probe,
                         omap24_i2c_read, omap24_i2c_write, NULL,
-                        CONFIG_SYS_OMAP24_I2C_SPEED4,
-                        CONFIG_SYS_OMAP24_I2C_SLAVE4,
+                        CONFIG_SYS_I2C_SPEED,
+                        CONFIG_SYS_I2C_SLAVE,
                         4)
 #endif
 #endif
index a47d119debac28f974071746ebf3bf1d3a63b86a..e79fb91e4d67b02cb550a87ceb848ff3944cc8a2 100644 (file)
@@ -246,7 +246,7 @@ struct tam3517_module_info {
 
 #define TAM3517_READ_EEPROM(info, ret) \
 do {                                                           \
-       i2c_init(CONFIG_SYS_OMAP24_I2C_SPEED, CONFIG_SYS_OMAP24_I2C_SLAVE); \
+       i2c_init(CONFIG_SYS_I2C_SPEED, CONFIG_SYS_I2C_SLAVE); \
        if (eeprom_read(CONFIG_SYS_I2C_EEPROM_ADDR, 0,          \
                (void *)info, sizeof(*info)))                   \
                ret = 1;                                        \