GNU Linux-libre 4.14.290-gnu1
[releases.git] / drivers / staging / ccree / ssi_sysfs.h
1 /*
2  * Copyright (C) 2012-2017 ARM Limited or its affiliates.
3  *
4  * This program is free software; you can redistribute it and/or modify
5  * it under the terms of the GNU General Public License version 2 as
6  * published by the Free Software Foundation.
7  *
8  * This program is distributed in the hope that it will be useful,
9  * but WITHOUT ANY WARRANTY; without even the implied warranty of
10  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
11  * GNU General Public License for more details.
12  *
13  * You should have received a copy of the GNU General Public License
14  * along with this program; if not, see <http://www.gnu.org/licenses/>.
15  */
16
17 /* \file ssi_sysfs.h
18  * ARM CryptoCell sysfs APIs
19  */
20
21 #ifndef __SSI_SYSFS_H__
22 #define __SSI_SYSFS_H__
23
24 #include <asm/timex.h>
25
26 /* forward declaration */
27 struct ssi_drvdata;
28
29 enum stat_phase {
30         STAT_PHASE_0 = 0,
31         STAT_PHASE_1,
32         STAT_PHASE_2,
33         STAT_PHASE_3,
34         STAT_PHASE_4,
35         STAT_PHASE_5,
36         STAT_PHASE_6,
37         MAX_STAT_PHASES,
38 };
39
40 enum stat_op {
41         STAT_OP_TYPE_NULL = 0,
42         STAT_OP_TYPE_ENCODE,
43         STAT_OP_TYPE_DECODE,
44         STAT_OP_TYPE_SETKEY,
45         STAT_OP_TYPE_GENERIC,
46         MAX_STAT_OP_TYPES,
47 };
48
49 int ssi_sysfs_init(struct kobject *sys_dev_obj, struct ssi_drvdata *drvdata);
50 void ssi_sysfs_fini(void);
51 void update_host_stat(unsigned int op_type, unsigned int phase, cycles_t result);
52 void update_cc_stat(unsigned int op_type, unsigned int phase, unsigned int elapsed_cycles);
53 void display_all_stat_db(void);
54
55 #endif /*__SSI_SYSFS_H__*/