sh_mobile_meram.h 2.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495
  1. #ifndef __VIDEO_SH_MOBILE_MERAM_H__
  2. #define __VIDEO_SH_MOBILE_MERAM_H__
  3. /* For sh_mobile_meram_info.addr_mode */
  4. enum {
  5. SH_MOBILE_MERAM_MODE0 = 0,
  6. SH_MOBILE_MERAM_MODE1
  7. };
  8. enum {
  9. SH_MOBILE_MERAM_PF_NV = 0,
  10. SH_MOBILE_MERAM_PF_RGB,
  11. SH_MOBILE_MERAM_PF_NV24
  12. };
  13. struct sh_mobile_meram_priv;
  14. /*
  15. * struct sh_mobile_meram_info - MERAM platform data
  16. * @reserved_icbs: Bitmask of reserved ICBs (for instance used through UIO)
  17. */
  18. struct sh_mobile_meram_info {
  19. int addr_mode;
  20. u32 reserved_icbs;
  21. struct sh_mobile_meram_priv *priv;
  22. struct platform_device *pdev;
  23. };
  24. /* icb config */
  25. struct sh_mobile_meram_icb_cfg {
  26. unsigned int meram_size; /* MERAM Buffer Size to use */
  27. };
  28. struct sh_mobile_meram_cfg {
  29. struct sh_mobile_meram_icb_cfg icb[2];
  30. };
  31. #if defined(CONFIG_FB_SH_MOBILE_MERAM) || \
  32. defined(CONFIG_FB_SH_MOBILE_MERAM_MODULE)
  33. unsigned long sh_mobile_meram_alloc(struct sh_mobile_meram_info *meram_dev,
  34. size_t size);
  35. void sh_mobile_meram_free(struct sh_mobile_meram_info *meram_dev,
  36. unsigned long mem, size_t size);
  37. void *sh_mobile_meram_cache_alloc(struct sh_mobile_meram_info *dev,
  38. const struct sh_mobile_meram_cfg *cfg,
  39. unsigned int xres, unsigned int yres,
  40. unsigned int pixelformat,
  41. unsigned int *pitch);
  42. void sh_mobile_meram_cache_free(struct sh_mobile_meram_info *dev, void *data);
  43. void sh_mobile_meram_cache_update(struct sh_mobile_meram_info *dev, void *data,
  44. unsigned long base_addr_y,
  45. unsigned long base_addr_c,
  46. unsigned long *icb_addr_y,
  47. unsigned long *icb_addr_c);
  48. #else
  49. static inline unsigned long
  50. sh_mobile_meram_alloc(struct sh_mobile_meram_info *meram_dev, size_t size)
  51. {
  52. return 0;
  53. }
  54. static inline void
  55. sh_mobile_meram_free(struct sh_mobile_meram_info *meram_dev,
  56. unsigned long mem, size_t size)
  57. {
  58. }
  59. static inline void *
  60. sh_mobile_meram_cache_alloc(struct sh_mobile_meram_info *dev,
  61. const struct sh_mobile_meram_cfg *cfg,
  62. unsigned int xres, unsigned int yres,
  63. unsigned int pixelformat,
  64. unsigned int *pitch)
  65. {
  66. return ERR_PTR(-ENODEV);
  67. }
  68. static inline void
  69. sh_mobile_meram_cache_free(struct sh_mobile_meram_info *dev, void *data)
  70. {
  71. }
  72. static inline void
  73. sh_mobile_meram_cache_update(struct sh_mobile_meram_info *dev, void *data,
  74. unsigned long base_addr_y,
  75. unsigned long base_addr_c,
  76. unsigned long *icb_addr_y,
  77. unsigned long *icb_addr_c)
  78. {
  79. }
  80. #endif
  81. #endif /* __VIDEO_SH_MOBILE_MERAM_H__ */