summaryrefslogtreecommitdiffstats
path: root/include/linux/tegra_l1ss_kernel_interface.h
blob: 5e08a8bf203b0bca385b5bd692c9d8bcc229018f (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
/*
 * Copyright (c) 2021, NVIDIA CORPORATION.  All rights reserved.
 *
 * This program is free software; you can redistribute it and/or modify it
 * under the terms and conditions of the GNU General Public License,
 * version 2, as published by the Free Software Foundation.
 *
 * This program is distributed in the hope it will be useful, but WITHOUT
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
 * more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */

#ifndef _L1SS_INTERFACE_H
#define _L1SS_INTERFACE_H

#include <linux/types.h>
#include <linux/tegra_l1ss_ioctl.h>
#include <linux/platform/tegra/l1ss_datatypes.h>

typedef int (*client_callback)(l1ss_cli_callback_param, void *);

typedef struct {
	nv_guard_client_id_t id;
	client_callback cli_callback;
	void *data;
} client_param_t;

struct l1ss_client_param_node {
	struct list_head cli_list;
	client_param_t *p;
};

#ifdef CONFIG_TEGRA_SAFETY
int l1ss_submit_rq(nv_guard_request_t *req, bool can_sleep);
int l1ss_register_client(client_param_t *p);
int l1ss_deregister_client(nv_guard_client_id_t id);
int l1ss_notify_client(l1ss_cli_callback_param val);
void l1ss_set_ivc_ready(void);
#else
inline int l1ss_register_client(client_param_t *p)
{
	return -ENODEV;
}

inline int l1ss_deregister_client(nv_guard_client_id_t id)
{
	return 0;
}

inline int l1ss_notify_client(l1ss_cli_callback_param val)
{
	return 0;
}

inline int l1ss_submit_rq(nv_guard_request_t *req, bool can_sleep)
{
	return 0;
}
#endif
#endif