]> git.itanic.dy.fi Git - linux-stable/commit
i2c: mlxbf: Fix frequency calculation
authorAsmaa Mnebhi <asmaa@nvidia.com>
Tue, 20 Sep 2022 17:47:29 +0000 (13:47 -0400)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 28 Sep 2022 09:32:26 +0000 (11:32 +0200)
commit4925e5e94ae9ff4dda3a59031354b5f4a75d7e41
tree5d99ce77f52bbacbac0ee9e0ac3accf4fe49c6e8
parent3b5ab5fbe69ebbee5692c72b05071a43fc0655d8
i2c: mlxbf: Fix frequency calculation

[ Upstream commit 37f071ec327b04c83d47637c5e5c2199b39899ca ]

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: b5b5b32081cd206b (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>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/i2c/busses/i2c-mlxbf.c