Received: by 2002:a25:6193:0:0:0:0:0 with SMTP id v141csp4763275ybb; Tue, 14 Apr 2020 13:39:48 -0700 (PDT) X-Google-Smtp-Source: APiQypKn5BG6OjW2SVeLUOdgWddvVmzfBmk8HavRekAoSBuTXpltXxJQD4gOUN9BFSJ+1SW0YUh6 X-Received: by 2002:a17:906:c7c5:: with SMTP id dc5mr1977737ejb.50.1586896788163; Tue, 14 Apr 2020 13:39:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1586896788; cv=none; d=google.com; s=arc-20160816; b=GWbyQwEsDYOrzxdP2IQ4Z1c9kV6xJIg5OQd/Sk/6fLTNKDYKLWRQseVj1ehxi7Lf9H UK4gBShXFqlFCfSECPHHAN1/gBgVSLkLj5jNtggeK0nDqFj40I0Zt5SJz4pa6D2f7Mmm J5pNoY7eyWcO9WwitKiwMF2bFvCtjmfIzylLma9wSSvUn6sdjo7q8KHpipGYt5OPM+fw mAF8/ldXP40PiYXf7yQdsEeM4QoZi9Ny9QMYaffXRCeREOABvNI3LotmwaONnWfnYbYt 1uSq67Rh07Nse7YpBQj9julKpJVn+iH5X38TXd+ZkbcmiFaMKWkjdcomzGuZqrPFhMRt nP/g== 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=caWDG0Tt5CnCCfKKGb4GPbwRSW732MB3B871K2hCqxo=; b=sICZzP0IQ1D9rZMt495Cwe7hpvDOzMXaoFOgV+DOC7fX3xOeJ635fTRrnnfeFX8JjO NV3aijlZjInATmpmESWGlCG6Zc7gACjmXau44W9jhdsmkxd3UQoVSEJVK9SUb9U+vGGQ 9A83WAtV8qir2XmDAy3soxruXqk0j80kSO9wDjlCRhuhzVlaf1xwX3JlVpFCeG7jv4kL 0fLZpIK6L5oipQlB6L8+Zsi0zdr9gsFPjEEe7npW3ZD7yzwcAiu7zTEfcrbUKSmueFrH UQWiK6LL5TFtGwJyvMDIH9/kWaoTT+9CBbe1Z5nXgBiEu/Kxsqb9Gr0Qn0ZuGF/BR/Qk gtfg== 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 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=collabora.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id y10si8919783ejw.403.2020.04.14.13.39.22; Tue, 14 Apr 2020 13:39:48 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=collabora.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729220AbgDMPGr (ORCPT + 99 others); Mon, 13 Apr 2020 11:06:47 -0400 Received: from bhuna.collabora.co.uk ([46.235.227.227]:59934 "EHLO bhuna.collabora.co.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728593AbgDMPGr (ORCPT ); Mon, 13 Apr 2020 11:06:47 -0400 Received: from [127.0.0.1] (localhost [127.0.0.1]) (Authenticated sender: sre) with ESMTPSA id 31F6A2A1296 Received: by jupiter.universe (Postfix, from userid 1000) id 948F64800F7; Mon, 13 Apr 2020 17:06:42 +0200 (CEST) From: Sebastian Reichel To: Jean Delvare Cc: linux-i2c@vger.kernel.org, linux-kernel@vger.kernel.org, Sebastian Reichel , Adam Honse Subject: [PATCH] i2c: piix4: Add second SMBus for X370/X470/X570 Date: Mon, 13 Apr 2020 17:06:34 +0200 Message-Id: <20200413150634.474842-1-sebastian.reichel@collabora.com> X-Mailer: git-send-email 2.25.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 The second interface can be found on X370, X470 and X570 according to the bugzilla entry. I only tested with X570 on an ASRock X570 Taichi: $ lspci -nnv -d 1022:790b 00:14.0 SMBus [0c05]: Advanced Micro Devices, Inc. [AMD] FCH SMBus Controller [1022:790b] (rev 61) Subsystem: ASRock Incorporation FCH SMBus Controller [1849:ffff] Flags: 66MHz, medium devsel Kernel driver in use: piix4_smbus Kernel modules: i2c_piix4, sp5100_tco Before the patch: $ i2cdetect -l | grep PIIX4 i2c-1 unknown SMBus PIIX4 adapter port 2 at 0b00 N/A i2c-0 unknown SMBus PIIX4 adapter port 0 at 0b00 N/A After the patch: $ i2cdetect -l | grep PIIX4 i2c-1 unknown SMBus PIIX4 adapter port 2 at 0b00 N/A i2c-2 unknown SMBus PIIX4 adapter port 1 at 0b20 N/A i2c-0 unknown SMBus PIIX4 adapter port 0 at 0b00 N/A Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=202587 Reported-by: Adam Honse Signed-off-by: Sebastian Reichel --- Hi, The Bugzilla entry contains a second change, which reduces the timeouts for quicker operation. I did not include that change, since I do not know if this is a good idea for all devices supported by this driver. In any case it should be a separate patch. Let's get the interface working for now. -- Sebastian --- drivers/i2c/busses/i2c-piix4.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/drivers/i2c/busses/i2c-piix4.c b/drivers/i2c/busses/i2c-piix4.c index 30ded6422e7b..3e89143a0ecf 100644 --- a/drivers/i2c/busses/i2c-piix4.c +++ b/drivers/i2c/busses/i2c-piix4.c @@ -976,9 +976,11 @@ static int piix4_probe(struct pci_dev *dev, const struct pci_device_id *id) } } - if (dev->vendor == PCI_VENDOR_ID_AMD && - dev->device == PCI_DEVICE_ID_AMD_HUDSON2_SMBUS) { - retval = piix4_setup_sb800(dev, id, 1); + if (dev->vendor == PCI_VENDOR_ID_AMD) { + if (dev->device == PCI_DEVICE_ID_AMD_HUDSON2_SMBUS || + dev->device == PCI_DEVICE_ID_AMD_KERNCZ_SMBUS) { + retval = piix4_setup_sb800(dev, id, 1); + } } if (retval > 0) { -- 2.25.1