Return-path: Received: from mx1.redhat.com ([209.132.183.28]:55710 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752952Ab3DTRvY (ORCPT ); Sat, 20 Apr 2013 13:51:24 -0400 Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id r3KHpNnh022909 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Sat, 20 Apr 2013 13:51:23 -0400 From: Mauro Carvalho Chehab Cc: Mauro Carvalho Chehab , Linux Media Mailing List Subject: [PATCH RFC v2 1/3] [media] Add SDR at V4L2 API Date: Sat, 20 Apr 2013 14:51:12 -0300 Message-Id: <1366480274-31255-2-git-send-email-mchehab@redhat.com> In-Reply-To: <1366480274-31255-1-git-send-email-mchehab@redhat.com> References: <366469499-31640-1-git-send-email-mchehab@redhat.com> <1366480274-31255-1-git-send-email-mchehab@redhat.com> To: unlisted-recipients:; (no To-header on input)@casper.infradead.org Sender: linux-media-owner@vger.kernel.org List-ID: Adds the basic API bits for Software Digital Radio (SDR) at the V4L2 API. Signed-off-by: Mauro Carvalho Chehab --- Documentation/DocBook/media/v4l/common.xml | 35 ++++++++++++++++++ Documentation/DocBook/media/v4l/pixfmt.xml | 41 ++++++++++++++++++++++ Documentation/DocBook/media/v4l/v4l2.xml | 1 + .../DocBook/media/v4l/vidioc-querycap.xml | 7 ++++ drivers/media/v4l2-core/v4l2-dev.c | 3 ++ include/media/v4l2-dev.h | 3 +- include/uapi/linux/videodev2.h | 11 ++++++ 7 files changed, 100 insertions(+), 1 deletion(-) diff --git a/Documentation/DocBook/media/v4l/common.xml b/Documentation/DocBook/media/v4l/common.xml index 1ddf354..f59c67d 100644 --- a/Documentation/DocBook/media/v4l/common.xml +++ b/Documentation/DocBook/media/v4l/common.xml @@ -513,6 +513,41 @@ the &v4l2-capability; returned by the &VIDIOC-QUERYCAP; ioctl when the device has one or more modulators. +
+ Software Digital Radio (SDR) Tuners and Modulators + + Those devices are special types of Radio devices that don't +have any analog demodulator. Instead, it samples the radio IF or baseband +and sends the samples for userspace to demodulate. +
+ Tuners + + SDR receivers can have one or more tuners sampling RF signals. +Each tuner is associated with one or more inputs, depending on the number +of RF connectors on the tuner. The type field of +the respective &v4l2-input; returned by the &VIDIOC-ENUMINPUT; ioctl is set to +V4L2_INPUT_TYPE_TUNER and its +tuner field contains the index number of +the tuner input. + +To query and change tuner properties applications use the +&VIDIOC-G-TUNER; and &VIDIOC-S-TUNER; ioctl, respectively. The +&v4l2-tuner; returned by VIDIOC_G_TUNER also +contains signal status information applicable when the tuner of the +current SDR input is queried. In order to change the SDR input, +VIDIOC_S_TUNER with a new SDR index should be called. +Drivers must support both ioctls and set the +V4L2_CAP_SDR and V4L2_CAP_TUNER +flags in the &v4l2-capability; returned by the &VIDIOC-QUERYCAP; ioctl. +
+ +
+ Modulators + To be defined. +
+
+ +
Radio Frequency diff --git a/Documentation/DocBook/media/v4l/pixfmt.xml b/Documentation/DocBook/media/v4l/pixfmt.xml index 99b8d2a..e30075e 100644 --- a/Documentation/DocBook/media/v4l/pixfmt.xml +++ b/Documentation/DocBook/media/v4l/pixfmt.xml @@ -203,6 +203,47 @@ codes can be used.
+
+ SDR format struture + + struct <structname>v4l2_sdr_format</structname> + + &cs-str; + + + __u32 + sampleformat + The format of the samples used by the SDR device. + This is a little endian + + four character code. + + + +
+ + SDR formats + + &cs-str; + + + V4L2_SDR_FMT_I8Q8 + Samples are given by a sequence of 8 bits in-phase(I) and + 8 bits quadrature (Q) samples taken from a + signal(t) represented by the following + expression: + + signal(t) = I cos(2π f t) - Q sin(2π f t) + signal(t) = I * cos(2π fc t) - Q * sin(2π fc t) + + + + + +
+ +
+
Standard Image Formats diff --git a/Documentation/DocBook/media/v4l/v4l2.xml b/Documentation/DocBook/media/v4l/v4l2.xml index bfc93cd..b53a5cf 100644 --- a/Documentation/DocBook/media/v4l/v4l2.xml +++ b/Documentation/DocBook/media/v4l/v4l2.xml @@ -521,6 +521,7 @@ and discussions on the V4L mailing list.
&sub-dev-teletext;
&sub-dev-radio;
&sub-dev-rds;
+
&sub-dev-sdr;
&sub-dev-event;
&sub-dev-subdev;
diff --git a/Documentation/DocBook/media/v4l/vidioc-querycap.xml b/Documentation/DocBook/media/v4l/vidioc-querycap.xml index d5a3c97..97bb25a 100644 --- a/Documentation/DocBook/media/v4l/vidioc-querycap.xml +++ b/Documentation/DocBook/media/v4l/vidioc-querycap.xml @@ -296,6 +296,13 @@ modulator programming see . + V4L2_CAP_SDR + 0x00100000 + The device is a Software Digital Radio. + For more information about SDR programming see +. + + V4L2_CAP_READWRITE 0x01000000 The device supports the