From patchwork Sun Nov 20 13:30:49 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tom Rini X-Patchwork-Id: 1706762 X-Patchwork-Delegate: trini@ti.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: legolas.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=konsulko.com header.i=@konsulko.com header.a=rsa-sha256 header.s=google header.b=JkM09kbs; dkim-atps=neutral Received: from phobos.denx.de (phobos.denx.de [IPv6:2a01:238:438b:c500:173d:9f52:ddab:ee01]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4NFWvt0Ls8z23n6 for ; Mon, 21 Nov 2022 00:44:10 +1100 (AEDT) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id C0233852F8; Sun, 20 Nov 2022 14:35:28 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=konsulko.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (1024-bit key; unprotected) header.d=konsulko.com header.i=@konsulko.com header.b="JkM09kbs"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id A8311852AB; Sun, 20 Nov 2022 14:34:41 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-qv1-xf2a.google.com (mail-qv1-xf2a.google.com [IPv6:2607:f8b0:4864:20::f2a]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 2D01285289 for ; Sun, 20 Nov 2022 14:34:37 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=konsulko.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=trini@konsulko.com Received: by mail-qv1-xf2a.google.com with SMTP id e15so6471142qvo.4 for ; Sun, 20 Nov 2022 05:34:37 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=konsulko.com; s=google; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to; bh=pkeTVerYMnnCLOEKGGlFWOVaceb06N2rs5NrGhwlBfM=; b=JkM09kbsmK/qFZoE4QIQyZU2GZ431nOeemF+83B7nnIF6QuKpC34Nqz4l9Dw3nZ5Cr s+xaoKBqN4VQm71lrcLpXR/ybMANH6RWMMjxg3N/upByni1orYMfCBwWXrIgAiu8DEoL bAoVPBbilsAeBpI7otJwJVp0kbEWMfZpjwXpM= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=pkeTVerYMnnCLOEKGGlFWOVaceb06N2rs5NrGhwlBfM=; b=BH3QGp2Zkl5fTjhbBEYolkeI5yqE6bOvfv7MSBISaFxkSz0q4AYmTRmDlJk+MGGDqh eAz8EDZnjJyetbMEHWX1HTkExcBsxgmsS8g3pYp9b+8pEqwFSofBd4hoNftUoOqfTLxK YpMt6+zoJZnNKdYZ71RybHhDr4TVjTNNChVX9Qlotqrs1XN9VUAYwKK7A+7TZ5JEyvLx WDazy9pMBO1QO5vZsFv4greJqOx0s5Huf9+ElnOu8OwrRHe/zy9T5llPOM3QgXKwumnx 8vpVqYMxfTUOFLW2zm+selPN78qXiQwQl5M6x/tmhIbYmSpwz1VW0A49VRS3SioPDCV0 LQUw== X-Gm-Message-State: ANoB5pnfsQyodFbaDFrHVNNRM78ZHJvlWEHs+0S6bi4eIsDxD0YlCwpg ieM1vkBXY2wWQAMDrRXF5RggW/4b6Xptvg== X-Google-Smtp-Source: AA0mqf504pgS3uejt+52uxqxJVurMpNmzdDiekepLoNDbogoNdBAWBAkRNanDiLh8Szp+BbGoinwvw== X-Received: by 2002:a0c:edc1:0:b0:4c6:dce:fe12 with SMTP id i1-20020a0cedc1000000b004c60dcefe12mr13867792qvr.122.1668951275742; Sun, 20 Nov 2022 05:34:35 -0800 (PST) Received: from bill-the-cat.lan (2603-6081-7b00-6400-29a0-035f-b06a-235e.res6.spectrum.com. [2603:6081:7b00:6400:29a0:35f:b06a:235e]) by smtp.gmail.com with ESMTPSA id m21-20020a05620a24d500b006ce0733caebsm6487740qkn.14.2022.11.20.05.34.35 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 20 Nov 2022 05:34:35 -0800 (PST) From: Tom Rini To: u-boot@lists.denx.de Subject: [PoC 058/241] global: Migrate CONFIG_I2C_MULTI_BUS to CFG Date: Sun, 20 Nov 2022 08:30:49 -0500 Message-Id: <20221120133352.3055600-59-trini@konsulko.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20221120133352.3055600-1-trini@konsulko.com> References: <20221119234545.404563-38-trini@konsulko.com> <20221120133352.3055600-1-trini@konsulko.com> MIME-Version: 1.0 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.6 at phobos.denx.de X-Virus-Status: Clean Signed-off-by: Tom Rini --- README | 8 ++++---- cmd/i2c.c | 12 ++++++------ drivers/i2c/mv_i2c.c | 4 ++-- include/configs/display5.h | 2 +- include/configs/km/pg-wcom-ls102xa.h | 2 +- include/configs/novena.h | 2 +- include/configs/omap3_beagle.h | 2 +- include/configs/sniper.h | 2 +- include/configs/tqma6.h | 2 +- include/i2c.h | 2 +- scripts/config_whitelist.txt | 2 +- 11 files changed, 20 insertions(+), 20 deletions(-) diff --git a/README b/README index d76058e1ab41..50bfd7e4fffc 100644 --- a/README +++ b/README @@ -1006,7 +1006,7 @@ The following options need to be configured: You should define these to the GPIO value as given directly to the generic GPIO functions. - CONFIG_I2C_MULTI_BUS + CFG_I2C_MULTI_BUS This option allows the use of multiple I2C buses, each of which must have a controller. At any point in time, only one bus is @@ -1016,17 +1016,17 @@ The following options need to be configured: CFG_SYS_I2C_NOPROBES This option specifies a list of I2C devices that will be skipped - when the 'i2c probe' command is issued. If CONFIG_I2C_MULTI_BUS + when the 'i2c probe' command is issued. If CFG_I2C_MULTI_BUS is set, specify a list of bus-device pairs. Otherwise, specify a 1D array of device addresses e.g. - #undef CONFIG_I2C_MULTI_BUS + #undef CFG_I2C_MULTI_BUS #define CFG_SYS_I2C_NOPROBES {0x50,0x68} will skip addresses 0x50 and 0x68 on a board with one I2C bus - #define CONFIG_I2C_MULTI_BUS + #define CFG_I2C_MULTI_BUS #define CFG_SYS_I2C_NOPROBES {{0,0x50},{0,0x68},{1,0x54}} will skip addresses 0x50 and 0x68 on bus 0 and address 0x54 on bus 1 diff --git a/cmd/i2c.c b/cmd/i2c.c index da8b4c255555..2f9acc6670a3 100644 --- a/cmd/i2c.c +++ b/cmd/i2c.c @@ -98,7 +98,7 @@ static uint i2c_mm_last_alen; * pairs. The following macros take care of this */ #if defined(CFG_SYS_I2C_NOPROBES) -#if CONFIG_IS_ENABLED(SYS_I2C_LEGACY) || defined(CONFIG_I2C_MULTI_BUS) +#if CONFIG_IS_ENABLED(SYS_I2C_LEGACY) || defined(CFG_I2C_MULTI_BUS) static struct { uchar bus; @@ -1764,7 +1764,7 @@ static int do_i2c_show_bus(struct cmd_tbl *cmdtp, int flag, int argc, * Returns zero on success, CMD_RET_USAGE in case of misuse and negative * on error. */ -#if CONFIG_IS_ENABLED(SYS_I2C_LEGACY) || defined(CONFIG_I2C_MULTI_BUS) || \ +#if CONFIG_IS_ENABLED(SYS_I2C_LEGACY) || defined(CFG_I2C_MULTI_BUS) || \ CONFIG_IS_ENABLED(DM_I2C) static int do_i2c_bus_num(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[]) @@ -1916,9 +1916,9 @@ static struct cmd_tbl cmd_i2c_sub[] = { #endif U_BOOT_CMD_MKENT(crc32, 3, 1, do_i2c_crc, "", ""), #if CONFIG_IS_ENABLED(SYS_I2C_LEGACY) || \ - defined(CONFIG_I2C_MULTI_BUS) || CONFIG_IS_ENABLED(DM_I2C) + defined(CFG_I2C_MULTI_BUS) || CONFIG_IS_ENABLED(DM_I2C) U_BOOT_CMD_MKENT(dev, 1, 1, do_i2c_bus_num, "", ""), -#endif /* CONFIG_I2C_MULTI_BUS */ +#endif /* CFG_I2C_MULTI_BUS */ #if defined(CONFIG_I2C_EDID) U_BOOT_CMD_MKENT(edid, 1, 1, do_edid, "", ""), #endif /* CONFIG_I2C_EDID */ @@ -1993,9 +1993,9 @@ static char i2c_help_text[] = #endif "crc32 chip address[.0, .1, .2] count - compute CRC32 checksum\n" #if CONFIG_IS_ENABLED(SYS_I2C_LEGACY) || \ - defined(CONFIG_I2C_MULTI_BUS) || CONFIG_IS_ENABLED(DM_I2C) + defined(CFG_I2C_MULTI_BUS) || CONFIG_IS_ENABLED(DM_I2C) "i2c dev [dev] - show or set current I2C bus\n" -#endif /* CONFIG_I2C_MULTI_BUS */ +#endif /* CFG_I2C_MULTI_BUS */ #if defined(CONFIG_I2C_EDID) "i2c edid chip - print EDID configuration information\n" #endif /* CONFIG_I2C_EDID */ diff --git a/drivers/i2c/mv_i2c.c b/drivers/i2c/mv_i2c.c index 8ee17f0a4501..dffd551f2c29 100644 --- a/drivers/i2c/mv_i2c.c +++ b/drivers/i2c/mv_i2c.c @@ -374,7 +374,7 @@ static int __i2c_write(struct mv_i2c *base, uchar chip, u8 *addr, int alen, static struct mv_i2c *base_glob; -#ifdef CONFIG_I2C_MULTI_BUS +#ifdef CFG_I2C_MULTI_BUS static unsigned long i2c_regs[CONFIG_MV_I2C_NUM] = CONFIG_MV_I2C_REG; static unsigned int bus_initialized[CONFIG_MV_I2C_NUM]; static unsigned int current_bus; @@ -407,7 +407,7 @@ void i2c_init(int speed, int slaveaddr) { u32 val; -#ifdef CONFIG_I2C_MULTI_BUS +#ifdef CFG_I2C_MULTI_BUS current_bus = 0; base_glob = (struct mv_i2c *)i2c_regs[current_bus]; #else diff --git a/include/configs/display5.h b/include/configs/display5.h index f95c1602e676..191c8fb8ab46 100644 --- a/include/configs/display5.h +++ b/include/configs/display5.h @@ -37,7 +37,7 @@ #define CONFIG_MXC_UART_BASE UART5_BASE /* I2C Configs */ -#define CONFIG_I2C_MULTI_BUS +#define CFG_I2C_MULTI_BUS /* MMC Configs */ #define CFG_SYS_FSL_ESDHC_ADDR 0 diff --git a/include/configs/km/pg-wcom-ls102xa.h b/include/configs/km/pg-wcom-ls102xa.h index 80027f3a773a..e64cf24bd5e9 100644 --- a/include/configs/km/pg-wcom-ls102xa.h +++ b/include/configs/km/pg-wcom-ls102xa.h @@ -154,7 +154,7 @@ * I2C */ -#define CONFIG_I2C_MULTI_BUS +#define CFG_I2C_MULTI_BUS #define CFG_SYS_I2C_MAX_HOPS 1 #define CFG_SYS_NUM_I2C_BUSES 3 #define I2C_MUX_PCA_ADDR 0x70 diff --git a/include/configs/novena.h b/include/configs/novena.h index 520c4ba130f1..af99ba4f193c 100644 --- a/include/configs/novena.h +++ b/include/configs/novena.h @@ -35,7 +35,7 @@ #define CFG_SYS_INIT_RAM_SIZE IRAM_SIZE /* I2C */ -#define CONFIG_I2C_MULTI_BUS +#define CFG_I2C_MULTI_BUS /* I2C EEPROM */ diff --git a/include/configs/omap3_beagle.h b/include/configs/omap3_beagle.h index efeb7bf10078..af7cb3513f8f 100644 --- a/include/configs/omap3_beagle.h +++ b/include/configs/omap3_beagle.h @@ -29,7 +29,7 @@ #endif /* CONFIG_MTD_RAW_NAND */ /* Enable Multi Bus support for I2C */ -#define CONFIG_I2C_MULTI_BUS +#define CFG_I2C_MULTI_BUS /* DSS Support */ diff --git a/include/configs/sniper.h b/include/configs/sniper.h index eaee8dd37396..45a3102aeeef 100644 --- a/include/configs/sniper.h +++ b/include/configs/sniper.h @@ -38,7 +38,7 @@ * I2C */ -#define CONFIG_I2C_MULTI_BUS +#define CFG_I2C_MULTI_BUS /* * Input diff --git a/include/configs/tqma6.h b/include/configs/tqma6.h index 14d7730f67bf..cb5f7fc25af9 100644 --- a/include/configs/tqma6.h +++ b/include/configs/tqma6.h @@ -28,7 +28,7 @@ #define TQMA6_SPI_FLASH_SECTOR_SIZE SZ_64K /* I2C Configs */ -#define CONFIG_I2C_MULTI_BUS +#define CFG_I2C_MULTI_BUS #if !defined(CONFIG_DM_PMIC) #define CONFIG_POWER_PFUZE100_I2C_ADDR 0x08 diff --git a/include/i2c.h b/include/i2c.h index 51390f8fd84f..3811b26c08e0 100644 --- a/include/i2c.h +++ b/include/i2c.h @@ -930,7 +930,7 @@ unsigned int i2c_get_bus_speed(void); * only for backwardcompatibility, should go away if we switched * completely to new multibus support. */ -#if CONFIG_IS_ENABLED(SYS_I2C_LEGACY) || defined(CONFIG_I2C_MULTI_BUS) +#if CONFIG_IS_ENABLED(SYS_I2C_LEGACY) || defined(CFG_I2C_MULTI_BUS) # if !defined(CFG_SYS_MAX_I2C_BUS) # define CFG_SYS_MAX_I2C_BUS 2 # endif diff --git a/scripts/config_whitelist.txt b/scripts/config_whitelist.txt index 440bef90575d..501e39bb4900 100644 --- a/scripts/config_whitelist.txt +++ b/scripts/config_whitelist.txt @@ -58,7 +58,7 @@ CFG_HOSTNAME CFG_HSMMC2_8BIT CFG_HW_ENV_SETTINGS CFG_I2C_ENV_EEPROM_BUS -CONFIG_I2C_MULTI_BUS +CFG_I2C_MULTI_BUS CONFIG_I2C_MVTWSI CONFIG_I2C_MVTWSI_BASE0 CONFIG_I2C_MVTWSI_BASE1