[PATCH v12 3/5] firmware: ti_sci: Add system suspend and resume call

Kamlesh Gurudasani kamlesh at ti.com
Tue Sep 17 04:12:15 PDT 2024


Markus Schneider-Pargmann <msp at baylibre.com> writes:
...
>  
> +static int ti_sci_prepare_system_suspend(struct ti_sci_info *info)
> +{
> +	/*
> +	 * Map and validate the target Linux suspend state to TISCI LPM.
> +	 * Default is to let Device Manager select the low power mode.
> +	 */
> +	switch (pm_suspend_target_state) {
> +	case PM_SUSPEND_MEM:
> +		if (info->fw_caps & MSG_FLAG_CAPS_LPM_DM_MANAGED) {
> +			/*
> +			 * For the DM_MANAGED mode the context is reserved for
> +			 * internal use and can be 0
> +			 */
> +			return ti_sci_cmd_prepare_sleep(&info->handle,
> +							TISCI_MSG_VALUE_SLEEP_MODE_DM_MANAGED,
> +							0, 0, 0);
> +		} else {
> +			/* DM Managed is not supported by the firmware. */
> +			dev_err(info->dev, "Suspend to memory is not supported by the firmware\n");
> +			return -EOPNOTSUPP;
> +		}
> +		break;
> +	default:
> +		/*
> +		 * Do not fail if we don't have action to take for a
> +		 * specific suspend mode.
> +		 */
> +		return 0;
> +	}
> +
> +	return 0;

Looks like this statement is unreachable, may be generating a warning as well.

> +}
> +
...



More information about the linux-arm-kernel mailing list