diff options
author | Timo Alho <talho@nvidia.com> | 2018-10-22 16:19:36 +0300 |
---|---|---|
committer | Thierry Reding <treding@nvidia.com> | 2018-11-08 14:49:25 +0300 |
commit | d78b5bde0ffc33d20f014b3ad4d7aaac8b79d34e (patch) | |
tree | dd3766d6b88c176abde694cacc7e366777571ffd /drivers/firmware/tegra | |
parent | 651022382c7f8da46cb4872a545ee1da6d097d2a (diff) | |
download | linux-d78b5bde0ffc33d20f014b3ad4d7aaac8b79d34e.tar.xz |
firmware: tegra: Add helper to check for supported MRQs
Add a helper function to check that firmware is supporting a given MRQ
command.
Signed-off-by: Timo Alho <talho@nvidia.com>
Acked-by: Sivaram Nair <sivaramn@nvidia.com>
Acked-by: Jon Hunter <jonathanh@nvidia.com>
Signed-off-by: Thierry Reding <treding@nvidia.com>
Diffstat (limited to 'drivers/firmware/tegra')
-rw-r--r-- | drivers/firmware/tegra/bpmp.c | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/drivers/firmware/tegra/bpmp.c b/drivers/firmware/tegra/bpmp.c index a3d5b518c10e..90c6089fed84 100644 --- a/drivers/firmware/tegra/bpmp.c +++ b/drivers/firmware/tegra/bpmp.c @@ -470,6 +470,31 @@ unlock: } EXPORT_SYMBOL_GPL(tegra_bpmp_free_mrq); +bool tegra_bpmp_mrq_is_supported(struct tegra_bpmp *bpmp, unsigned int mrq) +{ + struct mrq_query_abi_request req = { .mrq = cpu_to_le32(mrq) }; + struct mrq_query_abi_response resp; + struct tegra_bpmp_message msg = { + .mrq = MRQ_QUERY_ABI, + .tx = { + .data = &req, + .size = sizeof(req), + }, + .rx = { + .data = &resp, + .size = sizeof(resp), + }, + }; + int ret; + + ret = tegra_bpmp_transfer(bpmp, &msg); + if (ret || msg.rx.ret) + return false; + + return resp.status == 0; +} +EXPORT_SYMBOL_GPL(tegra_bpmp_mrq_is_supported); + static void tegra_bpmp_mrq_handle_ping(unsigned int mrq, struct tegra_bpmp_channel *channel, void *data) |