diff mbox series

power:supply: cros_usbpd-charger: update command version to set limit

Message ID 20241121-fix_power_limit_ec_cmd_version-v1-1-2f15dcf32084@chromium.org (mailing list archive)
State New
Headers show
Series power:supply: cros_usbpd-charger: update command version to set limit | expand

Commit Message

Sung-Chi Li Nov. 21, 2024, 5:18 a.m. UTC
The request that sets the power limit on the ChromeOS Embedded
Controller (EC) requires the command version to be 1, so update the
command version used in the driver.

Signed-off-by: Sung-Chi Li <lschyi@chromium.org>
---
The ChromeOS Embedded Controller (EC) exposes a set of commands (host
commands) for communicating with it, and the kernel driver
cros_usbpd-charger uses host commands to get and set power settings on
EC.

The host command needs to specify the version in the sent request. The
set external power command (EC_CMD_EXTERNAL_POWER_LIMIT) requires the
command version to be 1, so update that setting in the driver.
---
 drivers/power/supply/cros_usbpd-charger.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)


---
base-commit: ac24e26aa08fe026804f678599f805eb13374a5d
change-id: 20241121-fix_power_limit_ec_cmd_version-6f2d75ad84b5

Best regards,
diff mbox series

Patch

diff --git a/drivers/power/supply/cros_usbpd-charger.c b/drivers/power/supply/cros_usbpd-charger.c
index 47d3f58aa15c..c496c7c4dd2c 100644
--- a/drivers/power/supply/cros_usbpd-charger.c
+++ b/drivers/power/supply/cros_usbpd-charger.c
@@ -325,7 +325,7 @@  static int cros_usbpd_charger_set_ext_power_limit(struct charger_data *charger,
 	req.current_lim = current_lim;
 	req.voltage_lim = voltage_lim;
 
-	ret = cros_usbpd_charger_ec_command(charger, 0,
+	ret = cros_usbpd_charger_ec_command(charger, 1,
 					    EC_CMD_EXTERNAL_POWER_LIMIT,
 					    &req, sizeof(req), NULL, 0);
 	if (ret < 0)