Received: by 2002:a25:824b:0:0:0:0:0 with SMTP id d11csp230957ybn; Thu, 3 Oct 2019 04:21:26 -0700 (PDT) X-Google-Smtp-Source: APXvYqxsAG5yQO1zTqNW+++OXOfWayvHv9k8lnl5I9A2Swo4dQDMin6446SNJskp5beJRFpSLydp X-Received: by 2002:a05:6402:68c:: with SMTP id f12mr8796438edy.299.1570101686738; Thu, 03 Oct 2019 04:21:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1570101686; cv=none; d=google.com; s=arc-20160816; b=Pq1uZ6fN9cTYoLQtSq3MdPxgvxHlu3bY5P7OCuoYLNKufjGzh5ql8yKYZmIot6Kmul KCPq0vy4Zn0b1Ys6QSEkKOGBj7vyobvSozKekHcSDERfwkUEErQCnfOHnLmu7GM9SGPg leLPI5axaIM+cQbhj1vNC95dFy0Vq4Tmg0GWs+olvy8lTTHc1/IHdN5HE3DoAuwK2FxD 3FZg3sDiM8P1CvS5dKxYt1+yH01R7q07FJuJa+FsVYVLXbnxPoU+SK3h+uVFbaLAqrIB aqWZHA2OWDORGG1jrNNPGH3zrl3H0WP7K5vHwqxB0/a4RHOw661/OPgFlSGYUubbckiy /aqQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:subject:cc:to:from:date :dkim-signature; bh=E0Oh63oHhIbSzhlN17sqrOoPkjj5Y53xWSnvYbnZ9z4=; b=GRrcnYYR64NQfsDXbOY9cd7M+vnGc/Z2quKoXCwJxFcf/JPAV6aNqRBa/1JlJ6US4n plZ8k60ZoKwLX53LkYEOBj0wLB6ac9gxVNUZoV1M9Bu0qIv/2GwQDR5g2s/Gc3EXqKna IeiEJPn7d7zMFuNw5RkrLAZXSHQnljnT4Tp9KdOCbKs3fnw+4KURRQZ/kK9SHXKQD+8m PGLaLZWGfBiqBgdmojMfg9bXlEETL3XYHpopZpW80+nrD9shFcYsAq/cWeE1aPUkGmGS iW63B9Lb1AsA5MI1MS5BcFPXkAYiemBw0kF5hyYOcZ/FMTu/VCugDUIqePQZsmvlTHN6 gqYg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b="dy/V4f+t"; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id q8si1076271ejx.315.2019.10.03.04.21.02; Thu, 03 Oct 2019 04:21:26 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b="dy/V4f+t"; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729936AbfJCLRt (ORCPT + 99 others); Thu, 3 Oct 2019 07:17:49 -0400 Received: from bombadil.infradead.org ([198.137.202.133]:59540 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729241AbfJCLRt (ORCPT ); Thu, 3 Oct 2019 07:17:49 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20170209; h=Content-Transfer-Encoding: Content-Type:MIME-Version:References:In-Reply-To:Message-ID:Subject:Cc:To: From:Date:Sender:Reply-To: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=E0Oh63oHhIbSzhlN17sqrOoPkjj5Y53xWSnvYbnZ9z4=; b=dy/V4f+t+E/ubISR+CLAauMVc tK3DMQMxloFI6m77U9n4BTKHG2UzzX0cdWLHVJp7El7SqBTM1Ackc988IWE8Z5O95cvFJW3IItqNm wG7VTSBQjlWBSmmsJkUt7WptsRiWp/no0EmKHsLKHTnLZzvh/IoSoaCYExZ3TdGWaBbYDD7K+W8Ft acVNvi66jAXd1sKCHarr6Ns6BmJak4r4sOwrmd/mr4fUCcI/HbdybYclZ7e4+GomREWSV9+zm3JE8 pZXxJC2nfSiN7X+yt0MCmQDtQP0EswSWv1qPMLR+ddSOZ25S29X6WygfPdjgQRsJF/QSLbjXE0GAS iLUl75UEw==; Received: from 177.133.68.49.dynamic.adsl.gvt.net.br ([177.133.68.49] helo=coco.lan) by bombadil.infradead.org with esmtpsa (Exim 4.92.2 #3 (Red Hat Linux)) id 1iFz7C-0002A4-Bh; Thu, 03 Oct 2019 11:17:46 +0000 Date: Thu, 3 Oct 2019 08:17:42 -0300 From: Mauro Carvalho Chehab To: Gonsolo Cc: JP , crope@iki.fi, Sean Young , linux-media@vger.kernel.org, Linux Kernel Subject: Re: [PATCH] si2157: Add support for Logilink VG0022A. Message-ID: <20191003081742.0933264b@coco.lan> In-Reply-To: References: <20191001205203.4b1a5fb6@coco.lan> <20191002141359.30166-1-gonsolo@gmail.com> <20191002141359.30166-2-gonsolo@gmail.com> <20191002142744.GA3475@gofer.mess.org> <20191002150650.GA4227@gofer.mess.org> <29ab2e43-4374-a3ea-6ae1-a4267867eaa4@jpvw.nl> <20191002154922.7f1cfc76@coco.lan> X-Mailer: Claws Mail 3.17.4 (GTK+ 2.24.32; x86_64-redhat-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Em Thu, 3 Oct 2019 12:57:50 +0200 Gonsolo escreveu: > Hi! > > Boot time: > > > [ 5.380991] si2168 1-0067: firmware version: B 4.0.2 > > When starting VLC: > > > [ 457.677363] si2168 1-0067: downloading firmware from file > > 'dvb-demod-si2168-b40-01.fw' > > [ 458.631034] si2168 1-0067: firmware version: B 4.0.11 > > [ 458.650309] si2157 2-0063: unknown chip version Si21255-\xff\xff\xff > > There are two different firmware versions, 4.0.2 and 4.0.11. Is that expected? It means that there's a firmware stored at the device's eeprom (version 4.0.2). When the driver starts, it downloads a newer firmware from the file dvb-demod-si2168-b40-01.fw. Btw, could you please try the enclosed hack and post the results? Thanks, Mauro diff --git a/drivers/media/tuners/si2157.c b/drivers/media/tuners/si2157.c index e87040d6eca7..3ccfd602934b 100644 --- a/drivers/media/tuners/si2157.c +++ b/drivers/media/tuners/si2157.c @@ -76,6 +76,7 @@ static int si2157_init(struct dvb_frontend *fe) const struct firmware *fw; const char *fw_name; unsigned int uitmp, chip_id; + int i; dev_dbg(&client->dev, "\n"); @@ -118,16 +119,32 @@ static int si2157_init(struct dvb_frontend *fe) goto err; } - /* query chip revision */ - memcpy(cmd.args, "\x02", 1); - cmd.wlen = 1; - cmd.rlen = 13; - ret = si2157_cmd_execute(client, &cmd); - if (ret) - goto err; + for (i = 0; i < 10; i++) { + /* query chip revision */ + memcpy(cmd.args, "\x02", 1); + cmd.wlen = 1; + cmd.rlen = 13; + ret = si2157_cmd_execute(client, &cmd); + if (ret) + goto err; + + chip_id = cmd.args[1] << 24 | cmd.args[2] << 16 | cmd.args[3] << 8 | + cmd.args[4] << 0; - chip_id = cmd.args[1] << 24 | cmd.args[2] << 16 | cmd.args[3] << 8 | - cmd.args[4] << 0; + if (chip_id != 0xffffffff) + break; + + msleep(10); + } + + if (i) + dev_info(&client->dev, "Needed to wait %i ms to get chip version", i * 10); + + if (chip_id == 0xffffffff) { + dev_err(&client->dev, "Unable to retrieve chip version\n"); + ret = -EINVAL; + goto err; + } #define SI2177_A30 ('A' << 24 | 77 << 16 | '3' << 8 | '0' << 0) #define SI2158_A20 ('A' << 24 | 58 << 16 | '2' << 8 | '0' << 0)