Received: by 2002:a25:8b12:0:0:0:0:0 with SMTP id i18csp2009737ybl; Sun, 18 Aug 2019 16:14:19 -0700 (PDT) X-Google-Smtp-Source: APXvYqzKa6tuhOqqqWcky2e5Rr39dbk37KubRl5PN+TjxpmE1I3qU0t4IWNVemGHq3nsKBi0ve4O X-Received: by 2002:a17:902:9a95:: with SMTP id w21mr19546161plp.126.1566170059578; Sun, 18 Aug 2019 16:14:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1566170059; cv=none; d=google.com; s=arc-20160816; b=FkeMNY1y08k31ZV1xn5+B3Ow4UdIkMzCeTAvq0ZYruHjzJNpWKavJhGP0BzCo6fUeP gKmsIxuSZpkGF+9NrwmrTOSXnVN3fIVCdMC7UlbQPL3NNop6JdRaNET82CXaRijSf0gB 8y2HkmDTvMe27UXPn/yvJiOf1+r+sjcTAm9n2tWz5TeZOa86GMcZUiIuKwhCVe9/obeO 7uM9R2Sr0CJd4vUheKUpdmrXE9MVFehdlefpu3wKYnoISx8PEjZAp1+bxWEF1xx1wBTy R7uwWgHuLQeGAG6QQj0QG4YwKQ5/zfGTUv1vlGHsASNNTGyc3VJ9VnxCfJHFlbQclGfL uyIg== 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 :message-id:date:subject:cc:to:from; bh=My6z2ura9t6JxLLObDSnP3V+ynNQSB75bJKc5OCE2Ts=; b=RGlDgT30traMn5WTSGz1NgVLriBIBxEkpQ7+i/29Tk0vtDw6FTxVf5nMQwL+QeVUvM O/5ZDYIFKkBP0cQ0wyQnXxpdqNIhoLRYsyysOLMKj3tRYs5XjwoEbegjCh+LqhU7708g /xXfZtwCScCPicCAM9g0DunF+oJ/C4DcN/+U7evYAJLryZyGbpErUF3A5Op5/6S9ZxdA eFSPFfhMD6bTQl/SVC+ewOeW3JFHgyvPj690auw1uMyB9p01B0ZWiLYP+Nv7eK3KWl7G A+UXITPNcOB3/HovIQoMUFCdcTpblIH0iznZL3Gwf0/NMrtKEmMr2PIKbt5S+7D4PPGx MZfA== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id l66si8677684plb.337.2019.08.18.16.13.54; Sun, 18 Aug 2019 16:14:19 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726291AbfHRXMb (ORCPT + 99 others); Sun, 18 Aug 2019 19:12:31 -0400 Received: from vps-vb.mhejs.net ([37.28.154.113]:41114 "EHLO vps-vb.mhejs.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726211AbfHRXMb (ORCPT ); Sun, 18 Aug 2019 19:12:31 -0400 X-Greylist: delayed 1004 seconds by postgrey-1.27 at vger.kernel.org; Sun, 18 Aug 2019 19:12:29 EDT Received: from MUA by vps-vb.mhejs.net with esmtps (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.92) (envelope-from ) id 1hzU5Q-0005ur-5c; Mon, 19 Aug 2019 00:55:44 +0200 From: "Maciej S. Szmigiero" To: Mauro Carvalho Chehab Cc: linux-media@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] media: saa7134: keep demod i2c gate open on Medion 7134 Date: Mon, 19 Aug 2019 00:55:38 +0200 Message-Id: <20190818225538.302738-1-mail@maciej.szmigiero.name> X-Mailer: git-send-email 2.22.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Medion 7134 has two i2c eeproms on the same i2c bus sharing the same bus addresses: the first one for SAA7134 chip config and the second one behind TDA10046 DVB-T demod chip i2c gate storing its firmware. The TV tuner on this board is not behind this i2c gate. Due to the bus conflict described above, the card PCI SVID / SSID sometimes gets garbled after a reboot, which makes it necessary to specify the card model manually as an insmod option in order for it to be detected reliably. To avoid this, let's just leave the gate permanently open so the eeprom chips won't clash. The demod firmware load is done with its i2c gate open anyway so it is not affected by this change. Signed-off-by: Maciej S. Szmigiero --- drivers/media/pci/saa7134/saa7134-dvb.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/drivers/media/pci/saa7134/saa7134-dvb.c b/drivers/media/pci/saa7134/saa7134-dvb.c index eb8377a95023..ace019ef6784 100644 --- a/drivers/media/pci/saa7134/saa7134-dvb.c +++ b/drivers/media/pci/saa7134/saa7134-dvb.c @@ -1264,6 +1264,20 @@ static int dvb_init(struct saa7134_dev *dev) &medion_cardbus, &dev->i2c_adap); if (fe0->dvb.frontend) { + /* + * The TV tuner on this board is actually NOT + * behind the demod i2c gate. + * However, the demod eeprom is indeed there and it + * conflicts with the SAA7134 chip config eeprom + * if the i2c gate is closed (since they have same + * bus addresses) resulting in card PCI SVID / SSID + * being garbage after a reboot from time to time. + * + * Let's just leave the gate permanently open - + * saa7134_i2c_eeprom_md7134_gate() will open it for + * us at probe time if it was closed for some reason. + */ + fe0->dvb.frontend->ops.i2c_gate_ctrl = NULL; dvb_attach(simple_tuner_attach, fe0->dvb.frontend, &dev->i2c_adap, medion_cardbus.tuner_address, TUNER_PHILIPS_FMD1216ME_MK3);