From patchwork Thu Jun 12 23:12:24 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Antti Palosaari X-Patchwork-Id: 24340 Received: from mail.tu-berlin.de ([130.149.7.33]) by www.linuxtv.org with esmtp (Exim 4.72) (envelope-from ) id 1WvEAe-0000jQ-5v; Fri, 13 Jun 2014 01:12:36 +0200 X-tubIT-Incoming-IP: 209.132.180.67 Received: from vger.kernel.org ([209.132.180.67]) by mail.tu-berlin.de (exim-4.72/mailfrontend-7) with esmtp id 1WvEAb-0003gD-0m; Fri, 13 Jun 2014 01:12:35 +0200 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1750811AbaFLXMb (ORCPT + 1 other); Thu, 12 Jun 2014 19:12:31 -0400 Received: from mail.kapsi.fi ([217.30.184.167]:56134 "EHLO mail.kapsi.fi" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750777AbaFLXMa (ORCPT ); Thu, 12 Jun 2014 19:12:30 -0400 Received: from 85-23-164-3.bb.dnainternet.fi ([85.23.164.3] helo=localhost.localdomain) by mail.kapsi.fi with esmtpsa (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.72) (envelope-from ) id 1WvEAX-0003DC-1V; Fri, 13 Jun 2014 02:12:29 +0300 From: Antti Palosaari To: linux-media@vger.kernel.org Cc: Antti Palosaari Subject: [PATCH] af9035: override tuner for AVerMedia A835B devices Date: Fri, 13 Jun 2014 02:12:24 +0300 Message-Id: <1402614744-15723-1-git-send-email-crope@iki.fi> X-Mailer: git-send-email 1.9.3 X-SA-Exim-Connect-IP: 85.23.164.3 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-PMX-Version: 6.0.0.2142326, Antispam-Engine: 2.7.2.2107409, Antispam-Data: 2014.6.12.230019 X-PMX-Spam: Gauge=IIIIIIII, Probability=8%, Report=' HTML_00_01 0.05, HTML_00_10 0.05, BODYTEXTP_SIZE_3000_LESS 0, BODY_SIZE_1500_1599 0, BODY_SIZE_2000_LESS 0, BODY_SIZE_5000_LESS 0, BODY_SIZE_7000_LESS 0, URI_ENDS_IN_HTML 0, __ANY_URI 0, __CP_URI_IN_BODY 0, __DATE_TZ_RU 0, __HAS_FROM 0, __HAS_MSGID 0, __HAS_X_MAILER 0, __HAS_X_MAILING_LIST 0, __MIME_TEXT_ONLY 0, __SANE_MSGID 0, __STOCK_PHRASE_7 0, __SUBJ_ALPHA_END 0, __TO_MALFORMED_2 0, __TO_NO_NAME 0, __URI_NO_WWW 0, __URI_NS ' Tuner ID set into EEPROM is wrong, which causes driver to select wrong tuner profile. That leads device non-working. Fix issue by overriding known bad tuner IDs with suitable default value. Signed-off-by: Antti Palosaari --- drivers/media/usb/dvb-usb-v2/af9035.c | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/drivers/media/usb/dvb-usb-v2/af9035.c b/drivers/media/usb/dvb-usb-v2/af9035.c index 021e4d3..204a91a 100644 --- a/drivers/media/usb/dvb-usb-v2/af9035.c +++ b/drivers/media/usb/dvb-usb-v2/af9035.c @@ -773,6 +773,25 @@ static int af9035_read_config(struct dvb_usb_device *d) addr += 0x10; /* shift for the 2nd tuner params */ } + /* + * These AVerMedia devices has a bad EEPROM content :-( + * Override some wrong values here. + */ + if (le16_to_cpu(d->udev->descriptor.idVendor) == USB_VID_AVERMEDIA) { + switch (le16_to_cpu(d->udev->descriptor.idProduct)) { + case USB_PID_AVERMEDIA_A835B_1835: + case USB_PID_AVERMEDIA_A835B_2835: + case USB_PID_AVERMEDIA_A835B_3835: + dev_info(&d->udev->dev, + "%s: overriding tuner from %02x to %02x\n", + KBUILD_MODNAME, state->af9033_config[0].tuner, + AF9033_TUNER_IT9135_60); + + state->af9033_config[0].tuner = AF9033_TUNER_IT9135_60; + break; + } + } + skip_eeprom: /* get demod clock */ ret = af9035_rd_reg(d, 0x00d800, &tmp);