1 /* SPDX-License-Identifier: MIT */ 2 /* 3 * Copyright © 2020 Intel Corporation 4 */ 5 6 #ifndef _I915_PXP_TEE_INTERFACE_H_ 7 #define _I915_PXP_TEE_INTERFACE_H_ 8 9 #include <linux/mutex.h> 10 #include <linux/device.h> 11 12 /** 13 * struct i915_pxp_component_ops - ops for PXP services. 14 * @owner: Module providing the ops 15 * @send: sends data to PXP 16 * @receive: receives data from PXP 17 */ 18 struct i915_pxp_component_ops { 19 /** 20 * @owner: owner of the module provding the ops 21 */ 22 struct module *owner; 23 24 int (*send)(struct device *dev, const void *message, size_t size); 25 int (*recv)(struct device *dev, void *buffer, size_t size); 26 }; 27 28 /** 29 * struct i915_pxp_component - Used for communication between i915 and TEE 30 * drivers for the PXP services 31 * @tee_dev: device that provide the PXP service from TEE Bus. 32 * @pxp_ops: Ops implemented by TEE driver, used by i915 driver. 33 */ 34 struct i915_pxp_component { 35 struct device *tee_dev; 36 const struct i915_pxp_component_ops *ops; 37 38 /* To protect the above members. */ 39 struct mutex mutex; 40 }; 41 42 #endif /* _I915_TEE_PXP_INTERFACE_H_ */ 43