Received: by 2002:a25:8b12:0:0:0:0:0 with SMTP id i18csp34806ybl; Tue, 20 Aug 2019 15:08:21 -0700 (PDT) X-Google-Smtp-Source: APXvYqzKPaQJnrXRopvl9RWiwdzh1kphgLDGTbkh15MitR4TR7L408VXX0OLzOIwBiyk8G3iIxKk X-Received: by 2002:a17:90a:5884:: with SMTP id j4mr2244023pji.142.1566338901068; Tue, 20 Aug 2019 15:08:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1566338901; cv=none; d=google.com; s=arc-20160816; b=dik3I6+UIxpBykdDA8TR1kNAqwbl2mgTTBA3Ox5LVf9lEHbDCW6VfHDXltYASsMgq/ 9Ebcgni/FIRUFm6pe6so3ttxTQMr2motrJDWknJSrr/Ws7RBf6lkUjUAF1npa7UY1Idq rx2sIQmq/xg3tra61X9V/Emuo0UEf/XyUhXrOwDRL3FXxbZlWyQRxKeWCHzb4PDbonTU 3Zz1WVwePh64TJmehIcjEQJwxgiWsShmNfb4Gc+T7Wa7pqk3wLgFLWluFiqOBrYXdghL zDB+QC2G5iBcfrOfw3jXX4b2OOdClMbjHKgb+7nJCaC74bfPvNJEMjSDwU9mMae3Nu83 zWsg== 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=ssTcdeE01+eXmxLhy2C3D3BUaRWWDORrBxqPLhq1agA=; b=bJKQMBvgKG1nh1z3DXGEi63viYe8hxtQncwyZGI/KONcSeD+BJD11kz4h0djZAFOQd bQjaSAiaCVl2u591nIywq9MDOaJnMVZQVDusq1wee47ZLiZGbfBigYhIUxRpSHvnr1WJ A2gC4Zy4pxZelp7sxWnVO6aOMppKk+qVrfwQgSrFzOaKJ/vtADRmtulRdmvfByobPA04 bPwnZVf9tqxE91DzlbK9gX5qtqgNYSouTnLj2khUrQdAIK4wG49bNUeKFO/GxcOeY+jp nQOprS3RJRORX/HUFu1nGTZ9aeNrEOamf5pSm7xLjja9l54/tacQmht3QaRncvdXYYE1 GMPA== 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 a23si12785358pgg.131.2019.08.20.15.07.42; Tue, 20 Aug 2019 15:08:21 -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 S1730839AbfHTWGI (ORCPT + 99 others); Tue, 20 Aug 2019 18:06:08 -0400 Received: from vps-vb.mhejs.net ([37.28.154.113]:58440 "EHLO vps-vb.mhejs.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730092AbfHTWGH (ORCPT ); Tue, 20 Aug 2019 18:06:07 -0400 Received: from MUA by vps-vb.mhejs.net with esmtps (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.92) (envelope-from ) id 1i0CGQ-00075L-K2; Wed, 21 Aug 2019 00:06:02 +0200 From: "Maciej S. Szmigiero" To: Mauro Carvalho Chehab Cc: Matthias Schwarzott , linux-kernel , linux-media@vger.kernel.org Subject: [PATCH] media: saa7134: keep demod i2c gate closed on Medion 7134 Date: Wed, 21 Aug 2019 00:05:54 +0200 Message-Id: <20190820220555.883092-1-mail@maciej.szmigiero.name> X-Mailer: git-send-email 2.23.0 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 closed so the eeprom chips won't clash. The demod firmware load is done with its i2c gate closed anyway so it is not affected by this change. Signed-off-by: Maciej S. Szmigiero --- This replaces the "media: saa7134: keep demod i2c gate open on Medion 7134" submission as it used an inverted open / closed terminology by mistake. 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..f359cd5c006a 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 open (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 closed - + * saa7134_i2c_eeprom_md7134_gate() will close it for + * us at probe time if it was open 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);