Skip to content

Commit 8f6825b

Browse files
gmarullcarlescufi
authored andcommitted
[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 <[email protected]> (cherry picked from commit 92c3495)
1 parent f2ec083 commit 8f6825b

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

drivers/i2c/i2c_nrfx_twi_common.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,8 @@ extern "C" {
2222
: I2C_NRFX_TWI_INVALID_FREQUENCY)
2323
#define I2C(idx) DT_NODELABEL(i2c##idx)
2424
#define I2C_FREQUENCY(idx) \
25-
I2C_NRFX_TWI_FREQUENCY(DT_PROP(I2C(idx), clock_frequency))
25+
I2C_NRFX_TWI_FREQUENCY(DT_PROP_OR(I2C(idx), clock_frequency, \
26+
I2C_BITRATE_STANDARD))
2627

2728
struct i2c_nrfx_twi_common_data {
2829
uint32_t dev_config;

drivers/i2c/i2c_nrfx_twim_common.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,8 @@ extern "C" {
2828

2929
#define I2C(idx) DT_NODELABEL(i2c##idx)
3030
#define I2C_HAS_PROP(idx, prop) DT_NODE_HAS_PROP(I2C(idx), prop)
31-
#define I2C_FREQUENCY(idx) I2C_NRFX_TWIM_FREQUENCY(DT_PROP(I2C(idx), clock_frequency))
31+
#define I2C_FREQUENCY(idx) I2C_NRFX_TWIM_FREQUENCY(DT_PROP_OR(I2C(idx), clock_frequency, \
32+
I2C_BITRATE_STANDARD))
3233

3334
struct i2c_nrfx_twim_common_config {
3435
nrfx_twim_t twim;

0 commit comments

Comments
 (0)