From patchwork Fri Jun 4 07:23:40 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Huzaifa Sidhpurwala X-Patchwork-Id: 104219 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter.kernel.org (8.14.3/8.14.3) with ESMTP id o547Pgon015494 for ; Fri, 4 Jun 2010 07:25:42 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752347Ab0FDHZk (ORCPT ); Fri, 4 Jun 2010 03:25:40 -0400 Received: from mx1.redhat.com ([209.132.183.28]:63346 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751239Ab0FDHZk (ORCPT ); Fri, 4 Jun 2010 03:25:40 -0400 Received: from int-mx08.intmail.prod.int.phx2.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id o547Peqd028245 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Fri, 4 Jun 2010 03:25:40 -0400 Received: from localhost.localdomain (dhcp1-186.pnq.redhat.com [10.65.193.186]) by int-mx08.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id o547PbTR025075; Fri, 4 Jun 2010 03:25:38 -0400 From: huzaifas@redhat.com To: linux-media@vger.kernel.org Cc: hdegoede@redhat.com, Huzaifa Sidhpurwala Subject: [PATCH] libv4l1: move VIDIOCGFREQ and VIDIOCSFREQ to libv4l1 Date: Fri, 4 Jun 2010 12:53:40 +0530 Message-Id: <1275636220-21975-1-git-send-email-huzaifas@redhat.com> X-Scanned-By: MIMEDefang 2.67 on 10.5.11.21 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]); Fri, 04 Jun 2010 07:25:42 +0000 (UTC) diff --git a/lib/libv4l1/libv4l1.c b/lib/libv4l1/libv4l1.c index 081ed0a..579f13b 100644 --- a/lib/libv4l1/libv4l1.c +++ b/lib/libv4l1/libv4l1.c @@ -939,6 +939,34 @@ int v4l1_ioctl(int fd, unsigned long int request, ...) break; } + case VIDIOCSFREQ: { + unsigned long *freq = arg; + struct v4l2_frequency freq2 = { 0, }; + + result = v4l2_ioctl(fd, VIDIOC_G_FREQUENCY, &freq2); + if (result < 0) + break; + + freq2.frequency = *freq; + + result = v4l2_ioctl(fd, VIDIOC_S_FREQUENCY, &freq2); + + break; + } + + case VIDIOCGFREQ: { + unsigned long *freq = arg; + struct v4l2_frequency freq2 = { 0, }; + + freq2.tuner = 0; + result = v4l2_ioctl(fd, VIDIOC_G_FREQUENCY, &freq2); + if (result < 0) + break; + if (0 == result) + *freq = freq2.frequency; + + break; + } default: /* Pass through libv4l2 for applications which are using v4l2 through libv4l1 (this can happen with the v4l1compat.so wrapper preloaded */