blob: d91f4c154a7d623f623fc03f4072d14844b349a5 [file] [log] [blame]
Larry Bassel1daa0f02011-12-06 15:55:58 -08001/*
2 *
3 * Copyright (c) 2011, Code Aurora Forum. All rights reserved.
4 *
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License version 2 and
7 * only version 2 as published by the Free Software Foundation.
8 *
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
13 *
14 */
15#ifndef _FMEM_H_
16#define _FMEM_H_
17
Laura Abbott77497922011-12-13 11:32:19 -080018#include <linux/vmalloc.h>
19
Larry Bassel1daa0f02011-12-06 15:55:58 -080020struct fmem_platform_data {
21 unsigned long phys;
22 unsigned long size;
23};
24
25struct fmem_data {
26 unsigned long phys;
27 void *virt;
Laura Abbott77497922011-12-13 11:32:19 -080028 struct vm_struct *area;
Larry Bassel1daa0f02011-12-06 15:55:58 -080029 unsigned long size;
30};
31
32enum fmem_state {
33 FMEM_UNINITIALIZED = 0,
34 FMEM_C_STATE,
35 FMEM_T_STATE,
36 FMEM_O_STATE,
37};
38
Laura Abbott99f87d22011-12-14 16:01:54 -080039#ifdef CONFIG_QCACHE
Larry Bassel1daa0f02011-12-06 15:55:58 -080040struct fmem_data *fmem_get_info(void);
41int fmem_set_state(enum fmem_state);
42void lock_fmem_state(void);
43void unlock_fmem_state(void);
Laura Abbott77497922011-12-13 11:32:19 -080044void *fmem_map_virtual_area(int cacheability);
45void fmem_unmap_virtual_area(void);
Laura Abbott99f87d22011-12-14 16:01:54 -080046#else
47static inline struct fmem_data *fmem_get_info(void) { return NULL; }
48static inline int fmem_set_state(enum fmem_state f) { return -ENODEV; }
49static inline void lock_fmem_state(void) { return; }
50static inline void unlock_fmem_state(void) { return; }
Laura Abbott77497922011-12-13 11:32:19 -080051static inline void *fmem_map_virtual_area(int cacheability) { return NULL; }
52static inline void fmem_unmap_virtual_area(void) { return; }
Laura Abbott99f87d22011-12-14 16:01:54 -080053#endif
54
Larry Bassel1daa0f02011-12-06 15:55:58 -080055
56#endif