From patchwork Wed Jul 11 15:39:26 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Manjunath Hadli X-Patchwork-Id: 1183431 Return-Path: X-Original-To: patchwork-davinci@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from comal.ext.ti.com (comal.ext.ti.com [198.47.26.152]) by patchwork1.kernel.org (Postfix) with ESMTP id E40603FC8E for ; Wed, 11 Jul 2012 15:41:43 +0000 (UTC) Received: from dlelxv30.itg.ti.com ([172.17.2.17]) by comal.ext.ti.com (8.13.7/8.13.7) with ESMTP id q6BFdngZ004227; Wed, 11 Jul 2012 10:39:49 -0500 Received: from DLEE74.ent.ti.com (dlee74.ent.ti.com [157.170.170.8]) by dlelxv30.itg.ti.com (8.13.8/8.13.8) with ESMTP id q6BFdn4d023152; Wed, 11 Jul 2012 10:39:49 -0500 Received: from dlelxv23.itg.ti.com (172.17.1.198) by DLEE74.ent.ti.com (157.170.170.8) with Microsoft SMTP Server id 14.1.323.3; Wed, 11 Jul 2012 10:39:48 -0500 Received: from linux.omap.com (dlelxs01.itg.ti.com [157.170.227.31]) by dlelxv23.itg.ti.com (8.13.8/8.13.8) with ESMTP id q6BFdmsr023106; Wed, 11 Jul 2012 10:39:48 -0500 Received: from linux.omap.com (localhost [127.0.0.1]) by linux.omap.com (Postfix) with ESMTP id DAB6580627; Wed, 11 Jul 2012 10:39:48 -0500 (CDT) X-Original-To: davinci-linux-open-source@linux.davincidsp.com Delivered-To: davinci-linux-open-source@linux.davincidsp.com Received: from dbdp20.itg.ti.com (dbdp20.itg.ti.com [172.24.170.38]) by linux.omap.com (Postfix) with ESMTP id A6AA080626 for ; Wed, 11 Jul 2012 10:39:46 -0500 (CDT) Received: from DBDE70.ent.ti.com (localhost [127.0.0.1]) by dbdp20.itg.ti.com (8.13.8/8.13.8) with ESMTP id q6BFdhjN006499; Wed, 11 Jul 2012 21:09:43 +0530 (IST) Received: from dbdp33.itg.ti.com (172.24.170.252) by dbde70.ent.ti.com (172.24.170.148) with Microsoft SMTP Server id 14.1.323.3; Wed, 11 Jul 2012 21:09:43 +0530 Received: from psplinux051 (smtpvbd.itg.ti.com [172.24.170.250]) by dbdp33.itg.ti.com (8.13.8/8.13.8) with ESMTP id q6BFdeRb014817; Wed, 11 Jul 2012 21:09:41 +0530 Received: from x0144960 by psplinux051 with local (Exim 4.74) (envelope-from ) id 1Soz0u-0001bF-6O; Wed, 11 Jul 2012 21:09:40 +0530 From: Manjunath Hadli To: LMML Subject: [PATCH] [media] davinci: vpfe: Add documentation Date: Wed, 11 Jul 2012 21:09:26 +0530 Message-ID: <1342021166-6092-1-git-send-email-manjunath.hadli@ti.com> X-Mailer: git-send-email 1.7.4.1 MIME-Version: 1.0 CC: dlos , , , Rob Landley , Mauro Carvalho Chehab X-BeenThere: davinci-linux-open-source@linux.davincidsp.com X-Mailman-Version: 2.1.12 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: Errors-To: davinci-linux-open-source-bounces@linux.davincidsp.com Add documentation on the Davinci VPFE driver. Document the subdevs, and private IOTCLs the driver implements Signed-off-by: Manjunath Hadli Signed-off-by: Lad, Prabhakar --- Documentation/video4linux/davinci-vpfe-mc.txt | 263 +++++++++++++++++++++++++ 1 files changed, 263 insertions(+), 0 deletions(-) create mode 100644 Documentation/video4linux/davinci-vpfe-mc.txt diff --git a/Documentation/video4linux/davinci-vpfe-mc.txt b/Documentation/video4linux/davinci-vpfe-mc.txt new file mode 100644 index 0000000..968194f --- /dev/null +++ b/Documentation/video4linux/davinci-vpfe-mc.txt @@ -0,0 +1,263 @@ +Davinci Video processing Front End (VPFE) driver + +Copyright (C) 2012 Texas Instruments Inc + +Contacts: Manjunath Hadli + +Introduction +============ + +This file documents the Texas Instruments Davinci Video processing Front End +(VPFE) driver located under drivers/media/video/davinci. The original driver +exists for Davinci VPFE, which is now being changed to Media Controller +Framework. + +Currently the driver has been successfully used on the following version of Davinci: + + DM365/DM368 + +The driver implements V4L2, Media controller and v4l2_subdev interfaces. +Sensor, lens and flash drivers using the v4l2_subdev interface in the kernel +are supported. + + +Split to subdevs +================ + +The Davinic VPFE is split into V4L2 subdevs, each of the blocks inside the VPFE +having one subdev to represent it. Each of the subdevs provide a V4L2 subdev +interface to userspace. + + DAVINCI CCDC + DAVINCI PREVIEWER + DAVINCI RESIZER + DAVINCI AEW + DAVINCI AF + +Each possible link in the VPFE is modeled by a link in the Media controller +interface. For an example program see [1]. + + +Private IOCTLs +============== + +The Davinci Video processing Front End (VPFE) driver supports standard V4L2 +IOCTLs and controls where possible and practical. Much of the functions provided +by the VPFE, however, does not fall under the standard IOCTLs. + +In general, there is a private ioctl for configuring each of the blocks +containing hardware-dependent functions. + +The following private IOCTLs are supported: + +1: IOCTL: PREV_S_PARAM/PREV_G_PARAM +Description: + Sets/Gets the parameters required by the previewer module +Parameter: + /** + * struct prev_module_param- structure to configure preview modules + * @version: Version of the preview module + * @len: Length of the module config structure + * @module_id: Module id + * @param: pointer to module config parameter. + */ + struct prev_module_param { + char version[IMP_MAX_NAME_SIZE]; + unsigned short len; + unsigned short module_id; + void *param; + }; + +2: IOCTL: PREV_S_CONFIG/PREV_G_CONFIG +Description: + Sets/Gets the configuration required by the previewer channel +Parameter: + /** + * struct prev_channel_config - structure for configuring the previewer channel + * @len: Length of the user configuration + * @config: pointer to either single shot config or continuous + */ + struct prev_channel_config { + unsigned short len; + void *config; + }; + +3: IOCTL: PREV_ENUM_CAP +Description: + Queries the modules available in the image processor for preview the + input image. +Parameter: + /** + * struct prev_cap - structure to enumerate capabilities of previewer + * @index: application use this to iterate over the available modules + * @version: version of the preview module + * @module_id: module id + * @control: control operation allowed in continuous mode? 1 - allowed, 0 - not allowed + * @path: path on which the module is sitting + * @module_name: module name + */ + struct prev_cap { + unsigned short index; + char version[IMP_MAX_NAME_SIZE]; + unsigned short module_id; + char control; + enum imp_data_paths path; + char module_name[IMP_MAX_NAME_SIZE]; + }; + +4: IOCTL: RSZ_S_CONFIG/RSZ_G_CONFIG +Description: + Sets/Gets the configuration required by the resizer channel +Parameter: + /** + * struct rsz_channel_config - structure for configuring the resizer channel + * @chain: chain this resizer at the previewer output + * @len: length of the user configuration + * @config: pointer to either single shot config or continuous + */ + struct rsz_channel_config { + unsigned char chain; + unsigned short len; + void *config; + }; + +5: IOCTL: VPFE_CMD_S_CCDC_RAW_PARAMS/VPFE_CMD_G_CCDC_RAW_PARAMS +Description: + Sets/Gets the CCDC parameter +Parameter: + /** + * struct ccdc_config_params_raw - structure for configuring ccdc params + * @linearize: linearization parameters for image sensor data input + * @df_csc: data formatter or CSC + * @dfc: defect Pixel Correction (DFC) configuration + * @bclamp: Black/Digital Clamp configuration + * @gain_offset: Gain, offset adjustments + * @culling: Culling + * @pred: predictor for DPCM compression + * @horz_offset: horizontal offset for Gain/LSC/DFC + * @vert_offset: vertical offset for Gain/LSC/DFC + * @col_pat_field0: color pattern for field 0 + * @col_pat_field1: color pattern for field 1 + * @data_size: data size from 8 to 16 bits + * @data_shift: data shift applied before storing to SDRAM + * @test_pat_gen: enable input test pattern generation + */ + struct ccdc_config_params_raw { + struct ccdc_linearize linearize; + struct ccdc_df_csc df_csc; + struct ccdc_dfc dfc; + struct ccdc_black_clamp bclamp; + struct ccdc_gain_offsets_adj gain_offset; + struct ccdc_cul culling; + enum ccdc_dpcm_predictor pred; + unsigned short horz_offset; + unsigned short vert_offset; + struct ccdc_col_pat col_pat_field0; + struct ccdc_col_pat col_pat_field1; + enum ccdc_data_size data_size; + enum ccdc_datasft data_shift; + unsigned char test_pat_gen; + }; + +6: IOCTL: AF_S_PARAM/AF_G_PARAM +Description: + AF_S_PARAM performs the hardware setup and sets the parameter for + AF engine.AF_G_PARAM gets the parameter setup in AF engine +Parameter: + /** + * struct af_configuration - struct to configure parameters of AF engine + * @alaw_enable: ALAW status + * @fv_sel: focus value selection + * @hmf_config: HMF configurations + * @rgb_pos: RGB Positions. Only applicable with AF_HFV_ONLY selection + * @iir_config: IIR filter configurations + * @fir_config: FIR filter configuration + * @paxel_config: Paxel parameters + * @mode: accumulator mode + */ + struct af_configuration { + enum af_enable_flag alaw_enable; + enum af_focus_val_sel fv_sel; + struct af_hmf hmf_config; + enum rgbpos rgb_pos; + struct af_iir iir_config; + struct af_fir fir_config; + struct af_paxel paxel_config; + enum af_mode mode; + }; + +7: IOCTL: AF_GET_STAT +Description: + Copy the entire statistics located in application buffer + to user space from the AF engine +Parameter: + /** + * struct af_statdata - structure to get statistics from AF engine + * @buffer: pointer to buffer + * @buf_length: length of buffer + */ + struct af_statdata { + void *buffer; + int buf_length; + }; + +8: IOCTL: AEW_S_PARAM/AEW_G_PARAM +Description: + AEW_S_PARAM performs the hardware setup and sets the parameter for + AEW engine.AEW_G_PARAM gets the parameter setup in AEW engine +Parameter: + /** + * struct aew_configuration - struct to configure parameters of AEW engine + * @alaw_enable: A-law status + * @format: AE/AWB output format + * @sum_shift: AW/AWB right shift value for sum of pixels + * @saturation_limit: Saturation Limit + * @hmf_config: HMF configurations + * @window_config: Window for AEW Engine + * @blackwindow_config: Black Window + */ + struct aew_configuration { + enum aew_enable_flag alaw_enable; + enum aew_output_format out_format; + char sum_shift; + int saturation_limit; + struct aew_hmf hmf_config; + struct aew_window window_config; + struct aew_black_window blackwindow_config; + }; + +9: IOCTL: AEW_GET_STAT +Description: + Copy the entire statistics located in application buffer + to user space from the AEW engine +Parameter: + /** + * struct aew_statdata - structure to get statistics from AEW engine + * @buffer: pointer to buffer + * @buf_length: length of buffer + */ + struct aew_statdata { + void *buffer; + int buf_length; + }; + + +Technical reference manuals (TRMs) and other documentation +========================================================== + +Davinci DM365 TRM: + +Referenced MARCH 2009-REVISED JUNE 2011 + +Davinci DM368 TRM: + +Referenced APRIL 2010-REVISED JUNE 2011 + +Davinci Video Processing Front End (VPFE) DM36x + + + +References +========== + +[1] http://git.ideasonboard.org/?p=media-ctl.git;a=summary