Received: by 2002:ab2:6309:0:b0:1fb:d597:ff75 with SMTP id s9csp1517167lqt; Sat, 8 Jun 2024 01:13:48 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWlaiRw2Q/04bmirq6xdmIScXrjENQ43k8F8VM8t7wAgiPJ4tYxx60ROJ5dyacVSJCZFsodh6i3SHM/EtGB5zoTpgcZCasadQV3Z8xPEA== X-Google-Smtp-Source: AGHT+IEx28M9TpNX8hwOp/9pM8/Hlf+CPrjGIEK+5fTgCVLWemS8OSZZNZ8+HIcITXUegL0WluUa X-Received: by 2002:a05:6a00:1409:b0:702:71e6:2064 with SMTP id d2e1a72fcca58-7040c751f6bmr4832004b3a.30.1717834428084; Sat, 08 Jun 2024 01:13:48 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1717834428; cv=pass; d=google.com; s=arc-20160816; b=0/AtTnMyBmiJCyuNIvowDcQlY+rq917ddinC3p1fhYc5A/jTrz8oxMiS0NUXzeth9h 5HuiYAwrc3qDjiVFwcjXmobI3oJ8oTQZjXGj9lZJxmIxQX/RXfXSeAZ9qmOIy11AOaCS 9PdFfdjtleHePJSEAknXwbr29tqBvYXxu8w5x1cOoR35Yx5uEScfz8Oa+czXHLztLmNT 7GAhBix/Qu8BFoyayT3oVl2HVW8Hlxy0vBeC+ahKJHEAFZsNohF6B48YKlAVi0c/n5wn dKX+m0bXhvIOS1cXdX2N0JWtLPCqx41QWOkLTWYmyxshgFNBvDvd4/ZPu1+8p9Z4JnJM KcwQ== 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=IbghxWMp0DxgYfbWb6OZWMUDxty1N4aq+HP3biBdIDE=; fh=5AL+W+VRaKXi95ohmAitFf8Afj0BM5Bnt/5VviAo1h8=; b=QTh9NZkmulpJjKxw5WFGdMGaOHe+5+7pWSDfaeVnqvO6N3+h6voqZu9plB7B0glFx5 PEgXEPpn4Z8IObnj490brYs2nuA6wF5o6JNERZdxD/5Cz4LxpTUsu0P9sBtbeSJL7QzT IQWD+SOSuR7cF2DTJJeH6f8hMUzYNGkl4UvCZ2Qn24/C5WApcTk2uvA6f8qNINowBKEb EWHtGDP0y8FIP8R8BF7rwarU8XMJn4lRBkHFIEskEr9+Au17ZUqN5MZ50nvSmDpGs6RY +k+CQGgQFQ/EBwL0EbtqhU+M0qs1HoMBcwXeBBXDqvx51F5E7ubbVAFR98MeRxAbOQaI 4vUQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@weissschuh.net header.s=mail header.b=fm50fgeh; arc=pass (i=1 spf=pass spfdomain=weissschuh.net dkim=pass dkdomain=weissschuh.net dmarc=pass fromdomain=weissschuh.net); spf=pass (google.com: domain of linux-kernel+bounces-206946-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-206946-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=weissschuh.net Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [2604:1380:40f1:3f00::1]) by mx.google.com with ESMTPS id 41be03b00d2f7-6e443b31ee3si665511a12.30.2024.06.08.01.13.47 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 08 Jun 2024 01:13:48 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-206946-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) client-ip=2604:1380:40f1:3f00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@weissschuh.net header.s=mail header.b=fm50fgeh; arc=pass (i=1 spf=pass spfdomain=weissschuh.net dkim=pass dkdomain=weissschuh.net dmarc=pass fromdomain=weissschuh.net); spf=pass (google.com: domain of linux-kernel+bounces-206946-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-206946-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=weissschuh.net 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 AEBA8B21643 for ; Sat, 8 Jun 2024 08:13:15 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 93C251779A9; Sat, 8 Jun 2024 08:12:53 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=weissschuh.net header.i=@weissschuh.net header.b="fm50fgeh" 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 3CBE5176AC7; Sat, 8 Jun 2024 08:12:49 +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=1717834372; cv=none; b=eyQTZ1aTRVKtrKRRvc/P/D5HPjKu1ES9KH7mernv0ZH9hYCkn6ZavXPegH8qlpDvE8OieKLaEJEKDv8eOjWWa1NZ7NxrmxAhVECfckxTuHPs7ERlApz7vR5TXA8dEHSVSeguHxZZ8Q67r321CLmGXKLGnifZReLsIoUBtYAtHB8= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717834372; c=relaxed/simple; bh=c+uFpWCMZSQ7m/Mz5EU7dhzeC3k6SNmPxQRmuwxkvE4=; h=From:Subject:Date:Message-Id:MIME-Version:Content-Type:To:Cc; b=jC0Z6yF5e8j7Fmnfwjp00QwHXLNyccNfJ1JN7YqIrimvXihnhkjiaF0MbmEV7W/ztqqB8OTsUtcaE9H1tYdG7AIyNNTSEiEy7J7vHRNA9oqfODAT8KSZXuOVfjtaR5soRp1XfsRjtT+0JvdBabbk1Hycsz7UFfJxlkRBcvI1/IA= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine 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=fm50fgeh; arc=none smtp.client-ip=159.69.126.157 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine 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=1717834365; bh=c+uFpWCMZSQ7m/Mz5EU7dhzeC3k6SNmPxQRmuwxkvE4=; h=From:Subject:Date:To:Cc:From; b=fm50fgehiRH9BsrP5fW4J04QmVMefFB2retvoLCwfq2MkCj140cQuJ0CqSXpMqQ08 kzkba2FtQYlB10N2JxJpeISl1voORZPN+UOeI0XFVnHeX5PfYuE9igMgOHnizbdTKi MCs0CneMRezwRaxyuMvqYAv2dFL4FiSwGDno2YGM= From: =?utf-8?q?Thomas_Wei=C3=9Fschuh?= Subject: [PATCH 0/5] hwmon: (cros_ec): fan target, fan pwm control and temperature thresholds Date: Sat, 08 Jun 2024 10:12:42 +0200 Message-Id: <20240608-cros_ec-hwmon-pwm-v1-0-d29dfc26fbc3@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=H4sIAHoSZGYC/x2MQQqAMAzAviI9W6hDBf2KiMxatQc32cAJ4t8d3 pJD8kCUoBKhLx4IcmlU77JUZQG8W7cJ6pIdDJmaGtMhBx8nYdzT4R2e6UBamNuKZpsBcncGWfX +n8P4vh/9Ya6gYwAAAA== To: Benson Leung , Tzung-Bi Shih , Guenter Roeck , =?utf-8?q?Thomas_Wei=C3=9Fschuh?= , Jean Delvare , Guenter Roeck Cc: Dustin Howett , Mario Limonciello , Stephen Horvath , chrome-platform@lists.linux.dev, linux-kernel@vger.kernel.org, linux-hwmon@vger.kernel.org, =?utf-8?q?Thomas_Wei=C3=9Fschuh?= X-Mailer: b4 0.13.0 X-Developer-Signature: v=1; a=ed25519-sha256; t=1717834364; l=1917; i=linux@weissschuh.net; s=20221212; h=from:subject:message-id; bh=c+uFpWCMZSQ7m/Mz5EU7dhzeC3k6SNmPxQRmuwxkvE4=; b=4jzTKzT8wrfJoXc3/XsHoF+ibf+T1IlRLVbt8KY6ViDATww+JRaWiWiDD0SR2sFW6yLyQCBpy TLUja5j9ZpIBg/xxUIcAqrvfZqYyEAPlDQ0qwYtu2f0SE181uVI7oC1 X-Developer-Key: i=linux@weissschuh.net; a=ed25519; pk=KcycQgFPX2wGR5azS7RhpBqedglOZVgRPfdFSPB1LNw= Add support to cros_ec_hwmon for * fan target speed for fan 1 * fan pwm control for all fans * fan temperature thresholds (RW) for all temp sensors The EC also supports tempY_auto_pointZ_{pwm,temp} but that does not yet seem to be usable from "struct hwmon_channel_info". Guenter, is this intentional, do you want me to add support for it? Patch 1 introduces a utility function cros_ec_cmd_versions() which wraps EC_CMD_GET_CMD_VERSIONS. That is used as it seems inadvisable to call EC_CMD_PWM_SET_FAN_DUTY during probing. I'm planning on also using this utility function in my CrOS EC charge control driver. Also there are some other places throughout the tree that could use it. This series is meant to be merged through the chrome-platform tree, as cros_ec_hwmon itself is only available there and because of the new cros_ec_cmd_version(). To test it you *also* need commit 27e669820c ("mfd: cros_ec: Register hardware monitoring subdevice") from the MFD tree (branch mfd-for-next). Tested on a Framework 13 AMD. Signed-off-by: Thomas Weißschuh --- Thomas Weißschuh (5): platform/chrome: cros_ec_proto: Introduce cros_ec_cmd_versions() hwmon: (cros_ec) Add support for fan target speed hwmon: (cros_ec) Add support for PWM fan control hwmon: (cros_ec) Split temperature channel params hwmon: (cros_ec) Add support for temperature thresholds Documentation/hwmon/cros_ec_hwmon.rst | 8 +- drivers/hwmon/cros_ec_hwmon.c | 284 +++++++++++++++++++++++++--- drivers/platform/chrome/cros_ec_proto.c | 26 +++ include/linux/platform_data/cros_ec_proto.h | 2 + 4 files changed, 290 insertions(+), 30 deletions(-) --- base-commit: c8a4bdca928debacf49524d1b09dbf27e88e1f18 change-id: 20240529-cros_ec-hwmon-pwm-0dcc610ba0dc Best regards, -- Thomas Weißschuh