OSDN Git Service

mm: vmalloc: show number of vmalloc pages in /proc/meminfo
[sagit-ice-cold/kernel_xiaomi_msm8998.git] / include / linux / mdss_smmu_ext.h
1 /* Copyright (c) 2017, The Linux Foundation. All rights reserved.
2  *
3  * This program is free software; you can redistribute it and/or modify
4  * it under the terms of the GNU General Public License version 2 and
5  * only version 2 as published by the Free Software Foundation.
6  *
7  * This program is distributed in the hope that it will be useful,
8  * but WITHOUT ANY WARRANTY; without even the implied warranty of
9  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
10  * GNU General Public License for more details.
11  *
12  */
13
14 #ifndef MDSS_SMMU_EXT_H
15 #define MDSS_SMMU_EXT_H
16
17 /**
18  * struct msm_smmu:interface exposed to the clients which use smmu driver.
19  * @dev:        smmu device for attach/dettach
20  * @domain:     domain for the context bank.
21  * @is_secure: bool variable to check for secure domain.
22  * @iommu_ctrl: iommu ctrl function for enable/disable attach.
23  * @secure_session_ctrl: ctrl function for enable/disable session.
24  * @wait_for_transition:function to wait till secure transtion is complete.
25  * @reg_lock /reg_unlock: Lock to access shared registers.
26  */
27 struct mdss_smmu_intf {
28         struct device *dev;
29         int domain;
30         bool is_secure;
31         int (*iommu_ctrl)(int);
32         int (*secure_session_ctrl)(int);
33         int (*wait_for_transition)(int state, int request);
34         void (*reg_lock)(void);
35         void (*reg_unlock)(void);
36         bool (*handoff_pending)(void);
37 };
38
39 typedef void (*msm_smmu_handler_t) (struct mdss_smmu_intf *smmu);
40
41 /**
42  * mdss_smmu_request_mappings: function to request smmu mappings.
43  *              Client driver can request smmu dev via this API.
44  *              dev will be returned in the same call context
45  *              if probe is not finished then dev will be
46  *              returned once it is completed.
47  * @callback:   callback function that is called to return smmu
48  *              dev
49  */
50
51 int mdss_smmu_request_mappings(msm_smmu_handler_t callback);
52
53 #endif /* MDSS_SMMU_EXT_H */