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 05E4D1E6339; Tue, 15 Oct 2024 12:08:29 +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=1728994110; cv=none; b=fBLQKBc+rFfkaW3mMpwhcAHCn3hw9Hx5zMqcToteMtTCQHiiOoGBocrAbPiGjQG5KUl234Bek0S9edPOo90N0HQ3E0GDW/tCfO9djm/uODHHssc1WiXFVqNPW+RzBF6ugWefWer0FJy9ooDsjo3s9cFWpoTUiM+w92xH/RskZfs= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1728994110; c=relaxed/simple; bh=cOmKi7q15ea9WT2QXXlm8/SOy5O6Q2xb0g/OF43PGoE=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=RtEq7JkdLePUMPgwFVzAUJzl8mdS7XPC1QRr48gLbDdjQtCcn2e9UFQCQs1HEfcXq3LNG9O2keQcIrW+C5tEYvHMS0exZ7jHGRxeCTlVOwbwzBkn3Yl1gwn8XoZ7vFME2zIyE2jfY6ydYdgL9KX4echaUlzHBrgAA1hXDU+ytm8= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=1glcWeAK; 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="1glcWeAK" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 1AC3EC4CED3; Tue, 15 Oct 2024 12:08:28 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1728994109; bh=cOmKi7q15ea9WT2QXXlm8/SOy5O6Q2xb0g/OF43PGoE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=1glcWeAKC9LpismL9Cg9w6xadl34CktAs0HaZefF3kIz+OcHGsux21Sax14X5DXe8 /nGVcaweUtrh1qjhv2BO8e3ttmrOp/CaVm8iBIcQU7I2eXmrI4pGqUm8c0V9zKXxY4 onQxD2tTAAaD2FmIeI4XtW2TCf0mOgOsWPM3/2wc= 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 5.15 609/691] i2c: i801: Use a different adapter-name for IDF adapters Date: Tue, 15 Oct 2024 13:29:17 +0200 Message-ID: <20241015112504.510273911@linuxfoundation.org> X-Mailer: git-send-email 2.47.0 In-Reply-To: <20241015112440.309539031@linuxfoundation.org> References: <20241015112440.309539031@linuxfoundation.org> User-Agent: quilt/0.67 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: patches@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 5.15-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 758bbb13b8be3..e983ad07c4951 100644 --- a/drivers/i2c/busses/i2c-i801.c +++ b/drivers/i2c/busses/i2c-i801.c @@ -1851,8 +1851,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