From patchwork Thu Feb 27 00:30:22 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Antti Palosaari X-Patchwork-Id: 3729601 Return-Path: X-Original-To: patchwork-linux-media@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 9F59B9F3A2 for ; Thu, 27 Feb 2014 00:30:49 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id A910020211 for ; Thu, 27 Feb 2014 00:30:48 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id A7DFE20219 for ; Thu, 27 Feb 2014 00:30:47 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753890AbaB0Aao (ORCPT ); Wed, 26 Feb 2014 19:30:44 -0500 Received: from mail.kapsi.fi ([217.30.184.167]:42896 "EHLO mail.kapsi.fi" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753323AbaB0Aal (ORCPT ); Wed, 26 Feb 2014 19:30:41 -0500 Received: from dyn3-82-128-184-75.psoas.suomi.net ([82.128.184.75] helo=localhost.localdomain) by mail.kapsi.fi with esmtpsa (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.72) (envelope-from ) id 1WIos4-0004ky-F0; Thu, 27 Feb 2014 02:30:40 +0200 From: Antti Palosaari To: linux-media@vger.kernel.org Cc: Hans Verkuil , Antti Palosaari Subject: [REVIEW PATCH 13/16] rtl2832_sdr: expose e4000 controls to user Date: Thu, 27 Feb 2014 02:30:22 +0200 Message-Id: <1393461025-11857-14-git-send-email-crope@iki.fi> X-Mailer: git-send-email 1.8.5.3 In-Reply-To: <1393461025-11857-1-git-send-email-crope@iki.fi> References: <1393461025-11857-1-git-send-email-crope@iki.fi> X-SA-Exim-Connect-IP: 82.128.184.75 X-SA-Exim-Mail-From: crope@iki.fi X-SA-Exim-Scanned: No (on mail.kapsi.fi); SAEximRunCond expanded to false Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP E4000 tuner driver provides now some controls. Expose those to userland. Signed-off-by: Antti Palosaari --- drivers/staging/media/rtl2832u_sdr/rtl2832_sdr.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/drivers/staging/media/rtl2832u_sdr/rtl2832_sdr.c b/drivers/staging/media/rtl2832u_sdr/rtl2832_sdr.c index dea7743..38000d2 100644 --- a/drivers/staging/media/rtl2832u_sdr/rtl2832_sdr.c +++ b/drivers/staging/media/rtl2832u_sdr/rtl2832_sdr.c @@ -25,6 +25,7 @@ #include "dvb_frontend.h" #include "rtl2832_sdr.h" #include "dvb_usb.h" +#include "e4000.h" #include #include @@ -1347,6 +1348,7 @@ struct dvb_frontend *rtl2832_sdr_attach(struct dvb_frontend *fe, struct rtl2832_sdr_state *s; const struct v4l2_ctrl_ops *ops = &rtl2832_sdr_ctrl_ops; struct dvb_usb_device *d = i2c_get_adapdata(i2c); + struct v4l2_ctrl_handler *hdl; s = kzalloc(sizeof(struct rtl2832_sdr_state), GFP_KERNEL); if (s == NULL) { @@ -1386,10 +1388,10 @@ struct dvb_frontend *rtl2832_sdr_attach(struct dvb_frontend *fe, /* Register controls */ switch (s->cfg->tuner) { case RTL2832_TUNER_E4000: - v4l2_ctrl_handler_init(&s->hdl, 2); - s->bandwidth_auto = v4l2_ctrl_new_std(&s->hdl, ops, V4L2_CID_RF_TUNER_BANDWIDTH_AUTO, 0, 1, 1, 1); - s->bandwidth = v4l2_ctrl_new_std(&s->hdl, ops, V4L2_CID_RF_TUNER_BANDWIDTH, 4300000, 11000000, 100000, 4300000); - v4l2_ctrl_auto_cluster(2, &s->bandwidth_auto, 0, false); + hdl = e4000_get_ctrl_handler(fe); + v4l2_ctrl_handler_init(&s->hdl, 9); + if (hdl) + v4l2_ctrl_add_handler(&s->hdl, hdl, NULL); break; case RTL2832_TUNER_R820T: v4l2_ctrl_handler_init(&s->hdl, 2);