rar_register.h 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  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. #ifndef _RAR_REGISTER_H
  20. #define _RAR_REGISTER_H
  21. #include <linux/types.h>
  22. /* following are used both in drivers as well as user space apps */
  23. #define RAR_TYPE_VIDEO 0
  24. #define RAR_TYPE_AUDIO 1
  25. #define RAR_TYPE_IMAGE 2
  26. #define RAR_TYPE_DATA 3
  27. #ifdef __KERNEL__
  28. struct rar_device;
  29. #if defined(CONFIG_RAR_REGISTER)
  30. int register_rar(int num,
  31. int (*callback)(unsigned long data), unsigned long data);
  32. void unregister_rar(int num);
  33. int rar_get_address(int rar_index, dma_addr_t *start, dma_addr_t *end);
  34. int rar_lock(int rar_index);
  35. #else
  36. extern void unregister_rar(int num) { }
  37. extern int rar_lock(int rar_index) { return -EIO; }
  38. extern inline int register_rar(int num,
  39. int (*callback)(unsigned long data), unsigned long data)
  40. {
  41. return -ENODEV;
  42. }
  43. extern int rar_get_address(int rar_index, dma_addr_t *start, dma_addr_t *end)
  44. {
  45. return -ENODEV;
  46. }
  47. #endif /* RAR_REGISTER */
  48. #endif /* __KERNEL__ */
  49. #endif /* _RAR_REGISTER_H */