Mark Allyn | 9cedb39 | 2010-02-05 10:53:00 -0800 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (C) 2010 Intel Corporation. All rights reserved. |
| 3 | * |
| 4 | * This program is free software; you can redistribute it and/or |
| 5 | * modify it under the terms of version 2 of the GNU General |
| 6 | * Public License as published by the Free Software Foundation. |
| 7 | * |
| 8 | * This program is distributed in the hope that it will be |
| 9 | * useful, but WITHOUT ANY WARRANTY; without even the implied |
| 10 | * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR |
| 11 | * PURPOSE. See the GNU General Public License for more details. |
| 12 | * You should have received a copy of the GNU General Public |
| 13 | * License along with this program; if not, write to the Free |
| 14 | * Software Foundation, Inc., 59 Temple Place - Suite 330, |
| 15 | * Boston, MA 02111-1307, USA. |
| 16 | * The full GNU General Public License is included in this |
| 17 | * distribution in the file called COPYING. |
| 18 | */ |
| 19 | |
| 20 | |
| 21 | #ifndef _RAR_REGISTER_H |
| 22 | #define _RAR_REGISTER_H |
| 23 | |
Alan Cox | 375d65d | 2010-05-04 20:40:12 +0100 | [diff] [blame] | 24 | #include <linux/types.h> |
Mark Allyn | 9cedb39 | 2010-02-05 10:53:00 -0800 | [diff] [blame] | 25 | |
| 26 | /* following are used both in drivers as well as user space apps */ |
Alan Cox | 375d65d | 2010-05-04 20:40:12 +0100 | [diff] [blame] | 27 | |
| 28 | #define RAR_TYPE_VIDEO 0 |
| 29 | #define RAR_TYPE_AUDIO 1 |
| 30 | #define RAR_TYPE_IMAGE 2 |
| 31 | #define RAR_TYPE_DATA 3 |
Alan Cox | 542385e | 2009-08-06 20:44:18 +0100 | [diff] [blame] | 32 | |
Mark Allyn | 9cedb39 | 2010-02-05 10:53:00 -0800 | [diff] [blame] | 33 | #ifdef __KERNEL__ |
| 34 | |
Alan Cox | 375d65d | 2010-05-04 20:40:12 +0100 | [diff] [blame] | 35 | struct rar_device; |
Mark Allyn | 9cedb39 | 2010-02-05 10:53:00 -0800 | [diff] [blame] | 36 | |
Alan Cox | 62a8c3a | 2010-11-24 19:33:43 +0000 | [diff] [blame] | 37 | #if defined(CONFIG_RAR_REGISTER) |
Alan Cox | 375d65d | 2010-05-04 20:40:12 +0100 | [diff] [blame] | 38 | int register_rar(int num, |
| 39 | int (*callback)(unsigned long data), unsigned long data); |
| 40 | void unregister_rar(int num); |
| 41 | int rar_get_address(int rar_index, dma_addr_t *start, dma_addr_t *end); |
Mark Allyn | 9cedb39 | 2010-02-05 10:53:00 -0800 | [diff] [blame] | 42 | int rar_lock(int rar_index); |
Alan Cox | 62a8c3a | 2010-11-24 19:33:43 +0000 | [diff] [blame] | 43 | #else |
| 44 | extern void unregister_rar(int num) { } |
| 45 | extern int rar_lock(int rar_index) { return -EIO; } |
| 46 | |
| 47 | extern inline int register_rar(int num, |
| 48 | int (*callback)(unsigned long data), unsigned long data) |
| 49 | { |
| 50 | return -ENODEV; |
| 51 | } |
| 52 | |
| 53 | extern int rar_get_address(int rar_index, dma_addr_t *start, dma_addr_t *end) |
| 54 | { |
| 55 | return -ENODEV; |
| 56 | } |
| 57 | #endif /* RAR_REGISTER */ |
Alan Cox | 542385e | 2009-08-06 20:44:18 +0100 | [diff] [blame] | 58 | |
Mark Allyn | 9cedb39 | 2010-02-05 10:53:00 -0800 | [diff] [blame] | 59 | #endif /* __KERNEL__ */ |
| 60 | #endif /* _RAR_REGISTER_H */ |