mirror of
				https://github.com/smaeul/u-boot.git
				synced 2025-11-03 21:48:15 +00:00 
			
		
		
		
	Use CONFIG_IS_ENABLED() macro, which provides more convenient
way to check $(SPL)DM_I2C/$(SPL)DM_I2C_GPIO configs
for both SPL and U-Boot proper.
CONFIG_IS_ENABLED(DM_I2C) expands to:
- 1 if CONFIG_SPL_BUILD is undefined and CONFIG_DM_I2C is set to 'y',
- 1 if CONFIG_SPL_BUILD is defined and CONFIG_SPL_DM_I2C is set to 'y',
- 0 otherwise.
All occurences were replaced automatically using these bash cmds:
$ find . -type f -exec sed -i
     's/ifndef CONFIG_DM_I2C/if !CONFIG_IS_ENABLED(DM_I2C)/g' {} +
$ find . -type f -exec sed -i
    's/ifdef CONFIG_DM_I2C/if CONFIG_IS_ENABLED(DM_I2C)/g' {} +
$ find . -type f -exec sed -i
    's/defined(CONFIG_DM_I2C)/CONFIG_IS_ENABLED(DM_I2C)/g' {} +
$ find . -type f -exec sed -i
    's/ifndef CONFIG_DM_I2C_GPIO/if !CONFIG_IS_ENABLED(DM_I2C_GPIO)/g' {} +
$ find . -type f -exec sed -i
    's/ifdef CONFIG_DM_I2C_GPIO/if CONFIG_IS_ENABLED(DM_I2C_GPIO)/g' {} +
$ find . -type f -exec sed -i
    's/defined(CONFIG_DM_I2C_GPIO)/CONFIG_IS_ENABLED(DM_I2C_GPIO)/g' {} +
Reviewed-by: Heiko Schocher <hs@denx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Igor Opaniuk <igor.opaniuk@foundries.io>
Reviewed-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Priyanka Jain <priyanka.jain@nxp.com>
		
	
			
		
			
				
	
	
		
			56 lines
		
	
	
		
			1.2 KiB
		
	
	
	
		
			C
		
	
	
	
	
	
			
		
		
	
	
			56 lines
		
	
	
		
			1.2 KiB
		
	
	
	
		
			C
		
	
	
	
	
	
/*
 | 
						|
 * Copyright 2012 Texas Instruments
 | 
						|
 *
 | 
						|
 * This file is licensed under the terms of the GNU General Public
 | 
						|
 * License Version 2. This file is licensed "as is" without any
 | 
						|
 * warranty of any kind, whether express or implied.
 | 
						|
 */
 | 
						|
 | 
						|
#ifndef __CONFIG_FALLBACKS_H
 | 
						|
#define __CONFIG_FALLBACKS_H
 | 
						|
 | 
						|
#ifdef CONFIG_SPL
 | 
						|
#ifdef CONFIG_SPL_PAD_TO
 | 
						|
#ifdef CONFIG_SPL_MAX_SIZE
 | 
						|
#if CONFIG_SPL_PAD_TO && CONFIG_SPL_PAD_TO < CONFIG_SPL_MAX_SIZE
 | 
						|
#error CONFIG_SPL_PAD_TO < CONFIG_SPL_MAX_SIZE
 | 
						|
#endif
 | 
						|
#endif
 | 
						|
#else
 | 
						|
#ifdef CONFIG_SPL_MAX_SIZE
 | 
						|
#define CONFIG_SPL_PAD_TO	CONFIG_SPL_MAX_SIZE
 | 
						|
#else
 | 
						|
#define CONFIG_SPL_PAD_TO	0
 | 
						|
#endif
 | 
						|
#endif
 | 
						|
#endif
 | 
						|
 | 
						|
#ifndef CONFIG_SYS_BAUDRATE_TABLE
 | 
						|
#define CONFIG_SYS_BAUDRATE_TABLE	{ 9600, 19200, 38400, 57600, 115200 }
 | 
						|
#endif
 | 
						|
 | 
						|
/* Console I/O Buffer Size */
 | 
						|
#ifndef CONFIG_SYS_CBSIZE
 | 
						|
#if defined(CONFIG_CMD_KGDB)
 | 
						|
#define CONFIG_SYS_CBSIZE	1024
 | 
						|
#else
 | 
						|
#define CONFIG_SYS_CBSIZE	256
 | 
						|
#endif
 | 
						|
#endif
 | 
						|
 | 
						|
#ifndef CONFIG_SYS_PBSIZE
 | 
						|
#define CONFIG_SYS_PBSIZE	(CONFIG_SYS_CBSIZE + sizeof(CONFIG_SYS_PROMPT) + 16)
 | 
						|
#endif
 | 
						|
 | 
						|
#ifndef CONFIG_SYS_MAXARGS
 | 
						|
#define CONFIG_SYS_MAXARGS	16
 | 
						|
#endif
 | 
						|
 | 
						|
#if CONFIG_IS_ENABLED(DM_I2C)
 | 
						|
# ifdef CONFIG_SYS_I2C
 | 
						|
#  error "Cannot define CONFIG_SYS_I2C when CONFIG_DM_I2C is used"
 | 
						|
# endif
 | 
						|
#endif
 | 
						|
 | 
						|
#endif	/* __CONFIG_FALLBACKS_H */
 |