Path: blob/master/include/media/davinci/dm644x_ccdc.h
10818 views
/*1* Copyright (C) 2006-2009 Texas Instruments Inc2*3* This program is free software; you can redistribute it and/or modify4* it under the terms of the GNU General Public License as published by5* the Free Software Foundation; either version 2 of the License, or6* (at your option) any later version.7*8* This program is distributed in the hope that it will be useful,9* but WITHOUT ANY WARRANTY; without even the implied warranty of10* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the11* GNU General Public License for more details.12*13* You should have received a copy of the GNU General Public License14* along with this program; if not, write to the Free Software15* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA16*/17#ifndef _DM644X_CCDC_H18#define _DM644X_CCDC_H19#include <media/davinci/ccdc_types.h>20#include <media/davinci/vpfe_types.h>2122/* enum for No of pixel per line to be avg. in Black Clamping*/23enum ccdc_sample_length {24CCDC_SAMPLE_1PIXELS,25CCDC_SAMPLE_2PIXELS,26CCDC_SAMPLE_4PIXELS,27CCDC_SAMPLE_8PIXELS,28CCDC_SAMPLE_16PIXELS29};3031/* enum for No of lines in Black Clamping */32enum ccdc_sample_line {33CCDC_SAMPLE_1LINES,34CCDC_SAMPLE_2LINES,35CCDC_SAMPLE_4LINES,36CCDC_SAMPLE_8LINES,37CCDC_SAMPLE_16LINES38};3940/* enum for Alaw gama width */41enum ccdc_gama_width {42CCDC_GAMMA_BITS_15_6,43CCDC_GAMMA_BITS_14_5,44CCDC_GAMMA_BITS_13_4,45CCDC_GAMMA_BITS_12_3,46CCDC_GAMMA_BITS_11_2,47CCDC_GAMMA_BITS_10_1,48CCDC_GAMMA_BITS_09_049};5051enum ccdc_data_size {52CCDC_DATA_16BITS,53CCDC_DATA_15BITS,54CCDC_DATA_14BITS,55CCDC_DATA_13BITS,56CCDC_DATA_12BITS,57CCDC_DATA_11BITS,58CCDC_DATA_10BITS,59CCDC_DATA_8BITS60};6162/* structure for ALaw */63struct ccdc_a_law {64/* Enable/disable A-Law */65unsigned char enable;66/* Gama Width Input */67enum ccdc_gama_width gama_wd;68};6970/* structure for Black Clamping */71struct ccdc_black_clamp {72unsigned char enable;73/* only if bClampEnable is TRUE */74enum ccdc_sample_length sample_pixel;75/* only if bClampEnable is TRUE */76enum ccdc_sample_line sample_ln;77/* only if bClampEnable is TRUE */78unsigned short start_pixel;79/* only if bClampEnable is TRUE */80unsigned short sgain;81/* only if bClampEnable is FALSE */82unsigned short dc_sub;83};8485/* structure for Black Level Compensation */86struct ccdc_black_compensation {87/* Constant value to subtract from Red component */88char r;89/* Constant value to subtract from Gr component */90char gr;91/* Constant value to subtract from Blue component */92char b;93/* Constant value to subtract from Gb component */94char gb;95};9697/* structure for fault pixel correction */98struct ccdc_fault_pixel {99/* Enable or Disable fault pixel correction */100unsigned char enable;101/* Number of fault pixel */102unsigned short fp_num;103/* Address of fault pixel table */104unsigned int fpc_table_addr;105};106107/* Structure for CCDC configuration parameters for raw capture mode passed108* by application109*/110struct ccdc_config_params_raw {111/* data size value from 8 to 16 bits */112enum ccdc_data_size data_sz;113/* Structure for Optional A-Law */114struct ccdc_a_law alaw;115/* Structure for Optical Black Clamp */116struct ccdc_black_clamp blk_clamp;117/* Structure for Black Compensation */118struct ccdc_black_compensation blk_comp;119/* Structure for Fault Pixel Module Configuration */120struct ccdc_fault_pixel fault_pxl;121};122123124#ifdef __KERNEL__125#include <linux/io.h>126/* Define to enable/disable video port */127#define FP_NUM_BYTES 4128/* Define for extra pixel/line and extra lines/frame */129#define NUM_EXTRAPIXELS 8130#define NUM_EXTRALINES 8131132/* settings for commonly used video formats */133#define CCDC_WIN_PAL {0, 0, 720, 576}134/* ntsc square pixel */135#define CCDC_WIN_VGA {0, 0, (640 + NUM_EXTRAPIXELS), (480 + NUM_EXTRALINES)}136137/* Structure for CCDC configuration parameters for raw capture mode */138struct ccdc_params_raw {139/* pixel format */140enum ccdc_pixfmt pix_fmt;141/* progressive or interlaced frame */142enum ccdc_frmfmt frm_fmt;143/* video window */144struct v4l2_rect win;145/* field id polarity */146enum vpfe_pin_pol fid_pol;147/* vertical sync polarity */148enum vpfe_pin_pol vd_pol;149/* horizontal sync polarity */150enum vpfe_pin_pol hd_pol;151/* interleaved or separated fields */152enum ccdc_buftype buf_type;153/*154* enable to store the image in inverse155* order in memory(bottom to top)156*/157unsigned char image_invert_enable;158/* configurable paramaters */159struct ccdc_config_params_raw config_params;160};161162struct ccdc_params_ycbcr {163/* pixel format */164enum ccdc_pixfmt pix_fmt;165/* progressive or interlaced frame */166enum ccdc_frmfmt frm_fmt;167/* video window */168struct v4l2_rect win;169/* field id polarity */170enum vpfe_pin_pol fid_pol;171/* vertical sync polarity */172enum vpfe_pin_pol vd_pol;173/* horizontal sync polarity */174enum vpfe_pin_pol hd_pol;175/* enable BT.656 embedded sync mode */176int bt656_enable;177/* cb:y:cr:y or y:cb:y:cr in memory */178enum ccdc_pixorder pix_order;179/* interleaved or separated fields */180enum ccdc_buftype buf_type;181};182#endif183#endif /* _DM644X_CCDC_H */184185186