• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  *
3  * (C) COPYRIGHT 2017 ARM Limited. All rights reserved.
4  *
5  * This program is free software and is provided to you under the terms of the
6  * GNU General Public License version 2 as published by the Free Software
7  * Foundation, and any use by you of this program is subject to the terms
8  * of such GNU licence.
9  *
10  * A copy of the licence is included with the program, and can also be obtained
11  * from Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
12  * Boston, MA  02110-1301, USA.
13  *
14  */
15 
16 
17 
18 #ifndef _PROTECTED_MODE_SWITCH_H_
19 #define _PROTECTED_MODE_SWITCH_H_
20 
21 struct protected_mode_device;
22 
23 /**
24  * struct protected_mode_ops - Callbacks for protected mode switch operations
25  *
26  * @protected_mode_enable:  Callback to enable protected mode for device
27  * @protected_mode_disable: Callback to disable protected mode for device
28  */
29 struct protected_mode_ops {
30 	/**
31 	 * protected_mode_enable() - Enable protected mode on device
32 	 * @dev:	The struct device
33 	 *
34 	 * Return: 0 on success, non-zero on error
35 	 */
36 	int (*protected_mode_enable)(
37 			struct protected_mode_device *protected_dev);
38 
39 	/**
40 	 * protected_mode_disable() - Disable protected mode on device, and
41 	 *                            reset device
42 	 * @dev:	The struct device
43 	 *
44 	 * Return: 0 on success, non-zero on error
45 	 */
46 	int (*protected_mode_disable)(
47 			struct protected_mode_device *protected_dev);
48 };
49 
50 /**
51  * struct protected_mode_device - Device structure for protected mode devices
52  *
53  * @ops  - Callbacks associated with this device
54  * @data - Pointer to device private data
55  *
56  * This structure should be registered with the platform device using
57  * platform_set_drvdata().
58  */
59 struct protected_mode_device {
60 	struct protected_mode_ops ops;
61 	void *data;
62 };
63 
64 #endif /* _PROTECTED_MODE_SWITCH_H_ */
65