ccdc_hw_device.h 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110
  1. /*
  2. * Copyright (C) 2008-2009 Texas Instruments Inc
  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 as published by
  6. * the Free Software Foundation; either version 2 of the License, or
  7. * (at your option) any later version.
  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. * You should have received a copy of the GNU General Public License
  15. * along with this program; if not, write to the Free Software
  16. * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  17. *
  18. * ccdc device API
  19. */
  20. #ifndef _CCDC_HW_DEVICE_H
  21. #define _CCDC_HW_DEVICE_H
  22. #ifdef __KERNEL__
  23. #include <linux/videodev2.h>
  24. #include <linux/device.h>
  25. #include <media/davinci/vpfe_types.h>
  26. #include <media/davinci/ccdc_types.h>
  27. /*
  28. * ccdc hw operations
  29. */
  30. struct ccdc_hw_ops {
  31. /* Pointer to initialize function to initialize ccdc device */
  32. int (*open) (struct device *dev);
  33. /* Pointer to deinitialize function */
  34. int (*close) (struct device *dev);
  35. /* set ccdc base address */
  36. void (*set_ccdc_base)(void *base, int size);
  37. /* Pointer to function to enable or disable ccdc */
  38. void (*enable) (int en);
  39. /* reset sbl. only for 6446 */
  40. void (*reset) (void);
  41. /* enable output to sdram */
  42. void (*enable_out_to_sdram) (int en);
  43. /* Pointer to function to set hw parameters */
  44. int (*set_hw_if_params) (struct vpfe_hw_if_param *param);
  45. /* get interface parameters */
  46. int (*get_hw_if_params) (struct vpfe_hw_if_param *param);
  47. /*
  48. * Pointer to function to set parameters. Used
  49. * for implementing VPFE_S_CCDC_PARAMS
  50. */
  51. int (*set_params) (void *params);
  52. /*
  53. * Pointer to function to get parameter. Used
  54. * for implementing VPFE_G_CCDC_PARAMS
  55. */
  56. int (*get_params) (void *params);
  57. /* Pointer to function to configure ccdc */
  58. int (*configure) (void);
  59. /* Pointer to function to set buffer type */
  60. int (*set_buftype) (enum ccdc_buftype buf_type);
  61. /* Pointer to function to get buffer type */
  62. enum ccdc_buftype (*get_buftype) (void);
  63. /* Pointer to function to set frame format */
  64. int (*set_frame_format) (enum ccdc_frmfmt frm_fmt);
  65. /* Pointer to function to get frame format */
  66. enum ccdc_frmfmt (*get_frame_format) (void);
  67. /* enumerate hw pix formats */
  68. int (*enum_pix)(u32 *hw_pix, int i);
  69. /* Pointer to function to set buffer type */
  70. u32 (*get_pixel_format) (void);
  71. /* Pointer to function to get pixel format. */
  72. int (*set_pixel_format) (u32 pixfmt);
  73. /* Pointer to function to set image window */
  74. int (*set_image_window) (struct v4l2_rect *win);
  75. /* Pointer to function to set image window */
  76. void (*get_image_window) (struct v4l2_rect *win);
  77. /* Pointer to function to get line length */
  78. unsigned int (*get_line_length) (void);
  79. /* Query CCDC control IDs */
  80. int (*queryctrl)(struct v4l2_queryctrl *qctrl);
  81. /* Set CCDC control */
  82. int (*set_control)(struct v4l2_control *ctrl);
  83. /* Get CCDC control */
  84. int (*get_control)(struct v4l2_control *ctrl);
  85. /* Pointer to function to set frame buffer address */
  86. void (*setfbaddr) (unsigned long addr);
  87. /* Pointer to function to get field id */
  88. int (*getfid) (void);
  89. };
  90. struct ccdc_hw_device {
  91. /* ccdc device name */
  92. char name[32];
  93. /* module owner */
  94. struct module *owner;
  95. /* hw ops */
  96. struct ccdc_hw_ops hw_ops;
  97. };
  98. /* Used by CCDC module to register & unregister with vpfe capture driver */
  99. int vpfe_register_ccdc_device(struct ccdc_hw_device *dev);
  100. void vpfe_unregister_ccdc_device(struct ccdc_hw_device *dev);
  101. #endif
  102. #endif