Skip to content

Commit 8dafb9a

Browse files
bkbreitedkalowsk
authored andcommitted
drivers: i2c_dw: Fix HOLD_TIME_TO_TICKS divider
CONFIG_I2C_DW_CLOCK_SPEED is defined in MHz in Kconfig.dw however the HOLD_TIME_TO_TICKS macro is assuming it is in Hz resulting in any configuration of i2c_sda_hold_time_ns defaulting to 1 tick. Signed-off-by: Brandon Breitenstein <brandon.breitenstein@intel.com>
1 parent 94282a2 commit 8dafb9a

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

drivers/i2c/i2c_dw.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@ typedef int (*i2c_api_check_bus_t)(const struct device *dev);
145145
/* convert sda hold time in nanoseconds to DW I2C clock ticks at build time */
146146
#define HOLD_TIME_TO_TICKS(i2c_sda_hold_time_ns) \
147147
((uint32_t)DIV_ROUND_UP((uint64_t)(CONFIG_I2C_DW_CLOCK_SPEED) * (i2c_sda_hold_time_ns), \
148-
1000000000ULL))
148+
1000ULL))
149149

150150
struct i2c_dw_rom_config {
151151
DEVICE_MMIO_ROM;

0 commit comments

Comments
 (0)