blob: 0376427d81f2b5eb2f8d60deb8001dd455dd2897 [file] [log] [blame]
Praneeth Paladugu6e6fbdb2017-01-16 15:43:01 -08001/*
2 * Copyright (c) 2014, 2016-2017, The Linux Foundation. All rights reserved.
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License version 2 and
6 * only version 2 as published by the Free Software Foundation.
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
12 */
13
14#ifndef __VMEM_H__
15#define __VMEM_H__
16
17#define VMEM_ERROR(value) \
18 do { \
19 pr_info("%s : Fatal Level = %d\n", KBUILD_MODNAME, value);\
20 BUG_ON(value); \
21 } while (0)
22
23#if (defined CONFIG_MSM_VIDC_VMEM) || (defined CONFIG_MSM_VIDC_VMEM_MODULE)
24
25int vmem_allocate(size_t size, phys_addr_t *addr);
26void vmem_free(phys_addr_t to_free);
27
28#else
29
30static inline int vmem_allocate(size_t size, phys_addr_t *addr)
31{
32 return -ENODEV;
33}
34
35static inline void vmem_free(phys_addr_t to_free)
36{
37}
38
39#endif
40
41#endif /* __VMEM_H__ */