2 * Copyright (C) 2012 Texas Instruments Inc
4 * This program is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU General Public License as
6 * published by the Free Software Foundation version 2.
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
13 * You should have received a copy of the GNU General Public License
14 * along with this program; if not, write to the Free Software
15 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18 * Manjunath Hadli <manjunath.hadli@ti.com>
19 * Prabhakar Lad <prabhakar.lad@ti.com>
22 #ifndef _DAVINCI_VPFE_MC_CAPTURE_H
23 #define _DAVINCI_VPFE_MC_CAPTURE_H
25 #include "dm365_ipipe.h"
26 #include "dm365_ipipeif.h"
27 #include "dm365_isif.h"
28 #include "dm365_resizer.h"
29 #include "vpfe_video.h"
31 #define VPFE_MAJOR_RELEASE 0
32 #define VPFE_MINOR_RELEASE 0
34 #define VPFE_CAPTURE_VERSION_CODE ((VPFE_MAJOR_RELEASE << 16) | \
35 (VPFE_MINOR_RELEASE << 8) | \
38 /* IPIPE hardware limits */
39 #define IPIPE_MAX_OUTPUT_WIDTH_A 2176
40 #define IPIPE_MAX_OUTPUT_WIDTH_B 640
42 /* Based on max resolution supported. QXGA */
43 #define IPIPE_MAX_OUTPUT_HEIGHT_A 1536
44 /* Based on max resolution supported. VGA */
45 #define IPIPE_MAX_OUTPUT_HEIGHT_B 480
47 #define to_vpfe_device(ptr_module) \
48 container_of(ptr_module, struct vpfe_device, vpfe_##ptr_module)
49 #define to_device(ptr_module) \
50 (to_vpfe_device(ptr_module)->dev)
53 /* external registered sub devices */
54 struct v4l2_subdev **sd;
55 /* number of registered external subdevs */
56 unsigned int num_ext_subdevs;
58 struct vpfe_config *cfg;
59 /* clock ptrs for vpfe capture */
62 struct v4l2_device v4l2_dev;
65 /* IRQ number for DMA transfer completion at the image processor */
66 unsigned int imp_dma_irq;
67 /* CCDC IRQs used when CCDC/ISIF output to SDRAM */
68 unsigned int ccdc_irq0;
69 unsigned int ccdc_irq1;
71 struct media_device media_dev;
73 struct vpfe_isif_device vpfe_isif;
74 /* ipipeif subdevice */
75 struct vpfe_ipipeif_device vpfe_ipipeif;
77 struct vpfe_ipipe_device vpfe_ipipe;
78 /* resizer subdevice */
79 struct vpfe_resizer_device vpfe_resizer;
82 /* File handle structure */
85 struct vpfe_video_device *video;
86 /* Indicates whether this file handle is doing IO */
90 void mbus_to_pix(const struct v4l2_mbus_framefmt *mbus,
91 struct v4l2_pix_format *pix);
93 #endif /* _DAVINCI_VPFE_MC_CAPTURE_H */