drivers: i2c: nios2: convert to DT_INST defines
Convert driver to use DT_INST_ defines. The preferred defines for drivers are DT_INST_. Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
This commit is contained in:
parent
e04a367408
commit
1b0e654aec
2 changed files with 3 additions and 7 deletions
|
@ -157,14 +157,14 @@ static struct i2c_driver_api i2c_nios2_driver_api = {
|
|||
|
||||
static struct i2c_nios2_config i2c_nios2_cfg = {
|
||||
.i2c_dev = {
|
||||
.i2c_base = (alt_u32 *)DT_I2C_0_BASE_ADDRESS,
|
||||
.i2c_base = (alt_u32 *)DT_INST_0_NIOS2_I2C_BASE_ADDRESS,
|
||||
.irq_controller_ID = I2C_0_IRQ_INTERRUPT_CONTROLLER_ID,
|
||||
.irq_ID = I2C_0_IRQ,
|
||||
.ip_freq_in_hz = DT_I2C_0_BITRATE,
|
||||
.ip_freq_in_hz = DT_INST_0_NIOS2_I2C_CLOCK_FREQUENCY,
|
||||
},
|
||||
};
|
||||
|
||||
DEVICE_AND_API_INIT(i2c_nios2_0, DT_I2C_0_NAME, &i2c_nios2_init,
|
||||
DEVICE_AND_API_INIT(i2c_nios2_0, DT_INST_0_NIOS2_I2C_LABEL, &i2c_nios2_init,
|
||||
NULL, &i2c_nios2_cfg,
|
||||
POST_KERNEL, CONFIG_KERNEL_INIT_PRIORITY_DEVICE,
|
||||
&i2c_nios2_driver_api);
|
||||
|
|
|
@ -11,7 +11,3 @@
|
|||
#define _ROM_ADDR CONFIG_FLASH_BASE_ADDRESS
|
||||
|
||||
#define _ROM_SIZE (CONFIG_FLASH_SIZE *1024)
|
||||
|
||||
#define DT_I2C_0_NAME DT_NIOS2_I2C_100200_LABEL
|
||||
#define DT_I2C_0_BASE_ADDRESS DT_NIOS2_I2C_100200_BASE_ADDRESS
|
||||
#define DT_I2C_0_BITRATE DT_NIOS2_I2C_100200_CLOCK_FREQUENCY
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue