From a80df9670ef4b15d214252e6894b9dee2bf72fa8 Mon Sep 17 00:00:00 2001 From: Gerard Marull-Paretas Date: Tue, 15 Oct 2024 09:50:04 +0200 Subject: [PATCH] [nrf fromtree] drivers: i2c: nrfx_twi[m]: default to I2C_BITRATE_STANDARD Instead of forcing a definition in Devicetree. Right now, SoC DT files contain this default, but it should not be part of SoC DT files. Signed-off-by: Gerard Marull-Paretas (cherry picked from commit 92c34954935aeb19f243c05b51b65a16496485fe) --- drivers/i2c/i2c_nrfx_twi_common.h | 3 ++- drivers/i2c/i2c_nrfx_twim_common.h | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/drivers/i2c/i2c_nrfx_twi_common.h b/drivers/i2c/i2c_nrfx_twi_common.h index a8925d3f75b..a3e9847bab5 100644 --- a/drivers/i2c/i2c_nrfx_twi_common.h +++ b/drivers/i2c/i2c_nrfx_twi_common.h @@ -22,7 +22,8 @@ extern "C" { : I2C_NRFX_TWI_INVALID_FREQUENCY) #define I2C(idx) DT_NODELABEL(i2c##idx) #define I2C_FREQUENCY(idx) \ - I2C_NRFX_TWI_FREQUENCY(DT_PROP(I2C(idx), clock_frequency)) + I2C_NRFX_TWI_FREQUENCY(DT_PROP_OR(I2C(idx), clock_frequency, \ + I2C_BITRATE_STANDARD)) struct i2c_nrfx_twi_common_data { uint32_t dev_config; diff --git a/drivers/i2c/i2c_nrfx_twim_common.h b/drivers/i2c/i2c_nrfx_twim_common.h index 23811a225e7..ba7fa72f019 100644 --- a/drivers/i2c/i2c_nrfx_twim_common.h +++ b/drivers/i2c/i2c_nrfx_twim_common.h @@ -28,7 +28,8 @@ extern "C" { #define I2C(idx) DT_NODELABEL(i2c##idx) #define I2C_HAS_PROP(idx, prop) DT_NODE_HAS_PROP(I2C(idx), prop) -#define I2C_FREQUENCY(idx) I2C_NRFX_TWIM_FREQUENCY(DT_PROP(I2C(idx), clock_frequency)) +#define I2C_FREQUENCY(idx) I2C_NRFX_TWIM_FREQUENCY(DT_PROP_OR(I2C(idx), clock_frequency, \ + I2C_BITRATE_STANDARD)) struct i2c_nrfx_twim_common_config { nrfx_twim_t twim;