Skip to contentSkip to conversation

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

PATCH New Sung-Chi Li 1 participant 1 message Nov 21, 2024

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

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

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.

---
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(-)
drivers/power/supply/cros_usbpd-charger.c +1 -1
index 47d3f58aa15c..c496c7c4dd2c 100644
@@ -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)

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

Best regards,

Signature · 1 line
Sung-Chi Li <[email protected]>