From patchwork Fri Aug 28 00:16:47 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: santiago.nunez@ridgerun.com X-Patchwork-Id: 44364 Received: from arroyo.ext.ti.com (arroyo.ext.ti.com [192.94.94.40]) by demeter.kernel.org (8.14.2/8.14.2) with ESMTP id n7S0IxCn030328 for ; Fri, 28 Aug 2009 00:19:00 GMT Received: from dlep36.itg.ti.com ([157.170.170.91]) by arroyo.ext.ti.com (8.13.7/8.13.7) with ESMTP id n7S0GwKd008800; Thu, 27 Aug 2009 19:17:03 -0500 Received: from linux.omap.com (localhost [127.0.0.1]) by dlep36.itg.ti.com (8.13.8/8.13.8) with ESMTP id n7S0Gtcq028769; Thu, 27 Aug 2009 19:16:57 -0500 (CDT) Received: from linux.omap.com (localhost [127.0.0.1]) by linux.omap.com (Postfix) with ESMTP id 5673F80627; Thu, 27 Aug 2009 19:16:55 -0500 (CDT) X-Original-To: davinci-linux-open-source@linux.davincidsp.com Delivered-To: davinci-linux-open-source@linux.davincidsp.com Received: from dflp53.itg.ti.com (dflp53.itg.ti.com [128.247.5.6]) by linux.omap.com (Postfix) with ESMTP id 0468A80626 for ; Thu, 27 Aug 2009 19:16:54 -0500 (CDT) Received: from red.ext.ti.com (localhost [127.0.0.1]) by dflp53.itg.ti.com (8.13.8/8.13.8) with ESMTP id n7S0Grql018997 for ; Thu, 27 Aug 2009 19:16:53 -0500 (CDT) Received: from mail197-tx2-R.bigfish.com (mail-tx2.bigfish.com [65.55.88.114]) by red.ext.ti.com (8.13.7/8.13.7) with ESMTP id n7S0GmHx005415 for ; Thu, 27 Aug 2009 19:16:53 -0500 Received: from mail197-tx2 (localhost.localdomain [127.0.0.1]) by mail197-tx2-R.bigfish.com (Postfix) with ESMTP id 9B4FE15C84EC for ; Fri, 28 Aug 2009 00:16:48 +0000 (UTC) X-SpamScore: 7 X-BigFish: vps7(zza4b1ozz1202hzzz2fh62h) X-Spam-TCS-SCL: 1:0 X-FB-SS: 5, X-MS-Exchange-Organization-Antispam-Report: OrigIP: 74.208.67.6; Service: EHS Received: by mail197-tx2 (MessageSwitch) id 1251418606460984_9747; Fri, 28 Aug 2009 00:16:46 +0000 (UCT) Received: from mail.navvo.net (mail.navvo.net [74.208.67.6]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail197-tx2.bigfish.com (Postfix) with ESMTP id 5939B113004B; Fri, 28 Aug 2009 00:16:46 +0000 (UTC) Received: from [200.122.155.113] (helo=localhost.localdomain) by mail.navvo.net with esmtpa (Exim 4.63) (envelope-from ) id 1Mgp91-0001qw-I1; Thu, 27 Aug 2009 19:16:45 -0500 From: santiago.nunez@ridgerun.com To: m-karicheri2@ti.com Date: Thu, 27 Aug 2009 18:16:47 -0600 Message-Id: <1251418607-16091-1-git-send-email-santiago.nunez@ridgerun.com> X-Mailer: git-send-email 1.6.0.4 X-SA-Exim-Connect-IP: 200.122.155.113 X-SA-Exim-Mail-From: santiago.nunez@ridgerun.com X-Spam-Checker-Version: SpamAssassin 3.1.7-deb (2006-10-05) on mail.navvo.net X-Spam-Level: X-Spam-Status: No, score=-1.8 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00, NO_REAL_NAME,UPPERCASE_25_50 autolearn=ham version=3.1.7-deb X-SA-Exim-Version: 4.2.1 (built Tue, 09 Jan 2007 17:23:22 +0000) X-SA-Exim-Scanned: Yes (on mail.navvo.net) Cc: davinci-linux-open-source@linux.davincidsp.com, clark.becker@ridgerun.com, Santiago Nunez-Corrales , todd.fischer@ridgerun.com Subject: [PATCH 1/6] Support for TVP7002 in v4l2 definitions X-BeenThere: davinci-linux-open-source@linux.davincidsp.com X-Mailman-Version: 2.1.4 Precedence: list List-Id: davinci-linux-open-source.linux.davincidsp.com List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: davinci-linux-open-source-bounces@linux.davincidsp.com Errors-To: davinci-linux-open-source-bounces@linux.davincidsp.com From: Santiago Nunez-Corrales This patch provides required std and control definitions in TVP7002 within v4l2. Signed-off-by: Santiago Nunez-Corrales --- include/linux/videodev2.h | 87 +++++++++++++++++++++++++++++++++++++- include/media/v4l2-chip-ident.h | 3 + 2 files changed, 87 insertions(+), 3 deletions(-) diff --git a/include/linux/videodev2.h b/include/linux/videodev2.h index 74f1687..5a735be 100644 --- a/include/linux/videodev2.h +++ b/include/linux/videodev2.h @@ -704,11 +704,66 @@ typedef __u64 v4l2_std_id; V4L2_STD_PAL_Nc |\ V4L2_STD_SECAM) #define V4L2_STD_ATSC (V4L2_STD_ATSC_8_VSB |\ - V4L2_STD_ATSC_16_VSB) + V4L2_STD_ATSC_16_VSB) +/* Frequency for HD (i.e. 60 vs 50) */ +#define V4L2_STD_HDTV_50 ((v4l2_std_id)0x04000000) +#define V4L2_STD_HDTV_60 ((v4l2_std_id)0x00000000) + +/* interlaced vs progressive for HD */ +#define V4L2_STD_HDTV_I ((v4l2_std_id)0x08000000) +#define V4L2_STD_HDTV_P ((v4l2_std_id)0x00000000) + +/* 720 vs 1080 HD modes */ +#define V4L2_STD_HDTV_720 ((v4l2_std_id)0x08000000) +#define V4L2_STD_HDTV_1080 ((v4l2_std_id)0x10000000) + +/* FIXME: + * + * Definitions equal to zero are listed for clarity. In general, + * definitions of standards should be improved by using bits to + * denote properties, not specific standards and forcing the use + * of unnatural combinatorics tricks. Otherwise, as such is the + * current case, the descriptor bit space gets exhausted very + * rapidly. + */ + +/* some standards for SDTV and HDTV */ +#define V4L2_STD_480P_60 (V4L2_STD_525_60 |\ + V4L2_STD_HDTV_P) +#define V4L2_STD_480I_60 (V4L2_STD_525_60 |\ + V4L2_STD_HDTV_I) +#define V4L2_STD_576P_50 (V4L2_STD_625_50 |\ + V4L2_STD_HDTV_P) +#define V4L2_STD_576I_50 (V4L2_STD_625_50 |\ + V4L2_STD_HDTV_I) +#define V4L2_STD_720P_50 (V4L2_STD_ATSC |\ + V4L2_STD_HDTV_50 |\ + V4L2_STD_HDTV_P |\ + V4L2_STD_HDTV_720) +#define V4L2_STD_720P_60 (V4L2_STD_ATSC |\ + V4L2_STD_HDTV_60 |\ + V4L2_STD_HDTV_P |\ + V4L2_STD_HDTV_720) +#define V4L2_STD_1080I_50 (V4L2_STD_ATSC |\ + V4L2_STD_HDTV_50 |\ + V4L2_STD_HDTV_I |\ + V4L2_STD_HDTV_1080) +#define V4L2_STD_1080I_60 (V4L2_STD_ATSC |\ + V4L2_STD_HDTV_60 |\ + V4L2_STD_HDTV_I |\ + V4L2_STD_HDTV_1080) +#define V4L2_STD_1080P_50 (V4L2_STD_ATSC |\ + V4L2_STD_HDTV_50 |\ + V4L2_STD_HDTV_P |\ + V4L2_STD_HDTV_1080) +#define V4L2_STD_1080P_60 (V4L2_STD_ATSC |\ + V4L2_STD_HDTV_60 |\ + V4L2_STD_HDTV_P |\ + V4L2_STD_HDTV_1080) + + #define V4L2_STD_UNKNOWN 0 -#define V4L2_STD_ALL (V4L2_STD_525_60 |\ - V4L2_STD_625_50) struct v4l2_standard { __u32 index; @@ -808,6 +863,7 @@ struct v4l2_ext_controls { #define V4L2_CTRL_CLASS_USER 0x00980000 /* Old-style 'user' controls */ #define V4L2_CTRL_CLASS_MPEG 0x00990000 /* MPEG-compression controls */ #define V4L2_CTRL_CLASS_CAMERA 0x009a0000 /* Camera class controls */ +#define V4L2_CTRL_CLASS_DECODER 0x009c0000 /* Decoder class controls */ #define V4L2_CTRL_ID_MASK (0x0fffffff) #define V4L2_CTRL_ID2CLASS(id) ((id) & 0x0fff0000UL) @@ -1147,6 +1203,31 @@ enum v4l2_exposure_auto_type { #define V4L2_CID_PRIVACY (V4L2_CID_CAMERA_CLASS_BASE+16) + +/* tvp7002 control IDs*/ +#define V4L2_CID_TVP7002_BASE V4L2_CTRL_CLASS_DECODER +#define V4L2_CID_TVP7002_COARSE_GAIN_R (V4L2_CID_TVP7002_BASE + 1) +#define V4L2_CID_TVP7002_COARSE_GAIN_G (V4L2_CID_TVP7002_BASE + 2) +#define V4L2_CID_TVP7002_COARSE_GAIN_B (V4L2_CID_TVP7002_BASE + 3) +#define V4L2_CID_TVP7002_FINE_GAIN_R (V4L2_CID_TVP7002_BASE + 4) +#define V4L2_CID_TVP7002_FINE_GAIN_G (V4L2_CID_TVP7002_BASE + 5) +#define V4L2_CID_TVP7002_FINE_GAIN_B (V4L2_CID_TVP7002_BASE + 6) +#define V4L2_CID_TVP7002_B_CLAMP (V4L2_CID_TVP7002_BASE + 7) +#define V4L2_CID_TVP7002_G_CLAMP (V4L2_CID_TVP7002_BASE + 8) +#define V4L2_CID_TVP7002_R_CLAMP (V4L2_CID_TVP7002_BASE + 9) +#define V4L2_CID_TVP7002_CLAMP_OFF_EN (V4L2_CID_TVP7002_BASE + 10) +#define V4L2_CID_TVP7002_FCTCA (V4L2_CID_PRIVATE_BASE + 11) +#define V4L2_CID_TVP7002_F_CLAMP_GB (V4L2_CID_TVP7002_BASE + 12) +#define V4L2_CID_TVP7002_F_CLAMP_R (V4L2_CID_TVP7002_BASE + 13) +#define V4L2_CID_TVP7002_CLAMP_START (V4L2_CID_TVP7002_BASE + 14) +#define V4L2_CID_TVP7002_CLAMP_W (V4L2_CID_TVP7002_BASE + 15) +#define V4L2_CID_TVP7002_B_COARSE_OFF (V4L2_CID_TVP7002_BASE + 16) +#define V4L2_CID_TVP7002_G_COARSE_OFF (V4L2_CID_TVP7002_BASE + 17) +#define V4L2_CID_TVP7002_R_COARSE_OFF (V4L2_CID_TVP7002_BASE + 18) +#define V4L2_CID_TVP7002_B_FINE_OFF (V4L2_CID_TVP7002_BASE + 19) +#define V4L2_CID_TVP7002_G_FINE_OFF (V4L2_CID_TVP7002_BASE + 20) +#define V4L2_CID_TVP7002_R_FINE_OFF (V4L2_CID_TVP7002_BASE + 21) + /* * T U N I N G */ diff --git a/include/media/v4l2-chip-ident.h b/include/media/v4l2-chip-ident.h index 94e908c..b8c86d9 100644 --- a/include/media/v4l2-chip-ident.h +++ b/include/media/v4l2-chip-ident.h @@ -129,6 +129,9 @@ enum { V4L2_IDENT_SAA6752HS = 6752, V4L2_IDENT_SAA6752HS_AC3 = 6753, + /* module tvp7002: just ident 7002 */ + V4L2_IDENT_TVP7002 = 7002, + /* module adv7170: just ident 7170 */ V4L2_IDENT_ADV7170 = 7170,