Allow disabling driver model for I2C in SPL
Subsystems (14)
v3 cover Allow disabling driver model for I2C in SPL
From: Igor Opaniuk <[email protected]>
At present if U-Boot proper uses driver model for I2C, then SPL has to also. While this is desirable, it places a significant barrier to moving to driver model in some cases. For example, with a space-constrained SPL it may be necessary to enable CONFIG_SPL_OF_PLATDATA which involves adjusting some drivers.
This patch introduces a separate Kconfig symbols for enabling DM_I2C and DM_I2C_GPIO support in SPL.
This will also help to get away from dirty workarounds to achieve non-DM I2C support for SPL, which is currently used in some board header files like:
ifdef CONFIG_SPL_BUILD
undef CONFIG_DM_I2C
endif
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' {} +Azure CI results:
https://dev.azure.com/igoropaniuk/u-boot/_build/results?buildId=6&view=results
Changes in v3:
- Drop undefs for CONFIG_DM_I2C and moved that to board defconfigs
- Rebased on the latest master
Changes in v2:
- Applied R-b tags from Simon and Heiko
- Added additional patches that replace CONFIG_DM_I2C undefs with CONFIG_SPL_DM_I2C for SPL build case (this should be moved to board defconfigs by board maintainers)
Igor Opaniuk (3):
dm: i2c: allow disabling driver model in SPL
board: freescale: drop CONFIG_DM_I2C undefs
dm: i2c: use CONFIG_IS_ENABLED macro for DM_I2C/DM_I2C_GPIO
.../include/asm/arch-fsl-layerscape/config.h | 2 +- arch/arm/include/asm/arch-lpc32xx/i2c.h | 2 +- arch/arm/include/asm/mach-imx/mxc_i2c.h | 2 +- arch/arm/include/asm/omap_i2c.h | 2 +- arch/arm/mach-imx/i2c-mxv7.c | 2 +- arch/arm/mach-keystone/ddr3_spd.c | 2 +- arch/arm/mach-kirkwood/include/mach/config.h | 2 +- arch/arm/mach-omap2/am33xx/board.c | 2 +- arch/arm/mach-omap2/am33xx/clk_synthesizer.c | 6 +- arch/arm/mach-omap2/boot-common.c | 2 +- arch/arm/mach-omap2/clocks-common.c | 2 +- arch/arm/mach-sunxi/board.c | 2 +- arch/powerpc/include/asm/fsl_i2c.h | 2 +- board/freescale/common/dcu_sii9022a.c | 2 +- board/freescale/common/diu_ch7301.c | 2 +- board/freescale/common/emc2305.c | 4 +- board/freescale/common/qixis.c | 4 +- board/freescale/common/sys_eeprom.c | 20 ++-- board/freescale/common/vid.c | 24 ++--- board/freescale/common/vsc3316_3308.c | 10 +- board/freescale/ls1012aqds/ls1012aqds.c | 2 +- board/freescale/ls1012ardb/eth.c | 2 +- board/freescale/ls1012ardb/ls1012ardb.c | 12 +-- board/freescale/ls1021aqds/dcu.c | 6 +- board/freescale/ls1021aqds/ls1021aqds.c | 2 +- board/freescale/ls1021atwr/ls1021atwr.c | 2 +- board/freescale/ls1028a/ls1028a.c | 2 +- board/freescale/ls1043aqds/ls1043aqds.c | 4 +- board/freescale/ls1046afrwy/ls1046afrwy.c | 2 +- board/freescale/ls1046aqds/ls1046aqds.c | 2 +- board/freescale/ls1088a/eth_ls1088aqds.c | 16 +-- board/freescale/ls1088a/ls1088a.c | 60 ++++++------ board/freescale/ls2080aqds/eth.c | 14 +-- board/freescale/ls2080aqds/ls2080aqds.c | 4 +- board/freescale/ls2080ardb/ls2080ardb.c | 2 +- board/freescale/lx2160a/lx2160a.c | 2 +- board/freescale/p1010rdb/p1010rdb.c | 8 +- board/freescale/p1_p2_rdb_pc/p1_p2_rdb_pc.c | 2 +- board/freescale/t102xrdb/t102xrdb.c | 2 +- board/freescale/t208xqds/t208xqds.c | 2 +- board/friendlyarm/nanopi2/onewire.c | 6 +- board/keymile/common/ivm.c | 2 +- board/samsung/common/misc.c | 2 +- board/samsung/trats/trats.c | 10 +- board/samsung/trats2/trats2.c | 10 +- board/sunxi/board.c | 2 +- board/ti/am335x/board.c | 8 +- board/ti/am335x/mux.c | 2 +- board/ti/am43xx/board.c | 12 +-- board/ti/common/board_detect.c | 4 +- board/ti/ks2_evm/board_k2g.c | 2 +- board/wandboard/wandboard.c | 4 +- cmd/eeprom.c | 6 +- cmd/i2c.c | 98 +++++++++---------- configs/imx8mp_evk_defconfig | 1 + ...s1021atwr_sdcard_ifc_SECURE_BOOT_defconfig | 1 + .../ls1046ardb_sdcard_SECURE_BOOT_defconfig | 1 + configs/phycore-imx8mp_defconfig | 1 + doc/driver-model/i2c-howto.rst | 2 +- drivers/ddr/fsl/main.c | 8 +- drivers/i2c/Kconfig | 21 ++++ drivers/i2c/Makefile | 4 +- drivers/i2c/davinci_i2c.c | 4 +- drivers/i2c/designware_i2c.c | 4 +- drivers/i2c/fsl_i2c.c | 6 +- drivers/i2c/ihs_i2c.c | 42 ++++---- drivers/i2c/lpc32xx_i2c.c | 4 +- drivers/i2c/mv_i2c.c | 2 +- drivers/i2c/mvtwsi.c | 16 +-- drivers/i2c/mxc_i2c.c | 4 +- drivers/i2c/omap24xx_i2c.c | 2 +- drivers/misc/Makefile | 2 +- drivers/power/palmas.c | 2 +- drivers/power/pmic/pmic_tps62362.c | 6 +- drivers/power/pmic/pmic_tps65217.c | 14 +-- drivers/power/pmic/pmic_tps65218.c | 4 +- drivers/power/pmic/pmic_tps65910.c | 6 +- drivers/power/twl4030.c | 2 +- drivers/power/twl6030.c | 2 +- drivers/tpm/tpm_atmel_twi.c | 6 +- drivers/usb/host/ohci-lpc32xx.c | 8 +- include/_exports.h | 2 +- include/config_fallbacks.h | 2 +- include/configs/MPC8548CDS.h | 2 +- include/configs/P1010RDB.h | 2 +- include/configs/P2041RDB.h | 2 +- include/configs/T102xRDB.h | 2 +- include/configs/T104xRDB.h | 3 +- include/configs/T208xQDS.h | 2 +- include/configs/T208xRDB.h | 2 +- include/configs/T4240RDB.h | 2 +- include/configs/am43xx_evm.h | 2 +- include/configs/corenet_ds.h | 2 +- include/configs/imx8mp_evk.h | 1 - include/configs/ls1012a_common.h | 2 +- include/configs/ls1021aiot.h | 2 +- include/configs/ls1021aqds.h | 2 +- include/configs/ls1021atsn.h | 2 +- include/configs/ls1021atwr.h | 3 +- include/configs/ls1028a_common.h | 2 +- include/configs/ls1043a_common.h | 2 +- include/configs/ls1046a_common.h | 3 +- include/configs/ls1088a_common.h | 2 +- include/configs/ls1088aqds.h | 2 +- include/configs/ls2080a_common.h | 2 +- include/configs/ls2080aqds.h | 2 +- include/configs/ls2080ardb.h | 2 +- include/configs/p1_p2_rdb_pc.h | 2 +- include/configs/phycore_imx8mp.h | 1 - include/configs/sunxi-common.h | 2 +- include/configs/ti_armv7_common.h | 2 +- include/exports.h | 2 +- include/i2c.h | 2 +- include/palmas.h | 2 +- include/twl4030.h | 2 +- include/twl6030.h | 2 +- 116 files changed, 339 insertions(+), 319 deletions(-)
Signature · 1 line
2.25.1
PATCH v3 1/3 dm: i2c: allow disabling driver model in SPL
From: Igor Opaniuk <[email protected]>
At present if U-Boot proper uses driver model for I2C, then SPL has to also. While this is desirable, it places a significant barrier to moving to driver model in some cases. For example, with a space-constrained SPL it may be necessary to enable CONFIG_SPL_OF_PLATDATA which involves adjusting some drivers.
This patch introduces a separate Kconfig symbols for enabling DM_I2C and DM_I2C_GPIO support in SPL.
This will also help to get away from dirty workarounds to achieve non-DM I2C support for SPL, which is currently used in some board header files like:
ifdef CONFIG_SPL_BUILD
undef CONFIG_DM_I2C
endif
---
(no changes since v2)
Changes in v2:
- R-b tags applied (Simon and Heiko)
drivers/i2c/Kconfig | 21 +++++++++++++++++++++ drivers/i2c/Makefile | 4 ++-- drivers/misc/Makefile | 2 +- 3 files changed, 24 insertions(+), 3 deletions(-)
drivers/i2c/Kconfig +21 -0
@@ -14,6 +14,17 @@ config DM_I2C device (bus child) info is kept as parent plat. The interface is defined in include/i2c.h. +config SPL_DM_I2C + bool "Enable Driver Model for I2C drivers in SPL" + depends on SPL_DM && DM_I2C + default y + help + Enable driver model for I2C. The I2C uclass interface: probe, read, + write and speed, is implemented with the bus drivers operations, + which provide methods for bus setting and data transfer. Each chip + device (bus child) info is kept as parent platdata. The interface + is defined in include/i2c.h. + config I2C_CROS_EC_TUNNEL tristate "Chrome OS EC tunnel I2C bus" depends on CROS_EC
@@ -61,6 +72,16 @@ config DM_I2C_GPIO bindings are supported. Binding info: doc/device-tree-bindings/i2c/i2c-gpio.txt +config SPL_DM_I2C_GPIO + bool "Enable Driver Model for software emulated I2C bus driver in SPL" + depends on SPL_DM && DM_I2C_GPIO && SPL_DM_GPIO && SPL_GPIO_SUPPORT + default y + help + Enable the i2c bus driver emulation by using the GPIOs. The bus GPIO + configuration is given by the device tree. Kernel-style device tree + bindings are supported. + Binding info: doc/device-tree-bindings/i2c/i2c-gpio.txt + config SYS_I2C_AT91 bool "Atmel I2C driver" depends on DM_I2C && ARCH_AT91
drivers/i2c/Makefile +2 -2
@@ -2,9 +2,9 @@ # # (C) Copyright 2000-2007 # Wolfgang Denk, DENX Software Engineering, wd at denx.de. -obj-$(CONFIG_DM_I2C) += i2c-uclass.o +obj-$(CONFIG_$(SPL_)DM_I2C) += i2c-uclass.o ifdef CONFIG_ACPIGEN -obj-$(CONFIG_DM_I2C) += acpi_i2c.o +obj-$(CONFIG_$(SPL_)DM_I2C) += acpi_i2c.o endif obj-$(CONFIG_$(SPL_)DM_I2C_GPIO) += i2c-gpio.o obj-$(CONFIG_$(SPL_)I2C_CROS_EC_TUNNEL) += cros_ec_tunnel.o
drivers/misc/Makefile +1 -1
@@ -17,7 +17,7 @@ obj-$(CONFIG_SANDBOX) += p2sb_sandbox.o p2sb_emul.o obj-$(CONFIG_SANDBOX) += swap_case.o endif -ifdef CONFIG_DM_I2C +ifdef CONFIG_$(SPL_)DM_I2C ifndef CONFIG_SPL_BUILD obj-$(CONFIG_SANDBOX) += i2c_eeprom_emul.o endif
Signature · 1 line
2.25.1
PATCH v3 1/3 dm: i2c: allow disabling driver model in SPL
Quoted 15 lines · Igor Opaniuk
From: Igor Opaniuk <[email protected]>
At present if U-Boot proper uses driver model for I2C, then SPL has to also. While this is desirable, it places a significant barrier to moving to driver model in some cases. For example, with a space-constrained SPL it may be necessary to enable
CONFIG_SPL_OF_PLATDATAwhich involves adjusting some drivers.This patch introduces a separate
Kconfigsymbols for enablingDM_I2CandDM_I2C_GPIOsupport in SPL.This will also help to get away from dirty workarounds to achieve non-DM I2C support for SPL, which is currently used in some board header files like:
Quoted 8 lines
ifdef
CONFIG_SPL_BUILD
undefCONFIG_DM_I2C
endifReviewed-by Simon Glass <[email protected]>Reviewed-by Heiko Schocher <[email protected]>Signed-off-by Igor Opaniuk <[email protected]>
Signature · 8 lines
Tom -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 659 bytes Desc: not available URL: <https://lists.denx.de/pipermail/u-boot/attachments/20210210/4cda9aa1/attachment.sig>
PATCH v3 1/3 dm: i2c: allow disabling driver model in SPL
In reply to Igor OpaniukHello Igor,
Quoted 27 lines · Igor Opaniuk
From: Igor Opaniuk <[email protected]>
At present if U-Boot proper uses driver model for I2C, then SPL has to also. While this is desirable, it places a significant barrier to moving to driver model in some cases. For example, with a space-constrained SPL it may be necessary to enable
CONFIG_SPL_OF_PLATDATAwhich involves adjusting some drivers.This patch introduces a separate
Kconfigsymbols for enablingDM_I2CandDM_I2C_GPIOsupport in SPL.This will also help to get away from dirty workarounds to achieve non-DM I2C support for SPL, which is currently used in some board header files like:
ifdef
CONFIG_SPL_BUILD
undefCONFIG_DM_I2C
endifReviewed-by Simon Glass <[email protected]>Reviewed-by Heiko Schocher <[email protected]>Signed-off-by Igor Opaniuk <[email protected]>---
(no changes since v2)
Quoted 7 lines
Changes in v2:
- R-b tags applied (Simon and Heiko)drivers/i2c/Kconfig | 21 +++++++++++++++++++++ drivers/i2c/Makefile | 4 ++-- drivers/misc/Makefile | 2 +- 3 files changed, 24 insertions(+), 3 deletions(-)
Applied to u-boot-i2c.git master
Thanks!
bye,
Heiko
Signature · 3 lines
DENX Software Engineering GmbH, Managing Director: Wolfgang Denk HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: +49-8142-66989-52 Fax: +49-8142-66989-80 Email: hs at denx.de
PATCH v3 2/3 board: freescale: drop CONFIG_DM_I2C undefs
In reply to Igor OpaniukFrom: Igor Opaniuk <[email protected]>
Drop CONFIG_DM_I2C undefs from board header files, and make them disabled on these boards in defconfigs instead.
Disabling on Kconfig symbol was done automatically with this script:
cd configs
files=(*ls1046a*)
files2=(*T104*RDB*)
files3=(ls1021atwr_*)
files4=("imx8mp_evk_defconfig phycore-imx8mp_defconfig") combine=("${files[@]}" "${files2[@]}" "${files3[@]}" "${files4[@]}") cd ..
for item in ${combine[*]}
do
echo "Adjusting $item"
echo "# CONFIG_SPL_DM_I2C is not set" >> configs/$item make $item && make savedefconfig && cp defconfig configs/$item
done
---
Changes in v3:
- Drop CONFIG_DM_I2C undefs from board header files (instead of replacing them with another undef for CONFIG_SPL_DM_I2C), and make them disabled on these boards in defconfigs.
configs/imx8mp_evk_defconfig | 1 + configs/ls1021atwr_sdcard_ifc_SECURE_BOOT_defconfig | 1 + configs/ls1046ardb_sdcard_SECURE_BOOT_defconfig | 1 + configs/phycore-imx8mp_defconfig | 1 + include/configs/T104xRDB.h | 1 - include/configs/imx8mp_evk.h | 1 - include/configs/ls1021atwr.h | 1 - include/configs/ls1046a_common.h | 1 - include/configs/phycore_imx8mp.h | 1 - 9 files changed, 4 insertions(+), 5 deletions(-)
configs/imx8mp_evk_defconfig +1 -0
@@ -69,6 +69,7 @@ CONFIG_CLK_IMX8MP=y CONFIG_MXC_GPIO=y CONFIG_DM_PCA953X=y CONFIG_DM_I2C=y +# CONFIG_SPL_DM_I2C is not set CONFIG_SYS_I2C_MXC=y CONFIG_LED=y CONFIG_LED_GPIO=y
configs/ls1021atwr_sdcard_ifc_SECURE_BOOT_defconfig +1 -0
@@ -52,6 +52,7 @@ CONFIG_SYS_RELOC_GD_ENV_ADDR=y CONFIG_DM=y CONFIG_SPL_DM=y CONFIG_DM_I2C=y +# CONFIG_SPL_DM_I2C is not set CONFIG_FSL_ESDHC=y CONFIG_MTD=y CONFIG_MTD_NOR_FLASH=y
configs/ls1046ardb_sdcard_SECURE_BOOT_defconfig +1 -0
@@ -50,6 +50,7 @@ CONFIG_SYS_RELOC_GD_ENV_ADDR=y CONFIG_DM=y CONFIG_SPL_DM=y CONFIG_DM_I2C=y +# CONFIG_SPL_DM_I2C is not set CONFIG_FSL_ESDHC=y CONFIG_MTD=y CONFIG_MTD_RAW_NAND=y
configs/phycore-imx8mp_defconfig +1 -0
@@ -63,6 +63,7 @@ CONFIG_CLK_COMPOSITE_CCF=y CONFIG_CLK_IMX8MP=y CONFIG_MXC_GPIO=y CONFIG_DM_I2C=y +# CONFIG_SPL_DM_I2C is not set CONFIG_SYS_I2C_MXC=y CONFIG_MISC=y CONFIG_I2C_EEPROM=y
include/configs/T104xRDB.h +0 -1
@@ -30,7 +30,6 @@#define CONFIG_SPL_SKIP_RELOCATE #define CONFIG_SPL_COMMON_INIT_DDR #define CONFIG_SYS_CCSR_DO_NOT_RELOCATE -#undef CONFIG_DM_I2C#endif #define RESET_VECTOR_OFFSET 0x27FFC#define BOOT_PAGE_OFFSET 0x27000
include/configs/imx8mp_evk.h +0 -1
@@ -37,7 +37,6 @@#define CONFIG_POWER_I2C #define CONFIG_POWER_PCA9450 -#undef CONFIG_DM_I2C#define CONFIG_SYS_I2C #endif
include/configs/ls1021atwr.h +0 -1
@@ -442,7 +442,6 @@#ifdef CONFIG_SPL_BUILD #define CONFIG_SYS_MONITOR_BASE CONFIG_SPL_TEXT_BASE -#undef CONFIG_DM_I2C#else #define CONFIG_SYS_MONITOR_BASE CONFIG_SYS_TEXT_BASE/* start of monitor */ #endif
include/configs/ls1046a_common.h +0 -1
@@ -16,7 +16,6 @@#define SPL_NO_QSPI #define SPL_NO_USB #define SPL_NO_SATA -#undef CONFIG_DM_I2C#endif #if defined(CONFIG_SPL_BUILD ) && \ (defined(CONFIG_NAND_BOOT ) || defined(CONFIG_QSPI_BOOT ))
include/configs/phycore_imx8mp.h +0 -1
@@ -33,7 +33,6 @@#define CONFIG_POWER_I2C #define CONFIG_POWER_PCA9450 -#undef CONFIG_DM_I2C#define CONFIG_SYS_I2C #endif
Signature · 1 line
2.25.1
PATCH v3 2/3 board: freescale: drop CONFIG_DM_I2C undefs
Quoted 15 lines · Igor Opaniuk
From: Igor Opaniuk <[email protected]>
Drop
CONFIG_DM_I2Cundefs from board header files, and make them disabled on these boards in defconfigs instead.Disabling on
Kconfigsymbol was done automatically with this script:cd configs
files=(*ls1046a*)
files2=(*T104*RDB*)
files3=(ls1021atwr_*)
files4=("imx8mp_evk_defconfig phycore-imx8mp_defconfig") combine=("${files[@]}" "${files2[@]}" "${files3[@]}" "${files4[@]}") cd ..
Quoted 8 lines
for item in ${combine[*]}
do
echo "Adjusting $item"
echo "#CONFIG_SPL_DM_I2Cis not set" >> configs/$item make $item && make savedefconfig && cp defconfig configs/$item
doneSigned-off-by Igor Opaniuk <[email protected]>
Signature · 8 lines
Tom -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 659 bytes Desc: not available URL: <https://lists.denx.de/pipermail/u-boot/attachments/20210210/ed7b1f70/attachment.sig>
PATCH v3 2/3 board: freescale: drop CONFIG_DM_I2C undefs
In reply to Igor OpaniukHello Igor,
Quoted 30 lines · Igor Opaniuk
From: Igor Opaniuk <[email protected]>
Drop
CONFIG_DM_I2Cundefs from board header files, and make them disabled on these boards in defconfigs instead.Disabling on
Kconfigsymbol was done automatically with this script:cd configs
files=(*ls1046a*)
files2=(*T104*RDB*)
files3=(ls1021atwr_*)
files4=("imx8mp_evk_defconfig phycore-imx8mp_defconfig") combine=("${files[@]}" "${files2[@]}" "${files3[@]}" "${files4[@]}") cd ..for item in ${combine[*]}
do
echo "Adjusting $item"
echo "#CONFIG_SPL_DM_I2Cis not set" >> configs/$item make $item && make savedefconfig && cp defconfig configs/$item
doneSigned-off-by Igor Opaniuk <[email protected]>---
Changes in v3:
- DropCONFIG_DM_I2Cundefs from board header files (instead of replacing them with another undef forCONFIG_SPL_DM_I2C), and make them disabled on these boards in defconfigs.
Quoted 10 lines
configs/imx8mp_evk_defconfig | 1 + configs/ls1021atwr_sdcard_ifc_SECURE_BOOT_defconfig | 1 + configs/ls1046ardb_sdcard_SECURE_BOOT_defconfig | 1 + configs/phycore-imx8mp_defconfig | 1 + include/configs/T104xRDB.h | 1 - include/configs/imx8mp_evk.h | 1 - include/configs/ls1021atwr.h | 1 - include/configs/ls1046a_common.h | 1 - include/configs/phycore_imx8mp.h | 1 - 9 files changed, 4 insertions(+), 5 deletions(-)
Applied to u-boot-i2c.git master
Thanks!
bye,
Heiko
Signature · 3 lines
DENX Software Engineering GmbH, Managing Director: Wolfgang Denk HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: +49-8142-66989-52 Fax: +49-8142-66989-80 Email: hs at denx.de
PATCH v3 3/3 dm: i2c: use CONFIG_IS_ENABLED macro for DM_I2C/DM_I2C_GPIO
In reply to Igor OpaniukFrom: Igor Opaniuk <[email protected]>
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' {} +---
(no changes since v2)
Changes in v2:
- Added R-b tags (Heiko and Simon)
.../include/asm/arch-fsl-layerscape/config.h | 2 +- arch/arm/include/asm/arch-lpc32xx/i2c.h | 2 +- arch/arm/include/asm/mach-imx/mxc_i2c.h | 2 +- arch/arm/include/asm/omap_i2c.h | 2 +- arch/arm/mach-imx/i2c-mxv7.c | 2 +- arch/arm/mach-keystone/ddr3_spd.c | 2 +- arch/arm/mach-kirkwood/include/mach/config.h | 2 +- arch/arm/mach-omap2/am33xx/board.c | 2 +- arch/arm/mach-omap2/am33xx/clk_synthesizer.c | 6 +- arch/arm/mach-omap2/boot-common.c | 2 +- arch/arm/mach-omap2/clocks-common.c | 2 +- arch/arm/mach-sunxi/board.c | 2 +- arch/powerpc/include/asm/fsl_i2c.h | 2 +- board/freescale/common/dcu_sii9022a.c | 2 +- board/freescale/common/diu_ch7301.c | 2 +- board/freescale/common/emc2305.c | 4 +- board/freescale/common/qixis.c | 4 +- board/freescale/common/sys_eeprom.c | 20 ++-- board/freescale/common/vid.c | 24 ++--- board/freescale/common/vsc3316_3308.c | 10 +- board/freescale/ls1012aqds/ls1012aqds.c | 2 +- board/freescale/ls1012ardb/eth.c | 2 +- board/freescale/ls1012ardb/ls1012ardb.c | 12 +-- board/freescale/ls1021aqds/dcu.c | 6 +- board/freescale/ls1021aqds/ls1021aqds.c | 2 +- board/freescale/ls1021atwr/ls1021atwr.c | 2 +- board/freescale/ls1028a/ls1028a.c | 2 +- board/freescale/ls1043aqds/ls1043aqds.c | 4 +- board/freescale/ls1046afrwy/ls1046afrwy.c | 2 +- board/freescale/ls1046aqds/ls1046aqds.c | 2 +- board/freescale/ls1088a/eth_ls1088aqds.c | 16 +-- board/freescale/ls1088a/ls1088a.c | 60 ++++++------ board/freescale/ls2080aqds/eth.c | 14 +-- board/freescale/ls2080aqds/ls2080aqds.c | 4 +- board/freescale/ls2080ardb/ls2080ardb.c | 2 +- board/freescale/lx2160a/lx2160a.c | 2 +- board/freescale/p1010rdb/p1010rdb.c | 8 +- board/freescale/p1_p2_rdb_pc/p1_p2_rdb_pc.c | 2 +- board/freescale/t102xrdb/t102xrdb.c | 2 +- board/freescale/t208xqds/t208xqds.c | 2 +- board/friendlyarm/nanopi2/onewire.c | 6 +- board/keymile/common/ivm.c | 2 +- board/samsung/common/misc.c | 2 +- board/samsung/trats/trats.c | 10 +- board/samsung/trats2/trats2.c | 10 +- board/sunxi/board.c | 2 +- board/ti/am335x/board.c | 8 +- board/ti/am335x/mux.c | 2 +- board/ti/am43xx/board.c | 12 +-- board/ti/common/board_detect.c | 4 +- board/ti/ks2_evm/board_k2g.c | 2 +- board/wandboard/wandboard.c | 4 +- cmd/eeprom.c | 6 +- cmd/i2c.c | 98 +++++++++---------- doc/driver-model/i2c-howto.rst | 2 +- drivers/ddr/fsl/main.c | 8 +- drivers/i2c/davinci_i2c.c | 4 +- drivers/i2c/designware_i2c.c | 4 +- drivers/i2c/fsl_i2c.c | 6 +- drivers/i2c/ihs_i2c.c | 42 ++++---- drivers/i2c/lpc32xx_i2c.c | 4 +- drivers/i2c/mv_i2c.c | 2 +- drivers/i2c/mvtwsi.c | 16 +-- drivers/i2c/mxc_i2c.c | 4 +- drivers/i2c/omap24xx_i2c.c | 2 +- drivers/power/palmas.c | 2 +- drivers/power/pmic/pmic_tps62362.c | 6 +- drivers/power/pmic/pmic_tps65217.c | 14 +-- drivers/power/pmic/pmic_tps65218.c | 4 +- drivers/power/pmic/pmic_tps65910.c | 6 +- drivers/power/twl4030.c | 2 +- drivers/power/twl6030.c | 2 +- drivers/tpm/tpm_atmel_twi.c | 6 +- drivers/usb/host/ohci-lpc32xx.c | 8 +- include/_exports.h | 2 +- include/config_fallbacks.h | 2 +- include/configs/MPC8548CDS.h | 2 +- include/configs/P1010RDB.h | 2 +- include/configs/P2041RDB.h | 2 +- include/configs/T102xRDB.h | 2 +- include/configs/T104xRDB.h | 2 +- include/configs/T208xQDS.h | 2 +- include/configs/T208xRDB.h | 2 +- include/configs/T4240RDB.h | 2 +- include/configs/am43xx_evm.h | 2 +- include/configs/corenet_ds.h | 2 +- include/configs/ls1012a_common.h | 2 +- include/configs/ls1021aiot.h | 2 +- include/configs/ls1021aqds.h | 2 +- include/configs/ls1021atsn.h | 2 +- include/configs/ls1021atwr.h | 2 +- include/configs/ls1028a_common.h | 2 +- include/configs/ls1043a_common.h | 2 +- include/configs/ls1046a_common.h | 2 +- include/configs/ls1088a_common.h | 2 +- include/configs/ls1088aqds.h | 2 +- include/configs/ls2080a_common.h | 2 +- include/configs/ls2080aqds.h | 2 +- include/configs/ls2080ardb.h | 2 +- include/configs/p1_p2_rdb_pc.h | 2 +- include/configs/sunxi-common.h | 2 +- include/configs/ti_armv7_common.h | 2 +- include/exports.h | 2 +- include/i2c.h | 2 +- include/palmas.h | 2 +- include/twl4030.h | 2 +- include/twl6030.h | 2 +- 107 files changed, 311 insertions(+), 311 deletions(-)
arch/arm/include/asm/arch-fsl-layerscape/config.h +1 -1
@@ -183,7 +183,7 @@#elif defined(CONFIG_ARCH_LX2160A ) || defined(CONFIG_ARCH_LX2162A )#define TZPC_BASE 0x02200000#define TZPCDECPROT_0_SET_BASE (TZPC_BASE + 0x804) -#if !defined(CONFIG_DM_I2C ) +#if !CONFIG_IS_ENABLED (DM_I2C )#define CONFIG_SYS_I2C #define CONFIG_SYS_I2C_EARLY_INIT #endif
arch/arm/include/asm/arch-lpc32xx/i2c.h +1 -1
@@ -22,7 +22,7 @@ struct lpc32xx_i2c_base {u32 stxfl; }; -#ifdef CONFIG_DM_I2C +#if CONFIG_IS_ENABLED (DM_I2C )enum {I2C_0 ,I2C_1 ,I2C_2 , };
arch/arm/include/asm/mach-imx/mxc_i2c.h +1 -1
@@ -53,7 +53,7 @@ struct mxc_i2c_bus {#if CONFIG_IS_ENABLED (CLK )struct clk per_clk;#endif -#ifndef CONFIG_DM_I2C +#if !CONFIG_IS_ENABLED (DM_I2C )int (*idle_bus_fn)(void *p);void *idle_bus_data;#else
arch/arm/include/asm/omap_i2c.h +1 -1
@@ -3,7 +3,7 @@#ifndef _OMAP_I2C_H#define _OMAP_I2C_H -#ifdef CONFIG_DM_I2C +#if CONFIG_IS_ENABLED (DM_I2C )/* Information about a GPIO bank */ struct omap_i2c_plat {
arch/arm/mach-imx/i2c-mxv7.c +1 -1
@@ -102,7 +102,7 @@ int setup_i2c(unsigned i2c_index, int speed, int slave_addr,if (ret) goto err_idle; -#ifndef CONFIG_DM_I2C +#if !CONFIG_IS_ENABLED (DM_I2C )bus_i2c_init (i2c_index, speed, slave_addr, force_idle_bus, p);#endif
arch/arm/mach-keystone/ddr3_spd.c +1 -1
@@ -404,7 +404,7 @@ static void init_ddr3param(struct ddr3_spd_cb *spd_cb,static int ddr3_read_spd (ddr3_spd_eeprom_t *spd_params) {int ret; -#ifndef CONFIG_DM_I2C +#if !CONFIG_IS_ENABLED (DM_I2C )int old_bus;i2c_init (CONFIG_SYS_DAVINCI_I2C_SPEED ,CONFIG_SYS_DAVINCI_I2C_SLAVE );
arch/arm/mach-kirkwood/include/mach/config.h +1 -1
@@ -96,7 +96,7 @@/* * I2C related stuff */ -#if defined(CONFIG_CMD_I2C ) && !defined(CONFIG_DM_I2C ) +#if defined(CONFIG_CMD_I2C ) && !CONFIG_IS_ENABLED (DM_I2C )#ifndef CONFIG_SYS_I2C_SOFT #define CONFIG_SYS_I2C #define CONFIG_SYS_I2C_MVTWSI
arch/arm/mach-omap2/am33xx/board.c +1 -1
@@ -112,7 +112,7 @@ U_BOOT_DRVINFOS(am33xx_uarts) = {# endif }; -#ifdef CONFIG_DM_I2C +#if CONFIG_IS_ENABLED (DM_I2C )static const struct omap_i2c_plat am33xx_i2c[] = { {I2C_BASE1 ,100000 ,OMAP_I2C_REV_V2 }, { I2C_BASE2, 100000, OMAP_I2C_REV_V2},
arch/arm/mach-omap2/am33xx/clk_synthesizer.c +3 -3
@@ -29,7 +29,7 @@ static int clk_synthesizer_reg_read(struct udevice *dev, int addr, u8 *buf)/* Enable Bye read */ addr = addr |CLK_SYNTHESIZER_BYTE_MODE ; -#ifndef CONFIG_DM_I2C +#if !CONFIG_IS_ENABLED (DM_I2C )/* Send the command byte */ rc =i2c_write (CLK_SYNTHESIZER_I2C_ADDR , addr,1 , buf,1 );if (rc)
@@ -72,7 +72,7 @@ static int clk_synthesizer_reg_write(struct udevice *dev, int addr, u8 val) cmd[0 ] = addr |CLK_SYNTHESIZER_BYTE_MODE ; cmd[1 ] = val; -#ifndef CONFIG_DM_I2C +#if !CONFIG_IS_ENABLED (DM_I2C ) rc =i2c_write (CLK_SYNTHESIZER_I2C_ADDR , addr,1 , cmd,2 );#else rc =dm_i2c_write (dev, addr, cmd,2 );
@@ -96,7 +96,7 @@ int setup_clock_synthesizer(struct clk_synth *data)int rc;u8 val =0 ;struct udevice *dev =NULL ; -#ifndef CONFIG_DM_I2C +#if !CONFIG_IS_ENABLED (DM_I2C ) rc =i2c_probe (CLK_SYNTHESIZER_I2C_ADDR );if (rc) { printf("i2c probe failed at address 0x%x\n",
arch/arm/mach-omap2/boot-common.c +1 -1
@@ -201,7 +201,7 @@ void spl_board_init(void)#if defined(CONFIG_SPL_NAND_SUPPORT ) || defined(CONFIG_SPL_ONENAND_SUPPORT )gpmc_init ();#endif -#if defined(CONFIG_SPL_I2C_SUPPORT ) && !defined(CONFIG_DM_I2C ) +#if defined(CONFIG_SPL_I2C_SUPPORT ) && !CONFIG_IS_ENABLED (DM_I2C )i2c_init (CONFIG_SYS_OMAP24_I2C_SPEED ,CONFIG_SYS_OMAP24_I2C_SLAVE );#endif #if defined(CONFIG_AM33XX ) && defined(CONFIG_SPL_MUSB_NEW_SUPPORT )
arch/arm/mach-omap2/clocks-common.c +1 -1
@@ -912,7 +912,7 @@ void prcm_init(void)enable_basic_uboot_clocks (); } -#if !defined(CONFIG_DM_I2C ) +#if !CONFIG_IS_ENABLED (DM_I2C )void gpi2c_init (void ) {static int gpi2c =1 ;
arch/arm/mach-sunxi/board.c +1 -1
@@ -222,7 +222,7 @@ void s_init(void)clock_init ();timer_init ();gpio_init (); -#ifndef CONFIG_DM_I2C +#if !CONFIG_IS_ENABLED (DM_I2C )i2c_init_board ();#endif eth_init_board ();
arch/powerpc/include/asm/fsl_i2c.h +1 -1
@@ -68,7 +68,7 @@ typedef struct fsl_i2c_base {u8 res6[0xE8 ]; } fsl_i2c_t; -#ifdef CONFIG_DM_I2C +#if CONFIG_IS_ENABLED(DM_I2C) struct fsl_i2c_dev { struct fsl_i2c_base __iomem *base; /* register base */ u32 i2c_clk;
board/freescale/common/dcu_sii9022a.c +1 -1
@@ -64,7 +64,7 @@ int dcu_set_dvi_encoder(struct fb_videomode *videomode)u8 temp;u16 temp1, temp2;u32 temp3; -#ifdef CONFIG_DM_I2C +#if CONFIG_IS_ENABLED (DM_I2C )struct udevice *dev;int ret;
board/freescale/common/diu_ch7301.c +1 -1
@@ -53,7 +53,7 @@ int diu_set_dvi_encoder(unsigned int pixclock)u8 temp; temp =I2C_DVI_TEST_PATTERN_VAL ; -#ifdef CONFIG_DM_I2C +#if CONFIG_IS_ENABLED (DM_I2C )struct udevice *dev; ret = i2c_get_chip_for_busnum(CONFIG_SYS_I2C_DVI_BUS_NUM,
board/freescale/common/emc2305.c +2 -2
@@ -23,7 +23,7 @@ void set_fan_speed(u8 data, int chip_addr) I2C_EMC2305_FAN5};for (index =0 ; index <NUM_OF_FANS ; index++) { -#ifndef CONFIG_DM_I2C +#if !CONFIG_IS_ENABLED (DM_I2C )if (i2c_write (chip_addr, Fan[index],1 , &data,1 ) !=0 ) {printf ("Error: failed to change fan speed @%x\n" , Fan[index]);
@@ -47,7 +47,7 @@ void emc2305_init(int chip_addr)u8 data; data =I2C_EMC2305_CMD ; -#ifndef CONFIG_DM_I2C +#if !CONFIG_IS_ENABLED (DM_I2C )if (i2c_write (chip_addr,I2C_EMC2305_CONF ,1 , &data,1 ) !=0 )printf ("Error: failed to configure EMC2305\n" );#else
board/freescale/common/qixis.c +2 -2
@@ -32,7 +32,7 @@#ifdef CONFIG_SYS_I2C_FPGA_ADDR u8 qixis_read_i2c (unsigned int reg) { -#ifndef CONFIG_DM_I2C +#if !CONFIG_IS_ENABLED (DM_I2C )return i2c_reg_read (CONFIG_SYS_I2C_FPGA_ADDR , reg);#else struct udevice *dev;
@@ -47,7 +47,7 @@ u8 qixis_read_i2c(unsigned int reg)void qixis_write_i2c (unsigned int reg,u8 value) {u8 val = value; -#ifndef CONFIG_DM_I2C +#if !CONFIG_IS_ENABLED (DM_I2C )i2c_reg_write (CONFIG_SYS_I2C_FPGA_ADDR , reg, val);#else struct udevice *dev;
board/freescale/common/sys_eeprom.c +10 -10
@@ -152,7 +152,7 @@ static int read_eeprom(void) {int ret;#ifdef CONFIG_SYS_EEPROM_BUS_NUM -#ifndef CONFIG_DM_I2C +#if !CONFIG_IS_ENABLED (DM_I2C )unsigned int bus;#endif #endif
@@ -161,13 +161,13 @@ static int read_eeprom(void)return 0 ;#ifdef CONFIG_SYS_EEPROM_BUS_NUM -#ifndef CONFIG_DM_I2C +#if !CONFIG_IS_ENABLED (DM_I2C ) bus =i2c_get_bus_num ();i2c_set_bus_num (CONFIG_SYS_EEPROM_BUS_NUM );#endif #endif -#ifndef CONFIG_DM_I2C +#if !CONFIG_IS_ENABLED (DM_I2C ) ret =i2c_read (CONFIG_SYS_I2C_EEPROM_ADDR ,0 ,CONFIG_SYS_I2C_EEPROM_ADDR_LEN , (void *)&e,sizeof (e));
@@ -186,7 +186,7 @@ static int read_eeprom(void)#endif #ifdef CONFIG_SYS_EEPROM_BUS_NUM -#ifndef CONFIG_DM_I2C +#if !CONFIG_IS_ENABLED (DM_I2C )i2c_set_bus_num (bus);#endif #endif
@@ -223,7 +223,7 @@ static int prog_eeprom(void)int i;void *p;#ifdef CONFIG_SYS_EEPROM_BUS_NUM -#ifndef CONFIG_DM_I2C +#if !CONFIG_IS_ENABLED (DM_I2C )unsigned int bus;#endif #endif
@@ -237,7 +237,7 @@ static int prog_eeprom(void)#endif update_crc (); -#ifndef CONFIG_DM_I2C +#if !CONFIG_IS_ENABLED (DM_I2C )#ifdef CONFIG_SYS_EEPROM_BUS_NUM bus =i2c_get_bus_num ();i2c_set_bus_num (CONFIG_SYS_EEPROM_BUS_NUM );
@@ -250,7 +250,7 @@ static int prog_eeprom(void)* complete a given write. */ for (i =0 , p = &e; i <sizeof (e); i +=8 , p +=8 ) { -#ifndef CONFIG_DM_I2C +#if !CONFIG_IS_ENABLED (DM_I2C ) ret =i2c_write (CONFIG_SYS_I2C_EEPROM_ADDR , i,CONFIG_SYS_I2C_EEPROM_ADDR_LEN , p,min ((int )(sizeof (e) - i),8 ));
@@ -279,7 +279,7 @@ static int prog_eeprom(void)/* Verify the write by reading back the EEPROM and comparing */ struct eeprom e2; -#ifndef CONFIG_DM_I2C +#if !CONFIG_IS_ENABLED (DM_I2C ) ret =i2c_read (CONFIG_SYS_I2C_EEPROM_ADDR ,0 ,CONFIG_SYS_I2C_EEPROM_ADDR_LEN , (void *)&e2,sizeof (e2));
@@ -302,7 +302,7 @@ static int prog_eeprom(void) ret =-1 ; } -#ifndef CONFIG_DM_I2C +#if !CONFIG_IS_ENABLED (DM_I2C )#ifdef CONFIG_SYS_EEPROM_BUS_NUM i2c_set_bus_num (bus);#endif
@@ -594,7 +594,7 @@ unsigned int get_cpu_board_revision(void)u8 minor;/* 0x05 Board revision, minor */ } be; -#ifndef CONFIG_DM_I2C +#if !CONFIG_IS_ENABLED (DM_I2C )i2c_read (CONFIG_SYS_I2C_EEPROM_ADDR ,0 ,CONFIG_SYS_I2C_EEPROM_ADDR_LEN , (void *)&be,sizeof (be));#else
board/freescale/common/vid.c +12 -12
@@ -65,14 +65,14 @@ static int find_ir_chip_on_i2c(void)u8 byte;int i;const int ir_i2c_addr[] = {0x38 ,0x08 ,0x09 }; -#ifdef CONFIG_DM_I2C +#if CONFIG_IS_ENABLED (DM_I2C )struct udevice *dev;#endif /* Check all the address */ for (i =0 ; i < (sizeof (ir_i2c_addr)/sizeof (ir_i2c_addr[0 ])); i++) { i2caddress = ir_i2c_addr[i]; -#ifndef CONFIG_DM_I2C +#if !CONFIG_IS_ENABLED (DM_I2C ) ret =i2c_read (i2caddress,IR36021_MFR_ID_OFFSET ,1 , (void *)&byte,sizeof (byte));
@@ -117,12 +117,12 @@ static int read_voltage_from_INA220(int i2caddress)int i, ret, voltage_read =0 ;u16 vol_mon;u8 buf[2 ]; -#ifdef CONFIG_DM_I2C +#if CONFIG_IS_ENABLED (DM_I2C )struct udevice *dev;#endif for (i =0 ; i <NUM_READINGS ; i++) { -#ifndef CONFIG_DM_I2C +#if !CONFIG_IS_ENABLED (DM_I2C ) ret =i2c_read (I2C_VOL_MONITOR_ADDR ,I2C_VOL_MONITOR_BUS_V_OFFSET ,1 , (void *)&buf,2 );
@@ -160,12 +160,12 @@ static int read_voltage_from_IR(int i2caddress)int i, ret, voltage_read =0 ;u16 vol_mon;u8 buf; -#ifdef CONFIG_DM_I2C +#if CONFIG_IS_ENABLED (DM_I2C )struct udevice *dev;#endif for (i =0 ; i <NUM_READINGS ; i++) { -#ifndef CONFIG_DM_I2C +#if !CONFIG_IS_ENABLED (DM_I2C ) ret =i2c_read (i2caddress,IR36021_LOOP1_VOUT_OFFSET ,1 , (void *)&buf,1 );
@@ -213,7 +213,7 @@ static int read_voltage_from_LTC(int i2caddress)int ret, vcode =0 ;u8 chan =PWM_CHANNEL0 ; -#ifndef CONFIG_DM_I2C +#if !CONFIG_IS_ENABLED (DM_I2C )/* select the PAGE 0 using PMBus commands PAGE for VDD*/ ret =i2c_write (I2C_VOL_MONITOR_ADDR ,PMBUS_CMD_PAGE ,1 , &chan,1 );
@@ -229,7 +229,7 @@ static int read_voltage_from_LTC(int i2caddress)return ret; } -#ifndef CONFIG_DM_I2C +#if !CONFIG_IS_ENABLED (DM_I2C )/*read the output voltage using PMBus command READ_VOUT*/ ret =i2c_read (I2C_VOL_MONITOR_ADDR ,PMBUS_CMD_READ_VOUT ,1 , (void *)&vcode,2 );
@@ -344,7 +344,7 @@ static int set_voltage_to_IR(int i2caddress, int vdd) vid =DIV_ROUND_UP (vdd -245 ,5 );#endif -#ifndef CONFIG_DM_I2C +#if !CONFIG_IS_ENABLED (DM_I2C ) ret =i2c_write (i2caddress,IR36021_LOOP1_MANUAL_ID_OFFSET ,1 , (void *)&vid,sizeof (vid));#else
@@ -392,7 +392,7 @@ static int set_voltage_to_LTC(int i2caddress, int vdd) vdd & 0xFF, (vdd & 0xFF00) >> 8};/* Write the desired voltage code to the regulator */ -#ifndef CONFIG_DM_I2C +#if !CONFIG_IS_ENABLED (DM_I2C )/* Check write protect state */ ret = i2c_read(I2C_VOL_MONITOR_ADDR, PMBUS_CMD_WRITE_PROTECT, 1,
@@ -621,7 +621,7 @@ int adjust_vdd(ulong vdd_override) }/* check IR chip work on Intel mode*/ -#ifndef CONFIG_DM_I2C +#if !CONFIG_IS_ENABLED (DM_I2C ) ret =i2c_read (i2caddress,IR36021_INTEL_MODE_OOFSET ,1 , (void *)&buf,1 );
@@ -803,7 +803,7 @@ int adjust_vdd(ulong vdd_override) }/* check IR chip work on Intel mode*/ -#ifndef CONFIG_DM_I2C +#if !CONFIG_IS_ENABLED (DM_I2C ) ret =i2c_read (i2caddress,IR36021_INTEL_MODE_OOFSET ,1 , (void *)&buf,1 );
board/freescale/common/vsc3316_3308.c +5 -5
@@ -34,7 +34,7 @@ int vsc_if_enable(unsigned int vsc_addr)/* enable 2-wire Serial InterFace (I2C) */ data =0x02 ; -#ifdef CONFIG_DM_I2C +#if CONFIG_IS_ENABLED (DM_I2C )int ret, bus_num =0 ;struct udevice *dev;
@@ -62,7 +62,7 @@ int vsc3316_config(unsigned int vsc_addr, int8_t con_arr[][2],debug ("VSC:Initializing VSC3316 at I2C address 0x%2x" " for Tx\n" , vsc_addr); -#ifdef CONFIG_DM_I2C +#if CONFIG_IS_ENABLED (DM_I2C )int bus_num =0 ;struct udevice *dev;
@@ -185,7 +185,7 @@ int vsc3308_config_adjust(unsigned int vsc_addr, const int8_t con_arr[][2],debug ("VSC:Initializing VSC3308 at I2C address 0x%x for Tx\n" , vsc_addr); -#ifdef CONFIG_DM_I2C +#if CONFIG_IS_ENABLED (DM_I2C )int bus_num =0 ;struct udevice *dev;
@@ -385,7 +385,7 @@ int vsc3308_config(unsigned int vsc_addr, const int8_t con_arr[][2],debug ("VSC:Initializing VSC3308 at I2C address 0x%x" " for Tx\n" , vsc_addr); -#ifdef CONFIG_DM_I2C +#if CONFIG_IS_ENABLED (DM_I2C )int bus_num =0 ;struct udevice *dev;
@@ -509,7 +509,7 @@ void vsc_wp_config(unsigned int vsc_addr)/* For new crosspoint configuration to occur, WP bit of * CORE_CONFIG_REG should be set 1 and then reset to 0 */ -#ifdef CONFIG_DM_I2C +#if CONFIG_IS_ENABLED (DM_I2C )int ret, bus_num =0 ;struct udevice *dev;
board/freescale/ls1012aqds/ls1012aqds.c +1 -1
@@ -111,7 +111,7 @@ int misc_init_r(void)u8 mux_sdhc_cd =0x80 ;int bus_num =0 ; -#ifdef CONFIG_DM_I2C +#if CONFIG_IS_ENABLED (DM_I2C )struct udevice *dev;int ret;
board/freescale/ls1012ardb/eth.c +1 -1
@@ -29,7 +29,7 @@ static inline void ls1012ardb_reset_phy(void) {#ifdef CONFIG_TARGET_LS1012ARDB /* Through reset IO expander reset both RGMII and SGMII PHYs */ -#ifdef CONFIG_DM_I2C +#if CONFIG_IS_ENABLED (DM_I2C )struct udevice *dev;int ret;
board/freescale/ls1012ardb/ls1012ardb.c +6 -6
@@ -42,7 +42,7 @@ int checkboard(void)puts ("Board: LS1012ARDB " );/* Initialize i2c early for Serial flash bank information */ -#if defined(CONFIG_DM_I2C ) +#if CONFIG_IS_ENABLED (DM_I2C )struct udevice *dev; ret = i2c_get_chip_for_busnum(bus_num, I2C_MUX_IO_ADDR,
@@ -194,7 +194,7 @@ int esdhc_status_fixup(void *blob, const char *compat)u8 io =0 ;int ret, bus_num =0 ; -#if defined(CONFIG_DM_I2C ) +#if CONFIG_IS_ENABLED (DM_I2C )struct udevice *dev; ret = i2c_get_chip_for_busnum(bus_num, I2C_MUX_IO_ADDR,
@@ -233,7 +233,7 @@ int esdhc_status_fixup(void *blob, const char *compat)* 10 - eMMC Memory * 11 - SPI */ -#if defined(CONFIG_DM_I2C ) +#if CONFIG_IS_ENABLED (DM_I2C ) ret =dm_i2c_read (dev,I2C_MUX_IO_0 , &io,1 );#else ret =i2c_read (I2C_MUX_IO_ADDR ,I2C_MUX_IO_0 ,1 , &io,1 );
@@ -272,7 +272,7 @@ static int switch_to_bank1(void)u8 data =0xf4 , chip_addr =0x24 , offset_addr =0x03 ;int ret, bus_num =0 ; -#if defined(CONFIG_DM_I2C ) +#if CONFIG_IS_ENABLED (DM_I2C )struct udevice *dev; ret = i2c_get_chip_for_busnum(bus_num, chip_addr,
@@ -337,7 +337,7 @@ static int switch_to_bank2(void)u8 chip_addr =0x24 ;int ret, i, bus_num =0 ; -#if defined(CONFIG_DM_I2C ) +#if CONFIG_IS_ENABLED (DM_I2C )struct udevice *dev; ret = i2c_get_chip_for_busnum(bus_num, chip_addr,
@@ -360,7 +360,7 @@ static int switch_to_bank2(void)* CS routed to SPI memory bank2 */ for (i =0 ; i <sizeof (data); i++) { -#if defined(CONFIG_DM_I2C ) +#if CONFIG_IS_ENABLED (DM_I2C ) ret =dm_i2c_write (dev, offset_addr[i], &data[i],1 );#else /* Non DM I2C support - will be removed */ ret =i2c_write (chip_addr, offset_addr[i],1 , &data[i],1 );
board/freescale/ls1021aqds/dcu.c +3 -3
@@ -19,7 +19,7 @@ DECLARE_GLOBAL_DATA_PTR;static int select_i2c_ch_pca9547 (u8 ch,int bus_num) {int ret; -#ifdef CONFIG_DM_I2C +#if CONFIG_IS_ENABLED (DM_I2C )struct udevice *dev; ret = i2c_get_chip_for_busnum(bus_num, I2C_MUX_PCA_ADDR_PRI,
@@ -64,7 +64,7 @@ int platform_dcu_init(struct fb_info *fbinfo,u8 ch;/* Mux I2C3+I2C4 as HSYNC+VSYNC */ -#ifdef CONFIG_DM_I2C +#if CONFIG_IS_ENABLED (DM_I2C )struct udevice *dev;/* QIXIS device mount on I2C1 bus*/
@@ -112,7 +112,7 @@ int platform_dcu_init(struct fb_info *fbinfo, pixval =1000000000 / dcu_fb_videomode->pixclock; pixval *=1000 ; -#ifndef CONFIG_DM_I2C +#if !CONFIG_IS_ENABLED (DM_I2C )i2c_set_bus_num (CONFIG_SYS_I2C_DVI_BUS_NUM );#endif select_i2c_ch_pca9547(I2C_MUX_CH_CH7301,
board/freescale/ls1021aqds/ls1021aqds.c +1 -1
@@ -144,7 +144,7 @@ unsigned long get_board_ddr_clk(void)int select_i2c_ch_pca9547 (u8 ch,int bus_num) {int ret; -#ifdef CONFIG_DM_I2C +#if CONFIG_IS_ENABLED (DM_I2C )struct udevice *dev; ret = i2c_get_chip_for_busnum(bus_num, I2C_MUX_PCA_ADDR_PRI,
board/freescale/ls1021atwr/ls1021atwr.c +1 -1
@@ -457,7 +457,7 @@ void ls1twr_program_regulator(void)#define MC34VR500_ADDR 0x8#define MC34VR500_DEVICEID 0x4#define MC34VR500_DEVICEID_MASK 0x0f -#ifdef CONFIG_DM_I2C +#if CONFIG_IS_ENABLED (DM_I2C )struct udevice *dev;int ret;
board/freescale/ls1028a/ls1028a.c +1 -1
@@ -91,7 +91,7 @@ int board_init(void)#if defined(CONFIG_TARGET_LS1028ARDB )u8 val =I2C_MUX_CH_DEFAULT ; -#ifndef CONFIG_DM_I2C +#if !CONFIG_IS_ENABLED (DM_I2C )i2c_write (I2C_MUX_PCA_ADDR_PRI ,0x0b ,1 , &val,1 );#else struct udevice *dev;
board/freescale/ls1043aqds/ls1043aqds.c +2 -2
@@ -282,7 +282,7 @@ int select_i2c_ch_pca9547(u8 ch, int bus_num) {int ret; -#ifdef CONFIG_DM_I2C +#if CONFIG_IS_ENABLED (DM_I2C )struct udevice *dev; ret = i2c_get_chip_for_busnum(bus_num, I2C_MUX_PCA_ADDR_PRI,
@@ -337,7 +337,7 @@ void board_retimer_init(void)/* Retimer is connected to I2C1_CH7_CH5 */ select_i2c_ch_pca9547 (I2C_MUX_CH7 , bus_num); reg =I2C_MUX_CH5 ; -#ifdef CONFIG_DM_I2C +#if CONFIG_IS_ENABLED (DM_I2C )struct udevice *dev;int ret;
board/freescale/ls1046afrwy/ls1046afrwy.c +1 -1
@@ -41,7 +41,7 @@ int select_i2c_ch_pca9547(u8 ch, int bus_num) {int ret; -#ifdef CONFIG_DM_I2C +#if CONFIG_IS_ENABLED (DM_I2C )struct udevice *dev; ret = i2c_get_chip_for_busnum(bus_num, I2C_MUX_PCA_ADDR_PRI,
board/freescale/ls1046aqds/ls1046aqds.c +1 -1
@@ -278,7 +278,7 @@ u32 get_lpuart_clk(void)int select_i2c_ch_pca9547 (u8 ch,int bus_num) {int ret; -#ifdef CONFIG_DM_I2C +#if CONFIG_IS_ENABLED (DM_I2C )struct udevice *dev; ret = i2c_get_chip_for_busnum(bus_num, I2C_MUX_PCA_ADDR_PRI,
board/freescale/ls1088a/eth_ls1088aqds.c +8 -8
@@ -114,12 +114,12 @@ static void sgmii_configure_repeater(int dpmac) {0x18, NULL}, {0x23, ®_val[3]}, {0x2d, ®_val[4]}, {4, ®_val[5]}, }; -#ifdef CONFIG_DM_I2C +#if CONFIG_IS_ENABLED (DM_I2C )struct udevice *udev;#endif /* Set I2c to Slot 1 */ -#ifndef CONFIG_DM_I2C +#if !CONFIG_IS_ENABLED (DM_I2C ) ret =i2c_write (0x77 ,0 ,0 , &a,1 );#else ret =i2c_get_chip_for_busnum (0 ,0x77 ,1 , &udev);
@@ -173,7 +173,7 @@ static void sgmii_configure_repeater(int dpmac)return ; } -#ifdef CONFIG_DM_I2C +#if CONFIG_IS_ENABLED (DM_I2C )i2c_get_chip_for_busnum (0 , i2c_phy_addr,1 , &udev);#endif
@@ -184,7 +184,7 @@ static void sgmii_configure_repeater(int dpmac) reg_pair[5 ].val = &ch_b_eq[i]; reg_pair[6 ].val = &ch_b_ctl2[j];for (k =0 ; k <10 ; k++) { -#ifndef CONFIG_DM_I2C +#if !CONFIG_IS_ENABLED (DM_I2C ) ret =i2c_write (i2c_phy_addr, reg_pair[k].addr,1 , reg_pair[k].val,1 );
@@ -257,12 +257,12 @@ static void qsgmii_configure_repeater(int dpmac)const char *dev = mdio_names[EMI1_SLOT1 ];int ret =0 ;unsigned short value; -#ifdef CONFIG_DM_I2C +#if CONFIG_IS_ENABLED (DM_I2C )struct udevice *udev;#endif /* Set I2c to Slot 1 */ -#ifndef CONFIG_DM_I2C +#if !CONFIG_IS_ENABLED (DM_I2C ) ret =i2c_write (0x77 ,0 ,0 , &a,1 );#else ret =i2c_get_chip_for_busnum (0 ,0x77 ,1 , &udev);
@@ -304,7 +304,7 @@ static void qsgmii_configure_repeater(int dpmac)return ; } -#ifdef CONFIG_DM_I2C +#if CONFIG_IS_ENABLED (DM_I2C )i2c_get_chip_for_busnum (0 , i2c_phy_addr,1 , &udev);#endif
@@ -316,7 +316,7 @@ static void qsgmii_configure_repeater(int dpmac) reg_pair[6 ].val = &ch_b_ctl2[j];for (k =0 ; k <10 ; k++) { -#ifndef CONFIG_DM_I2C +#if !CONFIG_IS_ENABLED (DM_I2C ) ret =i2c_write (i2c_phy_addr, reg_pair[k].addr,1 , reg_pair[k].val,1 );
board/freescale/ls1088a/ls1088a.c +30 -30
230 lines not on this page · raw message
board/freescale/ls2080aqds/eth.c +7 -7
@@ -125,12 +125,12 @@ static void sgmii_configure_repeater(int serdes_port) };int *riser_phy_addr = &xqsgii_riser_phy_addr[0 ]; -#ifdef CONFIG_DM_I2C +#if CONFIG_IS_ENABLED (DM_I2C )struct udevice *udev;#endif /* Set I2c to Slot 1 */ -#ifndef CONFIG_DM_I2C +#if !CONFIG_IS_ENABLED (DM_I2C ) ret =i2c_write (0x77 ,0 ,0 , &a,1 );#else ret =i2c_get_chip_for_busnum (0 ,0x77 ,1 , &udev);
@@ -151,7 +151,7 @@ static void sgmii_configure_repeater(int serdes_port) mii_bus =1 ; dpmac_id = dpmac +9 ; a =0xb ; -#ifndef CONFIG_DM_I2C +#if !CONFIG_IS_ENABLED (DM_I2C ) ret =i2c_write (0x76 ,0 ,0 , &a,1 );#else ret =i2c_get_chip_for_busnum (0 ,0x76 ,1 , &udev);
@@ -198,7 +198,7 @@ static void sgmii_configure_repeater(int serdes_port) reg_pair[6 ].val = &ch_b_ctl2[j];for (k =0 ; k <10 ; k++) { -#ifndef CONFIG_DM_I2C +#if !CONFIG_IS_ENABLED (DM_I2C ) ret =i2c_write (i2c_addr[dpmac], reg_pair[k].addr,1 , reg_pair[k].val,1 );
@@ -277,12 +277,12 @@ static void qsgmii_configure_repeater(int dpmac)const char *dev ="LS2080A_QDS_MDIO0" ;int ret =0 ;unsigned short value; -#ifdef CONFIG_DM_I2C +#if CONFIG_IS_ENABLED (DM_I2C )struct udevice *udev;#endif /* Set I2c to Slot 1 */ -#ifndef CONFIG_DM_I2C +#if !CONFIG_IS_ENABLED (DM_I2C ) ret =i2c_write (0x77 ,0 ,0 , &a,1 );#else ret =i2c_get_chip_for_busnum (0 ,0x77 ,1 , &udev);
@@ -347,7 +347,7 @@ static void qsgmii_configure_repeater(int dpmac) reg_pair[6 ].val = &ch_b_ctl2[j];for (k =0 ; k <10 ; k++) { -#ifndef CONFIG_DM_I2C +#if !CONFIG_IS_ENABLED (DM_I2C ) ret =i2c_write (i2c_phy_addr, reg_pair[k].addr,1 , reg_pair[k].val,1 );
board/freescale/ls2080aqds/ls2080aqds.c +2 -2
@@ -163,7 +163,7 @@ unsigned long get_board_ddr_clk(void)int select_i2c_ch_pca9547 (u8 ch) {int ret; -#ifdef CONFIG_DM_I2C +#if CONFIG_IS_ENABLED (DM_I2C )struct udevice *dev; ret =i2c_get_chip_for_busnum (0 ,I2C_MUX_PCA_ADDR_PRI ,1 , &dev);
@@ -237,7 +237,7 @@ int board_init(void)select_i2c_ch_pca9547 (I2C_MUX_CH_DEFAULT );#ifdef CONFIG_RTC_ENABLE_32KHZ_OUTPUT -#ifdef CONFIG_DM_I2C +#if CONFIG_IS_ENABLED (DM_I2C )rtc_enable_32khz_output (0 ,CONFIG_SYS_I2C_RTC_ADDR );#else rtc_enable_32khz_output ();
board/freescale/ls2080ardb/ls2080ardb.c +1 -1
@@ -166,7 +166,7 @@ int select_i2c_ch_pca9547(u8 ch) {int ret; -#ifndef CONFIG_DM_I2C +#if !CONFIG_IS_ENABLED (DM_I2C ) ret =i2c_write (I2C_MUX_PCA_ADDR_PRI ,0 ,1 , &ch,1 );#else struct udevice *dev;
board/freescale/lx2160a/lx2160a.c +1 -1
@@ -82,7 +82,7 @@ int select_i2c_ch_pca9547(u8 ch) {int ret; -#ifndef CONFIG_DM_I2C +#if !CONFIG_IS_ENABLED (DM_I2C ) ret =i2c_write (I2C_MUX_PCA_ADDR_PRI ,0 ,1 , &ch,1 );#else struct udevice *dev;
board/freescale/p1010rdb/p1010rdb.c +4 -4
@@ -140,7 +140,7 @@ int config_board_mux(int ctrl_type)ccsr_gur_t __iomem *gur = (void *)(CONFIG_SYS_MPC85xx_GUTS_ADDR);u8 tmp; -#ifdef CONFIG_DM_I2C +#if CONFIG_IS_ENABLED (DM_I2C )struct udevice *dev;int ret;#if defined(CONFIG_TARGET_P1010RDB_PA )
@@ -376,7 +376,7 @@ int i2c_pca9557_read(int type)u8 val;int bus_num =I2C_PCA9557_BUS_NUM ; -#ifdef CONFIG_DM_I2C +#if CONFIG_IS_ENABLED (DM_I2C )struct udevice *dev;int ret;
@@ -418,7 +418,7 @@ int checkboard(void)printf ("Board: %sRDB-PA, " , cpu->name);#elif defined(CONFIG_TARGET_P1010RDB_PB )printf ("Board: %sRDB-PB, " , cpu->name); -#ifdef CONFIG_DM_I2C +#if CONFIG_IS_ENABLED (DM_I2C )struct udevice *dev;int ret;
@@ -461,7 +461,7 @@ int checkboard(void)case 0xe :puts ("SDHC\n" ); val =0x60 ;/* set pca9557 pin input/output */ -#ifdef CONFIG_DM_I2C +#if CONFIG_IS_ENABLED (DM_I2C )dm_i2c_write (dev,3 , &val,1 );#else i2c_write (I2C_PCA9557_ADDR2 ,3 ,1 , &val,1 );
board/freescale/p1_p2_rdb_pc/p1_p2_rdb_pc.c +1 -1
@@ -173,7 +173,7 @@ int checkboard(void) in_8(&cpld_data->pcba_rev) & 0x0F);/* Initialize i2c early for rom_loc and flash bank information */ -#if defined(CONFIG_DM_I2C ) +#if CONFIG_IS_ENABLED (DM_I2C )struct udevice *dev;int ret;
board/freescale/t102xrdb/t102xrdb.c +1 -1
@@ -258,7 +258,7 @@ static u32 t1023rdb_ctrl(u32 ctrl_type)u8 tmp;int bus_num =I2C_PCA6408_BUS_NUM ; -#ifdef CONFIG_DM_I2C +#if CONFIG_IS_ENABLED (DM_I2C )struct udevice *dev;int ret;
board/freescale/t208xqds/t208xqds.c +1 -1
@@ -82,7 +82,7 @@ int select_i2c_ch_pca9547(u8 ch, int bus_num) {int ret; -#ifdef CONFIG_DM_I2C +#if CONFIG_IS_ENABLED (DM_I2C )struct udevice *dev; ret =i2c_get_chip_for_busnum (bus_num,I2C_MUX_PCA_ADDR_PRI ,1 , &dev);
board/friendlyarm/nanopi2/onewire.c +3 -3
@@ -35,7 +35,7 @@ static int bus_type = -1;static int lcd_id =-1 ;static unsigned short lcd_fwrev;static int current_brightness =-1 ; -#ifdef CONFIG_DM_I2C +#if CONFIG_IS_ENABLED (DM_I2C )static struct udevice *i2c_dev;#endif
@@ -182,7 +182,7 @@ static int onewire_i2c_do_request(unsigned char req, unsigned char *buf) tx[0 ] = req; tx[1 ] =crc8_ow (req <<24 ,8 ); -#ifdef CONFIG_DM_I2C +#if CONFIG_IS_ENABLED (DM_I2C )if (dm_i2c_write (i2c_dev,0 , tx,2 ))return -EIO ;
@@ -214,7 +214,7 @@ static void onewire_i2c_init(void)unsigned char buf[4 ];int ret; -#ifdef CONFIG_DM_I2C +#if CONFIG_IS_ENABLED (DM_I2C ) ret =i2c_get_chip_for_busnum (ONEWIRE_I2C_BUS ,ONEWIRE_I2C_ADDR ,0 , &i2c_dev);#else
board/keymile/common/ivm.c +1 -1
@@ -333,7 +333,7 @@ static int ivm_populate_env(unsigned char *buf, int len, int mac_address_offset)int ivm_read_eeprom (unsigned char *buf,int len,int mac_address_offset) {int ret; -#ifdef CONFIG_DM_I2C +#if CONFIG_IS_ENABLED (DM_I2C )struct udevice *eedev =NULL ; ret = i2c_get_chip_for_busnum(CONFIG_KM_IVM_BUS,
board/samsung/common/misc.c +1 -1
@@ -116,7 +116,7 @@ void set_board_info(void)#ifdef CONFIG_LCD_MENU static int power_key_pressed (u32 reg) { -#ifndef CONFIG_DM_I2C /* TODO(maintainer): Convert to driver model */ +#if !CONFIG_IS_ENABLED (DM_I2C )/* TODO(maintainer): Convert to driver model */ struct pmic *pmic;u32 status;u32 mask;
board/samsung/trats/trats.c +5 -5
@@ -52,7 +52,7 @@ int exynos_init(void)return 0 ; } -#ifndef CONFIG_DM_I2C /* TODO(maintainer): Convert to driver model */ +#if !CONFIG_IS_ENABLED (DM_I2C )/* TODO(maintainer): Convert to driver model */ static void trats_low_power_mode (void ) { struct exynos4_clock *clk =
@@ -114,7 +114,7 @@ static void trats_low_power_mode(void)int exynos_power_init (void ) { -#ifndef CONFIG_DM_I2C /* TODO(maintainer): Convert to driver model */ +#if !CONFIG_IS_ENABLED (DM_I2C )/* TODO(maintainer): Convert to driver model */ int chrg, ret;struct power_battery *pb;struct pmic *p_fg, *p_chrg, *p_muic, *p_bat;
@@ -293,7 +293,7 @@ int board_usb_init(int index, enum usb_init_type init)int g_dnl_board_usb_cable_connected (void ) { -#ifndef CONFIG_DM_I2C /* TODO(maintainer): Convert to driver model */ +#if !CONFIG_IS_ENABLED (DM_I2C )/* TODO(maintainer): Convert to driver model */ struct pmic *muic =pmic_get ("MAX8997_MUIC" );if (!muic)return 0 ;
@@ -415,7 +415,7 @@ void exynos_reset_lcd(void)int lcd_power (void ) { -#ifndef CONFIG_DM_I2C /* TODO(maintainer): Convert to driver model */ +#if !CONFIG_IS_ENABLED (DM_I2C )/* TODO(maintainer): Convert to driver model */ int ret =0 ;struct pmic *p =pmic_get ("MAX8997_PMIC" );if (!p)
@@ -439,7 +439,7 @@ int lcd_power(void)int mipi_power (void ) { -#ifndef CONFIG_DM_I2C /* TODO(maintainer): Convert to driver model */ +#if !CONFIG_IS_ENABLED (DM_I2C )/* TODO(maintainer): Convert to driver model */ int ret =0 ;struct pmic *p =pmic_get ("MAX8997_PMIC" );if (!p)
board/samsung/trats2/trats2.c +5 -5
@@ -129,7 +129,7 @@ int exynos_init(void)int exynos_power_init (void ) { -#ifndef CONFIG_DM_I2C /* TODO(maintainer): Convert to driver model */ +#if !CONFIG_IS_ENABLED (DM_I2C )/* TODO(maintainer): Convert to driver model */ int chrg;struct power_battery *pb;struct pmic *p_chrg, *p_muic, *p_fg, *p_bat;
@@ -192,7 +192,7 @@ int exynos_power_init(void)#ifdef CONFIG_USB_GADGET static int s5pc210_phy_control (int on) { -#ifndef CONFIG_DM_I2C /* TODO(maintainer): Convert to driver model */ +#if !CONFIG_IS_ENABLED (DM_I2C )/* TODO(maintainer): Convert to driver model */ int ret =0 ;unsigned int val;struct pmic *p, *p_pmic, *p_muic;
@@ -269,7 +269,7 @@ int board_usb_init(int index, enum usb_init_type init)int g_dnl_board_usb_cable_connected (void ) { -#ifndef CONFIG_DM_I2C /* TODO(maintainer): Convert to driver model */ +#if !CONFIG_IS_ENABLED (DM_I2C )/* TODO(maintainer): Convert to driver model */ struct pmic *muic =pmic_get ("MAX77693_MUIC" );if (!muic)return 0 ;
@@ -288,7 +288,7 @@ int g_dnl_board_usb_cable_connected(void)#ifdef CONFIG_LCD int mipi_power (void ) { -#ifndef CONFIG_DM_I2C /* TODO(maintainer): Convert to driver model */ +#if !CONFIG_IS_ENABLED (DM_I2C )/* TODO(maintainer): Convert to driver model */ struct pmic *p =pmic_get ("MAX77686_PMIC" );/* LDO8 VMIPI_1.0V_AP */
@@ -302,7 +302,7 @@ int mipi_power(void)void exynos_lcd_power_on (void ) { -#ifndef CONFIG_DM_I2C /* TODO(maintainer): Convert to driver model */ +#if !CONFIG_IS_ENABLED (DM_I2C )/* TODO(maintainer): Convert to driver model */ struct pmic *p =pmic_get ("MAX77686_PMIC" );/* LCD_2.2V_EN: GPC0[1] */
board/sunxi/board.c +1 -1
@@ -292,7 +292,7 @@ int board_init(void) } } -#ifdef CONFIG_DM_I2C +#if CONFIG_IS_ENABLED (DM_I2C )/* * Temporary workaround for enabling I2C clocks until proper sunxi DM * clk, reset and pinctrl drivers land.
board/ti/am335x/board.c +4 -4
@@ -76,7 +76,7 @@ static struct ctrl_dev *cdev = (struct ctrl_dev *)CTRL_DEVICE_BASE;void do_board_detect (void ) {enable_i2c0_pin_mux (); -#ifndef CONFIG_DM_I2C +#if !CONFIG_IS_ENABLED (DM_I2C )i2c_init (CONFIG_SYS_OMAP24_I2C_SPEED ,CONFIG_SYS_OMAP24_I2C_SLAVE );#endif if (ti_i2c_eeprom_am_get(CONFIG_EEPROM_BUS_ADDRESS,
@@ -335,7 +335,7 @@ static void scale_vcores_bone(int freq)if (board_is_bone () && !strncmp (board_ti_get_rev (),"00A1" ,4 ))return ; -#ifndef CONFIG_DM_I2C +#if !CONFIG_IS_ENABLED (DM_I2C )if (i2c_probe (TPS65217_CHIP_PM ))return ;#else
@@ -434,7 +434,7 @@ void scale_vcores_generic(int freq)* 1.10V. For MPU voltage we need to switch based on * the frequency we are running at. */ -#ifndef CONFIG_DM_I2C +#if !CONFIG_IS_ENABLED (DM_I2C )if (i2c_probe (TPS65910_CTRL_I2C_ADDR ))return ;#else
@@ -468,7 +468,7 @@ void gpi2c_init(void)if (first_time) {enable_i2c0_pin_mux (); -#ifndef CONFIG_DM_I2C +#if !CONFIG_IS_ENABLED (DM_I2C )i2c_init (CONFIG_SYS_OMAP24_I2C_SPEED ,CONFIG_SYS_OMAP24_I2C_SLAVE );#endif
board/ti/am335x/mux.c +1 -1
@@ -333,7 +333,7 @@ static unsigned short detect_daughter_board_profile(void) {unsigned short val; -#ifndef CONFIG_DM_I2C +#if !CONFIG_IS_ENABLED (DM_I2C )if (i2c_probe (I2C_CPLD_ADDR ))return PROFILE_NONE ;
board/ti/am43xx/board.c +6 -6
@@ -392,7 +392,7 @@ void scale_vcores_generic(u32 m) {int mpu_vdd, ddr_volt; -#ifndef CONFIG_DM_I2C +#if !CONFIG_IS_ENABLED (DM_I2C )if (i2c_probe (TPS65218_CHIP_PM ))return ;#else
@@ -450,7 +450,7 @@ void scale_vcores_idk(u32 m) {int mpu_vdd; -#ifndef CONFIG_DM_I2C +#if !CONFIG_IS_ENABLED (DM_I2C )if (i2c_probe (TPS62362_I2C_ADDR ))return ;#else
@@ -491,7 +491,7 @@ void gpi2c_init(void)if (first_time) {enable_i2c0_pin_mux (); -#ifndef CONFIG_DM_I2C +#if !CONFIG_IS_ENABLED (DM_I2C )i2c_init (CONFIG_SYS_OMAP24_I2C_SPEED ,CONFIG_SYS_OMAP24_I2C_SLAVE );#endif
@@ -631,14 +631,14 @@ void sdram_init(void)int power_init_board (void ) {int rc; -#ifndef CONFIG_DM_I2C +#if !CONFIG_IS_ENABLED (DM_I2C )struct pmic *p =NULL ;#endif if (board_is_idk ()) { rc =power_tps62362_init (0 );if (rc) goto done; -#ifndef CONFIG_DM_I2C +#if !CONFIG_IS_ENABLED (DM_I2C ) p =pmic_get ("TPS62362" );if (!p ||pmic_probe (p)) goto done;
@@ -648,7 +648,7 @@ int power_init_board(void) rc =power_tps65218_init (0 );if (rc) goto done; -#ifndef CONFIG_DM_I2C +#if !CONFIG_IS_ENABLED (DM_I2C ) p =pmic_get ("TPS65218_PMIC" );if (!p ||pmic_probe (p)) goto done;
board/ti/common/board_detect.c +2 -2
@@ -22,7 +22,7 @@#include "board_detect.h" -#if !defined(CONFIG_DM_I2C ) +#if !CONFIG_IS_ENABLED (DM_I2C )/** * ti_i2c_eeprom_init - Initialize an i2c bus and probe for a device * @i2c_bus: i2c bus number to initialize
@@ -89,7 +89,7 @@ static int __maybe_unused ti_i2c_eeprom_get(int bus_addr, int dev_addr,u32 hdr_read;int rc; -#if defined(CONFIG_DM_I2C ) +#if CONFIG_IS_ENABLED (DM_I2C )struct udevice *dev;struct udevice *bus;
board/ti/ks2_evm/board_k2g.c +1 -1
@@ -259,7 +259,7 @@ int board_fit_config_name_match(const char *name)#if defined(CONFIG_DTB_RESELECT )static int k2g_alt_board_detect (void ) { -#ifndef CONFIG_DM_I2C +#if !CONFIG_IS_ENABLED (DM_I2C )int rc; rc =i2c_set_bus_num (1 );
board/wandboard/wandboard.c +2 -2
@@ -53,7 +53,7 @@ DECLARE_GLOBAL_DATA_PTR;#define REV_DETECTION IMX_GPIO_NR(2, 28)/* Speed defined in Kconfig is only applicable when not using DM_I2C. */ -#ifdef CONFIG_DM_I2C +#if CONFIG_IS_ENABLED (DM_I2C )#define I2C1_SPEED_NON_DM 0#define I2C2_SPEED_NON_DM 0#else
@@ -258,7 +258,7 @@ static void do_enable_hdmi(struct display_info_t const *dev)static int detect_i2c (struct display_info_t const *dev) { -#ifdef CONFIG_DM_I2C +#if CONFIG_IS_ENABLED (DM_I2C )struct udevice *bus, *udev;int rc;
cmd/eeprom.c +3 -3
@@ -61,7 +61,7 @@#endif #endif -#if defined(CONFIG_DM_I2C ) +#if CONFIG_IS_ENABLED (DM_I2C )static int eeprom_i2c_bus;#endif
@@ -73,7 +73,7 @@ __weak int eeprom_write_enable(unsigned dev_addr, int state)void eeprom_init (int bus) {/* I2C EEPROM */ -#if defined(CONFIG_DM_I2C ) +#if CONFIG_IS_ENABLED (DM_I2C ) eeprom_i2c_bus = bus;#elif defined(CONFIG_SYS_I2C )if (bus >=0 )
@@ -132,7 +132,7 @@ static int eeprom_rw_block(unsigned offset, uchar *addr, unsigned alen, {int ret =0 ; -#if defined(CONFIG_DM_I2C ) +#if CONFIG_IS_ENABLED (DM_I2C )struct udevice *dev; ret = i2c_get_chip_for_busnum(eeprom_i2c_bus, addr[0],
cmd/i2c.c +49 -49
387 lines not on this page · raw message
doc/driver-model/i2c-howto.rst +1 -1
@@ -25,7 +25,7 @@ forward to convert these, at some point there may come a patch to remove them! Here is a suggested approach for converting your I2C driver over to driver model. Please feel free to update this file with your ideas and suggestions. -- #ifdef out all your own I2C driver code (#ifndef CONFIG_DM_I2C) +- #ifdef out all your own I2C driver code (#if !CONFIG_IS_ENABLED(DM_I2C)) - Define CONFIG_DM_I2C for your board, vendor or architecture - If the board does not already use driver model, you need CONFIG_DM also - Your board should then build, but will not work fully since there will be
drivers/ddr/fsl/main.c +4 -4
@@ -86,7 +86,7 @@ u8 spd_i2c_addr[CONFIG_SYS_NUM_DDR_CTLRS][CONFIG_DIMM_SLOTS_PER_CTLR] = {#endif -#if defined(CONFIG_DM_I2C ) +#if CONFIG_IS_ENABLED (DM_I2C )#define DEV_TYPE struct udevice#else /* Local udevice */
@@ -106,7 +106,7 @@ static int ddr_i2c_read(DEV_TYPE *dev, unsigned int addr, {int ret; -#ifdef CONFIG_DM_I2C +#if CONFIG_IS_ENABLED (DM_I2C ) ret =dm_i2c_read (dev,0 , buf, len);#else ret =i2c_read (dev->chip, addr, alen, buf, len);
@@ -120,7 +120,7 @@ static int ddr_i2c_dummy_write(unsigned int chip_addr) {uint8_t buf =0 ; -#ifdef CONFIG_DM_I2C +#if CONFIG_IS_ENABLED (DM_I2C )struct udevice *dev;int ret;
@@ -146,7 +146,7 @@ static void __get_spd(generic_spd_eeprom_t *spd, u8 i2c_address)int ret;DEV_TYPE *dev; -#if defined(CONFIG_DM_I2C ) +#if CONFIG_IS_ENABLED (DM_I2C ) ret =i2c_get_chip_for_busnum (CONFIG_SYS_SPD_BUS_NUM , i2c_address,1 , &dev);if (ret) {
drivers/i2c/davinci_i2c.c +2 -2
@@ -21,7 +21,7 @@#include <linux/delay.h> #include "davinci_i2c.h" -#ifdef CONFIG_DM_I2C +#if CONFIG_IS_ENABLED(DM_I2C) /* Information about i2c controller */ struct i2c_bus { int id;
@@ -340,7 +340,7 @@ static int _davinci_i2c_probe_chip(struct i2c_regs *i2c_base, uint8_t chip)return rc; } -#ifndef CONFIG_DM_I2C +#if !CONFIG_IS_ENABLED (DM_I2C )static struct i2c_regs *davinci_get_base (struct i2c_adapter *adap) {switch (adap->hwadapnr) {
drivers/i2c/designware_i2c.c +2 -2
@@ -598,7 +598,7 @@ static int __dw_i2c_init(struct i2c_regs *i2c_base, int speed, int slaveaddr)writel (IC_RX_TL , &i2c_base->ic_rx_tl);writel (IC_TX_TL , &i2c_base->ic_tx_tl);writel (IC_STOP_DET , &i2c_base->ic_intr_mask); -#ifndef CONFIG_DM_I2C +#if !CONFIG_IS_ENABLED (DM_I2C )_dw_i2c_set_bus_speed (NULL , i2c_base, speed,IC_CLK );writel (slaveaddr, &i2c_base->ic_sar);#endif
@@ -611,7 +611,7 @@ static int __dw_i2c_init(struct i2c_regs *i2c_base, int speed, int slaveaddr)return 0 ; } -#ifndef CONFIG_DM_I2C +#if !CONFIG_IS_ENABLED (DM_I2C )/* * The legacy I2C functions. These need to get removed once * all users of this driver are converted to DM.
drivers/i2c/fsl_i2c.c +3 -3
@@ -39,7 +39,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 +202,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 +496,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,
drivers/i2c/ihs_i2c.c +21 -21
163 lines not on this page · raw message
drivers/i2c/lpc32xx_i2c.c +2 -2
@@ -42,7 +42,7 @@#define LPC32XX_I2C_STAT_NAI 0x00000004#define LPC32XX_I2C_STAT_TDI 0x00000001 -#ifndef CONFIG_DM_I2C +#if !CONFIG_IS_ENABLED (DM_I2C )static struct lpc32xx_i2c_base *lpc32xx_i2c[] = { (struct lpc32xx_i2c_base *)I2C1_BASE , (struct lpc32xx_i2c_base *)I2C2_BASE,
@@ -224,7 +224,7 @@ static int __i2c_write(struct lpc32xx_i2c_base *base, u8 dev, uint addr,return 0 ; } -#ifndef CONFIG_DM_I2C +#if !CONFIG_IS_ENABLED (DM_I2C )static void lpc32xx_i2c_init (struct i2c_adapter *adap,int requested_speed,int slaveadd) {
drivers/i2c/mv_i2c.c +1 -1
@@ -370,7 +370,7 @@ static int __i2c_write(struct mv_i2c *base, uchar chip, u8 *addr, int alen,return 0 ; } -#ifndef CONFIG_DM_I2C +#if !CONFIG_IS_ENABLED (DM_I2C )static struct mv_i2c *base_glob;
drivers/i2c/mvtwsi.c +8 -8
@@ -15,7 +15,7 @@#include <asm/io.h> #include <linux/bitops.h> #include <linux/compat.h> -#ifdef CONFIG_DM_I2C +#if CONFIG_IS_ENABLED (DM_I2C )#include <dm.h> #endif
@@ -26,7 +26,7 @@ DECLARE_GLOBAL_DATA_PTR;* settings */ -#ifndef CONFIG_DM_I2C +#if !CONFIG_IS_ENABLED (DM_I2C )#if defined(CONFIG_ARCH_ORION5X )#include <asm/arch/orion5x.h> #elif (defined(CONFIG_ARCH_KIRKWOOD ) || defined(CONFIG_ARCH_MVEBU ))
@@ -42,7 +42,7 @@ DECLARE_GLOBAL_DATA_PTR;* On SUNXI, we get CONFIG_SYS_TCLK from this include, so we want to * always have it. */ -#if defined(CONFIG_DM_I2C ) && defined(CONFIG_ARCH_SUNXI ) +#if CONFIG_IS_ENABLED (DM_I2C ) && defined(CONFIG_ARCH_SUNXI )#include <asm/arch/i2c.h> #endif
@@ -82,7 +82,7 @@ struct mvtwsi_registers {#endif -#ifdef CONFIG_DM_I2C +#if CONFIG_IS_ENABLED(DM_I2C) struct mvtwsi_i2c_dev { /* TWSI Register base for the device */ struct mvtwsi_registers *base;
@@ -183,7 +183,7 @@ inline uint calc_tick(uint speed)return (1000000000u / speed) +100 ; } -#ifndef CONFIG_DM_I2C +#if !CONFIG_IS_ENABLED (DM_I2C )/* * twsi_get_base() - Get controller register base for specified adapter
@@ -480,7 +480,7 @@ static uint __twsi_i2c_set_bus_speed(struct mvtwsi_registers *twsi,writel (baud, &twsi->baudrate);/* Wait for controller for one tick */ -#ifdef CONFIG_DM_I2C +#if CONFIG_IS_ENABLED (DM_I2C )ndelay (calc_tick (highest_speed));#else ndelay (10000 );
@@ -515,7 +515,7 @@ static void __twsi_i2c_init(struct mvtwsi_registers *twsi, int speed,writel (slaveadd, &twsi->slave_address);writel (0 , &twsi->xtnd_slave_addr);/* Assert STOP, but don't care for the result */ -#ifdef CONFIG_DM_I2C +#if CONFIG_IS_ENABLED (DM_I2C ) (void )twsi_stop (twsi,calc_tick (*actual_speed));#else (void )twsi_stop (twsi,10000 );
@@ -682,7 +682,7 @@ static int __twsi_i2c_write(struct mvtwsi_registers *twsi, uchar chip,return status !=0 ? status : stop_status; } -#ifndef CONFIG_DM_I2C +#if !CONFIG_IS_ENABLED (DM_I2C )static void twsi_i2c_init (struct i2c_adapter *adap,int speed,int slaveadd) {
drivers/i2c/mxc_i2c.c +2 -2
@@ -393,7 +393,7 @@ static struct mxc_i2c_bus mxc_i2c_buses[] = {#endif }; -#ifndef CONFIG_DM_I2C +#if !CONFIG_IS_ENABLED (DM_I2C )int i2c_idle_bus (struct mxc_i2c_bus *i2c_bus) {if (i2c_bus && i2c_bus->idle_bus_fn)
@@ -645,7 +645,7 @@ int __enable_i2c_clk(unsigned char enable, unsigned int i2c_num)int enable_i2c_clk (unsigned char enable,unsigned int i2c_num) __attribute__((weak,alias ("__enable_i2c_clk" ))); -#ifndef CONFIG_DM_I2C +#if !CONFIG_IS_ENABLED (DM_I2C )/* * Read data from I2C device *
drivers/i2c/omap24xx_i2c.c +1 -1
@@ -836,7 +836,7 @@ wr_exit:return i2c_error; } -#ifndef CONFIG_DM_I2C +#if !CONFIG_IS_ENABLED (DM_I2C )/* * The legacy I2C functions. These need to get removed once * all users of this driver are converted to DM.
drivers/power/palmas.c +1 -1
@@ -176,7 +176,7 @@ int twl603x_enable_bb_charge(u8 bb_fields)return err; } -#ifdef CONFIG_DM_I2C +#if CONFIG_IS_ENABLED (DM_I2C )int palmas_i2c_write_u8 (u8 chip_no,u8 reg,u8 val) {struct udevice *dev;
drivers/power/pmic/pmic_tps62362.c +3 -3
@@ -10,7 +10,7 @@#include <power/pmic.h> #include <power/tps62362.h> -#ifdef CONFIG_DM_I2C +#if CONFIG_IS_ENABLED (DM_I2C ) struct udevice *tps62362_dev __attribute__((section(".data"))) = NULL;#endif
@@ -26,7 +26,7 @@ int tps62362_voltage_update(unsigned char reg, unsigned char volt_sel)if (reg >TPS62362_NUM_REGS )return 1 ; -#ifndef CONFIG_DM_I2C +#if !CONFIG_IS_ENABLED (DM_I2C )return i2c_write (TPS62362_I2C_ADDR , reg,1 , &volt_sel,1 );#else if (!tps62362_dev)
@@ -35,7 +35,7 @@ int tps62362_voltage_update(unsigned char reg, unsigned char volt_sel)#endif } -#ifndef CONFIG_DM_I2C +#if !CONFIG_IS_ENABLED (DM_I2C )int power_tps62362_init (unsigned char bus) {static const char name[] ="TPS62362" ;
drivers/power/pmic/pmic_tps65217.c +7 -7
@@ -18,7 +18,7 @@ struct udevice *tps65217_dev __attribute__((section(".data"))) = NULL;*/ int tps65217_reg_read (uchar src_reg,uchar *src_val) { -#ifndef CONFIG_DM_I2C +#if !CONFIG_IS_ENABLED (DM_I2C )return i2c_read (TPS65217_CHIP_PM , src_reg,1 , src_val,1 );#else return dm_i2c_read (tps65217_dev, src_reg, src_val,1 );
@@ -52,7 +52,7 @@ int tps65217_reg_write(uchar prot_level, uchar dest_reg, uchar dest_val,* mask */ if (mask !=TPS65217_MASK_ALL_BITS ) { -#ifndef CONFIG_DM_I2C +#if !CONFIG_IS_ENABLED (DM_I2C ) ret =i2c_read (TPS65217_CHIP_PM , dest_reg,1 , &read_val,1 );#else ret =dm_i2c_read (tps65217_dev, dest_reg, &read_val,1 );
@@ -67,7 +67,7 @@ int tps65217_reg_write(uchar prot_level, uchar dest_reg, uchar dest_val,if (prot_level >0 ) { xor_reg = dest_reg ^TPS65217_PASSWORD_UNLOCK ; -#ifndef CONFIG_DM_I2C +#if !CONFIG_IS_ENABLED (DM_I2C ) ret =i2c_write (TPS65217_CHIP_PM ,TPS65217_PASSWORD ,1 , &xor_reg,1 );#else
@@ -77,7 +77,7 @@ int tps65217_reg_write(uchar prot_level, uchar dest_reg, uchar dest_val,if (ret)return ret; } -#ifndef CONFIG_DM_I2C +#if !CONFIG_IS_ENABLED (DM_I2C ) ret =i2c_write (TPS65217_CHIP_PM , dest_reg,1 , &dest_val,1 );#else ret =dm_i2c_write (tps65217_dev, dest_reg, &dest_val,1 );
@@ -86,7 +86,7 @@ int tps65217_reg_write(uchar prot_level, uchar dest_reg, uchar dest_val,return ret;if (prot_level ==TPS65217_PROT_LEVEL_2 ) { -#ifndef CONFIG_DM_I2C +#if !CONFIG_IS_ENABLED (DM_I2C ) ret =i2c_write (TPS65217_CHIP_PM ,TPS65217_PASSWORD ,1 , &xor_reg,1 );#else
@@ -96,7 +96,7 @@ int tps65217_reg_write(uchar prot_level, uchar dest_reg, uchar dest_val,if (ret)return ret; -#ifndef CONFIG_DM_I2C +#if !CONFIG_IS_ENABLED (DM_I2C ) ret =i2c_write (TPS65217_CHIP_PM , dest_reg,1 , &dest_val,1 );#else ret =dm_i2c_write (tps65217_dev, dest_reg, &dest_val,1 );
@@ -137,7 +137,7 @@ int tps65217_voltage_update(uchar dc_cntrl_reg, uchar volt_sel)int power_tps65217_init (unsigned char bus) { -#ifdef CONFIG_DM_I2C +#if CONFIG_IS_ENABLED (DM_I2C )struct udevice *dev =NULL ;int rc;
drivers/power/pmic/pmic_tps65218.c +2 -2
@@ -10,7 +10,7 @@#include <power/pmic.h> #include <power/tps65218.h> -#ifndef CONFIG_DM_I2C +#if !CONFIG_IS_ENABLED (DM_I2C )int tps65218_reg_read (uchar dest_reg,uchar *dest_val) {uchar read_val;
@@ -225,7 +225,7 @@ int tps65218_lock_fseal(void)return 0 ; } -#ifndef CONFIG_DM_I2C +#if !CONFIG_IS_ENABLED (DM_I2C )int power_tps65218_init (unsigned char bus) {static const char name[] ="TPS65218_PMIC" ;
drivers/power/pmic/pmic_tps65910.c +3 -3
@@ -12,7 +12,7 @@ struct udevice *tps65910_dev __attribute__((section(".data"))) = NULL;static inline int tps65910_read_reg (int addr,uchar *buf) { -#ifndef CONFIG_DM_I2C +#if !CONFIG_IS_ENABLED (DM_I2C )return i2c_read (TPS65910_CTRL_I2C_ADDR , addr,1 , buf,1 );#else int rc;
@@ -27,7 +27,7 @@ static inline int tps65910_read_reg(int addr, uchar *buf)static inline int tps65910_write_reg (int addr,uchar *buf) { -#ifndef CONFIG_DM_I2C +#if !CONFIG_IS_ENABLED (DM_I2C )return i2c_write (TPS65910_CTRL_I2C_ADDR , addr,1 , buf,1 );#else return dm_i2c_reg_write (tps65910_dev, addr, *buf);
@@ -36,7 +36,7 @@ static inline int tps65910_write_reg(int addr, uchar *buf)int power_tps65910_init (unsigned char bus) { -#ifdef CONFIG_DM_I2C +#if CONFIG_IS_ENABLED (DM_I2C )struct udevice *dev =NULL ;int rc;
drivers/power/twl4030.c +1 -1
@@ -182,7 +182,7 @@ int do_poweroff(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[]) }#endif -#ifdef CONFIG_DM_I2C +#if CONFIG_IS_ENABLED (DM_I2C )int twl4030_i2c_write_u8 (u8 chip_no,u8 reg,u8 val) {struct udevice *dev;
drivers/power/twl6030.c +1 -1
@@ -270,7 +270,7 @@ void twl6030_usb_device_settings()twl6030_i2c_write_u8 (TWL6030_CHIP_PM ,TWL6030_MISC2 , value); } -#ifdef CONFIG_DM_I2C +#if CONFIG_IS_ENABLED (DM_I2C )int twl6030_i2c_write_u8 (u8 chip_no,u8 reg,u8 val) {struct udevice *dev;
drivers/tpm/tpm_atmel_twi.c +3 -3
@@ -81,7 +81,7 @@ static int tpm_atmel_twi_xfer(struct udevice *dev,print_buffer (0 , (void *)sendbuf,1 , send_size,0 );#endif -#ifndef CONFIG_DM_I2C +#if !CONFIG_IS_ENABLED (DM_I2C ) res =i2c_write (0x29 ,0 ,0 , (uchar *)sendbuf, send_size);#else res =dm_i2c_write (dev,0 , sendbuf, send_size);
@@ -92,7 +92,7 @@ static int tpm_atmel_twi_xfer(struct udevice *dev, } start =get_timer (0 ); -#ifndef CONFIG_DM_I2C +#if !CONFIG_IS_ENABLED (DM_I2C )while ((res =i2c_read (0x29 ,0 ,0 , recvbuf,10 ))) #elsewhile ((res =dm_i2c_read (dev,0 , recvbuf,10 )))
@@ -116,7 +116,7 @@ static int tpm_atmel_twi_xfer(struct udevice *dev,return -1 ; }else { *recv_len = hdr_recv_len; -#ifndef CONFIG_DM_I2C +#if !CONFIG_IS_ENABLED (DM_I2C ) res =i2c_read (0x29 ,0 ,0 , recvbuf, *recv_len);#else res =dm_i2c_read (dev,0 , recvbuf, *recv_len);
drivers/usb/host/ohci-lpc32xx.c +4 -4
@@ -86,7 +86,7 @@ static struct clk_pm_regs *clk_pwr = (struct clk_pm_regs *)CLK_PM_BASE;static int isp1301_set_value (struct udevice *dev,int reg,u8 value) { -#ifndef CONFIG_DM_I2C +#if !CONFIG_IS_ENABLED (DM_I2C )return i2c_write (ISP1301_I2C_ADDR , reg,1 , &value,1 );#else return dm_i2c_write (dev, reg, &value,1 );
@@ -95,7 +95,7 @@ static int isp1301_set_value(struct udevice *dev, int reg, u8 value)static void isp1301_configure (struct udevice *dev) { -#ifndef CONFIG_DM_I2C +#if !CONFIG_IS_ENABLED (DM_I2C )i2c_set_bus_num (I2C_2 );#endif
@@ -160,7 +160,7 @@ int usb_cpu_init(void)u32 ret;struct udevice *dev =NULL ; -#ifdef CONFIG_DM_I2C +#if CONFIG_IS_ENABLED (DM_I2C ) ret =i2c_get_chip_for_busnum (I2C_2 ,ISP1301_I2C_ADDR ,1 , &dev);if (ret) {debug ("%s: No bus %d\n" , __func__,I2C_2 );
@@ -216,7 +216,7 @@ int usb_cpu_stop(void)struct udevice *dev =NULL ;int ret =0 ; -#ifdef CONFIG_DM_I2C +#if CONFIG_IS_ENABLED (DM_I2C ) ret =i2c_get_chip_for_busnum (I2C_2 ,ISP1301_I2C_ADDR ,1 , &dev);if (ret) {debug ("%s: No bus %d\n" , __func__,I2C_2 );
include/_exports.h +1 -1
@@ -40,7 +40,7 @@EXPORT_FUNC (simple_strtol, long, simple_strtol, const char *, char **, unsigned int) EXPORT_FUNC(strcmp, int, strcmp, const char *cs, const char *ct) -#if defined(CONFIG_CMD_I2C ) && !defined(CONFIG_DM_I2C ) +#if defined(CONFIG_CMD_I2C ) && !CONFIG_IS_ENABLED (DM_I2C ) EXPORT_FUNC(i2c_write, int, i2c_write, uchar, uint, int , uchar * , int) EXPORT_FUNC(i2c_read, int, i2c_read, uchar, uint, int , uchar * , int) #else
include/config_fallbacks.h +1 -1
@@ -46,7 +46,7 @@#define CONFIG_SYS_MAXARGS 16#endif -#ifdef CONFIG_DM_I2C +#if CONFIG_IS_ENABLED (DM_I2C )# ifdef CONFIG_SYS_I2C # error "Cannot define CONFIG_SYS_I2C when CONFIG_DM_I2C is used"# endif
include/configs/MPC8548CDS.h +1 -1
@@ -296,7 +296,7 @@ extern unsigned long get_clock_freq(void);/* * I2C */ -#ifndef CONFIG_DM_I2C +#if !CONFIG_IS_ENABLED (DM_I2C )#define CONFIG_SYS_I2C #define CONFIG_SYS_FSL_I2C_SPEED 400000#define CONFIG_SYS_FSL_I2C_SLAVE 0x7F
include/configs/P1010RDB.h +1 -1
@@ -525,7 +525,7 @@ extern unsigned long get_sdram_size(void);#define CONFIG_SYS_NS16550_COM2 (CONFIG_SYS_CCSRBAR+0x4600)/* I2C */ -#ifndef CONFIG_DM_I2C +#if !CONFIG_IS_ENABLED (DM_I2C )#define CONFIG_SYS_I2C #define CONFIG_SYS_FSL_I2C_SPEED 400000#define CONFIG_SYS_FSL_I2C_SLAVE 0x7F
include/configs/P2041RDB.h +1 -1
@@ -259,7 +259,7 @@ unsigned long get_board_sys_clk(unsigned long dummy);#define CONFIG_SYS_NS16550_COM4 (CONFIG_SYS_CCSRBAR+0x11D600)/* I2C */ -#ifndef CONFIG_DM_I2C +#if !CONFIG_IS_ENABLED (DM_I2C )#define CONFIG_SYS_I2C #define CONFIG_SYS_FSL_I2C_SPEED 400000#define CONFIG_SYS_FSL_I2C_SLAVE 0x7F
include/configs/T102xRDB.h +1 -1
@@ -422,7 +422,7 @@ unsigned long get_board_ddr_clk(void);#endif /* I2C */ -#ifndef CONFIG_DM_I2C +#if !CONFIG_IS_ENABLED (DM_I2C )#define CONFIG_SYS_I2C #define CONFIG_SYS_FSL_I2C_SPEED 50000/* I2C speed in Hz */ #define CONFIG_SYS_FSL_I2C_SLAVE 0x7F
include/configs/T104xRDB.h +1 -1
@@ -452,7 +452,7 @@ $(SRCTREE)/board/freescale/t104xrdb/t1042d4_sd_rcw.cfg#endif /* I2C */ -#ifndef CONFIG_DM_I2C +#if !CONFIG_IS_ENABLED (DM_I2C )#define CONFIG_SYS_I2C #define CONFIG_SYS_FSL_I2C_SPEED 400000/* I2C speed in Hz */ #define CONFIG_SYS_FSL_I2C2_SPEED 400000
include/configs/T208xQDS.h +1 -1
@@ -377,7 +377,7 @@ unsigned long get_board_ddr_clk(void);/* * I2C */ -#ifndef CONFIG_DM_I2C +#if !CONFIG_IS_ENABLED (DM_I2C )#define CONFIG_SYS_I2C #define CONFIG_SYS_FSL_I2C_SLAVE 0x7F#define CONFIG_SYS_FSL_I2C2_SLAVE 0x7F
include/configs/T208xRDB.h +1 -1
@@ -322,7 +322,7 @@ unsigned long get_board_ddr_clk(void);/* * I2C */ -#ifndef CONFIG_DM_I2C +#if !CONFIG_IS_ENABLED (DM_I2C )#define CONFIG_SYS_I2C #define CONFIG_SYS_FSL_I2C_SLAVE 0x7F#define CONFIG_SYS_FSL_I2C2_SLAVE 0x7F
include/configs/T4240RDB.h +1 -1
@@ -154,7 +154,7 @@#define CONFIG_SYS_NS16550_COM4 (CONFIG_SYS_CCSRBAR+0x11D600)/* I2C */ -#ifndef CONFIG_DM_I2C +#if !CONFIG_IS_ENABLED (DM_I2C )#define CONFIG_SYS_I2C #define CONFIG_SYS_FSL_I2C_SLAVE 0x7F#define CONFIG_SYS_FSL_I2C_OFFSET 0x118000
include/configs/am43xx_evm.h +1 -1
@@ -26,7 +26,7 @@#define CONFIG_SYS_I2C_EEPROM_ADDR_LEN 2/* Power */ -#ifndef CONFIG_DM_I2C +#if !CONFIG_IS_ENABLED (DM_I2C )#define CONFIG_POWER #define CONFIG_POWER_I2C #endif
include/configs/corenet_ds.h +1 -1
@@ -269,7 +269,7 @@#define CONFIG_SYS_NS16550_COM4 (CONFIG_SYS_CCSRBAR+0x11D600)/* I2C */ -#ifndef CONFIG_DM_I2C +#if !CONFIG_IS_ENABLED (DM_I2C )#define CONFIG_SYS_I2C #define CONFIG_SYS_FSL_I2C_SPEED 400000#define CONFIG_SYS_FSL_I2C_SLAVE 0x7F
include/configs/ls1012a_common.h +1 -1
@@ -55,7 +55,7 @@ CONFIG_SYS_SCSI_MAX_LUN)/* I2C */ -#ifndef CONFIG_DM_I2C +#if !CONFIG_IS_ENABLED (DM_I2C )#define CONFIG_SYS_I2C #else #define CONFIG_I2C_SET_DEFAULT_BUS_NUM
include/configs/ls1021aiot.h +1 -1
@@ -98,7 +98,7 @@* I2C */ -#ifndef CONFIG_DM_I2C +#if !CONFIG_IS_ENABLED (DM_I2C )#define CONFIG_SYS_I2C #else #define CONFIG_I2C_SET_DEFAULT_BUS_NUM
include/configs/ls1021aqds.h +1 -1
@@ -330,7 +330,7 @@ unsigned long get_board_ddr_clk(void);/* * I2C */ -#ifndef CONFIG_DM_I2C +#if !CONFIG_IS_ENABLED (DM_I2C )#define CONFIG_SYS_I2C #else #define CONFIG_I2C_SET_DEFAULT_BUS_NUM
include/configs/ls1021atsn.h +1 -1
@@ -104,7 +104,7 @@#define CONFIG_SYS_NS16550_CLK get_serial_clock()/* I2C */ -#ifndef CONFIG_DM_I2C +#if !CONFIG_IS_ENABLED (DM_I2C )#define CONFIG_SYS_I2C #else #define CONFIG_I2C_SET_DEFAULT_BUS_NUM
include/configs/ls1021atwr.h +1 -1
@@ -208,7 +208,7 @@/* * I2C */ -#ifndef CONFIG_DM_I2C +#if !CONFIG_IS_ENABLED (DM_I2C )#define CONFIG_SYS_I2C #else #define CONFIG_I2C_SET_DEFAULT_BUS_NUM
include/configs/ls1028a_common.h +1 -1
@@ -44,7 +44,7 @@#endif /* I2C */ -#ifndef CONFIG_DM_I2C +#if !CONFIG_IS_ENABLED (DM_I2C )#define CONFIG_SYS_I2C #endif
include/configs/ls1043a_common.h +1 -1
@@ -149,7 +149,7 @@#endif /* I2C */ -#ifndef CONFIG_DM_I2C +#if !CONFIG_IS_ENABLED (DM_I2C )#define CONFIG_SYS_I2C #define CONFIG_SYS_I2C_MXC_I2C1 /* enable I2C bus 1 */ #define CONFIG_SYS_I2C_MXC_I2C2 /* enable I2C bus 2 */
include/configs/ls1046a_common.h +1 -1
@@ -133,7 +133,7 @@#endif /* I2C */ -#ifndef CONFIG_DM_I2C +#if !CONFIG_IS_ENABLED (DM_I2C )#define CONFIG_SYS_I2C #define CONFIG_SYS_I2C_MXC_I2C1 /* enable I2C bus 1 */ #define CONFIG_SYS_I2C_MXC_I2C2 /* enable I2C bus 2 */
include/configs/ls1088a_common.h +1 -1
@@ -61,7 +61,7 @@#endif /* I2C */ -#ifndef CONFIG_DM_I2C +#if !CONFIG_IS_ENABLED (DM_I2C )#define CONFIG_SYS_I2C #endif
include/configs/ls1088aqds.h +1 -1
@@ -26,7 +26,7 @@ unsigned long get_board_ddr_clk(void);#define CONFIG_DDR_CLK_FREQ 100000000#else #define CONFIG_QIXIS_I2C_ACCESS -#ifndef CONFIG_DM_I2C +#if !CONFIG_IS_ENABLED (DM_I2C )#define CONFIG_SYS_I2C_EARLY_INIT #endif #define CONFIG_SYS_CLK_FREQ get_board_sys_clk()
include/configs/ls2080a_common.h +1 -1
@@ -74,7 +74,7 @@#endif /* I2C */ -#ifndef CONFIG_DM_I2C +#if !CONFIG_IS_ENABLED (DM_I2C )#define CONFIG_SYS_I2C #endif
include/configs/ls2080aqds.h +1 -1
@@ -16,7 +16,7 @@ unsigned long get_board_ddr_clk(void);#ifdef CONFIG_FSL_QSPI #define CONFIG_QIXIS_I2C_ACCESS -#ifndef CONFIG_DM_I2C +#if !CONFIG_IS_ENABLED (DM_I2C )#define CONFIG_SYS_I2C_EARLY_INIT #endif #define CONFIG_SYS_I2C_IFDR_DIV 0x7e
include/configs/ls2080ardb.h +1 -1
@@ -13,7 +13,7 @@#ifdef CONFIG_TARGET_LS2081ARDB #define CONFIG_QIXIS_I2C_ACCESS #endif -#ifndef CONFIG_DM_I2C +#if !CONFIG_IS_ENABLED (DM_I2C )#define CONFIG_SYS_I2C_EARLY_INIT #endif #endif
include/configs/p1_p2_rdb_pc.h +1 -1
@@ -463,7 +463,7 @@#define CONFIG_SYS_NS16550_COM2 (CONFIG_SYS_CCSRBAR+0x4600)/* I2C */ -#ifndef CONFIG_DM_I2C +#if !CONFIG_IS_ENABLED (DM_I2C )#define CONFIG_SYS_I2C #define CONFIG_SYS_FSL_I2C_SPEED 400000#define CONFIG_SYS_FSL_I2C_SLAVE 0x7F
include/configs/sunxi-common.h +1 -1
@@ -207,7 +207,7 @@ defined CONFIG_I2C2_ENABLE || defined CONFIG_I2C3_ENABLE || \ defined CONFIG_I2C4_ENABLE || defined CONFIG_R_I2C_ENABLE#define CONFIG_SYS_I2C_MVTWSI -#ifndef CONFIG_DM_I2C +#if !CONFIG_IS_ENABLED (DM_I2C )#define CONFIG_SYS_I2C #define CONFIG_SYS_I2C_SPEED 400000#define CONFIG_SYS_I2C_SLAVE 0x7f
include/configs/ti_armv7_common.h +1 -1
@@ -87,7 +87,7 @@#define CONFIG_SYS_PTV 2/* Divisor: 2^(PTV+1) => 8 */ /* If DM_I2C, enable non-DM I2C support */ -#if !defined(CONFIG_DM_I2C ) +#if !CONFIG_IS_ENABLED (DM_I2C )#define CONFIG_I2C #define CONFIG_SYS_I2C #endif
include/exports.h +1 -1
@@ -48,7 +48,7 @@ long simple_strtol(const char *cp, char **endp, unsigned int base);int strcmp (const char *cs,const char *ct);unsigned long ustrtoul (const char *cp,char **endp,unsigned int base);unsigned long long ustrtoull (const char *cp,char **endp,unsigned int base); -#if defined(CONFIG_CMD_I2C ) && !defined(CONFIG_DM_I2C ) +#if defined(CONFIG_CMD_I2C ) && !CONFIG_IS_ENABLED (DM_I2C )int i2c_write (uchar ,uint ,int ,uchar * ,int );int i2c_read (uchar ,uint ,int ,uchar * ,int );#endif
include/i2c.h +1 -1
@@ -581,7 +581,7 @@ extern struct acpi_ops i2c_acpi_ops;*/ int acpi_i2c_of_to_plat (struct udevice *dev); -#ifndef CONFIG_DM_I2C +#if !CONFIG_IS_ENABLED (DM_I2C )/* * WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING
include/palmas.h +1 -1
@@ -117,7 +117,7 @@#define BB_VSEL_VBAT (3 << 1)#define BB_CHRG_EN (1 << 0) -#ifndef CONFIG_DM_I2C +#if !CONFIG_IS_ENABLED (DM_I2C )/* * Functions to read and write from TPS659038/TWL6035/TWL6037 * or other Palmas family of TI PMICs
include/twl4030.h +1 -1
@@ -648,7 +648,7 @@* examples are TWL4030_PM_RECEIVER_VMMC1_DEV_GRP and * TWL4030_LED_LEDEN. */ -#ifndef CONFIG_DM_I2C +#if !CONFIG_IS_ENABLED (DM_I2C )static inline int twl4030_i2c_write_u8 (u8 chip_no,u8 reg,u8 val) {return i2c_write (chip_no, reg,1 , &val,1 );
include/twl6030.h +1 -1
@@ -186,7 +186,7 @@ struct twl6030_data{ };/* Functions to read and write from TWL6030 */ -#ifndef CONFIG_DM_I2C +#if !CONFIG_IS_ENABLED (DM_I2C )static inline int twl6030_i2c_write_u8 (u8 chip_no,u8 reg,u8 val) {return i2c_write (chip_no, reg,1 , &val,1 );
Signature · 1 line
2.25.1
PATCH v3 3/3 dm: i2c: use CONFIG_IS_ENABLED macro for DM_I2C/DM_I2C_GPIO
Quoted 25 lines · Igor Opaniuk
From: Igor Opaniuk <[email protected]>
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 ifCONFIG_SPL_BUILDis undefined andCONFIG_DM_I2Cis set to 'y',
- 1 ifCONFIG_SPL_BUILDis defined andCONFIG_SPL_DM_I2Cis 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' {} +
Quoted 4 lines
Reviewed-by Heiko Schocher <[email protected]>Reviewed-by Simon Glass <[email protected]>Signed-off-by Igor Opaniuk <[email protected]>
Signature · 8 lines
Tom -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 659 bytes Desc: not available URL: <https://lists.denx.de/pipermail/u-boot/attachments/20210210/3c120f37/attachment.sig>
PATCH v3 3/3 dm: i2c: use CONFIG_IS_ENABLED macro for DM_I2C/DM_I2C_GPIO
In reply to Igor OpaniukQuoted 69 lines
-----Original Message-----
From: Igor Opaniuk <[email protected]>
Sent: Tuesday, February 9, 2021 5:23 PM
To: u-boot at lists.denx.de
Cc: ricardo at foundries.io; Michael Scott <[email protected]>; jorge at foundries.io; sjg at chromium.org; trini at konsulko.com; Igor Opaniuk <[email protected]>; Heiko Schocher <[email protected]>; Adam Ford <[email protected]>; Alison Wang <[email protected]>; Andre Przywara <[email protected]>; Ashish Kumar <[email protected]>; Ashok Reddy Soma <[email protected]>; Bhaskar Upadhaya <[email protected]>; Biwen Li <[email protected]>; Fabio Estevam <[email protected]>; Faiz Abbas <[email protected]>; Feng Li <[email protected]>; Frieder Schrempf <[email protected]>; Hans de Goede <[email protected]>; Heinrich Schuchardt <[email protected]>; Holger Brunck <holger.brunck@hitachi- powergrids.com>; Z.q. Hou <[email protected]>; Jaehoon Chung <[email protected]>; Jagan Teki <[email protected]>; Jernej Skrabec <[email protected]>; Jonas Smedegaard <[email protected]>; Kuldeep Singh <[email protected]>; Lokesh Vutla <[email protected]>; Lukasz Majewski <[email protected]>; Madalin Bucur (OSS) <[email protected]>; Manish Tomar <[email protected]>; Marek Szyprowski <[email protected]>; Marek Vasut <[email protected]>; Masahiro Yamada <[email protected]>; Meenakshi Aggarwal <[email protected]>; Michael Walle <[email protected]>; Michal Simek <[email protected]>; Mingkai Hu <[email protected]>; dl-uboot-imx <[email protected]>; Neil Armstrong <[email protected]>; Niel Fourie <[email protected]>; Ovidiu Panait <[email protected]>; Pali Roh?r <[email protected]>; Prabhakar Kushwaha <[email protected]>; Pramod Kumar <[email protected]>; Priyanka Jain <[email protected]>; Priyanka Singh <[email protected]>; Qiang Zhao <[email protected]>; Rai Harninder <[email protected]>; Rajesh Bhagat <[email protected]>; Shengzhou Liu <[email protected]>; Stefan Bosch <[email protected]>; Stefan Roese <[email protected]>; Stefano Babic <[email protected]>; Sudhanshu Gupta <[email protected]>; Suman Anna <[email protected]>; Sumit Garg <[email protected]>; Andy Tang <[email protected]>; Udit Agarwal <[email protected]>; Vitaly Andrianov <[email protected]>; Vladimir Oltean <[email protected]>; Wasim Khan <[email protected]>; Wolfgang Denk <[email protected]>
Subject: [PATCH v3 3/3] dm: i2c: useCONFIG_IS_ENABLEDmacro for DM_I2C/DM_I2C_GPIOFrom: Igor Opaniuk <[email protected]>
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 ifCONFIG_SPL_BUILDis undefined andCONFIG_DM_I2Cis set to 'y',
- 1 ifCONFIG_SPL_BUILDis defined andCONFIG_SPL_DM_I2Cis 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' {} +
Quoted 6 lines
Reviewed-by Heiko Schocher <[email protected]>Reviewed-by Simon Glass <[email protected]>Signed-off-by Igor Opaniuk <[email protected]>---
PATCH v3 3/3 dm: i2c: use CONFIG_IS_ENABLED macro for DM_I2C/DM_I2C_GPIO
In reply to Igor OpaniukHello Igor,
Quoted 136 lines · Igor Opaniuk
From: Igor Opaniuk <[email protected]>
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 ifCONFIG_SPL_BUILDis undefined andCONFIG_DM_I2Cis set to 'y',
- 1 ifCONFIG_SPL_BUILDis defined andCONFIG_SPL_DM_I2Cis 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 <[email protected]>Reviewed-by Simon Glass <[email protected]>Signed-off-by Igor Opaniuk <[email protected]>---
(no changes since v2)
Changes in v2:
- Added R-b tags (Heiko and Simon).../include/asm/arch-fsl-layerscape/config.h | 2 +- arch/arm/include/asm/arch-lpc32xx/i2c.h | 2 +- arch/arm/include/asm/mach-imx/mxc_i2c.h | 2 +- arch/arm/include/asm/omap_i2c.h | 2 +- arch/arm/mach-imx/i2c-mxv7.c | 2 +- arch/arm/mach-keystone/ddr3_spd.c | 2 +- arch/arm/mach-kirkwood/include/mach/config.h | 2 +- arch/arm/mach-omap2/am33xx/board.c | 2 +- arch/arm/mach-omap2/am33xx/clk_synthesizer.c | 6 +- arch/arm/mach-omap2/boot-common.c | 2 +- arch/arm/mach-omap2/clocks-common.c | 2 +- arch/arm/mach-sunxi/board.c | 2 +- arch/powerpc/include/asm/fsl_i2c.h | 2 +- board/freescale/common/dcu_sii9022a.c | 2 +- board/freescale/common/diu_ch7301.c | 2 +- board/freescale/common/emc2305.c | 4 +- board/freescale/common/qixis.c | 4 +- board/freescale/common/sys_eeprom.c | 20 ++-- board/freescale/common/vid.c | 24 ++--- board/freescale/common/vsc3316_3308.c | 10 +- board/freescale/ls1012aqds/ls1012aqds.c | 2 +- board/freescale/ls1012ardb/eth.c | 2 +- board/freescale/ls1012ardb/ls1012ardb.c | 12 +-- board/freescale/ls1021aqds/dcu.c | 6 +- board/freescale/ls1021aqds/ls1021aqds.c | 2 +- board/freescale/ls1021atwr/ls1021atwr.c | 2 +- board/freescale/ls1028a/ls1028a.c | 2 +- board/freescale/ls1043aqds/ls1043aqds.c | 4 +- board/freescale/ls1046afrwy/ls1046afrwy.c | 2 +- board/freescale/ls1046aqds/ls1046aqds.c | 2 +- board/freescale/ls1088a/eth_ls1088aqds.c | 16 +-- board/freescale/ls1088a/ls1088a.c | 60 ++++++------ board/freescale/ls2080aqds/eth.c | 14 +-- board/freescale/ls2080aqds/ls2080aqds.c | 4 +- board/freescale/ls2080ardb/ls2080ardb.c | 2 +- board/freescale/lx2160a/lx2160a.c | 2 +- board/freescale/p1010rdb/p1010rdb.c | 8 +- board/freescale/p1_p2_rdb_pc/p1_p2_rdb_pc.c | 2 +- board/freescale/t102xrdb/t102xrdb.c | 2 +- board/freescale/t208xqds/t208xqds.c | 2 +- board/friendlyarm/nanopi2/onewire.c | 6 +- board/keymile/common/ivm.c | 2 +- board/samsung/common/misc.c | 2 +- board/samsung/trats/trats.c | 10 +- board/samsung/trats2/trats2.c | 10 +- board/sunxi/board.c | 2 +- board/ti/am335x/board.c | 8 +- board/ti/am335x/mux.c | 2 +- board/ti/am43xx/board.c | 12 +-- board/ti/common/board_detect.c | 4 +- board/ti/ks2_evm/board_k2g.c | 2 +- board/wandboard/wandboard.c | 4 +- cmd/eeprom.c | 6 +- cmd/i2c.c | 98 +++++++++---------- doc/driver-model/i2c-howto.rst | 2 +- drivers/ddr/fsl/main.c | 8 +- drivers/i2c/davinci_i2c.c | 4 +- drivers/i2c/designware_i2c.c | 4 +- drivers/i2c/fsl_i2c.c | 6 +- drivers/i2c/ihs_i2c.c | 42 ++++---- drivers/i2c/lpc32xx_i2c.c | 4 +- drivers/i2c/mv_i2c.c | 2 +- drivers/i2c/mvtwsi.c | 16 +-- drivers/i2c/mxc_i2c.c | 4 +- drivers/i2c/omap24xx_i2c.c | 2 +- drivers/power/palmas.c | 2 +- drivers/power/pmic/pmic_tps62362.c | 6 +- drivers/power/pmic/pmic_tps65217.c | 14 +-- drivers/power/pmic/pmic_tps65218.c | 4 +- drivers/power/pmic/pmic_tps65910.c | 6 +- drivers/power/twl4030.c | 2 +- drivers/power/twl6030.c | 2 +- drivers/tpm/tpm_atmel_twi.c | 6 +- drivers/usb/host/ohci-lpc32xx.c | 8 +- include/_exports.h | 2 +- include/config_fallbacks.h | 2 +- include/configs/MPC8548CDS.h | 2 +- include/configs/P1010RDB.h | 2 +- include/configs/P2041RDB.h | 2 +- include/configs/T102xRDB.h | 2 +- include/configs/T104xRDB.h | 2 +- include/configs/T208xQDS.h | 2 +- include/configs/T208xRDB.h | 2 +- include/configs/T4240RDB.h | 2 +- include/configs/am43xx_evm.h | 2 +- include/configs/corenet_ds.h | 2 +- include/configs/ls1012a_common.h | 2 +- include/configs/ls1021aiot.h | 2 +- include/configs/ls1021aqds.h | 2 +- include/configs/ls1021atsn.h | 2 +- include/configs/ls1021atwr.h | 2 +- include/configs/ls1028a_common.h | 2 +- include/configs/ls1043a_common.h | 2 +- include/configs/ls1046a_common.h | 2 +- include/configs/ls1088a_common.h | 2 +- include/configs/ls1088aqds.h | 2 +- include/configs/ls2080a_common.h | 2 +- include/configs/ls2080aqds.h | 2 +- include/configs/ls2080ardb.h | 2 +- include/configs/p1_p2_rdb_pc.h | 2 +-
Quoted 8 lines
include/configs/sunxi-common.h | 2 +- include/configs/ti_armv7_common.h | 2 +- include/exports.h | 2 +- include/i2c.h | 2 +- include/palmas.h | 2 +- include/twl4030.h | 2 +- include/twl6030.h | 2 +- 107 files changed, 311 insertions(+), 311 deletions(-)
Applied to u-boot-i2c.git master
Thanks!
bye,
Heiko
Signature · 3 lines
DENX Software Engineering GmbH, Managing Director: Wolfgang Denk HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: +49-8142-66989-52 Fax: +49-8142-66989-80 Email: hs at denx.de