drivers: i2c: i2c_sbcon: Convert to new DT_<COMPAT>_<INSTANCE> defines
Convert i2c_sbcon driver to use new defines so we can remove the dts_fixup.h code for it. Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
This commit is contained in:
parent
1878765972
commit
da474efe80
4 changed files with 7 additions and 68 deletions
|
@ -101,19 +101,7 @@ endif # COUNTER
|
|||
if I2C
|
||||
|
||||
config I2C_SBCON
|
||||
default y
|
||||
|
||||
config I2C_SBCON_0
|
||||
default y
|
||||
|
||||
config I2C_SBCON_1
|
||||
default y
|
||||
|
||||
config I2C_SBCON_2
|
||||
default y
|
||||
|
||||
config I2C_SBCON_3
|
||||
default y
|
||||
def_bool y
|
||||
|
||||
endif # I2C
|
||||
|
||||
|
|
|
@ -65,17 +65,4 @@
|
|||
#define DT_CMSDK_AHB_GPIO3 DT_ARM_CMSDK_GPIO_40013000_BASE_ADDRESS
|
||||
#define DT_IRQ_PORT3_ALL DT_ARM_CMSDK_GPIO_40013000_IRQ_0
|
||||
|
||||
/* I2C SBCon */
|
||||
#define DT_I2C_SBCON_0_BASE_ADDR DT_ARM_VERSATILE_I2C_40022000_BASE_ADDRESS
|
||||
#define DT_I2C_SBCON_0_NAME DT_ARM_VERSATILE_I2C_40022000_LABEL
|
||||
|
||||
#define DT_I2C_SBCON_1_BASE_ADDR DT_ARM_VERSATILE_I2C_40023000_BASE_ADDRESS
|
||||
#define DT_I2C_SBCON_1_NAME DT_ARM_VERSATILE_I2C_40023000_LABEL
|
||||
|
||||
#define DT_I2C_SBCON_2_BASE_ADDR DT_ARM_VERSATILE_I2C_40029000_BASE_ADDRESS
|
||||
#define DT_I2C_SBCON_2_NAME DT_ARM_VERSATILE_I2C_40029000_LABEL
|
||||
|
||||
#define DT_I2C_SBCON_3_BASE_ADDR DT_ARM_VERSATILE_I2C_4002A000_BASE_ADDRESS
|
||||
#define DT_I2C_SBCON_3_NAME DT_ARM_VERSATILE_I2C_4002A000_LABEL
|
||||
|
||||
/* End of SoC Level DTS fixup file */
|
||||
|
|
|
@ -8,39 +8,3 @@ menuconfig I2C_SBCON
|
|||
bool "I2C driver for ARM's SBCon two-wire serial bus interface"
|
||||
depends on ARM
|
||||
select I2C_BITBANG
|
||||
|
||||
if I2C_SBCON
|
||||
|
||||
config I2C_SBCON_0
|
||||
bool "Enable SBCon device 0"
|
||||
|
||||
config I2C_SBCON_0_NAME
|
||||
depends on I2C_SBCON_0
|
||||
string "SBCon device 0 Device Name"
|
||||
default "SBCON_0"
|
||||
|
||||
config I2C_SBCON_1
|
||||
bool "Enable SBCon device 1"
|
||||
|
||||
config I2C_SBCON_1_NAME
|
||||
depends on I2C_SBCON_1
|
||||
string "SBCon device 1 Device Name"
|
||||
default "SBCON_1"
|
||||
|
||||
config I2C_SBCON_2
|
||||
bool "Enable SBCon device 2"
|
||||
|
||||
config I2C_SBCON_2_NAME
|
||||
depends on I2C_SBCON_2
|
||||
string "SBCon device 2 Device Name"
|
||||
default "SBCON_2"
|
||||
|
||||
config I2C_SBCON_3
|
||||
bool "Enable SBCon device 3"
|
||||
|
||||
config I2C_SBCON_3_NAME
|
||||
depends on I2C_SBCON_3
|
||||
string "SBCon device 0 Device Name"
|
||||
default "SBCON_3"
|
||||
|
||||
endif
|
||||
|
|
|
@ -111,27 +111,27 @@ static int i2c_sbcon_init(struct device *dev)
|
|||
static struct i2c_sbcon_context i2c_sbcon_dev_data_##_num; \
|
||||
\
|
||||
static const struct i2c_sbcon_config i2c_sbcon_dev_cfg_##_num = { \
|
||||
.sbcon = (void *)DT_I2C_SBCON_##_num##_BASE_ADDR, \
|
||||
.sbcon = (void *)DT_ARM_VERSATILE_I2C_##_num##_BASE_ADDRESS, \
|
||||
}; \
|
||||
\
|
||||
DEVICE_AND_API_INIT(i2c_sbcon_##_num, CONFIG_I2C_SBCON_##_num##_NAME, \
|
||||
DEVICE_AND_API_INIT(i2c_sbcon_##_num, DT_ARM_VERSATILE_I2C_##_num##_LABEL, \
|
||||
i2c_sbcon_init, \
|
||||
&i2c_sbcon_dev_data_##_num, \
|
||||
&i2c_sbcon_dev_cfg_##_num, \
|
||||
PRE_KERNEL_2, CONFIG_I2C_INIT_PRIORITY, &api)
|
||||
|
||||
#ifdef CONFIG_I2C_SBCON_0
|
||||
#ifdef DT_ARM_VERSATILE_I2C_0
|
||||
DEFINE_I2C_SBCON(0);
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_I2C_SBCON_1
|
||||
#ifdef DT_ARM_VERSATILE_I2C_1
|
||||
DEFINE_I2C_SBCON(1);
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_I2C_SBCON_2
|
||||
#ifdef DT_ARM_VERSATILE_I2C_2
|
||||
DEFINE_I2C_SBCON(2);
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_I2C_SBCON_3
|
||||
#ifdef DT_ARM_VERSATILE_I2C_3
|
||||
DEFINE_I2C_SBCON(3);
|
||||
#endif
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue