On 6/29/26 3:01 PM, George Moussalem via B4 Relay wrote:
> From: George Moussalem <[email protected]>
> 
> The Bluetooth subsystem (BTSS) on the IPQ5018 SoC supports setting power
> modes which are required to be configured through a Secure Channel
> Manager (SCM) call to TrustZone. However, not all Trusted Execution
> Environment (QSEE) images support this call, so first check if the call
> is available.
> 
> Signed-off-by: George Moussalem <[email protected]>
> ---

I'm amazed changing this setting is a secure operation

[...]

> +/**
> + * qcom_scm_pas_set_bluetooth_power_mode() - Configure power optimization 
> mode
> + *                                        for the Bluetooth subsystem (BTSS)
> + * @pas_id:  peripheral authentication service id
> + * @val:     0x0 for normal operation, 0x4 for ECO mode

If there's just two values, maybe we should make this take a `bool eco_mode`?

> + *
> + * Return: 0 on success, negative errno on failure.
> + * Returns -EOPNOTSUPP if the firmware configuration call is unavailable.
> + */
> +int qcom_scm_pas_set_bluetooth_power_mode(u32 pas_id, u32 val)
> +{
> +     if (!__qcom_scm_is_call_available(__scm->dev, QCOM_SCM_SVC_PIL,
> +                                       QCOM_SCM_PIL_PAS_BT_PWR_MODE))
> +             return -EOPNOTSUPP;
> +
> +     return __qcom_scm_pas_set_bluetooth_power_mode(pas_id, val);

Let's just inline the whole definition here - it's single-use anyway

Konrad

Reply via email to