From 405912c9e089a05d872f7bc496c0a9a9ce372ebb Mon Sep 17 00:00:00 2001 From: Daniel Schultz Date: Fri, 25 Oct 2024 09:30:58 -0700 Subject: [PATCH 1/2] drivers: i2c: Reorganize Driver List Organize all drivers in alphabetic order and move common parts at the beginning. Signed-off-by: Daniel Schultz --- drivers/i2c/CMakeLists.txt | 128 +++++++++++++++++-------------------- drivers/i2c/Kconfig | 47 +++++++------- 2 files changed, 84 insertions(+), 91 deletions(-) diff --git a/drivers/i2c/CMakeLists.txt b/drivers/i2c/CMakeLists.txt index 25a68ea5f8ffab..ae31aaa34e55ac 100644 --- a/drivers/i2c/CMakeLists.txt +++ b/drivers/i2c/CMakeLists.txt @@ -6,107 +6,99 @@ zephyr_library() zephyr_library_sources(i2c_common.c) +zephyr_library_sources_ifdef(CONFIG_GPIO_I2C_SWITCH gpio_i2c_switch.c) +zephyr_library_sources_ifdef(CONFIG_I2C_BITBANG i2c_bitbang.c) +zephyr_library_sources_ifdef(CONFIG_I2C_EMUL i2c_emul.c) +zephyr_library_sources_ifdef(CONFIG_I2C_GPIO i2c_gpio.c) +zephyr_library_sources_ifdef(CONFIG_I2C_SHELL i2c_shell.c) zephyr_library_sources_ifdef(CONFIG_I2C_RTIO i2c_rtio.c i2c_rtio_default.c ) -zephyr_library_sources_ifdef(CONFIG_I2C_SHELL i2c_shell.c) -zephyr_library_sources_ifdef(CONFIG_I2C_BITBANG i2c_bitbang.c) -zephyr_library_sources_ifdef(CONFIG_I2C_TELINK_B91 i2c_b91.c) -zephyr_library_sources_ifdef(CONFIG_I2C_IPROC i2c_bcm_iproc.c) -zephyr_library_sources_ifdef(CONFIG_I2C_CC13XX_CC26XX i2c_cc13xx_cc26xx.c) +zephyr_library_sources_ifdef(CONFIG_I2C_TEST i2c_test.c) +zephyr_library_sources_ifdef(CONFIG_USERSPACE i2c_handlers.c) +add_subdirectory_ifdef(CONFIG_I2C_TARGET target) + + +zephyr_library_sources_ifdef(CONFIG_I2C_AMBIQ i2c_ambiq.c) +zephyr_library_sources_ifdef(CONFIG_I2C_ANDES_ATCIIC100 i2c_andes_atciic100.c) +zephyr_library_sources_ifdef(CONFIG_I2C_CC13XX_CC26XX i2c_cc13xx_cc26xx.c) zephyr_library_sources_ifdef(CONFIG_I2C_CC32XX i2c_cc32xx.c) +zephyr_library_sources_ifdef(CONFIG_I2C_DW i2c_dw.c) +zephyr_library_sources_ifdef(CONFIG_I2C_ENE_KB1200 i2c_ene_kb1200.c) zephyr_library_sources_ifdef(CONFIG_I2C_ESP32 i2c_esp32.c) -zephyr_library_sources_ifdef(CONFIG_I2C_GPIO i2c_gpio.c) -zephyr_library_sources_ifdef(CONFIG_I2C_ITE_IT8XXX2 i2c_ite_it8xxx2.c) -zephyr_library_sources_ifdef(CONFIG_I2C_ITE_ENHANCE i2c_ite_enhance.c) +zephyr_library_sources_ifdef(CONFIG_I2C_GD32 i2c_gd32.c) +zephyr_library_sources_ifdef(CONFIG_I2C_GECKO i2c_gecko.c) zephyr_library_sources_ifdef(CONFIG_I2C_IMX i2c_imx.c) -zephyr_library_sources_ifdef(CONFIG_I2C_LPC11U6X i2c_lpc11u6x.c) -zephyr_library_sources_ifdef(CONFIG_I2C_XEC i2c_mchp_xec.c) +zephyr_library_sources_ifdef(CONFIG_I2C_IPROC i2c_bcm_iproc.c) +zephyr_library_sources_ifdef(CONFIG_I2C_INFINEON_CAT1 i2c_ifx_cat1.c) +zephyr_library_sources_ifdef(CONFIG_I2C_INFINEON_XMC4 i2c_ifx_xmc4.c) +zephyr_library_sources_ifdef(CONFIG_I2C_ITE_IT8XXX2 i2c_ite_it8xxx2.c) +zephyr_library_sources_ifdef(CONFIG_I2C_ITE_ENHANCE i2c_ite_enhance.c) +zephyr_library_sources_ifdef(CONFIG_I2C_LITEX i2c_litex.c) +zephyr_library_sources_ifdef(CONFIG_I2C_LPC11U6X i2c_lpc11u6x.c) +zephyr_library_sources_ifdef(CONFIG_I2C_MAX32 i2c_max32.c) +zephyr_library_sources_ifdef(CONFIG_I2C_MCHP_MSS i2c_mchp_mss.c) zephyr_library_sources_ifdef(CONFIG_I2C_MCUX i2c_mcux.c) zephyr_library_sources_ifdef(CONFIG_I2C_MCUX_FLEXCOMM i2c_mcux_flexcomm.c) - if(CONFIG_I2C_RTIO) zephyr_library_sources_ifdef(CONFIG_I2C_MCUX_LPI2C i2c_mcux_lpi2c_rtio.c) else() zephyr_library_sources_ifdef(CONFIG_I2C_MCUX_LPI2C i2c_mcux_lpi2c.c) endif() - -zephyr_library_sources_ifdef(CONFIG_I2C_EMUL i2c_emul.c) - +zephyr_library_sources_ifdef(CONFIG_I2C_NIOS2 i2c_nios2.c) +zephyr_library_sources_ifdef(CONFIG_I2C_NPCX i2c_npcx_controller.c) +zephyr_library_sources_ifdef(CONFIG_I2C_NPCX i2c_npcx_port.c) if(CONFIG_I2C_RTIO) - zephyr_library_sources_ifdef(CONFIG_I2C_NRFX_TWI - i2c_nrfx_twi_rtio.c - i2c_nrfx_twi_common.c - ) -else() - zephyr_library_sources_ifdef(CONFIG_I2C_NRFX_TWI - i2c_nrfx_twi.c - i2c_nrfx_twi_common.c + zephyr_library_sources_ifdef(CONFIG_I2C_NRFX_TWI + i2c_nrfx_twi_rtio.c + i2c_nrfx_twi_common.c ) -endif() - -if(CONFIG_I2C_RTIO) zephyr_library_sources_ifdef(CONFIG_I2C_NRFX_TWIM - i2c_nrfx_twim_rtio.c - i2c_nrfx_twim_common.c + i2c_nrfx_twim_rtio.c + i2c_nrfx_twim_common.c ) else() + zephyr_library_sources_ifdef(CONFIG_I2C_NRFX_TWI + i2c_nrfx_twi.c + i2c_nrfx_twi_common.c + ) zephyr_library_sources_ifdef(CONFIG_I2C_NRFX_TWIM - i2c_nrfx_twim.c - i2c_nrfx_twim_common.c + i2c_nrfx_twim.c + i2c_nrfx_twim_common.c ) endif() +zephyr_library_sources_ifdef(CONFIG_I2C_NUMAKER i2c_numaker.c) zephyr_library_sources_ifdef(CONFIG_I2C_SAM_TWI i2c_sam_twi.c) - if(CONFIG_I2C_RTIO) - zephyr_library_sources_ifdef(CONFIG_I2C_SAM_TWIHS i2c_sam_twihs_rtio.c) + zephyr_library_sources_ifdef(CONFIG_I2C_SAM_TWIHS + i2c_sam_twihs_rtio.c + ) else() - zephyr_library_sources_ifdef(CONFIG_I2C_SAM_TWIHS i2c_sam_twihs.c) + zephyr_library_sources_ifdef(CONFIG_I2C_SAM_TWIHS + i2c_sam_twihs.c + ) endif() - zephyr_library_sources_ifdef(CONFIG_I2C_SAM_TWIM i2c_sam4l_twim.c) -zephyr_library_sources_ifdef(CONFIG_I2C_SBCON i2c_sbcon.c) -zephyr_library_sources_ifdef(CONFIG_I2C_SIFIVE i2c_sifive.c) -zephyr_library_sources_ifdef(CONFIG_I2C_NIOS2 i2c_nios2.c) -zephyr_library_sources_ifdef(CONFIG_I2C_GECKO i2c_gecko.c) -zephyr_library_sources_ifdef(CONFIG_I2C_RV32M1_LPI2C i2c_rv32m1_lpi2c.c) zephyr_library_sources_ifdef(CONFIG_I2C_SAM0 i2c_sam0.c) -zephyr_library_sources_ifdef(CONFIG_I2C_LITEX i2c_litex.c) -zephyr_library_sources_ifdef(CONFIG_I2C_NPCX i2c_npcx_controller.c) -zephyr_library_sources_ifdef(CONFIG_I2C_NPCX i2c_npcx_port.c) -zephyr_library_sources_ifdef(CONFIG_I2C_DW i2c_dw.c) -zephyr_library_sources_ifdef(CONFIG_I2C_RCAR i2c_rcar.c) -zephyr_library_sources_ifdef(CONFIG_I2C_TCA954X i2c_tca954x.c) -zephyr_library_sources_ifdef(CONFIG_I2C_XEC_V2 i2c_mchp_xec_v2.c) -zephyr_library_sources_ifdef(CONFIG_I2C_GD32 i2c_gd32.c) -zephyr_library_sources_ifdef(CONFIG_I2C_INFINEON_CAT1 i2c_ifx_cat1.c) -zephyr_library_sources_ifdef(CONFIG_I2C_INFINEON_XMC4 i2c_ifx_xmc4.c) -zephyr_library_sources_ifdef(CONFIG_I2C_ANDES_ATCIIC100 i2c_andes_atciic100.c) +zephyr_library_sources_ifdef(CONFIG_I2C_SBCON i2c_sbcon.c) zephyr_library_sources_ifdef(CONFIG_I2C_SC18IM704 i2c_sc18im704.c) -zephyr_library_sources_ifdef(CONFIG_I2C_SMARTBOND i2c_smartbond.c) -zephyr_library_sources_ifdef(CONFIG_I2C_XILINX_AXI i2c_xilinx_axi.c) -zephyr_library_sources_ifdef(CONFIG_I2C_MCHP_MSS i2c_mchp_mss.c) zephyr_library_sources_ifdef(CONFIG_I2C_SEDI i2c_sedi.c) -zephyr_library_sources_ifdef(CONFIG_I2C_AMBIQ i2c_ambiq.c) -zephyr_library_sources_ifdef(CONFIG_I2C_ENE_KB1200 i2c_ene_kb1200.c) -zephyr_library_sources_ifdef(CONFIG_GPIO_I2C_SWITCH gpio_i2c_switch.c) -zephyr_library_sources_ifdef(CONFIG_I2C_NUMAKER i2c_numaker.c) -zephyr_library_sources_ifdef(CONFIG_I2C_MAX32 i2c_max32.c) - +zephyr_library_sources_ifdef(CONFIG_I2C_SIFIVE i2c_sifive.c) +zephyr_library_sources_ifdef(CONFIG_I2C_SMARTBOND i2c_smartbond.c) zephyr_library_sources_ifdef(CONFIG_I2C_STM32_V1 i2c_ll_stm32_v1.c i2c_ll_stm32.c - ) +) zephyr_library_sources_ifdef(CONFIG_I2C_STM32_V2 i2c_ll_stm32_v2.c i2c_ll_stm32.c - ) - -zephyr_library_sources_ifdef(CONFIG_RENESAS_RA_I2C_IIC i2c_renesas_ra_iic.c) - -zephyr_library_sources_ifdef(CONFIG_I2C_TEST i2c_test.c) - -zephyr_library_sources_ifdef(CONFIG_USERSPACE i2c_handlers.c) - -add_subdirectory_ifdef(CONFIG_I2C_TARGET target) +) +zephyr_library_sources_ifdef(CONFIG_RENESAS_RA_I2C_IIC i2c_renesas_ra_iic.c) +zephyr_library_sources_ifdef(CONFIG_I2C_RCAR i2c_rcar.c) +zephyr_library_sources_ifdef(CONFIG_I2C_RV32M1_LPI2C i2c_rv32m1_lpi2c.c) +zephyr_library_sources_ifdef(CONFIG_I2C_TCA954X i2c_tca954x.c) +zephyr_library_sources_ifdef(CONFIG_I2C_TELINK_B91 i2c_b91.c) +zephyr_library_sources_ifdef(CONFIG_I2C_XEC i2c_mchp_xec.c) +zephyr_library_sources_ifdef(CONFIG_I2C_XEC_V2 i2c_mchp_xec_v2.c) +zephyr_library_sources_ifdef(CONFIG_I2C_XILINX_AXI i2c_xilinx_axi.c) diff --git a/drivers/i2c/Kconfig b/drivers/i2c/Kconfig index 86e7165bf080c9..4e2d04565ed17e 100644 --- a/drivers/i2c/Kconfig +++ b/drivers/i2c/Kconfig @@ -116,43 +116,44 @@ endif # I2C_RTIO # Include these first so that any properties (e.g. defaults) below can be # overridden (by defining symbols in multiple locations) +source "drivers/i2c/target/Kconfig" +source "drivers/i2c/Kconfig.ambiq" +source "drivers/i2c/Kconfig.andes_atciic100" source "drivers/i2c/Kconfig.b91" source "drivers/i2c/Kconfig.bcm_iproc" source "drivers/i2c/Kconfig.cc13xx_cc26xx" source "drivers/i2c/Kconfig.dw" +source "drivers/i2c/Kconfig.ene" source "drivers/i2c/Kconfig.esp32" -source "drivers/i2c/target/Kconfig" +source "drivers/i2c/Kconfig.gd32" source "drivers/i2c/Kconfig.gpio" -source "drivers/i2c/Kconfig.xec" -source "drivers/i2c/Kconfig.nrfx" -source "drivers/i2c/Kconfig.i2c_emul" +source "drivers/i2c/Kconfig.ifx_cat1" +source "drivers/i2c/Kconfig.ifx_xmc4" source "drivers/i2c/Kconfig.it8xxx2" -source "drivers/i2c/Kconfig.sbcon" -source "drivers/i2c/Kconfig.sifive" -source "drivers/i2c/Kconfig.stm32" -source "drivers/i2c/Kconfig.sam0" -source "drivers/i2c/Kconfig.sam_twihs" +source "drivers/i2c/Kconfig.i2c_emul" source "drivers/i2c/Kconfig.litex" source "drivers/i2c/Kconfig.lpc11u6x" +source "drivers/i2c/Kconfig.max32" +source "drivers/i2c/Kconfig.mchp_mss" +source "drivers/i2c/Kconfig.mcux" source "drivers/i2c/Kconfig.npcx" -source "drivers/i2c/Kconfig.test" -source "drivers/i2c/Kconfig.rcar" +source "drivers/i2c/Kconfig.nrfx" +source "drivers/i2c/Kconfig.numaker" source "drivers/i2c/Kconfig.renesas_ra" -source "drivers/i2c/Kconfig.tca954x" -source "drivers/i2c/Kconfig.gd32" -source "drivers/i2c/Kconfig.ifx_cat1" -source "drivers/i2c/Kconfig.ifx_xmc4" -source "drivers/i2c/Kconfig.andes_atciic100" +source "drivers/i2c/Kconfig.rcar" +source "drivers/i2c/Kconfig.sam0" +source "drivers/i2c/Kconfig.sam_twihs" +source "drivers/i2c/Kconfig.sbcon" source "drivers/i2c/Kconfig.sc18im704" +source "drivers/i2c/Kconfig.sedi" +source "drivers/i2c/Kconfig.sifive" source "drivers/i2c/Kconfig.smartbond" +source "drivers/i2c/Kconfig.stm32" + +source "drivers/i2c/Kconfig.tca954x" +source "drivers/i2c/Kconfig.test" +source "drivers/i2c/Kconfig.xec" source "drivers/i2c/Kconfig.xilinx_axi" -source "drivers/i2c/Kconfig.mchp_mss" -source "drivers/i2c/Kconfig.sedi" -source "drivers/i2c/Kconfig.ambiq" -source "drivers/i2c/Kconfig.numaker" -source "drivers/i2c/Kconfig.mcux" -source "drivers/i2c/Kconfig.ene" -source "drivers/i2c/Kconfig.max32" config I2C_INIT_PRIORITY int "Init priority" From a77ddcc3a1ec3390d87d7d31dee8fe99f848b1fe Mon Sep 17 00:00:00 2001 From: Daniel Schultz Date: Fri, 25 Oct 2024 09:41:53 -0700 Subject: [PATCH 2/2] drivers: i2c: Rename RENESAS_RA_I2C_IIC Kconfig names follow the convention CONFIG_I2C_driver-name. Rename RENESAS_RA_I2C_IIC to I2C_RENESAS_RA_IIC to align this config name with all others. Signed-off-by: Daniel Schultz --- drivers/i2c/CMakeLists.txt | 2 +- drivers/i2c/Kconfig.renesas_ra | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/i2c/CMakeLists.txt b/drivers/i2c/CMakeLists.txt index ae31aaa34e55ac..2fdd0abf4f5378 100644 --- a/drivers/i2c/CMakeLists.txt +++ b/drivers/i2c/CMakeLists.txt @@ -94,7 +94,7 @@ zephyr_library_sources_ifdef(CONFIG_I2C_STM32_V2 i2c_ll_stm32_v2.c i2c_ll_stm32.c ) -zephyr_library_sources_ifdef(CONFIG_RENESAS_RA_I2C_IIC i2c_renesas_ra_iic.c) +zephyr_library_sources_ifdef(CONFIG_I2C_RENESAS_RA_IIC i2c_renesas_ra_iic.c) zephyr_library_sources_ifdef(CONFIG_I2C_RCAR i2c_rcar.c) zephyr_library_sources_ifdef(CONFIG_I2C_RV32M1_LPI2C i2c_rv32m1_lpi2c.c) zephyr_library_sources_ifdef(CONFIG_I2C_TCA954X i2c_tca954x.c) diff --git a/drivers/i2c/Kconfig.renesas_ra b/drivers/i2c/Kconfig.renesas_ra index bf11f2d0728873..95d036514dcdbb 100644 --- a/drivers/i2c/Kconfig.renesas_ra +++ b/drivers/i2c/Kconfig.renesas_ra @@ -3,7 +3,7 @@ # Copyright (c) 2024 Renesas Electronics Corporation # SPDX-License-Identifier: Apache-2.0 -config RENESAS_RA_I2C_IIC +config I2C_RENESAS_RA_IIC bool "Renesas RA I2C IIC Master" default y depends on DT_HAS_RENESAS_RA_IIC_ENABLED