Skip to content
Commit 71c49ee9 authored by Binbin Zhou's avatar Binbin Zhou Committed by Andi Shyti
Browse files

i2c: ls2x: Fix frequency division register access



According to the chip manual, the I2C register access type of
Loongson-2K2000/LS7A is "B", so we can only access registers in byte
form (readb()/writeb()).

Although Loongson-2K0500/Loongson-2K1000 do not have similar
constraints, register accesses in byte form also behave correctly.

Also, in hardware, the frequency division registers are defined as two
separate registers (high 8-bit and low 8-bit), so we just access them
directly as bytes.

Fixes: 015e61f0 ("i2c: ls2x: Add driver for Loongson-2K/LS7A I2C controller")
Co-developed-by: default avatarHongliang Wang <wanghongliang@loongson.cn>
Signed-off-by: default avatarHongliang Wang <wanghongliang@loongson.cn>
Signed-off-by: default avatarBinbin Zhou <zhoubinbin@loongson.cn>
Cc: stable@vger.kernel.org # v6.3+
Reviewed-by: default avatarAndy Shevchenko <andy@kernel.org>
Signed-off-by: default avatarAndi Shyti <andi.shyti@kernel.org>
Link: https://lore.kernel.org/r/20250220125612.1910990-1-zhoubinbin@loongson.cn
parent dd1998e2
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment