From: "Kory Maincent (AddSecure)" The register map is configured for 16-bit accesses, but the FOLDBACK register was read and written with 8-bit accesses. All other registers use 16-bit accesses, except for the accesses done during firmware loading and boot configuration. Fix the FOLDBACK register access to use 16-bit reads and writes as well. Without this fix, setting power limit on ports 4 to 7 may not work properly. Signed-off-by: Kory Maincent (AddSecure) Fixes: 7f076ce3f1733 ("net: pse-pd: tps23881: Add support for power limit and measurement features") Reported-by: Sashiko Closes: https://sashiko.dev/#/bug/linux-200958a2-c64a-48bf-b1f6-1584a6f2b35d --- drivers/net/pse-pd/tps23881.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/net/pse-pd/tps23881.c b/drivers/net/pse-pd/tps23881.c index 4b1eec0fb045e..0354457c35eec 100644 --- a/drivers/net/pse-pd/tps23881.c +++ b/drivers/net/pse-pd/tps23881.c @@ -173,7 +173,7 @@ static int tps23881_pi_enable_manual_pol(struct tps23881_priv *priv, int id) u8 chan; u16 val; - ret = i2c_smbus_read_byte_data(client, TPS23881_REG_FOLDBACK); + ret = i2c_smbus_read_word_data(client, TPS23881_REG_FOLDBACK); if (ret < 0) return ret; @@ -183,7 +183,7 @@ static int tps23881_pi_enable_manual_pol(struct tps23881_priv *priv, int id) */ chan = priv->port[id].chan[0]; val = tps23881_set_val(ret, chan, 0, BIT(chan % 4), BIT(chan % 4)); - return i2c_smbus_write_byte_data(client, TPS23881_REG_FOLDBACK, val); + return i2c_smbus_write_word_data(client, TPS23881_REG_FOLDBACK, val); } static int tps23881_pi_enable(struct pse_controller_dev *pcdev, int id) -- 2.43.0