From patchwork Fri Oct 4 13:15:24 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mauro Carvalho Chehab X-Patchwork-Id: 11174481 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id DC1D71902 for ; Fri, 4 Oct 2019 13:15:46 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id B9E94222C2 for ; Fri, 4 Oct 2019 13:15:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1570194946; bh=HKVYJOd8nlFyRLZWLG9ZCwnPGqerccWR7yCvAb5VGKk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=ouHKv0N+HOVmwt0RlvqBxld0R05xQ709Rg3u/WEVsiqgqfw25NKGBQWR90MQK/ap5 7TrMn7OJaTENuSi6/bLoFKTnrIUeapnYqW6kISLMmRDw1GG7gtfsqDzNYU3EUXMHVV McsA283hf6QvOH41wqBYoWBsu1wQl06V6stAUerk= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2388393AbfJDNPe (ORCPT ); Fri, 4 Oct 2019 09:15:34 -0400 Received: from bombadil.infradead.org ([198.137.202.133]:45552 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2388362AbfJDNPd (ORCPT ); Fri, 4 Oct 2019 09:15:33 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20170209; h=Sender:Content-Transfer-Encoding: MIME-Version:References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From: Reply-To:Content-Type:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help: List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=5Jk2FsConQzsRK+hX40Ij18Y47YadtEMXcbabS4xxtY=; b=jXIrfHc8V9Vh47xoIPFMutpDf9 RL16l8pr5w31/0SRBIMtw+5g9PUj2bVglq4SWN4RyY6ZlDE4CwYAjkujYBAHnN9yiacvsDn3LdyhA aNUGOADYAzg6zLCfA1HID5O12KsDHq46t7G/063BWC/LYG7kijxCXQ/adGv+ip8ZktHDzqFhksEb/ GcXSWfrssd2bPFeit8r+7P07YzjwnlXolwy7hNjWR9tGDh20qExWz2RxT9pl43oblRAscvuuxbCBi kB3H4+flB+LMFsjzcQ4JlmQciCIRwo1FF0edQxdiAUloYljwgg6rXd6XBrvDlCJE2Go+Ra96Zo5Ba b5raJcrw==; Received: from 177.133.68.49.dynamic.adsl.gvt.net.br ([177.133.68.49] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtpsa (Exim 4.92.2 #3 (Red Hat Linux)) id 1iGNQj-0007jG-5d; Fri, 04 Oct 2019 13:15:33 +0000 Received: from mchehab by bombadil.infradead.org with local (Exim 4.92.2) (envelope-from ) id 1iGNQg-0002hw-8j; Fri, 04 Oct 2019 10:15:30 -0300 From: Mauro Carvalho Chehab To: Linux Media Mailing List Cc: Mauro Carvalho Chehab , Mauro Carvalho Chehab , JP , Gonsolo , crope@iki.fi, Sean Young , Linux Kernel Subject: [PATCH 3/4] media: af9035: add support for Logilink VG0022A Date: Fri, 4 Oct 2019 10:15:24 -0300 Message-Id: <9618316567493f917c41109f7dba94e533fbfb4b.1570194906.git.mchehab+samsung@kernel.org> X-Mailer: git-send-email 2.21.0 In-Reply-To: <2942b7ca9ecf86b6bff75c10ccfca25c173c3f0d.1570194906.git.mchehab+samsung@kernel.org> References: <2942b7ca9ecf86b6bff75c10ccfca25c173c3f0d.1570194906.git.mchehab+samsung@kernel.org> MIME-Version: 1.0 Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org This it930x-based device has an issue with si2068. When the si2168 firmware that came with the device is replaced by a new one, any I2C data received from the tuner will be replaced by 0xff. Probably, the vendor firmware has some patch specifically designed for this device. So, we can't replace by the generic firmware. The right solution would be to extract the si2168 firmware from the original driver and ask the driver to load the specifically designed firmware, but, while we don't have that, the next best solution is to just keep the original firmware at the device. For more details, see the discussions at: https://lore.kernel.org/linux-media/20191002141359.30166-2-gonsolo@gmail.com/ Signed-off-by: Mauro Carvalho Chehab Signed-off-by: Andreas Wendleder --- 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 3afd18733614..e555483c3077 100644 --- a/drivers/media/usb/dvb-usb-v2/af9035.c +++ b/drivers/media/usb/dvb-usb-v2/af9035.c @@ -1255,6 +1255,23 @@ static int it930x_frontend_attach(struct dvb_usb_adapter *adap) si2168_config.fe = &adap->fe[0]; si2168_config.ts_mode = SI2168_TS_SERIAL; + /* + * HACK: The Logilink VG0022A has a bug: when the si2168 + * firmware that came with the device is replaced by a new + * one, the I2C transfers to the tuner will return just 0xff. + * + * Probably, the vendor firmware has some patch specifically + * designed for this device. So, we can't replace by the + * generic firmware. The right solution would be to extract + * the si2168 firmware from the original driver and ask the + * driver to load the specifically designed firmware, but, + * while we don't have that, the next best solution is to just + * keep the original firmware at the device. + */ + if (le16_to_cpu(d->udev->descriptor.idVendor) == USB_VID_DEXATEK && + le16_to_cpu(d->udev->descriptor.idProduct) == 0x0100) + si2168_config.dont_load_firmware = true; + state->af9033_config[adap->id].fe = &adap->fe[0]; state->af9033_config[adap->id].ops = &state->ops; ret = af9035_add_i2c_dev(d, "si2168", @@ -2121,6 +2138,8 @@ static const struct usb_device_id af9035_id_table[] = { &it930x_props, "ITE 9303 Generic", NULL) }, { DVB_USB_DEVICE(USB_VID_AVERMEDIA, USB_PID_AVERMEDIA_TD310, &it930x_props, "AVerMedia TD310 DVB-T2", NULL) }, + { DVB_USB_DEVICE(USB_VID_DEXATEK, 0x0100, + &it930x_props, "Logilink VG0022A", NULL) }, { } }; MODULE_DEVICE_TABLE(usb, af9035_id_table);