Received: by 2002:a89:288:0:b0:1f7:eeee:6653 with SMTP id j8csp535482lqh; Tue, 7 May 2024 06:57:45 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVnrYaMPamsdPkY5f2QO32a7psHwM4xZP+pLpccyA0Ztk85CxAdy1LEiClikalPjwPdq6BV35bpfAla6HZnS8/r+ffrF8IQ28zgKimdeQ== X-Google-Smtp-Source: AGHT+IFWvln+Oao4l2EEYeTsRxr4F3GX9xJuXnWr9Pc5+guYAHMuEZ4vX+QIVlICtS/vXnqDNdpP X-Received: by 2002:a50:a413:0:b0:572:a13c:30ca with SMTP id u19-20020a50a413000000b00572a13c30camr8395626edb.20.1715090265729; Tue, 07 May 2024 06:57:45 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1715090265; cv=pass; d=google.com; s=arc-20160816; b=qGMmTab++LVPt78kq2dbIwBIWASJfFwt3vtFLYrS3g52BURQWfVws2+QgMwmm2YJY2 H47FKoXXkyQgtYFX08+e1oeEd59PKaXKFHvFy7inUb3nBJPrpy/OoPD/1BxpYsk833ok 4zTWD6CotqKXf+7sRlleJRrV6lvrffOPHZ38dEIWt9A+AvGwtw28CtLkMT8Xm+e38qg6 XCsZMtsLqBynH5+bVuu2zrdSDW+CqDL+Q/OFbBXeg7zc3/VSEeB6y9HSIwGCIZUqX5YZ gcycjWv96sPSzb9oy8WptWrpuZsB/5QzbtfCY+PLOx+drADnmEO988gaVI3e9447Yidf TctA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=cc:to:content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:message-id:date:subject:from :dkim-signature; bh=FLYT+bLJXuOUQR3QOadR9CrcY5/GZrEJKrNTlP/Ex70=; fh=NZ86eiPRp+qjgKyll3LKq9JMG2TwcLvQfg5HxL1Y/Ds=; b=Ri8PETa3wOk46pPYYbYADmKv8bZyM388ohtCMKKcNbVPNCMXdGtzlkXEwiTIXGxu8Q 5WTiK8FkJ9NmuhzDmgXWYac/a3TRh1GQF00a97N8EAyfJpFrKSGoZ3JFVbg5A4IhX25z uvS0HkYwOdimJn+iHTz9CJyzv0Zy6ZXrEG2FkONQ3vtRmxcAKa6lzsvf0kodElrqdqrE cv49SjOBVpVYyMls//l+LXlMJa4xQkmPrw/Qd9iqqN+7gHGZzu9Ab8ARddfcHoMVfYxR ORNcILXHYAYQotUj2K/nNX0Yn+isFUD2ASQb+6reZ5sxk+zT4buS5qYTfYV/NAfx3gM6 RTKQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@weissschuh.net header.s=mail header.b=Vz4iGHg7; arc=pass (i=1 spf=pass spfdomain=weissschuh.net dkim=pass dkdomain=weissschuh.net); spf=pass (google.com: domain of linux-kernel+bounces-171485-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-171485-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id z5-20020aa7c645000000b0057287a8b212si4869282edr.423.2024.05.07.06.57.45 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 07 May 2024 06:57:45 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-171485-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@weissschuh.net header.s=mail header.b=Vz4iGHg7; arc=pass (i=1 spf=pass spfdomain=weissschuh.net dkim=pass dkdomain=weissschuh.net); spf=pass (google.com: domain of linux-kernel+bounces-171485-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-171485-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 am.mirrors.kernel.org (Postfix) with ESMTPS id 764061F2154B for ; Tue, 7 May 2024 13:57:45 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id C0C1315F3E4; Tue, 7 May 2024 13:57:32 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=weissschuh.net header.i=@weissschuh.net header.b="Vz4iGHg7" Received: from todd.t-8ch.de (todd.t-8ch.de [159.69.126.157]) (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 26A7315ECDD; Tue, 7 May 2024 13:57:28 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=159.69.126.157 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715090251; cv=none; b=fIAvHgBWgbcMeeYYKWWzuxlsRs+g4RPtDnsB9yvvVYcggGrKv78Lq+65AQoBXosDREYZrqDBQIiwjvKLqOlX6A45B6slFwMrbjpOnxCyCIPWS7I7FA5vWLLeuUlJenT91MHhtERhFVudhqGENXaudWdw3fMrDfrYLaaWpuCnlmc= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715090251; c=relaxed/simple; bh=CtbVsaAWGVPtKOnSGhlvMhVfqRtNMnCw7MAcBD0skng=; h=From:Subject:Date:Message-Id:MIME-Version:Content-Type:To:Cc; b=iRAFY6H8GBidim0u6pjZwWN2BexVdKQly1wD4ElQ10nJ4NTMiewOGBpUDubTvNmnt1i1Gs4oenWGArIOMjD2jGE4DSC/R+l8E9vEkXiBgVTPDG+45qK2g68HXydb/mXabfxvOjqb+q1IEdulU6OGsBoezBEgFmIrHqTLXFqjgQc= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=weissschuh.net; spf=pass smtp.mailfrom=weissschuh.net; dkim=pass (1024-bit key) header.d=weissschuh.net header.i=@weissschuh.net header.b=Vz4iGHg7; arc=none smtp.client-ip=159.69.126.157 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=weissschuh.net Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=weissschuh.net DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=weissschuh.net; s=mail; t=1715090246; bh=CtbVsaAWGVPtKOnSGhlvMhVfqRtNMnCw7MAcBD0skng=; h=From:Subject:Date:To:Cc:From; b=Vz4iGHg7drjKVl7d7EcyvXo83nonOFwB5y6lH/5NvWV61VrAswtaDwBI4AFC4TR5v ZvhbBJjYwepLgF7DCkA3dL+rv+ubFIbQpH9e6ztZIHLs65RIYggo/YnrvHnrlFOcy0 9rVJUYuol2etOoYhsbThfGNnldad7OI8pGv2OOkk= From: =?utf-8?q?Thomas_Wei=C3=9Fschuh?= Subject: [PATCH 0/2] ChromeOS Embedded controller hwmon driver Date: Tue, 07 May 2024 15:57:23 +0200 Message-Id: <20240507-cros_ec-hwmon-v1-0-2c47c5ce8e85@weissschuh.net> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit X-B4-Tracking: v=1; b=H4sIAEMzOmYC/6tWKk4tykwtVrJSqFYqSi3LLM7MzwNyDHUUlJIzE vPSU3UzU4B8JSMDIxMDUwMz3eSi/OL41GTdjPLc/DxdIxMzY5MkA/PkNLM0JaCegqLUtMwKsHn RsbW1AGFFcgNfAAAA To: Jean Delvare , Guenter Roeck , Benson Leung , Lee Jones Cc: Guenter Roeck , linux-kernel@vger.kernel.org, linux-hwmon@vger.kernel.org, chrome-platform@lists.linux.dev, Dustin Howett , Mario Limonciello , Moritz Fischer , =?utf-8?q?Thomas_Wei=C3=9Fschuh?= X-Mailer: b4 0.13.0 X-Developer-Signature: v=1; a=ed25519-sha256; t=1715090246; l=1624; i=linux@weissschuh.net; s=20221212; h=from:subject:message-id; bh=CtbVsaAWGVPtKOnSGhlvMhVfqRtNMnCw7MAcBD0skng=; b=PnxbvT1dqivcDWo2rkJkvaTA8qizq977AD1ZU/4fP2zcQBn8+V8jD1fdAH4zKrH58JAvPFdId tLu+/z+L7xlBu5JLMKqWeQRcHzz2qSGNUNy1+EVpPG/QQM06y4tdTwJ X-Developer-Key: i=linux@weissschuh.net; a=ed25519; pk=KcycQgFPX2wGR5azS7RhpBqedglOZVgRPfdFSPB1LNw= Add a hwmon driver that reports fan and temperature readings from the ChromeOS Embedded controller. There was an earlier effort in 2017 to add such a driver [0], but there was no followup after v1. The new driver is complete reimplementation based on newer APIs and with more features (temp sensor names). It only works on LPC-connected ECs, as only those implement direct memory-map access. For other busses the data would need to be read with a command. Adding some helpers was discussed in the previous patchset [1]. The EC protocols also support reading and writing fan curves but that is not implemented. Tested on a Framework 13 AMD, Firmware 3.05. [0] https://lore.kernel.org/all/1491602410-31518-1-git-send-email-moritz.fischer@ettus.com/ [1] https://lore.kernel.org/all/ac61bfca-bfa0-143b-c9ca-365b8026ce8d@roeck-us.net/ Signed-off-by: Thomas Weißschuh --- Thomas Weißschuh (2): hwmon: add ChromeOS EC driver mfd: cros_ec: Register hardware monitoring subdevice Documentation/hwmon/cros_ec_hwmon.rst | 26 ++++ Documentation/hwmon/index.rst | 1 + MAINTAINERS | 8 + drivers/hwmon/Kconfig | 11 ++ drivers/hwmon/Makefile | 1 + drivers/hwmon/cros_ec_hwmon.c | 279 ++++++++++++++++++++++++++++++++++ drivers/mfd/cros_ec_dev.c | 1 + 7 files changed, 327 insertions(+) --- base-commit: 2fbe479c0024e1c6b992184a799055e19932aa48 change-id: 20240506-cros_ec-hwmon-24634b07cf6f Best regards, -- Thomas Weißschuh