blob: 30bf47503c84a450f2372457c426219c47097960 [file] [log] [blame]
Davide Grohmann32660f92022-04-27 16:49:07 +02001/*
Kristofer Jonssond779a082023-01-04 17:09:47 +01002 * Copyright 2022-2023 Arm Limited and/or its affiliates
Davide Grohmann32660f92022-04-27 16:49:07 +02003 *
4 * This program is free software and is provided to you under the terms of the
5 * GNU General Public License version 2 as published by the Free Software
6 * Foundation, and any use by you of this program is subject to the terms
7 * of such GNU licence.
8 *
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
13 *
14 * You should have received a copy of the GNU General Public License
15 * along with this program; if not, you can access it online at
16 * http://www.gnu.org/licenses/gpl-2.0.html.
17 *
18 * SPDX-License-Identifier: GPL-2.0-only
19 */
20
21#ifndef ETHOSU_CAPABILITIES_H
22#define ETHOSU_CAPABILITIES_H
23
24/****************************************************************************
25 * Includes
26 ****************************************************************************/
27
Davide Grohmann32660f92022-04-27 16:49:07 +020028#include "ethosu_mailbox.h"
29
30#include <linux/types.h>
31#include <linux/completion.h>
32
33/****************************************************************************
34 * Types
35 ****************************************************************************/
36
Kristofer Jonssond779a082023-01-04 17:09:47 +010037struct ethosu_core_msg_capabilities_rsp;
Davide Grohmann32660f92022-04-27 16:49:07 +020038struct ethosu_device;
39struct ethosu_uapi_device_capabilities;
40
41/**
42 * struct ethosu_capabilities - Capabilities internal struct
43 */
44struct ethosu_capabilities {
Kristofer Jonssonec477042023-01-20 13:38:13 +010045 struct device *dev;
Davide Grohmann32660f92022-04-27 16:49:07 +020046 struct completion done;
47 struct ethosu_uapi_device_capabilities *uapi;
48 struct ethosu_mailbox_msg msg;
49 int errno;
50};
51
52/****************************************************************************
53 * Functions
54 ****************************************************************************/
55
Kristofer Jonssonec477042023-01-20 13:38:13 +010056int ethosu_capabilities_request(struct device *dev,
57 struct ethosu_mailbox *mailbox,
Davide Grohmann32660f92022-04-27 16:49:07 +020058 struct ethosu_uapi_device_capabilities *uapi);
59
Kristofer Jonssonec477042023-01-20 13:38:13 +010060void ethosu_capability_rsp(struct ethosu_mailbox *mailbox,
Kristofer Jonssond779a082023-01-04 17:09:47 +010061 int msg_id,
Davide Grohmann32660f92022-04-27 16:49:07 +020062 struct ethosu_core_msg_capabilities_rsp *rsp);
63
64#endif