0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012 #include <linux/device.h>
0013 #include <linux/err.h>
0014
0015 #ifndef __OCMEM_H__
0016 #define __OCMEM_H__
0017
0018 enum ocmem_client {
0019
0020 OCMEM_GRAPHICS = 0x0,
0021
0022
0023
0024
0025 OCMEM_CLIENT_MAX,
0026 };
0027
0028 struct ocmem;
0029
0030 struct ocmem_buf {
0031 unsigned long offset;
0032 unsigned long addr;
0033 unsigned long len;
0034 };
0035
0036 #if IS_ENABLED(CONFIG_QCOM_OCMEM)
0037
0038 struct ocmem *of_get_ocmem(struct device *dev);
0039 struct ocmem_buf *ocmem_allocate(struct ocmem *ocmem, enum ocmem_client client,
0040 unsigned long size);
0041 void ocmem_free(struct ocmem *ocmem, enum ocmem_client client,
0042 struct ocmem_buf *buf);
0043
0044 #else
0045
0046 static inline struct ocmem *of_get_ocmem(struct device *dev)
0047 {
0048 return ERR_PTR(-ENODEV);
0049 }
0050
0051 static inline struct ocmem_buf *ocmem_allocate(struct ocmem *ocmem,
0052 enum ocmem_client client,
0053 unsigned long size)
0054 {
0055 return ERR_PTR(-ENODEV);
0056 }
0057
0058 static inline void ocmem_free(struct ocmem *ocmem, enum ocmem_client client,
0059 struct ocmem_buf *buf)
0060 {
0061 }
0062
0063 #endif
0064
0065 #endif