Commit 4dbb9e23 authored by Stephan Gerhold's avatar Stephan Gerhold Committed by Bjorn Andersson

soc: qcom: smem: Add qcom_smem_is_available()

Avoid having to look up a dummy item from SMEM to detect if it is
already available or if we need to defer probing.
Reviewed-by: default avatarKonrad Dybcio <konrad.dybcio@linaro.org>
Signed-off-by: default avatarStephan Gerhold <stephan@gerhold.net>
Link: https://lore.kernel.org/r/20230531-rpm-rproc-v3-7-a07dcdefd918@gerhold.netSigned-off-by: default avatarBjorn Andersson <andersson@kernel.org>
parent 9a2c674e
......@@ -359,6 +359,17 @@ static struct qcom_smem *__smem;
/* Timeout (ms) for the trylock of remote spinlocks */
#define HWSPINLOCK_TIMEOUT 1000
/**
* qcom_smem_is_available() - Check if SMEM is available
*
* Return: true if SMEM is available, false otherwise.
*/
bool qcom_smem_is_available(void)
{
return !!__smem;
}
EXPORT_SYMBOL(qcom_smem_is_available);
static int qcom_smem_alloc_private(struct qcom_smem *smem,
struct smem_partition *part,
unsigned item,
......
......@@ -4,6 +4,7 @@
#define QCOM_SMEM_HOST_ANY -1
bool qcom_smem_is_available(void);
int qcom_smem_alloc(unsigned host, unsigned item, size_t size);
void *qcom_smem_get(unsigned host, unsigned item, size_t *size);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment