summaryrefstree
path: root/kernel/drivers/nfc/cold_reset.h
blob: 6c41b1b6fbaeb8cc81e2e33cac8a928f1a8dfb5d (plain)
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
/******************************************************************************
 *  Copyright (C) 2020 NXP
 *   *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that 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, write to the Free Software
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 *
 ******************************************************************************/
#ifndef _NFC_COMMON_H_
#define _NFC_COMMON_H_

#define MSG_NFCC_RSP              0x40
#define MSG_PROP_GID              0x0F
#define ESE_CLD_RST_OID           0x1E
#define RST_PROTECTION_CMD_INDEX  0x03

#define RST_PROTECTION_OID        0x1F
#define RST_PROTECTION_ENABLED    0x08

enum ese_cold_reset_origin {
	ESE_COLD_RESET_NOT_REQUESTED = 0x00,
	ESE_COLD_RESET_SOURCE_NFC = 0x01,
	ESE_COLD_RESET_SOURCE_SPI = 0x02,
	ESE_COLD_RESET_SOURCE_UWB = 0x04,
};

void ese_reset_resource_init(void);
void ese_reset_resource_destroy(void);
void rcv_prop_resp_status(const char * const buf);
int ese_cold_reset(enum ese_cold_reset_origin src);
int do_reset_protection(bool type);
void set_force_reset(bool value);
#endif /* _NFC_COMMON_H_ */