diff options
| author | Muralidharan Karicheri <m-karicheri2@ti.com> | 2009-07-03 04:23:07 -0400 |
|---|---|---|
| committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2009-09-18 23:18:15 -0400 |
| commit | dd2ceb1a4028dc9644ed4df80cea9c05ca0b5f6d (patch) | |
| tree | 275bc7ebf9dbb24aa9264d6cc572221b15971aaf /include | |
| parent | 638c97400829a43eecc2ad924a0f5143b6c56a6d (diff) | |
V4L/DVB (12250): v4l: dm355 ccdc module for vpfe capture driver
Adds ccdc hw module for DM355 CCDC. This registers with the bridge
driver a set of hw_ops for configuring the CCDC for a specific
decoder device connected to vpfe.
Reviewed by: Hans Verkuil <hverkuil@xs4all.nl>
Reviewed by: Laurent Pinchart <laurent.pinchart@skynet.be>
Reviewed by: Mauro Carvalho Chehab <mchehab@infradead.org>
Signed-off-by: Muralidharan Karicheri <m-karicheri2@ti.com>
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'include')
| -rw-r--r-- | include/media/davinci/dm355_ccdc.h | 321 |
1 files changed, 321 insertions, 0 deletions
diff --git a/include/media/davinci/dm355_ccdc.h b/include/media/davinci/dm355_ccdc.h new file mode 100644 index 000000000000..df8a7b107477 --- /dev/null +++ b/include/media/davinci/dm355_ccdc.h | |||
| @@ -0,0 +1,321 @@ | |||
| 1 | /* | ||
| 2 | * Copyright (C) 2005-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 | #ifndef _DM355_CCDC_H | ||
| 19 | #define _DM355_CCDC_H | ||
| 20 | #include <media/davinci/ccdc_types.h> | ||
| 21 | #include <media/davinci/vpfe_types.h> | ||
| 22 | |||
| 23 | /* enum for No of pixel per line to be avg. in Black Clamping */ | ||
| 24 | enum ccdc_sample_length { | ||
| 25 | CCDC_SAMPLE_1PIXELS, | ||
| 26 | CCDC_SAMPLE_2PIXELS, | ||
| 27 | CCDC_SAMPLE_4PIXELS, | ||
| 28 | CCDC_SAMPLE_8PIXELS, | ||
| 29 | CCDC_SAMPLE_16PIXELS | ||
| 30 | }; | ||
| 31 | |||
| 32 | /* enum for No of lines in Black Clamping */ | ||
| 33 | enum ccdc_sample_line { | ||
| 34 | CCDC_SAMPLE_1LINES, | ||
| 35 | CCDC_SAMPLE_2LINES, | ||
| 36 | CCDC_SAMPLE_4LINES, | ||
| 37 | CCDC_SAMPLE_8LINES, | ||
| 38 | CCDC_SAMPLE_16LINES | ||
| 39 | }; | ||
| 40 | |||
| 41 | /* enum for Alaw gama width */ | ||
| 42 | enum ccdc_gamma_width { | ||
| 43 | CCDC_GAMMA_BITS_13_4, | ||
| 44 | CCDC_GAMMA_BITS_12_3, | ||
| 45 | CCDC_GAMMA_BITS_11_2, | ||
| 46 | CCDC_GAMMA_BITS_10_1, | ||
| 47 | CCDC_GAMMA_BITS_09_0 | ||
| 48 | }; | ||
| 49 | |||
| 50 | enum ccdc_colpats { | ||
| 51 | CCDC_RED, | ||
| 52 | CCDC_GREEN_RED, | ||
| 53 | CCDC_GREEN_BLUE, | ||
| 54 | CCDC_BLUE | ||
| 55 | }; | ||
| 56 | |||
| 57 | struct ccdc_col_pat { | ||
| 58 | enum ccdc_colpats olop; | ||
| 59 | enum ccdc_colpats olep; | ||
| 60 | enum ccdc_colpats elop; | ||
| 61 | enum ccdc_colpats elep; | ||
| 62 | }; | ||
| 63 | |||
| 64 | enum ccdc_datasft { | ||
| 65 | CCDC_DATA_NO_SHIFT, | ||
| 66 | CCDC_DATA_SHIFT_1BIT, | ||
| 67 | CCDC_DATA_SHIFT_2BIT, | ||
| 68 | CCDC_DATA_SHIFT_3BIT, | ||
| 69 | CCDC_DATA_SHIFT_4BIT, | ||
| 70 | CCDC_DATA_SHIFT_5BIT, | ||
| 71 | CCDC_DATA_SHIFT_6BIT | ||
| 72 | }; | ||
| 73 | |||
| 74 | enum ccdc_data_size { | ||
| 75 | CCDC_DATA_16BITS, | ||
| 76 | CCDC_DATA_15BITS, | ||
| 77 | CCDC_DATA_14BITS, | ||
| 78 | CCDC_DATA_13BITS, | ||
| 79 | CCDC_DATA_12BITS, | ||
| 80 | CCDC_DATA_11BITS, | ||
| 81 | CCDC_DATA_10BITS, | ||
| 82 | CCDC_DATA_8BITS | ||
| 83 | }; | ||
| 84 | enum ccdc_mfilt1 { | ||
| 85 | CCDC_NO_MEDIAN_FILTER1, | ||
| 86 | CCDC_AVERAGE_FILTER1, | ||
| 87 | CCDC_MEDIAN_FILTER1 | ||
| 88 | }; | ||
| 89 | |||
| 90 | enum ccdc_mfilt2 { | ||
| 91 | CCDC_NO_MEDIAN_FILTER2, | ||
| 92 | CCDC_AVERAGE_FILTER2, | ||
| 93 | CCDC_MEDIAN_FILTER2 | ||
| 94 | }; | ||
| 95 | |||
| 96 | /* structure for ALaw */ | ||
| 97 | struct ccdc_a_law { | ||
| 98 | /* Enable/disable A-Law */ | ||
| 99 | unsigned char enable; | ||
| 100 | /* Gama Width Input */ | ||
| 101 | enum ccdc_gamma_width gama_wd; | ||
| 102 | }; | ||
| 103 | |||
| 104 | /* structure for Black Clamping */ | ||
| 105 | struct ccdc_black_clamp { | ||
| 106 | /* only if bClampEnable is TRUE */ | ||
| 107 | unsigned char b_clamp_enable; | ||
| 108 | /* only if bClampEnable is TRUE */ | ||
| 109 | enum ccdc_sample_length sample_pixel; | ||
| 110 | /* only if bClampEnable is TRUE */ | ||
| 111 | enum ccdc_sample_line sample_ln; | ||
| 112 | /* only if bClampEnable is TRUE */ | ||
| 113 | unsigned short start_pixel; | ||
| 114 | /* only if bClampEnable is FALSE */ | ||
| 115 | unsigned short sgain; | ||
| 116 | unsigned short dc_sub; | ||
| 117 | }; | ||
| 118 | |||
| 119 | /* structure for Black Level Compensation */ | ||
| 120 | struct ccdc_black_compensation { | ||
| 121 | /* Constant value to subtract from Red component */ | ||
| 122 | unsigned char r; | ||
| 123 | /* Constant value to subtract from Gr component */ | ||
| 124 | unsigned char gr; | ||
| 125 | /* Constant value to subtract from Blue component */ | ||
| 126 | unsigned char b; | ||
| 127 | /* Constant value to subtract from Gb component */ | ||
| 128 | unsigned char gb; | ||
| 129 | }; | ||
| 130 | |||
| 131 | struct ccdc_float { | ||
| 132 | int integer; | ||
| 133 | unsigned int decimal; | ||
| 134 | }; | ||
| 135 | |||
| 136 | #define CCDC_CSC_COEFF_TABLE_SIZE 16 | ||
| 137 | /* structure for color space converter */ | ||
| 138 | struct ccdc_csc { | ||
| 139 | unsigned char enable; | ||
| 140 | /* | ||
| 141 | * S8Q5. Use 2 decimal precision, user values range from -3.00 to 3.99. | ||
| 142 | * example - to use 1.03, set integer part as 1, and decimal part as 3 | ||
| 143 | * to use -1.03, set integer part as -1 and decimal part as 3 | ||
| 144 | */ | ||
| 145 | struct ccdc_float coeff[CCDC_CSC_COEFF_TABLE_SIZE]; | ||
| 146 | }; | ||
| 147 | |||
| 148 | /* Structures for Vertical Defect Correction*/ | ||
| 149 | enum ccdc_vdf_csl { | ||
| 150 | CCDC_VDF_NORMAL, | ||
| 151 | CCDC_VDF_HORZ_INTERPOL_SAT, | ||
| 152 | CCDC_VDF_HORZ_INTERPOL | ||
| 153 | }; | ||
| 154 | |||
| 155 | enum ccdc_vdf_cuda { | ||
| 156 | CCDC_VDF_WHOLE_LINE_CORRECT, | ||
| 157 | CCDC_VDF_UPPER_DISABLE | ||
| 158 | }; | ||
| 159 | |||
| 160 | enum ccdc_dfc_mwr { | ||
| 161 | CCDC_DFC_MWR_WRITE_COMPLETE, | ||
| 162 | CCDC_DFC_WRITE_REG | ||
| 163 | }; | ||
| 164 | |||
| 165 | enum ccdc_dfc_mrd { | ||
| 166 | CCDC_DFC_READ_COMPLETE, | ||
| 167 | CCDC_DFC_READ_REG | ||
| 168 | }; | ||
| 169 | |||
| 170 | enum ccdc_dfc_ma_rst { | ||
| 171 | CCDC_DFC_INCR_ADDR, | ||
| 172 | CCDC_DFC_CLR_ADDR | ||
| 173 | }; | ||
| 174 | |||
| 175 | enum ccdc_dfc_mclr { | ||
| 176 | CCDC_DFC_CLEAR_COMPLETE, | ||
| 177 | CCDC_DFC_CLEAR | ||
| 178 | }; | ||
| 179 | |||
| 180 | struct ccdc_dft_corr_ctl { | ||
| 181 | enum ccdc_vdf_csl vdfcsl; | ||
| 182 | enum ccdc_vdf_cuda vdfcuda; | ||
| 183 | unsigned int vdflsft; | ||
| 184 | }; | ||
| 185 | |||
| 186 | struct ccdc_dft_corr_mem_ctl { | ||
| 187 | enum ccdc_dfc_mwr dfcmwr; | ||
| 188 | enum ccdc_dfc_mrd dfcmrd; | ||
| 189 | enum ccdc_dfc_ma_rst dfcmarst; | ||
| 190 | enum ccdc_dfc_mclr dfcmclr; | ||
| 191 | }; | ||
| 192 | |||
| 193 | #define CCDC_DFT_TABLE_SIZE 16 | ||
| 194 | /* | ||
| 195 | * Main Structure for vertical defect correction. Vertical defect | ||
