Received: by 2002:ab2:7903:0:b0:1fb:b500:807b with SMTP id a3csp1358694lqj; Mon, 3 Jun 2024 21:06:38 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXlzxDDAlVsOhUnzlY5dvvHvnnH16OeQgqH7dsEQM+i6RiSbCjLIdE9igra7hclqyivfEEvPrGPINVW9zgSdonzkEKZg7YvaNo34K/Yjw== X-Google-Smtp-Source: AGHT+IFd0tNX5W20qp30/iNUPbCKSVPOx0GoywaqdFZ6ECleklwgrjGt8vZCb5AkQ1AfiVxVAKdO X-Received: by 2002:a05:6a20:da83:b0:1ac:4fca:23c2 with SMTP id adf61e73a8af0-1b26f0f1a4emr11260767637.8.1717473998165; Mon, 03 Jun 2024 21:06:38 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1717473998; cv=pass; d=google.com; s=arc-20160816; b=cH7GW71Yh+U0W5v7ztRleIeDWYNHzmWhRh5RuOV3xIZomwj9Z+j9dJSlARiU5n2eCb hkfvNOjdUGYv+wpnCYx1KpXkT+TcJaX8U6zmcp/EZGBKVmdTs7hSOfsl7RRCGbBASSTr 8tt0IKmiim1CBZNN3zPozvkgIz7ZPrWvwcAA8A9b7jFXDxi8Z2FP5hoimvNX/xjY1pX8 8gycN9Tfr+Al+ZQvZlZwDzFhE0oVy1Ew2JYgSRAuaiKc8nwO3s+NwhpX45x+8/rID9Sl JiIL/DTJLTKiOQgv4PY9RZCbTN7BunRCiqGNz5yJdKMMDYZF+CSEBWv3ROJWfyMoSn7T gkLw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:sender:dkim-signature; bh=zpadqb8vKvLH/+6eZrQoNDzpGd4fRnONNtxPtJWEc8k=; fh=8LQq5Q7JScMBMdSJA2KnPH5g4KPS9FTRFWjrTOf8SIk=; b=xSyf6dZe7evG3va2+9gI1wYML4rvqwo5yQk2m8V+myx5QCeIM9MN4U30CfCq2god7n +gxYe87EgXX6MstFFN0GaQbhYewHzu7hZf2SHoWWaDCArUWD9ZB2C4u7DDEN+fgtT9eU BtkazT/Ld5Ok6akyi6A1qAp6Sl5fnBN54rAUEP84BkimyVLQuQV8qAVsKFadQ9OvV7AC Dxl5hQ0ax0Ehd+ii74w+gCDeehcp4V6um0/Zh+6RFzgUPUKGAmtsIxc7aHxP8PIAszCt Ir+di+/27mb1OK7AwxdBf8bHDMtaiajFZxYgBBDmGPMH33xFfdnuz5jBW5ADUp7F0NNG E4Ew==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=Al4TeUtv; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-200000-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-200000-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [147.75.48.161]) by mx.google.com with ESMTPS id d9443c01a7336-1f63233cfa8si74240565ad.47.2024.06.03.21.06.37 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 03 Jun 2024 21:06:38 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-200000-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) client-ip=147.75.48.161; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=Al4TeUtv; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-200000-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-200000-linux.lists.archive=gmail.com@vger.kernel.org" Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sy.mirrors.kernel.org (Postfix) with ESMTPS id 0CBAAB2562E for ; Tue, 4 Jun 2024 04:04:36 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 937DD1411E8; Tue, 4 Jun 2024 04:02:54 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="Al4TeUtv" Received: from mail-pg1-f174.google.com (mail-pg1-f174.google.com [209.85.215.174]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 27E30140378; Tue, 4 Jun 2024 04:02:52 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.215.174 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717473773; cv=none; b=rsj71yD3Xa2n7ejvkVzxRLCrV0mvDxreHiDp50tmOVshMO7D09s82z5BG+WO8gtJuOHqit43J2sv65k66m5pWN8aikfQhPblNtNrmJZqHnuXGqU0NPjptKM7RMAUeZXeapl9G69rAbltev7Tg/FT17fyREJjyYx0eVbQMRIo0D8= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717473773; c=relaxed/simple; bh=1dfvmehwDdEq07h8mkXsmnX+fXO2B5adsczXbeWlw/Y=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=MH06GwhBashLwWE6jfrUpYEktgrm81p1SSzsE6biRr6llj9Kq1IW/yfql3Jn4qWPSwLLTEjsq+1kbF6Xl95VMfzYWdNo6WemQ6mV9emAHQrpl+c9A0pZjhuWy4OXhj0gJE+YFXY4X2esXf0kapNZvOLdVm+6QESqRDW3U4kFEzA= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=roeck-us.net; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=Al4TeUtv; arc=none smtp.client-ip=209.85.215.174 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=roeck-us.net Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-pg1-f174.google.com with SMTP id 41be03b00d2f7-656d8b346d2so3670269a12.2; Mon, 03 Jun 2024 21:02:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1717473771; x=1718078571; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:sender:from:to:cc:subject:date :message-id:reply-to; bh=zpadqb8vKvLH/+6eZrQoNDzpGd4fRnONNtxPtJWEc8k=; b=Al4TeUtvRrKeRoRANq9XwOCWoE4YJTN/wznRRyz3zXLblsKvBvE5gB0pYHuz9CvpRt BpGYchJn4u2RNFDXEzFM1znxWA088UqpG0Y2HjUCVCgn6W+lQ30fZq8HeZfFF4IeE3T1 eXkrAuoS1TJlDXvWpLtw6DzHx7OQnl4s2vrOR/wWks2VNvvdDwyFqAMynNDs7nmrHf6B N6kb8I4pRDeMkrZERUnPcA3A6YWOqz+YfFWK0pWeJh6I49OWLljpBJ0V88wPgNz41GwJ Cz08lyzoXa70TvKziS5opVfOaXeP4zHfvQz70b3MY1ZD1O41T+Aw/tpZr40CLdcUciYr FEUw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1717473771; x=1718078571; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:sender:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=zpadqb8vKvLH/+6eZrQoNDzpGd4fRnONNtxPtJWEc8k=; b=al0MV5mFUPCp7cecLM9AAislRWowbtxLQn/Ves0cnb8M/7yq5LHPRJ1l5DlaO3roH0 oFdNyOvIZVbco4e9uG/7et/Y/jYvmprkT9xG/1P30VIZ5D7L1JgAkQk2ZnMlLObFLDiK XDUzrnuK5+OKIXB1l6r0+Y9m4kPzd4urE68TYw8GlJUT8Qdm6054X+mmRMViKY6ALuLo Wlq1cUI9ROzN6bmpZzdrWiFxaitc26pzO2Qt/6syhNyOM4Eo9Lz6PF1d5RvEkItAx1TG S61MzAdm2cuFSwQm0blJkDL/gs3fKlwANlIoqYVhXk8JNpZLnNJmwp9Y5FgYDAg8wsP8 2cSQ== X-Forwarded-Encrypted: i=1; AJvYcCUBi4IUZzAKJ3Po9tTa0J7R1eNhiXMkQBo8ODNOEtmroOp4Vgm0p5oVgxwXNq2MTmBCzurLaHOnlscMg4BSwr2xW4prHeYG2dwrpoCt8aj3t26AWiMf0YagRyiXb+vmkFnTr1JBG6+LYg== X-Gm-Message-State: AOJu0Yy/7Pvc0FWfC+Ho/xbMGg3eJ6sE2hipNF3r887cq16tvO0E9v5n WjMPq1W53793OxHrhhsoubKJqdD1n5IvdqcfbyTCxZUneWarp91I4L3Z1g== X-Received: by 2002:a17:90a:ff0e:b0:2c1:ae24:fa19 with SMTP id 98e67ed59e1d1-2c1dc5ccdfemr8935070a91.39.1717473770817; Mon, 03 Jun 2024 21:02:50 -0700 (PDT) Received: from server.roeck-us.net ([2600:1700:e321:62f0:329c:23ff:fee3:9d7c]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-2c2559e6741sm360716a91.1.2024.06.03.21.02.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 03 Jun 2024 21:02:50 -0700 (PDT) Sender: Guenter Roeck From: Guenter Roeck To: linux-hwmon@vger.kernel.org Cc: linux-i2c@vger.kernel.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, Krzysztof Kozlowski , Wolfram Sang , =?UTF-8?q?Ren=C3=A9=20Rebe?= , =?UTF-8?q?Thomas=20Wei=C3=9Fschuh?= , Armin Wolf , Stephen Horvath , Guenter Roeck Subject: [PATCH v4 6/6] hwmon: (spd5118) Add configuration option for auto-detection Date: Mon, 3 Jun 2024 21:02:37 -0700 Message-Id: <20240604040237.1064024-7-linux@roeck-us.net> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240604040237.1064024-1-linux@roeck-us.net> References: <20240604040237.1064024-1-linux@roeck-us.net> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit With SPD5118 chip detection for the most part handled by the i2c-smbus core using DMI information, the spd5118 driver no longer needs to auto-detect spd5118 compliant chips. Auto-detection by the driver is still needed on systems with no DMI support or on systems with more than eight DIMMs and can not be removed entirely. However, it affects boot time and introduces the risk of mis-identifying chips. Add configuration option to be able to disable it on systems where chip detection is handled outside the driver. Cc: Wolfram Sang Signed-off-by: Guenter Roeck --- v4: New patch drivers/hwmon/Kconfig | 18 ++++++++++++++++++ drivers/hwmon/spd5118.c | 4 +++- 2 files changed, 21 insertions(+), 1 deletion(-) diff --git a/drivers/hwmon/Kconfig b/drivers/hwmon/Kconfig index 7a84e7637b51..0bb1bdee3e43 100644 --- a/drivers/hwmon/Kconfig +++ b/drivers/hwmon/Kconfig @@ -2185,6 +2185,7 @@ config SENSORS_SPD5118 tristate "SPD5118 Compliant Temperature Sensors" depends on I2C select REGMAP_I2C + select SENSORS_SPD5118_DETECT if !DMI help If you say yes here you get support for SPD5118 (JEDEC JESD300) compliant temperature sensors. Such sensors are found on DDR5 memory @@ -2193,6 +2194,23 @@ config SENSORS_SPD5118 This driver can also be built as a module. If so, the module will be called spd5118. +config SENSORS_SPD5118_DETECT + bool "Enable detect function" + depends on SENSORS_SPD5118 + default y + help + If enabled, the driver auto-detects if a chip in the SPD address + range is compliant to the SPD51888 standard and auto-instantiates + if that is the case. If disabled, SPD5118 compliant devices have + to be instantiated by other means. On systems with DMI support + this will typically be done from DMI DDR detection code in the + I2C SMBus subsystem. + Disabling the detect function will speed up boot time and reduce + the risk of mis-detecting SPD5118 compliant devices. In general + it should only be enabled if necessary. + + If unsure, say Y. + config SENSORS_TC74 tristate "Microchip TC74" depends on I2C diff --git a/drivers/hwmon/spd5118.c b/drivers/hwmon/spd5118.c index 5cb5e52c0a38..19d203283a21 100644 --- a/drivers/hwmon/spd5118.c +++ b/drivers/hwmon/spd5118.c @@ -313,7 +313,7 @@ static bool spd5118_vendor_valid(u8 bank, u8 id) } /* Return 0 if detection is successful, -ENODEV otherwise */ -static int spd5118_detect(struct i2c_client *client, struct i2c_board_info *info) +static int __maybe_unused spd5118_detect(struct i2c_client *client, struct i2c_board_info *info) { struct i2c_adapter *adapter = client->adapter; int regval; @@ -647,7 +647,9 @@ static struct i2c_driver spd5118_driver = { }, .probe = spd5118_probe, .id_table = spd5118_id, +#ifdef CONFIG_SENSORS_SPD5118_DETECT .detect = spd5118_detect, +#endif .address_list = normal_i2c, }; -- 2.39.2