ccdc_hw_device.h 2.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889
  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. /* Pointer to function to configure ccdc */
  44. int (*configure) (void);
  45. /* Pointer to function to set buffer type */
  46. int (*set_buftype) (enum ccdc_buftype buf_type);
  47. /* Pointer to function to get buffer type */
  48. enum ccdc_buftype (*get_buftype) (void);
  49. /* Pointer to function to set frame format */
  50. int (*set_frame_format) (enum ccdc_frmfmt frm_fmt);
  51. /* Pointer to function to get frame format */
  52. enum ccdc_frmfmt (*get_frame_format) (void);
  53. /* enumerate hw pix formats */
  54. int (*enum_pix)(u32 *hw_pix, int i);
  55. /* Pointer to function to set buffer type */
  56. u32 (*get_pixel_format) (void);
  57. /* Pointer to function to get pixel format. */
  58. int (*set_pixel_format) (u32 pixfmt);
  59. /* Pointer to function to set image window */
  60. int (*set_image_window) (struct v4l2_rect *win);
  61. /* Pointer to function to set image window */
  62. void (*get_image_window) (struct v4l2_rect *win);
  63. /* Pointer to function to get line length */
  64. unsigned int (*get_line_length) (void);
  65. /* Pointer to function to set frame buffer address */
  66. void (*setfbaddr) (unsigned long addr);
  67. /* Pointer to function to get field id */
  68. int (*getfid) (void);
  69. };
  70. struct ccdc_hw_device {
  71. /* ccdc device name */
  72. char name[32];
  73. /* module owner */
  74. struct module *owner;
  75. /* hw ops */
  76. struct ccdc_hw_ops hw_ops;
  77. };
  78. /* Used by CCDC module to register & unregister with vpfe capture driver */
  79. int vpfe_register_ccdc_device(const struct ccdc_hw_device *dev);
  80. void vpfe_unregister_ccdc_device(const struct ccdc_hw_device *dev);
  81. #endif
  82. #endif