ccdc_hw_device.h 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899
  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. * ccdc device API
  15. */
  16. #ifndef _CCDC_HW_DEVICE_H
  17. #define _CCDC_HW_DEVICE_H
  18. #ifdef __KERNEL__
  19. #include <linux/videodev2.h>
  20. #include <linux/device.h>
  21. #include <media/davinci/vpfe_types.h>
  22. #include <media/davinci/ccdc_types.h>
  23. /*
  24. * ccdc hw operations
  25. */
  26. struct ccdc_hw_ops {
  27. /* Pointer to initialize function to initialize ccdc device */
  28. int (*open) (struct device *dev);
  29. /* Pointer to deinitialize function */
  30. int (*close) (struct device *dev);
  31. /* set ccdc base address */
  32. void (*set_ccdc_base)(void *base, int size);
  33. /* Pointer to function to enable or disable ccdc */
  34. void (*enable) (int en);
  35. /* reset sbl. only for 6446 */
  36. void (*reset) (void);
  37. /* enable output to sdram */
  38. void (*enable_out_to_sdram) (int en);
  39. /* Pointer to function to set hw parameters */
  40. int (*set_hw_if_params) (struct vpfe_hw_if_param *param);
  41. /* get interface parameters */
  42. int (*get_hw_if_params) (struct vpfe_hw_if_param *param);
  43. /*
  44. * Pointer to function to set parameters. Used
  45. * for implementing VPFE_S_CCDC_PARAMS
  46. */
  47. int (*set_params) (void *params);
  48. /*
  49. * Pointer to function to get parameter. Used
  50. * for implementing VPFE_G_CCDC_PARAMS
  51. */
  52. int (*get_params) (void *params);
  53. /* Pointer to function to configure ccdc */
  54. int (*configure) (void);
  55. /* Pointer to function to set buffer type */
  56. int (*set_buftype) (enum ccdc_buftype buf_type);
  57. /* Pointer to function to get buffer type */
  58. enum ccdc_buftype (*get_buftype) (void);
  59. /* Pointer to function to set frame format */
  60. int (*set_frame_format) (enum ccdc_frmfmt frm_fmt);
  61. /* Pointer to function to get frame format */
  62. enum ccdc_frmfmt (*get_frame_format) (void);
  63. /* enumerate hw pix formats */
  64. int (*enum_pix)(u32 *hw_pix, int i);
  65. /* Pointer to function to set buffer type */
  66. u32 (*get_pixel_format) (void);
  67. /* Pointer to function to get pixel format. */
  68. int (*set_pixel_format) (u32 pixfmt);
  69. /* Pointer to function to set image window */
  70. int (*set_image_window) (struct v4l2_rect *win);
  71. /* Pointer to function to set image window */
  72. void (*get_image_window) (struct v4l2_rect *win);
  73. /* Pointer to function to get line length */
  74. unsigned int (*get_line_length) (void);
  75. /* Pointer to function to set frame buffer address */
  76. void (*setfbaddr) (unsigned long addr);
  77. /* Pointer to function to get field id */
  78. int (*getfid) (void);
  79. };
  80. struct ccdc_hw_device {
  81. /* ccdc device name */
  82. char name[32];
  83. /* module owner */
  84. struct module *owner;
  85. /* hw ops */
  86. struct ccdc_hw_ops hw_ops;
  87. };
  88. /* Used by CCDC module to register & unregister with vpfe capture driver */
  89. int vpfe_register_ccdc_device(struct ccdc_hw_device *dev);
  90. void vpfe_unregister_ccdc_device(struct ccdc_hw_device *dev);
  91. #endif
  92. #endif