From patchwork Mon Aug 2 14:06:39 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Matti Aaltonen X-Patchwork-Id: 116514 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter.kernel.org (8.14.4/8.14.3) with ESMTP id o72E7c2x027504 for ; Mon, 2 Aug 2010 14:07:38 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753198Ab0HBOHh (ORCPT ); Mon, 2 Aug 2010 10:07:37 -0400 Received: from smtp.nokia.com ([192.100.122.233]:34078 "EHLO mgw-mx06.nokia.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751631Ab0HBOHf (ORCPT ); Mon, 2 Aug 2010 10:07:35 -0400 Received: from esebh105.NOE.Nokia.com (esebh105.ntc.nokia.com [172.21.138.211]) by mgw-mx06.nokia.com (Switch-3.3.3/Switch-3.3.3) with ESMTP id o72E6wvk012144; Mon, 2 Aug 2010 17:07:21 +0300 Received: from esebh102.NOE.Nokia.com ([172.21.138.183]) by esebh105.NOE.Nokia.com with Microsoft SMTPSVC(6.0.3790.4675); Mon, 2 Aug 2010 17:06:54 +0300 Received: from mgw-da02.ext.nokia.com ([147.243.128.26]) by esebh102.NOE.Nokia.com over TLS secured channel with Microsoft SMTPSVC(6.0.3790.4675); Mon, 2 Aug 2010 17:06:54 +0300 Received: from localhost.localdomain (masi.nmp.nokia.com [172.22.211.19]) by mgw-da02.ext.nokia.com (Switch-3.3.3/Switch-3.3.3) with ESMTP id o72E6kaW013150; Mon, 2 Aug 2010 17:06:49 +0300 From: "Matti J. Aaltonen" To: linux-media@vger.kernel.org, hverkuil@xs4all.nl, eduardo.valentin@nokia.com, mchehab@redhat.com Cc: "Matti J. Aaltonen" Subject: [PATCH v7 1/5] V4L2: Add seek spacing and FM RX class. Date: Mon, 2 Aug 2010 17:06:39 +0300 Message-Id: <1280758003-16118-2-git-send-email-matti.j.aaltonen@nokia.com> X-Mailer: git-send-email 1.6.1.3 In-Reply-To: <1280758003-16118-1-git-send-email-matti.j.aaltonen@nokia.com> References: <1280758003-16118-1-git-send-email-matti.j.aaltonen@nokia.com> X-OriginalArrivalTime: 02 Aug 2010 14:06:54.0566 (UTC) FILETIME=[F6423060:01CB324B] X-Nokia-AV: Clean Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.3 (demeter.kernel.org [140.211.167.41]); Mon, 02 Aug 2010 14:07:39 +0000 (UTC) diff --git a/drivers/media/video/v4l2-common.c b/drivers/media/video/v4l2-common.c index cd1f21d..41b1bb2 100644 --- a/drivers/media/video/v4l2-common.c +++ b/drivers/media/video/v4l2-common.c @@ -351,6 +351,12 @@ const char **v4l2_ctrl_get_menu(u32 id) "75 useconds", NULL, }; + static const char *fm_band[] = { + "87.5 - 108. MHz", + "76. - 90. MHz, Japan", + "65. - 74. MHz, OIRT", + NULL, + }; switch (id) { case V4L2_CID_MPEG_AUDIO_SAMPLING_FREQ: @@ -391,6 +397,8 @@ const char **v4l2_ctrl_get_menu(u32 id) return colorfx; case V4L2_CID_TUNE_PREEMPHASIS: return tune_preemphasis; + case V4L2_CID_FM_BAND: + return fm_band; default: return NULL; } @@ -515,6 +523,8 @@ const char *v4l2_ctrl_get_name(u32 id) case V4L2_CID_TUNE_PREEMPHASIS: return "Pre-emphasis settings"; case V4L2_CID_TUNE_POWER_LEVEL: return "Tune Power Level"; case V4L2_CID_TUNE_ANTENNA_CAPACITOR: return "Tune Antenna Capacitor"; + case V4L2_CID_FM_RX_CLASS: return "FM Radio Tuner Controls"; + case V4L2_CID_FM_BAND: return "FM Band"; default: return NULL; @@ -580,6 +590,7 @@ int v4l2_ctrl_query_fill(struct v4l2_queryctrl *qctrl, s32 min, s32 max, s32 ste case V4L2_CID_EXPOSURE_AUTO: case V4L2_CID_COLORFX: case V4L2_CID_TUNE_PREEMPHASIS: + case V4L2_CID_FM_BAND: qctrl->type = V4L2_CTRL_TYPE_MENU; step = 1; break; @@ -591,6 +602,7 @@ int v4l2_ctrl_query_fill(struct v4l2_queryctrl *qctrl, s32 min, s32 max, s32 ste case V4L2_CID_CAMERA_CLASS: case V4L2_CID_MPEG_CLASS: case V4L2_CID_FM_TX_CLASS: + case V4L2_CID_FM_RX_CLASS: qctrl->type = V4L2_CTRL_TYPE_CTRL_CLASS; qctrl->flags |= V4L2_CTRL_FLAG_READ_ONLY; min = max = step = def = 0; diff --git a/include/linux/videodev2.h b/include/linux/videodev2.h index 418dacf..26522cb 100644 --- a/include/linux/videodev2.h +++ b/include/linux/videodev2.h @@ -935,6 +935,7 @@ struct v4l2_ext_controls { #define V4L2_CTRL_CLASS_MPEG 0x00990000 /* MPEG-compression controls */ #define V4L2_CTRL_CLASS_CAMERA 0x009a0000 /* Camera class controls */ #define V4L2_CTRL_CLASS_FM_TX 0x009b0000 /* FM Modulator control class */ +#define V4L2_CTRL_CLASS_FM_RX 0x009c0000 /* FM Tuner control class */ #define V4L2_CTRL_ID_MASK (0x0fffffff) #define V4L2_CTRL_ID2CLASS(id) ((id) & 0x0fff0000UL) @@ -1313,6 +1314,17 @@ enum v4l2_preemphasis { #define V4L2_CID_TUNE_POWER_LEVEL (V4L2_CID_FM_TX_CLASS_BASE + 113) #define V4L2_CID_TUNE_ANTENNA_CAPACITOR (V4L2_CID_FM_TX_CLASS_BASE + 114) +/* FM Tuner class control IDs */ +#define V4L2_CID_FM_RX_CLASS_BASE (V4L2_CTRL_CLASS_FM_RX | 0x900) +#define V4L2_CID_FM_RX_CLASS (V4L2_CTRL_CLASS_FM_RX | 1) + +#define V4L2_CID_FM_BAND (V4L2_CID_FM_RX_CLASS_BASE + 1) +enum v4l2_fm_band { + V4L2_FM_BAND_OTHER = 0, + V4L2_FM_BAND_JAPAN = 1, + V4L2_FM_BAND_OIRT = 2 +}; + /* * T U N I N G */ @@ -1377,7 +1389,8 @@ struct v4l2_hw_freq_seek { enum v4l2_tuner_type type; __u32 seek_upward; __u32 wrap_around; - __u32 reserved[8]; + __u32 spacing; + __u32 reserved[7]; }; /*