From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 8624A1DF721; Wed, 6 Nov 2024 12:18:31 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1730895511; cv=none; b=FK1oTrlD8l/GT1yhJuSd90NSX3u8JdkZn0KixEHZzOMcLACIkn27cXWUhiBNstY0veYyNIh1CiwfbALRhrMkes6iwVuL0BHvrAYscl22XVMVl4ckDfHURiuORByaYB95yUuq/bAligedhtaxPnwYPAn5Ed3iiXrG5YJGWNb41SU= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1730895511; c=relaxed/simple; bh=dmUPOFpb7eY6Mx+BOTYKfTvEGZh8Sv1WpTL9t0CSVb8=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=Kxn0tp9jdZ0uhbIdnfcacDMnEZml/pLuYO33/9q2K3kR71VrXZDo//iCUNFLbqvRcB+HH996rw/BwJTLrzzRyK/pqS929B0wR0DzLUOimF7kZxtSNtqIECXBeb5zIq5hQEOh5KWoeaS3JnT4cCjeRdyUYDj7UudvWHnV1me7tM0= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=SMn9yq1b; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="SMn9yq1b" Received: by smtp.kernel.org (Postfix) with ESMTPSA id D2A02C4CECD; Wed, 6 Nov 2024 12:18:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1730895511; bh=dmUPOFpb7eY6Mx+BOTYKfTvEGZh8Sv1WpTL9t0CSVb8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=SMn9yq1bKHc/EW/1GQwci1KEirQruJPNljFx8pnnrrj4bGxv02kmx2nE8zeOSaYhT vi4Jm7NR/0UtlGvIOmkQcOkmFpoXPNvlUun+qN3MkFM0VubD8rLBz/EE3cMThqS3DJ Ue1RmTRh1MNiLNu1MbOf1ULdWSRulW910rXLPMrI= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, =?UTF-8?q?Pali=20Roh=C3=A1r?= , Hans de Goede , Wolfram Sang , Andi Shyti , Sasha Levin Subject: [PATCH 4.19 241/350] i2c: i801: Use a different adapter-name for IDF adapters Date: Wed, 6 Nov 2024 13:02:49 +0100 Message-ID: <20241106120326.897240218@linuxfoundation.org> X-Mailer: git-send-email 2.47.0 In-Reply-To: <20241106120320.865793091@linuxfoundation.org> References: <20241106120320.865793091@linuxfoundation.org> User-Agent: quilt/0.67 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: stable@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 4.19-stable review patch. If anyone has any objections, please let me know. ------------------ From: Hans de Goede [ Upstream commit 43457ada98c824f310adb7bd96bd5f2fcd9a3279 ] On chipsets with a second 'Integrated Device Function' SMBus controller use a different adapter-name for the second IDF adapter. This allows platform glue code which is looking for the primary i801 adapter to manually instantiate i2c_clients on to differentiate between the 2. This allows such code to find the primary i801 adapter by name, without needing to duplicate the PCI-ids to feature-flags mapping from i2c-i801.c. Reviewed-by: Pali Rohár Signed-off-by: Hans de Goede Acked-by: Wolfram Sang Signed-off-by: Andi Shyti Signed-off-by: Sasha Levin --- drivers/i2c/busses/i2c-i801.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/drivers/i2c/busses/i2c-i801.c b/drivers/i2c/busses/i2c-i801.c index c1e2539b79502..b552f8d62fa2f 100644 --- a/drivers/i2c/busses/i2c-i801.c +++ b/drivers/i2c/busses/i2c-i801.c @@ -1674,8 +1674,15 @@ static int i801_probe(struct pci_dev *dev, const struct pci_device_id *id) i801_add_tco(priv); + /* + * adapter.name is used by platform code to find the main I801 adapter + * to instantiante i2c_clients, do not change. + */ snprintf(priv->adapter.name, sizeof(priv->adapter.name), - "SMBus I801 adapter at %04lx", priv->smba); + "SMBus %s adapter at %04lx", + (priv->features & FEATURE_IDF) ? "I801 IDF" : "I801", + priv->smba); + err = i2c_add_adapter(&priv->adapter); if (err) { platform_device_unregister(priv->tco_pdev); -- 2.43.0