From patchwork Tue Mar 6 13:47:46 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gianluca Gennari X-Patchwork-Id: 10200 Received: from mail.tu-berlin.de ([130.149.7.33]) by www.linuxtv.org with esmtp (Exim 4.72) (envelope-from ) id 1S4ukn-0005Lh-If for patchwork@linuxtv.org; Tue, 06 Mar 2012 14:48:37 +0100 X-tubIT-Incoming-IP: 209.132.180.67 Received: from vger.kernel.org ([209.132.180.67]) by mail.tu-berlin.de (exim-4.75/mailfrontend-3) with esmtp for id 1S4ukm-0003Nz-Du; Tue, 06 Mar 2012 14:48:37 +0100 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1030679Ab2CFNsc (ORCPT ); Tue, 6 Mar 2012 08:48:32 -0500 Received: from mail-ee0-f46.google.com ([74.125.83.46]:58953 "EHLO mail-ee0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1758591Ab2CFNsU (ORCPT ); Tue, 6 Mar 2012 08:48:20 -0500 Received: by mail-ee0-f46.google.com with SMTP id c41so1888705eek.19 for ; Tue, 06 Mar 2012 05:48:19 -0800 (PST) Received-SPF: pass (google.com: domain of gennarone@gmail.com designates 10.14.47.137 as permitted sender) client-ip=10.14.47.137; Authentication-Results: mr.google.com; spf=pass (google.com: domain of gennarone@gmail.com designates 10.14.47.137 as permitted sender) smtp.mail=gennarone@gmail.com; dkim=pass header.i=gennarone@gmail.com Received: from mr.google.com ([10.14.47.137]) by 10.14.47.137 with SMTP id t9mr10539874eeb.5.1331041699898 (num_hops = 1); Tue, 06 Mar 2012 05:48:19 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:x-mailer:in-reply-to:references; bh=1JglhIRpOOtD/eaA2U+S5zIoTpsStUSq3xRBb5QRVRc=; b=1CvxzOq2/anxSD8BjsDqMB0oSff3ADJEYpLvebpQHEcFqalr+ofsY+uwwp2Jw6NV2z zwj9C/6l0HwtlFkm8z8W3IQPMJrQn3otgn/4ZcyisoVW17w2pB35+LTJc4hfC81zTwqZ tZxPxhXQqZ7mmKGcjzQ1Lt90vbTRlpmY0qbdmLjqdKvx8u/bGxJNe8d3ubEoe+aYNpUa oBuoG9uKWku25xSNi0q2sIeWa9VBU89/0hVy9Rdz9D0qxFfZaAJbIKn47XJOoyZBlOqt Z1WGFDJMNVA5sEbKwC6pL94X9v5YfVeFBh+3IbSd4n4aIp0Lxx9/J7T986298Z6npfta At9Q== Received: by 10.14.47.137 with SMTP id t9mr7997539eeb.5.1331041699823; Tue, 06 Mar 2012 05:48:19 -0800 (PST) Received: from localhost.localdomain (93-50-34-119.ip150.fastwebnet.it. [93.50.34.119]) by mx.google.com with ESMTPS id u9sm74639385eem.11.2012.03.06.05.48.18 (version=TLSv1/SSLv3 cipher=OTHER); Tue, 06 Mar 2012 05:48:19 -0800 (PST) From: Gianluca Gennari To: linux-media@vger.kernel.org, mchehab@redhat.com Cc: dheitmueller@kernellabs.com, snjw23@gmail.com, Gianluca Gennari , Ryley Angus Subject: [PATCH 2/2] as102: set optimal eLNA config values for each device Date: Tue, 6 Mar 2012 14:47:46 +0100 Message-Id: <1331041666-22361-3-git-send-email-gennarone@gmail.com> X-Mailer: git-send-email 1.7.0.4 In-Reply-To: <1331041666-22361-1-git-send-email-gennarone@gmail.com> References: <1331041666-22361-1-git-send-email-gennarone@gmail.com> Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org X-PMX-Version: 5.6.1.2065439, Antispam-Engine: 2.7.2.376379, Antispam-Data: 2012.3.6.133620 X-PMX-Spam: Gauge=IIIIIIIII, Probability=9%, Report=' FORGED_FROM_GMAIL 0.1, MULTIPLE_RCPTS 0.1, HTML_00_01 0.05, HTML_00_10 0.05, BODY_SIZE_3000_3999 0, BODY_SIZE_5000_LESS 0, BODY_SIZE_7000_LESS 0, __ANY_URI 0, __CP_URI_IN_BODY 0, __FRAUD_BODY_WEBMAIL 0, __FRAUD_REFNUM 0, __FRAUD_WEBMAIL 0, __FRAUD_WEBMAIL_FROM 0, __FROM_GMAIL 0, __HAS_MSGID 0, __HAS_X_MAILER 0, __HAS_X_MAILING_LIST 0, __MIME_TEXT_ONLY 0, __MULTIPLE_RCPTS_CC_X2 0, __PHISH_SPEAR_STRUCTURE_1 0, __SANE_MSGID 0, __SUBJ_ALPHA_END 0, __TO_MALFORMED_2 0, __TO_NO_NAME 0, __URI_NO_WWW 0, __URI_NS ' Ryley and me tested several eLNA configuration values with both a rooftop and a portable antenna. Ryley fuond out that the best value for his Elgato stick is indeed the current default value 0xC0. Instead, my stick is not capable of tuning VHF channels with 0xC0. With 0x80, VHF works but the tuner sensitivity with the portable antenna is poor. Instead, the value 0xA0 works with VHF and also gives good performance with both the rooftop and the portable antenna. So we concluded that devices built on the reference design work best with 0xA0, while custom designs (Elgato, PCTV) seem to require 0xC0. I also removed the unused parameter "minor" in struct as102_dev_t. Signed-off-by: Gianluca Gennari Signed-off-by: Ryley Angus --- drivers/staging/media/as102/as102_drv.h | 2 +- drivers/staging/media/as102/as102_fe.c | 2 +- drivers/staging/media/as102/as102_usb_drv.c | 15 ++++++++++++++- 3 files changed, 16 insertions(+), 3 deletions(-) diff --git a/drivers/staging/media/as102/as102_drv.h b/drivers/staging/media/as102/as102_drv.h index 957f0ed..b0e5a23 100644 --- a/drivers/staging/media/as102/as102_drv.h +++ b/drivers/staging/media/as102/as102_drv.h @@ -76,7 +76,7 @@ struct as102_dev_t { struct as10x_bus_adapter_t bus_adap; struct list_head device_entry; struct kref kref; - unsigned long minor; + uint8_t elna_cfg; struct dvb_adapter dvb_adap; struct dvb_frontend dvb_fe; diff --git a/drivers/staging/media/as102/as102_fe.c b/drivers/staging/media/as102/as102_fe.c index bdc5a38..9f2c610 100644 --- a/drivers/staging/media/as102/as102_fe.c +++ b/drivers/staging/media/as102/as102_fe.c @@ -265,7 +265,7 @@ static int as102_fe_ts_bus_ctrl(struct dvb_frontend *fe, int acquire) if (acquire) { if (elna_enable) - as10x_cmd_set_context(&dev->bus_adap, 1010, 0xC0); + as10x_cmd_set_context(&dev->bus_adap, CONTEXT_LNA, dev->elna_cfg); ret = as10x_cmd_turn_on(&dev->bus_adap); } else { diff --git a/drivers/staging/media/as102/as102_usb_drv.c b/drivers/staging/media/as102/as102_usb_drv.c index d775be0..8b7357e 100644 --- a/drivers/staging/media/as102/as102_usb_drv.c +++ b/drivers/staging/media/as102/as102_usb_drv.c @@ -57,6 +57,17 @@ static const char * const as102_device_names[] = { NULL /* Terminating entry */ }; +/* eLNA configuration: devices built on the reference design work best + with 0xA0, while custom designs seem to require 0xC0 */ +static uint8_t const as102_elna_cfg[] = { + 0xA0, + 0xC0, + 0xC0, + 0xA0, + 0xA0, + 0x00 /* Terminating entry */ +}; + struct usb_driver as102_usb_driver = { .name = DRIVER_FULL_NAME, .probe = as102_usb_probe, @@ -369,8 +380,10 @@ static int as102_usb_probe(struct usb_interface *intf, /* Assign the user-friendly device name */ for (i = 0; i < (sizeof(as102_usb_id_table) / sizeof(struct usb_device_id)); i++) { - if (id == &as102_usb_id_table[i]) + if (id == &as102_usb_id_table[i]) { as102_dev->name = as102_device_names[i]; + as102_dev->elna_cfg = as102_elna_cfg[i]; + } } if (as102_dev->name == NULL)