]> git.baikalelectronics.ru Git - kernel.git/commit
i2c: mlxbf: Fix frequency calculation
authorAsmaa Mnebhi <asmaa@nvidia.com>
Tue, 20 Sep 2022 17:47:29 +0000 (13:47 -0400)
committerWolfram Sang <wsa@kernel.org>
Wed, 21 Sep 2022 19:43:19 +0000 (21:43 +0200)
commitb368d9dd43a0c64a9e524558bde54857c24c53a7
treee460d9f7939b79dc26b0da93eccff384662d0a32
parent2ecbc862f93d02001f4e5d578b5e910e5a0221fc
i2c: mlxbf: Fix frequency calculation

The i2c-mlxbf.c driver is currently broken because there is a bug
in the calculation of the frequency. core_f, core_r and core_od
are components read from hardware registers and are used to
compute the frequency used to compute different timing parameters.
The shifting mechanism used to get core_f, core_r and core_od is
wrong. Use FIELD_GET to mask and shift the bitfields properly.

Fixes: 96f60cc0548added (i2c: mlxbf: I2C SMBus driver for Mellanox BlueField SoC)
Reviewed-by: Khalil Blaiech <kblaiech@nvidia.com>
Signed-off-by: Asmaa Mnebhi <asmaa@nvidia.com>
Signed-off-by: Wolfram Sang <wsa@kernel.org>
drivers/i2c/busses/i2c-mlxbf.c