blob: 04e5354bdef56439448e2863404cb32f73426dbd [file] [log] [blame]
Davide Grohmann32660f92022-04-27 16:49:07 +02001/*
Mikael Olssond4ad9e52024-02-07 11:22:26 +01002 * SPDX-FileCopyrightText: Copyright 2022-2024 Arm Limited and/or its affiliates <open-source-office@arm.com>
3 * SPDX-License-Identifier: GPL-2.0-only
Davide Grohmann32660f92022-04-27 16:49:07 +02004 *
5 * This program is free software and is provided to you under the terms of the
6 * GNU General Public License version 2 as published by the Free Software
7 * Foundation, and any use by you of this program is subject to the terms
8 * of such GNU licence.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, you can access it online at
17 * http://www.gnu.org/licenses/gpl-2.0.html.
Davide Grohmann32660f92022-04-27 16:49:07 +020018 */
19
Mikael Olsson16be2852024-02-12 09:56:56 +010020#ifndef ETHOSU_RPMSG_CAPABILITES_H
21#define ETHOSU_RPMSG_CAPABILITES_H
Davide Grohmann32660f92022-04-27 16:49:07 +020022
23/****************************************************************************
24 * Includes
25 ****************************************************************************/
26
Mikael Olssond4ad9e52024-02-07 11:22:26 +010027#include <rpmsg/ethosu_rpmsg_mailbox.h>
Davide Grohmann32660f92022-04-27 16:49:07 +020028
29#include <linux/types.h>
30#include <linux/completion.h>
31
32/****************************************************************************
33 * Types
34 ****************************************************************************/
35
Mikael Olsson16be2852024-02-12 09:56:56 +010036struct ethosu_rpmsg_capabilities_rsp;
Davide Grohmann32660f92022-04-27 16:49:07 +020037struct ethosu_device;
38struct ethosu_uapi_device_capabilities;
39
40/**
Mikael Olsson16be2852024-02-12 09:56:56 +010041 * struct ethosu_rpmsg_capabilities - Capabilities internal struct
Davide Grohmann32660f92022-04-27 16:49:07 +020042 */
Mikael Olsson16be2852024-02-12 09:56:56 +010043struct ethosu_rpmsg_capabilities {
Kristofer Jonssonec477042023-01-20 13:38:13 +010044 struct device *dev;
Davide Grohmann32660f92022-04-27 16:49:07 +020045 struct completion done;
46 struct ethosu_uapi_device_capabilities *uapi;
Mikael Olsson16be2852024-02-12 09:56:56 +010047 struct ethosu_rpmsg_mailbox_msg msg;
Davide Grohmann32660f92022-04-27 16:49:07 +020048 int errno;
49};
50
51/****************************************************************************
52 * Functions
53 ****************************************************************************/
54
Mikael Olsson16be2852024-02-12 09:56:56 +010055int ethosu_rpmsg_capabilities_request(struct device *dev,
56 struct ethosu_rpmsg_mailbox *mailbox,
57 struct ethosu_uapi_device_capabilities *uapi);
Davide Grohmann32660f92022-04-27 16:49:07 +020058
Mikael Olsson16be2852024-02-12 09:56:56 +010059void ethosu_capability_rsp(struct ethosu_rpmsg_mailbox *mailbox,
Kristofer Jonssond779a082023-01-04 17:09:47 +010060 int msg_id,
Mikael Olsson16be2852024-02-12 09:56:56 +010061 struct ethosu_rpmsg_capabilities_rsp *rsp);
Davide Grohmann32660f92022-04-27 16:49:07 +020062
Mikael Olsson16be2852024-02-12 09:56:56 +010063#endif /* ETHOSU_RPMSG_CAPABILITES_H */