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