Skip to content

Commit

Permalink
[nrf fromtree] drivers: i2c: nrfx_twi[m]: default to I2C_BITRATE_STAN…
Browse files Browse the repository at this point in the history
…DARD

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)
  • Loading branch information
gmarull authored and carlescufi committed Dec 3, 2024
1 parent d96f9a8 commit 6c5454b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
3 changes: 2 additions & 1 deletion drivers/i2c/i2c_nrfx_twi_common.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
3 changes: 2 additions & 1 deletion drivers/i2c/i2c_nrfx_twim_common.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 6c5454b

Please sign in to comment.