From patchwork Thu Oct 3 12:45:30 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gon Solo X-Patchwork-Id: 11172675 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 24B1213B1 for ; Thu, 3 Oct 2019 12:46:02 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id ED53C21D81 for ; Thu, 3 Oct 2019 12:46:01 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="Y2CNPgMh" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729170AbfJCMpr (ORCPT ); Thu, 3 Oct 2019 08:45:47 -0400 Received: from mail-wr1-f67.google.com ([209.85.221.67]:42288 "EHLO mail-wr1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726780AbfJCMpq (ORCPT ); Thu, 3 Oct 2019 08:45:46 -0400 Received: by mail-wr1-f67.google.com with SMTP id n14so2736054wrw.9; Thu, 03 Oct 2019 05:45:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=Hm/3KLPMiFgYLhw0cNyU9JiizTQ6GNbshHm6KlyE1Ew=; b=Y2CNPgMhbSKh6xdzlYgVApEYlbJWcgbWywt9jI5epA1Pnex7HPauTZEb6KoabPovqw OWEVt21EQ2q/iNwi64ssy9o8N7MvcyFWUUHrsjtAwmE0MAWlfvOuXmYzv80K6b85EqS2 7VS5Z8h6R6UuECf9uXyJ8XRo+rGkAAapGonoEViP/sZgJgkB0/Km2fu8aqX2o8p7UPlM i4+pPuqU73+rWacPG5zeiXH+ZMrdZMWb1/kMMQ9LNs2R8pjuRTwWPCDGIHxnCeYbE7ud uvwmAbywbd921yPKab5m6og+DXXRvmTawZ0e/6d7uG1E+wvwCpv5fviORaiQVrkha7tR ZvLg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=Hm/3KLPMiFgYLhw0cNyU9JiizTQ6GNbshHm6KlyE1Ew=; b=uglYywBs5x6wnXGmWw3hx7W6L+JJZwAsYBp5V8qOkyCtAxH99KmwT30b5Ou77eW00z Z9YNaags10JxhPgptUQlAvT190lOWMVQm1Kd6lzs7tate8j6ixTYZsGMZixwWZJdbJP9 kwFl8vTocHJ9muAJF5aRuzXYN66NCVLHobxbvFyum1UquR1kzYQ5JeZpB6qyih/q/S5y 722YiewznitHn2mUVxwfPJyPmmmydfgSvB0i2/RpgSfVtrLG6ePdYVsr5z8V/cmR4XaT 2DxRNPkG/IfzSbPozsvPp9BRpfGDIiKZqEGDXvl/xhOgfzbEzZYoWgVct+jk0ZgA2F5j 9JpQ== X-Gm-Message-State: APjAAAXdPmYPGhl7NfkMSi+Tl3R1ijbMPMxbWqrr5U+WLz2uHcY3RKLV X5HpgWvOeTDSbhldAgpBLwU= X-Google-Smtp-Source: APXvYqzv+O1eJ8dRkgQ6D+NIV3h7oe2bTquP92YlVVNkQaEFFLfDYdtLlqa2ewbA7Ba0tWb5nX4IkA== X-Received: by 2002:adf:f689:: with SMTP id v9mr7544605wrp.82.1570106745008; Thu, 03 Oct 2019 05:45:45 -0700 (PDT) Received: from localhost.localdomain ([46.114.33.103]) by smtp.googlemail.com with ESMTPSA id y3sm12880507wmg.2.2019.10.03.05.45.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 03 Oct 2019 05:45:44 -0700 (PDT) From: Gon Solo To: mchehab+samsung@kernel.org Cc: sean@mess.org, crope@iki.fi, linux-media@vger.kernel.org, linux-kernel@vger.kernel.org, Gon Solo Subject: [PATCH 1/3] [PATCH] af9035: Better explain how i2c bus speed is computed. Date: Thu, 3 Oct 2019 14:45:30 +0200 Message-Id: <20191003124532.10945-2-gonsolo@gmail.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20191003122027.GA2674@Limone> References: <20191003122027.GA2674@Limone> MIME-Version: 1.0 Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org Original patch from Mauro Carvalho Chehab. Signed-off-by: Gon Solo --- drivers/media/usb/dvb-usb-v2/af9035.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/drivers/media/usb/dvb-usb-v2/af9035.c b/drivers/media/usb/dvb-usb-v2/af9035.c index 3afd18733614..7828f8567da0 100644 --- a/drivers/media/usb/dvb-usb-v2/af9035.c +++ b/drivers/media/usb/dvb-usb-v2/af9035.c @@ -1197,6 +1197,9 @@ static int af9035_frontend_attach(struct dvb_usb_adapter *adap) return ret; } +/* I2C speed register = (1000000000 / (24.4 * 16 * I2C_speed)) */ +#define I2C_SPEED_REGISTER 7 + static int it930x_frontend_attach(struct dvb_usb_adapter *adap) { struct state *state = adap_to_priv(adap); @@ -1208,13 +1211,13 @@ static int it930x_frontend_attach(struct dvb_usb_adapter *adap) dev_dbg(&intf->dev, "adap->id=%d\n", adap->id); - /* I2C master bus 2 clock speed 300k */ - ret = af9035_wr_reg(d, 0x00f6a7, 0x07); + /* I2C master bus 2 clock speed ~300k */ + ret = af9035_wr_reg(d, 0x00f6a7, I2C_SPEED_REGISTER); if (ret < 0) goto err; - /* I2C master bus 1,3 clock speed 300k */ - ret = af9035_wr_reg(d, 0x00f103, 0x07); + /* I2C master bus 1,3 clock speed ~300k */ + ret = af9035_wr_reg(d, 0x00f103, I2C_SPEED_REGISTER); if (ret < 0) goto err; From patchwork Thu Oct 3 12:45:31 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gon Solo X-Patchwork-Id: 11172677 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 455F217EE for ; Thu, 3 Oct 2019 12:46:02 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 23F23222CB for ; Thu, 3 Oct 2019 12:46:02 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="nW0aGAeM" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729375AbfJCMpu (ORCPT ); Thu, 3 Oct 2019 08:45:50 -0400 Received: from mail-wr1-f65.google.com ([209.85.221.65]:45590 "EHLO mail-wr1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726780AbfJCMpt (ORCPT ); Thu, 3 Oct 2019 08:45:49 -0400 Received: by mail-wr1-f65.google.com with SMTP id r5so2712247wrm.12; Thu, 03 Oct 2019 05:45:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=940db3PTzUda6NGaBwDYe5qsP3ZwZELMQcnjKXaprP4=; b=nW0aGAeMTpDogI570OyQ7RcWumU9hli3TunxU9LKP9uY9CKVatmy8tsrDN7jzzYrko 22aWfwLeoOdzJJtyEBwySSRoZSRiquYjzJ2+vZcSuyavaLtgfDoJrrRpaiDAr0pJfIEv JyuJKnkMHDCOoCFOQCUMVvaTrpLG7iZf9K4xI3XI8MLmLvMA0yHdlePOvd/BZ+yJoE83 KSxM861fItp0LXjymGnBgrmTlEje1QUIg3OlTQP7ezLoSqmmiRpgyiQwQEwxNbRKMlXF m8pld1qfyYr38G8VSnWDd98tICSyJ5GKgYPmbVAapsdSjDH0GJlAZLbQK3DRuqAdA6lE rd+g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=940db3PTzUda6NGaBwDYe5qsP3ZwZELMQcnjKXaprP4=; b=EM/kmX/cUGWnCx4wUhXdkcra0ekfVwin82HaT1DR9vbKXiPt+aOdCTcBvHRZ2WX9eZ 9s7xjYTvE+/PXpXntueusMhA2oYINmE5Z+FjDq2xPx+zgPfOHml8cZM98Gea5z06+tjC XHQxeamTVoekAsXGgWEw0UViV83R0aC3Zc53PiZY5NimPOjCDnL3JDuqlxgPdrNf9Bjy Est+JzEGjI0TUAly6MPz6tzZYvccMdybfaTtdVv7h8UYRIUf9wUtB2a8C/RhkzIlEzZW YyQac2t3NnTNVjiibGwrsrLEWRbKUue2eCJJU/WH5306s7RuZ6RqOrYZtI+EwD8WewA+ iMHQ== X-Gm-Message-State: APjAAAWAQoxlM8HFam8cSm8KjX6Dp+N6w+rnNG5hyHAQG4RHy72EtZbV 2wSZsuFJomCuWUSJsn8Rn1s= X-Google-Smtp-Source: APXvYqzBC/BZSo+iZOU2bw8Al2Lirz6sYYF+jLTttY6uZAvnxvgZ0CU7ilvCpmrpZ1fy0uwH7pbblA== X-Received: by 2002:a5d:52c2:: with SMTP id r2mr7218402wrv.367.1570106746330; Thu, 03 Oct 2019 05:45:46 -0700 (PDT) Received: from localhost.localdomain ([46.114.33.103]) by smtp.googlemail.com with ESMTPSA id y3sm12880507wmg.2.2019.10.03.05.45.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 03 Oct 2019 05:45:45 -0700 (PDT) From: Gon Solo To: mchehab+samsung@kernel.org Cc: sean@mess.org, crope@iki.fi, linux-media@vger.kernel.org, linux-kernel@vger.kernel.org, Gon Solo Subject: [PATCH 2/3] [PATCH] s2157: Handle bogus chip version. Date: Thu, 3 Oct 2019 14:45:31 +0200 Message-Id: <20191003124532.10945-3-gonsolo@gmail.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20191003122027.GA2674@Limone> References: <20191003122027.GA2674@Limone> MIME-Version: 1.0 Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org On some hardware bogus chip version numbers are returned. Try to continue without firmware. Signed-off-by: Gon Solo --- drivers/media/tuners/si2157.c | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/drivers/media/tuners/si2157.c b/drivers/media/tuners/si2157.c index e87040d6eca7..615bc8a75c64 100644 --- a/drivers/media/tuners/si2157.c +++ b/drivers/media/tuners/si2157.c @@ -129,13 +129,14 @@ static int si2157_init(struct dvb_frontend *fe) chip_id = cmd.args[1] << 24 | cmd.args[2] << 16 | cmd.args[3] << 8 | cmd.args[4] << 0; - #define SI2177_A30 ('A' << 24 | 77 << 16 | '3' << 8 | '0' << 0) - #define SI2158_A20 ('A' << 24 | 58 << 16 | '2' << 8 | '0' << 0) - #define SI2148_A20 ('A' << 24 | 48 << 16 | '2' << 8 | '0' << 0) - #define SI2157_A30 ('A' << 24 | 57 << 16 | '3' << 8 | '0' << 0) - #define SI2147_A30 ('A' << 24 | 47 << 16 | '3' << 8 | '0' << 0) - #define SI2146_A10 ('A' << 24 | 46 << 16 | '1' << 8 | '0' << 0) - #define SI2141_A10 ('A' << 24 | 41 << 16 | '1' << 8 | '0' << 0) + #define SI2177_A30 ('A' << 24 | 77 << 16 | '3' << 8 | '0' << 0) + #define SI2158_A20 ('A' << 24 | 58 << 16 | '2' << 8 | '0' << 0) + #define SI2148_A20 ('A' << 24 | 48 << 16 | '2' << 8 | '0' << 0) + #define SI2157_A30 ('A' << 24 | 57 << 16 | '3' << 8 | '0' << 0) + #define SI2147_A30 ('A' << 24 | 47 << 16 | '3' << 8 | '0' << 0) + #define SI2146_A10 ('A' << 24 | 46 << 16 | '1' << 8 | '0' << 0) + #define SI2141_A10 ('A' << 24 | 41 << 16 | '1' << 8 | '0' << 0) + #define SI_BOGUS (255 << 24 | 255 << 16 | 255 << 8 | 255 << 0) switch (chip_id) { case SI2158_A20: @@ -148,6 +149,10 @@ static int si2157_init(struct dvb_frontend *fe) case SI2177_A30: fw_name = SI2157_A30_FIRMWARE; break; + case SI_BOGUS: + dev_info(&client->dev, "Bogus chip version, trying with no firmware\n"); + fw_name = NULL; + break; case SI2157_A30: case SI2147_A30: case SI2146_A10: From patchwork Thu Oct 3 12:45:32 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gon Solo X-Patchwork-Id: 11172679 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 7065976 for ; Thu, 3 Oct 2019 12:46:02 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 4F1FE21D81 for ; Thu, 3 Oct 2019 12:46:02 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="FkjmAdLE" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729590AbfJCMpx (ORCPT ); Thu, 3 Oct 2019 08:45:53 -0400 Received: from mail-wm1-f67.google.com ([209.85.128.67]:53242 "EHLO mail-wm1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729359AbfJCMpu (ORCPT ); Thu, 3 Oct 2019 08:45:50 -0400 Received: by mail-wm1-f67.google.com with SMTP id r19so2178688wmh.2; Thu, 03 Oct 2019 05:45:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=fsP3cZqmFOpdaGYxxpYbN4dztYokivLUizeDopvF2Jk=; b=FkjmAdLEuwWuX2q7hwt6yjHPb2HiLHCYK9FJmsjxGOx7/KamhQpBriKzCLnHngt5OI 4cz0NdZ2BitH5aLrWz/PQtu+gaFs14gKVU8NNxKJ0AJg4uuCjSoeRd+htU2n1K4ey4eF ATfBY2wq1wE0OOhgteka7F6kBqywZh+H+WPUrUD9e3z2NmKyneAdi3KSZuaCwlBBkipY QsOnBhFJ/DvzvotrF5e2th/cgzeNY0eGaGnWazx9fHHroxP7pg4hHmHjGI1Qz7kEuivg SHxXx/t18YNm69EVW8bu06U/KWlnUDAYa7/e17LD/4mYt4N2sDS8Y2TfmV995VY1BN91 RfLw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=fsP3cZqmFOpdaGYxxpYbN4dztYokivLUizeDopvF2Jk=; b=SOEbq85AV/Y12W45sfpOpouHz761z2tlG1kToaak8Vb5skivIyKduPQKqXj5ZrzEDs ciz4ElHrXlm9JV3C3vkJaQWK5Hz9uuOcz9mR0VLlyabqS7dNVKlhkvdd9WpNw/Ul4Raq hYA1VEJ5Toq2piTrlG+ETc0KLBA3+aFjPgknlc4QqMjsQze2UiXybXoNraszEnYef3wl YHzz4QaGf7orMIzkzmrRY4N1rhsqSRBuezHyNa7ga8rh2bskKZ22DqELEGT7AKrdBKxo VQc/EEkZLCjo3CfqGLwN2FlnAtOW8Km/0vWZYqQ/db9w7wMsHpWxGq9yFpq9Lm8sHug3 roLw== X-Gm-Message-State: APjAAAVYiH1OLFQTvRjLXal1/OdNuMpABCsJAcWzqVj8/zJb3VwlmSA/ Uzj5m/rNridsaeavnmN5L7/FmEko8Xk= X-Google-Smtp-Source: APXvYqycbt37vdd4ERJbV1fj5BjmylITE0M1F2w40YExNd03ARYXVgP02Pvmdyw3Q3uIJoW2nLmduA== X-Received: by 2002:a7b:c203:: with SMTP id x3mr7178029wmi.8.1570106748107; Thu, 03 Oct 2019 05:45:48 -0700 (PDT) Received: from localhost.localdomain ([46.114.33.103]) by smtp.googlemail.com with ESMTPSA id y3sm12880507wmg.2.2019.10.03.05.45.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 03 Oct 2019 05:45:47 -0700 (PDT) From: Gon Solo To: mchehab+samsung@kernel.org Cc: sean@mess.org, crope@iki.fi, linux-media@vger.kernel.org, linux-kernel@vger.kernel.org, Gon Solo Subject: [PATCH 3/3] [PATCH] af9035: Add Logilink VG0022A id. Date: Thu, 3 Oct 2019 14:45:32 +0200 Message-Id: <20191003124532.10945-4-gonsolo@gmail.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20191003122027.GA2674@Limone> References: <20191003122027.GA2674@Limone> MIME-Version: 1.0 Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org Original patch from Andreas Kemnade. Signed-off-by: Gon Solo --- drivers/media/usb/dvb-usb-v2/af9035.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/media/usb/dvb-usb-v2/af9035.c b/drivers/media/usb/dvb-usb-v2/af9035.c index 7828f8567da0..a02cafadfb49 100644 --- a/drivers/media/usb/dvb-usb-v2/af9035.c +++ b/drivers/media/usb/dvb-usb-v2/af9035.c @@ -2122,6 +2122,8 @@ static const struct usb_device_id af9035_id_table[] = { /* IT930x devices */ { DVB_USB_DEVICE(USB_VID_ITETECH, USB_PID_ITETECH_IT9303, &it930x_props, "ITE 9303 Generic", NULL) }, + { DVB_USB_DEVICE(USB_VID_DEXATEK, 0x0100, + &it930x_props, "Logilink VG0022A", NULL) }, { DVB_USB_DEVICE(USB_VID_AVERMEDIA, USB_PID_AVERMEDIA_TD310, &it930x_props, "AVerMedia TD310 DVB-T2", NULL) }, { }