From patchwork Fri Jun 21 12:24:57 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hans de Goede X-Patchwork-Id: 806922 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) (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 47FB01509A5 for ; Fri, 21 Jun 2024 12:25:50 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=170.10.133.124 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718972752; cv=none; b=kObEC1jVK0l1/9bw9DYbTskykxh+iCEHIUHyltKi+CdWyDOwomGkNpin1XrgclzyldR/xWMIW+sMtECzAlmb0R+ga1DS1k42LU375jvw72gR+YRZOUz4W6phc0AWasL11kvNSjo1UMN8QCXqp0xOHeDYhKVE4diuEz+R4SokAc8= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718972752; c=relaxed/simple; bh=7AnuA9t8SkOmHDhFL3owoQl2T6QwQo0Re8HYlaQvRjg=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=tXKnFa9uBwnpLbE/Yq1IHJ6YhT4xnO75+ntriPH8XJNrWmCWZfPdEkYTPXimi8pnYIKPFaZXlh/tVJPCfzOUu1W7b8mtP8hGgRbYg8JQqCtPQW6AmMZ1D2xvmEFyAGrBjceFbAnAgMUXxXWJE2RCKZxQ4GjsOTgkDBdF3GFnDEA= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=redhat.com; spf=pass smtp.mailfrom=redhat.com; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b=BatQ4vtO; arc=none smtp.client-ip=170.10.133.124 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=redhat.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="BatQ4vtO" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1718972750; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=ou2/aaKZonzrrblU7wDVgfWljjZmis7Sflpk2l1xDq8=; b=BatQ4vtOoLbUVItu3EwobNjvLasr8sDZBmWa8Keg5eukuM2QCpaQjAvW5qLv/FPvfKpe7k EdwhSzSzLqCNdc09nUEjGnJeJFX1HFM7sw2u9dBixSGvEs/87dR5m2W5yHWIvFv+LzuUeF WC+Jd22P+Ng52z1N86FupUWba7rNYcw= Received: from mx-prod-mc-04.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-644-VB-BFExeOeq8ahAshSZtpw-1; Fri, 21 Jun 2024 08:25:46 -0400 X-MC-Unique: VB-BFExeOeq8ahAshSZtpw-1 Received: from mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-04.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 49A951953963; Fri, 21 Jun 2024 12:25:41 +0000 (UTC) Received: from shalem.redhat.com (unknown [10.39.194.69]) by mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id B11D53002085; Fri, 21 Jun 2024 12:25:25 +0000 (UTC) From: Hans de Goede To: =?utf-8?q?Pali_Roh=C3=A1r?= , =?utf-8?q?Ilpo_J=C3=A4rvi?= =?utf-8?q?nen?= , Andy Shevchenko , Paul Menzel , Wolfram Sang Cc: Hans de Goede , eric.piel@tremplin-utc.net, Marius Hoch , Dell.Client.Kernel@dell.com, Kai Heng Feng , platform-driver-x86@vger.kernel.org, Jean Delvare , Andi Shyti , linux-i2c@vger.kernel.org Subject: [PATCH v3 2/6] i2c: i801: Use a different adapter-name for IDF adapters Date: Fri, 21 Jun 2024 14:24:57 +0200 Message-ID: <20240621122503.10034-3-hdegoede@redhat.com> In-Reply-To: <20240621122503.10034-1-hdegoede@redhat.com> References: <20240621122503.10034-1-hdegoede@redhat.com> Precedence: bulk X-Mailing-List: linux-i2c@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.4 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. Signed-off-by: Hans de Goede --- drivers/i2c/busses/i2c-i801.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/drivers/i2c/busses/i2c-i801.c b/drivers/i2c/busses/i2c-i801.c index d2d2a6dbe29f..5ac5bbd60d45 100644 --- a/drivers/i2c/busses/i2c-i801.c +++ b/drivers/i2c/busses/i2c-i801.c @@ -1760,8 +1760,13 @@ static int i801_probe(struct pci_dev *dev, const struct pci_device_id *id) i801_add_tco(priv); - snprintf(priv->adapter.name, sizeof(priv->adapter.name), - "SMBus I801 adapter at %04lx", priv->smba); + if (priv->features & FEATURE_IDF) + snprintf(priv->adapter.name, sizeof(priv->adapter.name), + "SMBus I801 IDF adapter at %04lx", priv->smba); + else + snprintf(priv->adapter.name, sizeof(priv->adapter.name), + "SMBus I801 adapter at %04lx", priv->smba); + err = i2c_add_adapter(&priv->adapter); if (err) { platform_device_unregister(priv->tco_pdev);