Skip to content

Commit

Permalink
drivers: i2c: nrfx_twi[m]: default to I2C_BITRATE_STANDARD
Browse files Browse the repository at this point in the history
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]>
  • Loading branch information
gmarull authored and carlescufi committed Dec 3, 2024
1 parent d73656a commit cc4a9d4
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))

Check notice on line 27 in drivers/i2c/i2c_nrfx_twi_common.h

View workflow job for this annotation

GitHub Actions / Run compliance checks on patch series (PR)

You may want to run clang-format on this change

drivers/i2c/i2c_nrfx_twi_common.h:27 -#define I2C_FREQUENCY(idx) \ - I2C_NRFX_TWI_FREQUENCY(DT_PROP_OR(I2C(idx), clock_frequency, \ - I2C_BITRATE_STANDARD)) +#define I2C_FREQUENCY(idx) \ + I2C_NRFX_TWI_FREQUENCY(DT_PROP_OR(I2C(idx), clock_frequency, I2C_BITRATE_STANDARD))

Check notice on line 27 in drivers/i2c/i2c_nrfx_twi_common.h

View workflow job for this annotation

GitHub Actions / Run compliance checks on patch series (PR)

You may want to run clang-format on this change

drivers/i2c/i2c_nrfx_twi_common.h:27 -#define I2C_FREQUENCY(idx) \ - I2C_NRFX_TWI_FREQUENCY(DT_PROP_OR(I2C(idx), clock_frequency, \ - I2C_BITRATE_STANDARD)) +#define I2C_FREQUENCY(idx) \ + 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))

Check notice on line 33 in drivers/i2c/i2c_nrfx_twim_common.h

View workflow job for this annotation

GitHub Actions / Run compliance checks on patch series (PR)

You may want to run clang-format on this change

drivers/i2c/i2c_nrfx_twim_common.h:33 -#define I2C_FREQUENCY(idx) I2C_NRFX_TWIM_FREQUENCY(DT_PROP_OR(I2C(idx), clock_frequency, \ - I2C_BITRATE_STANDARD)) +#define I2C_FREQUENCY(idx) \ + I2C_NRFX_TWIM_FREQUENCY(DT_PROP_OR(I2C(idx), clock_frequency, I2C_BITRATE_STANDARD))

Check notice on line 33 in drivers/i2c/i2c_nrfx_twim_common.h

View workflow job for this annotation

GitHub Actions / Run compliance checks on patch series (PR)

You may want to run clang-format on this change

drivers/i2c/i2c_nrfx_twim_common.h:33 -#define I2C_FREQUENCY(idx) I2C_NRFX_TWIM_FREQUENCY(DT_PROP_OR(I2C(idx), clock_frequency, \ - I2C_BITRATE_STANDARD)) +#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 cc4a9d4

Please sign in to comment.