Re: [PATCH] platform/chrome: cros_ec_lightbar: Check if ec supports suspend commands
From: Tzung-Bi Shih
Date: Sun Oct 26 2025 - 23:54:16 EST
On Thu, Oct 23, 2025 at 07:42:40PM -0400, Brady Norander wrote:
> The Chromebook Pixel 2013 (Link)'s ec does not support the lightbar manual suspend commands.
> As a result, attempting to suspend the device fails and prints the following error:
>
> cros-ec-lightbar cros-ec-lightbar.3.auto: PM: dpm_run_callback(): platform_pm_suspend returns -22
> cros-ec-lightbar cros-ec-lightbar.3.auto: PM: failed to suspend: error -22
> PM: Some devices failed to suspend, or early wake event detected
Thanks for looking on this.
> @@ -550,7 +557,7 @@ static int cros_ec_lightbar_probe(struct platform_device *pd)
> return -ENODEV;
>
> /* Take control of the lightbar from the EC. */
> - lb_manual_suspend_ctrl(ec_dev, 1);
> + has_manual_suspend = (lb_manual_suspend_ctrl(ec_dev, 1) >= 0);
The driver doesn't emit an error if lb_manual_suspend_ctrl() returns an
error in the first place. However, I think `has_manual_suspend` should
only check for -22. E.g.:
has_manual_suspend = lb_manual_suspend_ctrl(...) != -EINVAL;