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
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
|
/* SPDX-License-Identifier: GPL-2.0-only */
/*
* Copyright (c) 2020, The Linux Foundation. All rights reserved.
*
*/
#ifndef __HH_DBL_H
#define __HH_DBL_H
#include "hh_common.h"
typedef void (*dbl_rx_cb_t)(int irq, void *priv_data);
enum hh_dbl_label {
HH_DBL_TUI_LABEL,
HH_DBL_TUI_NEURON_BLK0,
HH_DBL_TUI_NEURON_BLK1,
HH_DBL_TUI_QRTR,
HH_DBL_LABEL_MAX
};
/* Possible flags to pass for send, set_mask, read, reset */
#define HH_DBL_NONBLOCK BIT(32)
#if IS_ENABLED(CONFIG_HH_DBL)
void *hh_dbl_tx_register(enum hh_dbl_label label);
void *hh_dbl_rx_register(enum hh_dbl_label label, dbl_rx_cb_t rx_cb,
void *priv);
int hh_dbl_tx_unregister(void *dbl_client_desc);
int hh_dbl_rx_unregister(void *dbl_client_desc);
int hh_dbl_send(void *dbl_client_desc, uint64_t *newflags,
const unsigned long flags);
int hh_dbl_set_mask(void *dbl_client_desc, hh_dbl_flags_t enable_mask,
hh_dbl_flags_t ack_mask, const unsigned long flags);
int hh_dbl_read_and_clean(void *dbl_client_desc, hh_dbl_flags_t *clear_flags,
const unsigned long flags);
int hh_dbl_reset(void *dbl_client_desc, const unsigned long flags);
int hh_dbl_populate_cap_info(enum hh_dbl_label label, u64 cap_id,
int direction, int rx_irq);
#else
static inline void *hh_dbl_tx_register(enum hh_dbl_label label)
{
return ERR_PTR(-ENODEV);
}
static inline void *hh_dbl_rx_register(enum hh_dbl_label label,
dbl_rx_cb_t rx_cb,
void *priv)
{
return ERR_PTR(-ENODEV);
}
static inline int hh_dbl_tx_unregister(void *dbl_client_desc)
{
return ERR_PTR(-ENODEV);
}
static inline int hh_dbl_rx_unregister(void *dbl_client_desc)
{
return ERR_PTR(-ENODEV);
}
static inline int hh_dbl_send(void *dbl_client_desc, uint64_t *newflags,
const unsigned long flags)
{
return -EINVAL;
}
static inline int hh_dbl_set_mask(void *dbl_client_desc,
hh_dbl_flags_t enable_mask,
hh_dbl_flags_t ack_mask,
const unsigned long flags)
{
return -EINVAL;
}
static inline int hh_dbl_read_and_clean(void *dbl_client_desc,
hh_dbl_flags_t *clear_flags,
const unsigned long flags)
{
return -EINVAL;
}
static inline int hh_dbl_reset(void *dbl_client_desc, const unsigned long flags)
{
return -EINVAL;
}
static inline int hh_dbl_populate_cap_info(enum hh_dbl_label label, u64 cap_id,
int direction, int rx_irq)
{
return -EINVAL;
}
#endif
#endif
|