From nobody Mon Sep 28 07:17:18 2026 Received: from mail-ej1-f43.google.com (mail-ej1-f43.google.com [209.85.218.43]) (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 6871B3F0770 for ; Tue, 25 Aug 2026 09:25:57 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.218.43 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1787649959; cv=none; b=WARgxpe07MlbDrFD9FOZKaO5zJQcPyclmWylmbed76MTnVXr87UJxG7OfpjCDR/2h9VDABqzTHHpsszGbwrY68ZjoHEiOoemD5h/zGsxa86IahH3mHkb6scTBZFUg+IWU4MOwdVlEkbJBSY53YPYKq2B4IfVMzVLujnW41kadFc= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1787649959; c=relaxed/simple; bh=l76oCLpiCkP1+fv2wQD3Bwww2nvMdP8ddihNpJ7IhJc=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=r+DDnAdt43bi3x5TLZrNguvjiQvbY3hcpf7yXbdZCFL3t6w5zv9rqB25lfMM4X3hWCUbJakqeQvfgONg6YVkEM0yCg+JRmYTtHbkRtONfRyWk6TX3mafhcZS+W7iXlQO+wBGg1sleK/CnMs8xwhRc2dOd+zZPko/GEamhYbyv6k= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=C608NQAP; arc=none smtp.client-ip=209.85.218.43 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="C608NQAP" Received: by mail-ej1-f43.google.com with SMTP id a640c23a62f3a-c20e70a0962so684064766b.2 for ; Tue, 25 Aug 2026 02:25:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1787649956; x=1788254756; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to:content-type; bh=WmqhkbstVUIAv6coMLpxvuSdMjsljUC7sCwH3KLVIHQ=; b=C608NQAPpsG6CnsVQnrIxgNLkrYlDwVqGAKujI7sO3Jxqaek/Bl6+qG0UTAuhv9EhS ubkZyRGWOqeB2HjNcljiSszo3KwtkWZu3CRyep7kPiBpYdu4Q1iSzdJ3ROHXuBKM8rTD LZIEJheDtIw+q8ONPn/ejMsvK2h+elcna/Fnu6RtQ342NrjlRiDlgOLwH37QFs/J86py tj8kulgGk1vtQoByXwhI4jyTKvxWa1wyO36b2+uV+GXqtpY3GrdvXDVfdU4Z4ywrnvtP mVEozZTftDWuF1w2PjkD5Z75W6Z8NDJHrX5pJa9glP7UVmWrIhKO7lmYPdEEUj5ggoBR 0gPQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1787649956; x=1788254756; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to:content-type; bh=WmqhkbstVUIAv6coMLpxvuSdMjsljUC7sCwH3KLVIHQ=; b=TCXusmfMsOmDpEc7GY6zIY1sI+OJHkYNcMle9dR4SLavHV9AyBcuCNYJb3G61dylNc bRbYSw0zz49pcdMilSlfD02gmuCSsV47otTRAw//MmtqVVzsUMf6G6haaHXfbHSjIqg5 VWREovqM/JuzVDjGo396oARxwTEm11/lONh3Ul6ODNOCyyntcGVWlVxvZs1uPAiHwDEI miwtjzTOmOpAfZWcDyaxHmtu9SUZ0dR0+gigUoiVTtWthyV/XjKuUMfLgCgV8B5/hhO7 y+8Uj8dmGXCKg4zc6m2SWfqvyKble9gWlUNUvOAkU1EWJrnBRgI+KN1/lekljV0ertu6 rP2Q== X-Forwarded-Encrypted: i=1; AHgh+RqXw/MeJ9fbFdd/IbEnsHURVlOhtMp9SY251tN3eISPCFajym7FUY2g+3ivtoWTKrXqoOdD1H64MLFGcT0=@vger.kernel.org X-Gm-Message-State: AFuF++kp/p/3gM+TErGqYN83jTDx+0mnIZ3EzehhcfvppTQgvrBpKbff AR/N6+D5UBB5bwwKyFpKAy9nl3Oy2vZH35FgJzTwlkJ75jHUJK28G6Fi X-Gm-Gg: AR+sD12Vt587LDlDtsuzG31A2ClRHF8+M7nQ2qB1md3EtN6Npw2j01cEodYdvdBELb0 tEQe5rrGqFbLZl6gRb+DBKxH9B++hkg8Syp2OgFPGjgbwjI3Ybq3S3uklX/wtkXfhMuGbE/fCWs lZkaKJughjKw+TGlnT6qzhlxnk7fwjPIzLIl+mUmoSefkMear+odweYVSz1plywMReJNBLkRYQ2 CH+qG+cpt7Uv4lwaqjJj8p0XqGiJ4VsPqI0IDuSAc0HTOWJbnUFYgCqWfQltgmz9zV3eBZRf7b6 xCEll2W0wUxezm/sPmu+GErNw2TLG4foz2OXxlo8CLNHbCc211vtrQ20SNqWXJGNZiSL3Oxt7tM 6ZKWQcPJVG97Bcv0NB1JBU8StXR05XOK3tSA5TkrivPgR3ikU/0nrhuN9t7k4xMHLEsjPgKtLlH x4f25hKfU7GYH0S4qGHTctYXBgDrEPGTZUVPeNmBKlanoIVc17IJ6j2c3RYZP3yNaijfLqDQzS0 Ff6/gZMg2P/1uRpTKrRofdFFxqfzaa7qlGFFkNyXS8bYj2E4lQGzRpWatRZzdTAbTV3fB72Jlmd wqRqxsA8bmEoXzlJQZwUBYc= X-Received: by 2002:a17:906:fe48:b0:c15:fc59:cdf3 with SMTP id a640c23a62f3a-c24b3ebee48mr2064957566b.12.1787649955545; Tue, 25 Aug 2026 02:25:55 -0700 (PDT) Received: from fractal.tuxedo-gray.ts.net (c-78-82-25-228.bbcust.telenor.se. [78.82.25.228]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-c249606bd05sm1612570866b.2.2026.08.25.02.25.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 25 Aug 2026 02:25:55 -0700 (PDT) From: Johan Dahlin To: Guenter Roeck Cc: linux-hwmon@vger.kernel.org, linux-kernel@vger.kernel.org, Johan Dahlin Subject: [PATCH 1/5] hwmon: (nct6683) Retry pwm writes until they take effect Date: Tue, 25 Aug 2026 11:25:42 +0200 Message-ID: <20260825092546.669450-2-jdahlin@gmail.com> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260825092546.669450-1-jdahlin@gmail.com> References: <20260825092546.669450-1-jdahlin@gmail.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" store_pwm() waits a fixed 1-2 ms for the EC to hand over the fan configuration registers before writing. That delay dates back to commit 91918d13eb17 ("hwmon: (nct6683) Add basic support for NCT6683 on Mitac boards") and, pwm being read-only elsewhere, has never been exercised against other firmware. It is too short for at least one of them: on an ASRock B850 Steel Legend WiFi (NCT6686D), two of six consecutive pwm writes were silently discarded, leaving the fan on its previous setting. Read the value back and repeat the sequence when it did not stick, waiting longer each time and reporting -EIO if it never does. Raising the delay for everyone would penalise boards that work today, while a write that succeeds first time issues the same register sequence as before. Signed-off-by: Johan Dahlin --- drivers/hwmon/nct6683.c | 21 ++++++++++++++++----- 1 file changed, 16 insertions(+), 5 deletions(-) diff --git a/drivers/hwmon/nct6683.c b/drivers/hwmon/nct6683.c index e1c36c95affb..b524a45b1471 100644 --- a/drivers/hwmon/nct6683.c +++ b/drivers/hwmon/nct6683.c @@ -934,18 +934,29 @@ store_pwm(struct device *dev, struct device_attribute= *attr, const char *buf, struct nct6683_data *data =3D dev_get_drvdata(dev); int index =3D sattr->index; unsigned long val; + int tries; =20 if (kstrtoul(buf, 10, &val) || val > 255) return -EINVAL; =20 + /* + * The EC does not always release the fan configuration registers + * within the settling delay, and a write issued before it does is + * silently discarded. Repeat the sequence until the value sticks. + */ mutex_lock(&data->update_lock); - nct6683_write(data, NCT6683_REG_FAN_CFG_CTRL, NCT6683_FAN_CFG_REQ); - usleep_range(1000, 2000); - nct6683_write(data, NCT6683_REG_PWM_WRITE(index), val); - nct6683_write(data, NCT6683_REG_FAN_CFG_CTRL, NCT6683_FAN_CFG_DONE); + for (tries =3D 0; tries < 3; tries++) { + nct6683_write(data, NCT6683_REG_FAN_CFG_CTRL, NCT6683_FAN_CFG_REQ); + /* A failed attempt means the EC needed longer than we waited */ + usleep_range(1000 * (tries + 1), 2000 * (tries + 1)); + nct6683_write(data, NCT6683_REG_PWM_WRITE(index), val); + nct6683_write(data, NCT6683_REG_FAN_CFG_CTRL, NCT6683_FAN_CFG_DONE); + if (nct6683_read(data, NCT6683_REG_PWM_WRITE(index)) =3D=3D val) + break; + } mutex_unlock(&data->update_lock); =20 - return count; + return tries =3D=3D 3 ? -EIO : count; } =20 SENSOR_TEMPLATE(pwm, "pwm%d", S_IRUGO, show_pwm, store_pwm, 0); --=20 2.53.0 From nobody Mon Sep 28 07:17:18 2026 Received: from mail-ej1-f43.google.com (mail-ej1-f43.google.com [209.85.218.43]) (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 2BD1E3EDE76 for ; Tue, 25 Aug 2026 09:25:58 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.218.43 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1787649960; cv=none; b=RPW9Ciu0d1V7ihsrNe6iUh5JL+onNkuWCXlFKi73A5mTSV8gMivZ8BAInQjp+8hDCzOfJ5KE8iERLz/G2jkWUGpuIg75eLsWheLutIYztBkB4Ox6OYPmaa9saJi7xECBahwGrZMD0qKzeHQr14IzyXuXRJ0bZAkfQbD38Q9oomU= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1787649960; c=relaxed/simple; bh=x4b3FnrRl4mnIm2nuuyD1wW2HRcp1yeP21KvEk36LJw=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=BRC00EwH8Znq5zqW3vM1Pnqgzd9ZO8ylw7/cb98GanVHA6izbAEhtlIuYpLKyI/ztN1p9y624uGK+496r+C1ZJNikQQO24GafHg1aC9V6gfOGbBpRe1sKb9ge+LsqREEsHHaqIWzrYqgWzDOTu34Ap6DCjTWj5Uo8B29Y+UDQXA= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=rdzzcmHt; arc=none smtp.client-ip=209.85.218.43 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="rdzzcmHt" Received: by mail-ej1-f43.google.com with SMTP id a640c23a62f3a-c20ce3c118aso125282666b.0 for ; Tue, 25 Aug 2026 02:25:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1787649956; x=1788254756; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to:content-type; bh=srb6xdaTGZYwN0OspPy3DAgDlETn/SdGMB9cf3v5QI0=; b=rdzzcmHtBHS513CtPHCRgYtX/mt6nKJ7wKzq+krwAXqLlZ+ImtHblNsc3r8GzRFlyh dalT45tlpmYrOclAAwlZEBd2hftkyT/CxR4rNx5gbnYNfE5LlhM1RBLwE6asCU6SqPGN 3nicjM+tn0WpPCHhEUbMQLc8t4/HRAEbWAgQ6bmgK0YQwspEd7Pw6p96IM/946KvcMfH jcW0iVD7IFmpI52iY6lCq3uq5bgvl+fgMwPRhO6EjMPKHUj7ovyyixDIktRJHfFCs9FZ Pa0dycWjKaa9aYHV9fDukhOf8QQE+Wd8eX1CLSDIsxuvq6F67xixHu9q/LVDKBqi7HoE aEZA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1787649956; x=1788254756; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to:content-type; bh=srb6xdaTGZYwN0OspPy3DAgDlETn/SdGMB9cf3v5QI0=; b=e9/ByM0MBpuPFg6SjuaEPRCJv157WW0YODfIMvrcuEdWzdZtFaZGsYsU3XTwHZq5G9 qguQ3k1aMY0g2//gfu7WTR+oFqgCxkS0Z+zj/3tHGT26xFZ2Blm+BYeL5YlEhR2QGLcH ITiRvmdfPtdofDRw2v3MG6Y0Prffd1+plvXumYPO199MpKJkG74xeOnEdOzv3tjKLBBA LjJL+8N5aaPKMfFaiDoJw0iQbP3yClPVgafUfcN9g94HrdLwZpRuahWuBQ9UMlHxshTp gUNN+QKmM0WGXGMpC756ufVlTqHoKDdwjdhPVYJLijzShXkfSg6XZhFV5eJglYrqwIMN AvPw== X-Forwarded-Encrypted: i=1; AHgh+Rrbu5nPzUUCWp+tSsiiDtFuoHehUy4fpOMDXBsJ1wW414PzWmkxo15KeFPZT6utmuZEWt0CRbxhwe6ACcI=@vger.kernel.org X-Gm-Message-State: AFuF++nlsushHQ6LgSKYZlPNbWxg+XbNYRp7dsTuaTGGkb3Anuu+PPfu 8d8LIFZvmBSBgMCz9k8RJ4eHWfN+0G8V4gZMj0Z7kTfJtFvvxjGvvoguZJfT2w== X-Gm-Gg: AR+sD122jBpvU3flgZzHRgMNvNuM93aYvDrFaBJV5DtWvpHGa0zsVWLPCYkmOdp41di Ji2R+nKdcotaBvSdPAphUYeMvSU7QrUHxgRnLS57G4ffRQ9Fx2MLavAjpmrDuSImOjVR2OP0VD7 ahn0bZQBf501azr6tDmcg/guSMaqhJtOWST1FWW75Zaqe7X9Qn3K77CKPsjashJMLGT9VtwfGUy JOnKjLoASO3f9VzVAGPGcS66gkZAqukNmH+3L6gO9sfFHgylpW8goHBx28fPBAjHUTrGhqGfDxR jNwnL1Beu06uQhxLExmQiHw1PWsaWKjXsGz8FEoKY1VNF3AD6SyOdyjDjdGOUQksiX9sSPR96xU CnoFMTL7+NeUv2sGLVSeXLDongVcslz0+6hFObnBr01xjaDgFj4iNQi5u2N2zL9HFop+lu5K/pv 7Iw3noqZld037OllrFCeArmxrz1kFZ6rz/OWbJq7YrHfZRqXKzSAiIJhpriLbbq7IsQeQjY9yM3 YnA90TFYGLoMuSDsge/QlyC/0c4vkCnOZ+Z5WiYsTQnHp/KAW92ypRmpmxkoKjndSDgbJk9oZmr QfyB0B9aAOPhL7ib6UxsTfk= X-Received: by 2002:a17:907:d40f:b0:c20:ec9c:441a with SMTP id a640c23a62f3a-c24e2df8d14mr579497966b.12.1787649956393; Tue, 25 Aug 2026 02:25:56 -0700 (PDT) Received: from fractal.tuxedo-gray.ts.net (c-78-82-25-228.bbcust.telenor.se. [78.82.25.228]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-c249606bd05sm1612570866b.2.2026.08.25.02.25.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 25 Aug 2026 02:25:56 -0700 (PDT) From: Johan Dahlin To: Guenter Roeck Cc: linux-hwmon@vger.kernel.org, linux-kernel@vger.kernel.org, Johan Dahlin Subject: [PATCH 2/5] hwmon: (nct6683) Add customer ID for ASRock B850 Steel Legend WiFi Date: Tue, 25 Aug 2026 11:25:43 +0200 Message-ID: <20260825092546.669450-3-jdahlin@gmail.com> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260825092546.669450-1-jdahlin@gmail.com> References: <20260825092546.669450-1-jdahlin@gmail.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" The ASRock B850 Steel Legend WiFi uses an NCT6686D chip reporting customer ID 0x164a. Without this ID the driver refuses to probe unless the force module parameter is set, leaving the board without hardware monitoring. Add NCT6683_CUSTOMER_ID_ASROCK8 and handle it in the probe function. Signed-off-by: Johan Dahlin --- Documentation/hwmon/nct6683.rst | 1 + drivers/hwmon/nct6683.c | 3 +++ 2 files changed, 4 insertions(+) diff --git a/Documentation/hwmon/nct6683.rst b/Documentation/hwmon/nct6683.= rst index 45eec9dd349a..908c0b10c642 100644 --- a/Documentation/hwmon/nct6683.rst +++ b/Documentation/hwmon/nct6683.rst @@ -66,6 +66,7 @@ ASRock X570 NCT6683D EC firmware version 1.0 build 06/2= 8/19 ASRock X670E NCT6686D EC firmware version 1.0 build 05/19/22 ASRock B650 Steel Legend WiFi NCT6686D EC firmware version 1.0 build 11/09= /23 ASRock Z590 Taichi NCT6686D EC firmware version 1.0 build 01/25/21 +ASRock B850 Steel Legend WiFi NCT6686D EC firmware version 1.0 build 10/29= /24 MSI B550 NCT6687D EC firmware version 1.0 build 05/07/20 MSI X670-P NCT6687D EC firmware version 0.0 build 09/27/22 MSI X870E NCT6687D EC firmware version 0.0 build 11/13/24 diff --git a/drivers/hwmon/nct6683.c b/drivers/hwmon/nct6683.c index b524a45b1471..b43e915f9d0f 100644 --- a/drivers/hwmon/nct6683.c +++ b/drivers/hwmon/nct6683.c @@ -184,6 +184,7 @@ superio_exit(int ioreg) #define NCT6683_CUSTOMER_ID_ASROCK5 0x1621 #define NCT6683_CUSTOMER_ID_ASROCK6 0x1633 #define NCT6683_CUSTOMER_ID_ASROCK7 0x163d +#define NCT6683_CUSTOMER_ID_ASROCK8 0x164a =20 #define NCT6683_REG_BUILD_YEAR 0x604 #define NCT6683_REG_BUILD_MONTH 0x605 @@ -1262,6 +1263,8 @@ static int nct6683_probe(struct platform_device *pdev) break; case NCT6683_CUSTOMER_ID_ASROCK7: break; + case NCT6683_CUSTOMER_ID_ASROCK8: + break; default: if (!force) return -ENODEV; --=20 2.53.0 From nobody Mon Sep 28 07:17:18 2026 Received: from mail-ej1-f46.google.com (mail-ej1-f46.google.com [209.85.218.46]) (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 6578F3F1676 for ; Tue, 25 Aug 2026 09:25:59 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.218.46 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1787649961; cv=none; b=YKcxHFOL+pJAZfwiB4gXDNpIR/l91Pf3IfFVNr2pICMOtwbEysTN97BSw/c8iSV9pTYbKVOeYWu9sPUtzKFE635MzeaPhjiwZMnBOChLjNURkC+RoUtnxDY9T5HyUNmU4RzLAIWqLyrNSpICDQr1Oqxyj3GwBWeLHROjEcm2x3g= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1787649961; c=relaxed/simple; bh=2anvQFVPfCyDPhPtMpfhIbGCje2Q1JFv4wsSV1RIuZc=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=mFDS0WthmwSSk2HOoN6fW87p7CA7l6rI/PQ9tV2+e9ZaxKRFyGY6LYhV4dplqrhtlnjpVCNnzjP+WLeP24gMfck7iUrE4Xyc5gRmgxdPaAG+a3g3EpYgRJqAP3R8g8z2tlKHQutBUmQC9VQ06wQwtHCuH3JPDQYcx3Y/lVk4nKs= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=gO8/Ha2f; arc=none smtp.client-ip=209.85.218.46 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="gO8/Ha2f" Received: by mail-ej1-f46.google.com with SMTP id a640c23a62f3a-c15cf78d1a2so510795366b.1 for ; Tue, 25 Aug 2026 02:25:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1787649957; x=1788254757; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to:content-type; bh=A94qe2JMzOXhdD0NYjSSk1XRZc3aGtD4hUgwzwZIA0U=; b=gO8/Ha2fkHHtn4P65jMFZoMsgPmTZ4q9CeBBj9vzqzxHyM4OkSWqYeOSeXiH3P0Rdz MJFsm8N0p9DG5TcMteWg7lZdAnmRJ8XAkIy5ozqVXdE5QvpkgKI5FrY+AsFYo7ALiNLq G1lJDa2IFtj9JX0ZndYDfHT6fDdKF6tAMywW3eCVV7R+FgLoP3hMfFe83Mv4x5vHaKiL O9+TdnN6h4S7/DW8of+904QmMQ5Ry3Mt2zVFBfB3v6JH/jUjFfZjWknoAYAeiwDH0J8o UeFkPtZ7mY4sDgVENh07fW/SurCrkIHBYLYxCnoIVYY8ZOMGAqZyj5JJhqWaeB8tZ9tv nyOw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1787649957; x=1788254757; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to:content-type; bh=A94qe2JMzOXhdD0NYjSSk1XRZc3aGtD4hUgwzwZIA0U=; b=GpVgQebn9ENPuJiT8drKaTdw/kheVuyrlrFmJkJf5nY3xjmE3f+YNYPlOtXDiuPwOv kiE7g/ScqCtD+8tKEwWODCRDS5NW7qmJmJ/3/kZW2nP6bhAncy51qIIiSXe1qR9h8O2O +B1tmc+u2OMTgl0KnDhaWzYlZaGmsrCHTPAHDdiETqOndDBqz3IuK/EOx1rnpTn+1lXZ hLUCK54bdw14xv58rkKKqNIF7iU7P5m2BpH7cV1ngT3En9P2taWrdt3E0nsuWfp8KbF0 6aMRYhhXnwiAAkAvePYvrCBVQmeY6FKd8GnkPpu2PnHPSvgyakJr4Zpr5M2mJsLPhhLg r0JQ== X-Forwarded-Encrypted: i=1; AHgh+RqChZxLfuidmpJJds3kCVOKL24uCEWW5/5nlaO6mS5qshFy9Lda4Pd37CoRVfyOo4KPQSEoC9d6qpsj6iE=@vger.kernel.org X-Gm-Message-State: AFuF++kxk3pREN1KKpPmVAhozQHQfYBRaAWED2RT7lcQ9KqPwV2ReCik sJPN/H8IIFKlRajSHGpRzqgziyAbO0UXDRjPnICYYC4MEC+0dgItA80+ X-Gm-Gg: AR+sD11W0/Wn82GDxxmVhkXuTSUNkc684GlwDyYJMhRgU8JucjKNhh/axCQKLomxirf kh0H7zNv7ikGVwRJ+kgQtv8pNzQOLA2rxgrKDELS2HZDJXV/hzH7idVEfmbCSBuznj2j0VPQHuC hXDZRi8UL5qnbKmYfYLo6s55psWJIuIIj6QZ/kRmwZHoYzeppS/69HPa53qct4iBKRuKRUTHRMB cE3ZS6X+Z12MhL8OECZfV5VzbmmeyXbLjgskhZbbITjbe5pK1oTmr5/OhhE9bgF5M1Otikap0A3 JRs55ZgHHlbqWzUxPkF3hZDa59Ag9+LCXAFEmztm3uhGu9UtOiXB/fpO7s7xQUMAtKOouuoYCEr +MCICWoDbONVFDcNyqgL6vKGAL3XxtI8qOLxzUqwVplwhJuUCS6zzDpYHG1QU5EYtaIOcZyPf/x 5GVG04LxFvsuFeZULN6stKfx+PwF9xh1j96CNgu1q+FDmE5kQMweCn0uAicCi3HR5a3KuLA8MZS USW6i5x5oBI+KR5tHiheLOv4gQeFQJ0VRk3zaDMP6IiBj0mJ2OtAeyF1PnEUDuLmcqeLNpCreJ+ 8DAxInFn8CUmqrP9GTyIiO4= X-Received: by 2002:a17:907:1ca7:b0:c20:33db:41d3 with SMTP id a640c23a62f3a-c24e5ade69dmr575868666b.11.1787649957161; Tue, 25 Aug 2026 02:25:57 -0700 (PDT) Received: from fractal.tuxedo-gray.ts.net (c-78-82-25-228.bbcust.telenor.se. [78.82.25.228]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-c249606bd05sm1612570866b.2.2026.08.25.02.25.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 25 Aug 2026 02:25:56 -0700 (PDT) From: Johan Dahlin To: Guenter Roeck Cc: linux-hwmon@vger.kernel.org, linux-kernel@vger.kernel.org, Johan Dahlin Subject: [PATCH 3/5] hwmon: (nct6683) Add pwm[1-8]_enable Date: Tue, 25 Aug 2026 11:25:44 +0200 Message-ID: <20260825092546.669450-4-jdahlin@gmail.com> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260825092546.669450-1-jdahlin@gmail.com> References: <20260825092546.669450-1-jdahlin@gmail.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" NCT668x keeps a per-fan manual-control bitmap in register 0xa00. While a fan's bit is clear the EC runs its own control loop and ignores the pwm registers, so a pwm write succeeds and then has no effect on the fan. Expose the bitmap as pwm[1-8]_enable following the hwmon ABI, with 1 for manual control and 2 for the EC's automatic control. The attribute group now has two attributes per channel, so is_visible derives the channel from the attribute index. Intel boards run a firmware variant that Nuvoton confirms uses different register addresses, so 0xa00 cannot be assumed to mean the same thing there. Only expose the attribute where fan control has been verified. The register was derived from the out-of-tree nct6687d driver, which documents it from LibreHardwareMonitor's reverse engineering. Link: https://github.com/Fred78290/nct6687d Link: https://github.com/LibreHardwareMonitor/LibreHardwareMonitor Signed-off-by: Johan Dahlin --- Documentation/hwmon/nct6683.rst | 6 +++ drivers/hwmon/nct6683.c | 77 +++++++++++++++++++++++++++++++-- 2 files changed, 79 insertions(+), 4 deletions(-) diff --git a/Documentation/hwmon/nct6683.rst b/Documentation/hwmon/nct6683.= rst index 908c0b10c642..ff5edb34c5c5 100644 --- a/Documentation/hwmon/nct6683.rst +++ b/Documentation/hwmon/nct6683.rst @@ -49,6 +49,12 @@ The driver has only been tested with the Intel firmware,= and by default only instantiates on Intel boards. To enable it on non-Intel boards, set the 'force' module parameter to 1. =20 +Fan control is likewise restricted. The EC runs its own control loop unless +a fan is switched to manual mode by writing 1 to its pwm[1-8]_enable +attribute, and pwm values are only writable on boards where this has been +verified to work. On all other boards the pwm attributes are read-only and +the fan curve must be configured from the BIOS. + Tested Boards and Firmware Versions ----------------------------------- =20 diff --git a/drivers/hwmon/nct6683.c b/drivers/hwmon/nct6683.c index b43e915f9d0f..0324ace707a5 100644 --- a/drivers/hwmon/nct6683.c +++ b/drivers/hwmon/nct6683.c @@ -165,6 +165,7 @@ superio_exit(int ioreg) =20 #define NCT6683_REG_FAN_MIN(x) (0x3b8 + (x) * 2) /* 16 bit */ =20 +#define NCT6683_REG_FAN_CTRL_MODE 0xa00 #define NCT6683_REG_FAN_CFG_CTRL 0xa01 #define NCT6683_FAN_CFG_REQ 0x80 #define NCT6683_FAN_CFG_DONE 0x40 @@ -962,25 +963,93 @@ store_pwm(struct device *dev, struct device_attribute= *attr, const char *buf, =20 SENSOR_TEMPLATE(pwm, "pwm%d", S_IRUGO, show_pwm, store_pwm, 0); =20 +/* + * Fan control has only been verified on the boards listed here. Intel boa= rds + * in particular run a firmware variant that Nuvoton confirms uses differe= nt + * register addresses, so 0xa00 cannot be assumed to mean the same thing + * there. Leave the fans to the EC everywhere else. + */ +static bool nct6683_has_fan_control(struct nct6683_data *data) +{ + return data->customer_id =3D=3D NCT6683_CUSTOMER_ID_MITAC; +} + +/* + * NCT668x keeps a per-fan manual-control bitmap. While a fan's bit is cle= ar + * the EC runs its own control loop and ignores the pwm registers, so pwm + * writes only take effect once the fan has been switched to manual mode. + */ +static ssize_t +show_pwm_enable(struct device *dev, struct device_attribute *attr, char *b= uf) +{ + struct sensor_device_attribute_2 *sattr =3D to_sensor_dev_attr_2(attr); + struct nct6683_data *data =3D dev_get_drvdata(dev); + u8 mode; + + mutex_lock(&data->update_lock); + mode =3D nct6683_read(data, NCT6683_REG_FAN_CTRL_MODE); + mutex_unlock(&data->update_lock); + + return sysfs_emit(buf, "%d\n", (mode & BIT(sattr->index)) ? 1 : 2); +} + +static ssize_t +store_pwm_enable(struct device *dev, struct device_attribute *attr, + const char *buf, size_t count) +{ + struct sensor_device_attribute_2 *sattr =3D to_sensor_dev_attr_2(attr); + struct nct6683_data *data =3D dev_get_drvdata(dev); + u8 bit =3D BIT(sattr->index); + unsigned long val; + bool manual; + int err =3D 0; + u8 mode; + + if (kstrtoul(buf, 10, &val) || (val !=3D 1 && val !=3D 2)) + return -EINVAL; + + manual =3D val =3D=3D 1; + + mutex_lock(&data->update_lock); + mode =3D nct6683_read(data, NCT6683_REG_FAN_CTRL_MODE); + if (manual) + mode |=3D bit; + else + mode &=3D ~bit; + nct6683_write(data, NCT6683_REG_FAN_CTRL_MODE, mode); + + if (!!(nct6683_read(data, NCT6683_REG_FAN_CTRL_MODE) & bit) !=3D manual) + err =3D -EIO; + mutex_unlock(&data->update_lock); + + return err ? err : count; +} + +SENSOR_TEMPLATE(pwm_enable, "pwm%d_enable", 0444, show_pwm_enable, + store_pwm_enable, 0); + static umode_t nct6683_pwm_is_visible(struct kobject *kobj, struct attribute *attr, int index) { struct device *dev =3D kobj_to_dev(kobj); struct nct6683_data *data =3D dev_get_drvdata(dev); - int pwm =3D index; /* pwm index */ + int pwm =3D index / 2; /* pwm index */ + int nr =3D index % 2; /* attribute index */ =20 if (!(data->have_pwm & (1 << pwm))) return 0; =20 - /* Only update pwm values for Mitac boards */ - if (data->customer_id =3D=3D NCT6683_CUSTOMER_ID_MITAC) + /* Only touch fan control on boards where it has been verified */ + if (nct6683_has_fan_control(data)) return attr->mode | S_IWUSR; =20 - return attr->mode; + /* Elsewhere hide pwm_enable and keep pwm read-only */ + return nr ? 0 : attr->mode; } =20 static struct sensor_device_template *nct6683_attributes_pwm_template[] = =3D { &sensor_dev_template_pwm, + &sensor_dev_template_pwm_enable, NULL }; =20 --=20 2.53.0 From nobody Mon Sep 28 07:17:18 2026 Received: from mail-ej1-f42.google.com (mail-ej1-f42.google.com [209.85.218.42]) (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 23AE03EFFD7 for ; Tue, 25 Aug 2026 09:25:59 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.218.42 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1787649962; cv=none; b=gLRGp2A4/cT9Pr2yAaTs32lIrQzKyXyw1dBn4o5XhBN4CaD0ZMP+PAbDp8ArbeP+J5cWY3UNs3U+PzUj+aRomjf0Wvu/pZiBuCwlP1J2o6pzYXc1gPuWFx3JNbp8WsmPHg+mdNhXkxXeCo9aOD2PyQVYh5Ph+2n6kV5jV2CLDRg= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1787649962; c=relaxed/simple; bh=VYkgLWCJeyiEauXzcozuHqKvw+ZR7o179+bK3zgGtWA=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=cSCrngFh1kr1WWmNPd9aqP28Vcf4tNvqcQ0pPvMiWpciZJ5Hl1KOw7bSPBscMJtkIXljaUye/JWM1NyVdWIjlC5ntaw794q/qS+nq268N2O+pKc0xp/VaA5zRmo5Nee8v0996gXdThstwluwTOwyIQ2gMSYWX595lNLxAW+kl2I= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=k6Ajig3x; arc=none smtp.client-ip=209.85.218.42 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="k6Ajig3x" Received: by mail-ej1-f42.google.com with SMTP id a640c23a62f3a-c15e592da74so625987166b.1 for ; Tue, 25 Aug 2026 02:25:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1787649958; x=1788254758; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to:content-type; bh=dFXySYEtb7Jp90OKqpFBc5Jr23ETazFykOiMX2/lKCk=; b=k6Ajig3xYw+3nqKdjMcaFu3ApIojc7JYmyYV4mLvog4umM7OdYbt9deju5+0nkXLYe NCXghhXo0TIkqqIjM3yTGhmZccDwUCo7+68LWohfc9S9k3UiApkz+R+BXHEMOz04f3XO WGGUYH2g3VX1qXlE12T5gVNO10C/M1r9iQSMJM1X/xPzjgfKGsfYK9wyfrEXQVrCz2Jk O9JLZaH/laTXdLm/JVtD/cLOrWANDQj0GU9ygfb9Oup6nrcJtvWdtFtLh3D/mKLNHZke 1p7nMyY6cpRuBDRAEwrfTO4Hn0I/mRQrmYP++AfPQ0I1KlhNIB3svlUXjhy8dvl7TuKi 4lbQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1787649958; x=1788254758; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to:content-type; bh=dFXySYEtb7Jp90OKqpFBc5Jr23ETazFykOiMX2/lKCk=; b=moqhWRIVmkA5X5XPJ3kXC5jV194Us2iBkbljQ0gAU3OHgkcjitZFLNdHxCsWQPJJ42 5GqfizjDRvdvK2359TgTPATqEy3gfDEdKp/xdL8i86Q/7FvG+iL1wctPDWzSoREUl4CK 4mjJ8/Wyxvp5bw//VnNtUpvfDU6W5hYv8Md+y8D00qT0ouX93JVAoZRdoRqOwXMDm+Ch 2WNnB7Nu4fNHNHlUxRCvv3rCxaVx5S+HtD5z/PBGg2H280/YUTWPtc+YauA7mNUxZ6Tt y4skinzWdKrXvDd+K8nnEU5rRB3aSHdgpP8B3uSD8gY/y2GuArKsH5G+tLEB9Ukj/LZa EtqQ== X-Forwarded-Encrypted: i=1; AHgh+RpEopRx0bXrHlE4Bbi0a8fAWPW4zsU7fkqLxfjkHYi6bjY90jlc0k+DpSw2qplAiz2N8jKUYCPEgM4kXeo=@vger.kernel.org X-Gm-Message-State: AFuF++kVfSixLV6VsbayaYpcLh82SQ6H57Yf8/JsDIIqb4drYqQr7plD HfUtUGK/YYxnE4a955hEuaNBPmAIJUoBdU4co1kuixsiwEAvgaNvLSjV X-Gm-Gg: AR+sD10LYrUuOgY4cwwlD9xLHSizTpNLOyrcpRf+z5h7sn5u1KCjjT6s0KQEtzkZR3N w9VGxjefbPT6TMDTfONADoCk4461f7wyRuLbcUXupJXbbdHidDxwSdaEoZeJtCBnUyAsM5jlVcK aoyCcU4+eBuzvhhHirlrRm2YXDUIO4Kv/7zDO8+8nDDSX2a55Mg+RIGsVK4gs1Ap+cIkB6pYtAy oCWFuNMNY7jboIumw0w9Ifei+66sUI/3JLCOQ02fCujAe4ny8lS5ZyXSoDacL6QA6yJgQK1Q1Vg Mm6v4gQkoWKKrn6tcDfvAsIzh9sZ9T6sjY+GCGNpBFSFnZFT5ZGT7n9P9boaNsMKHH9Cmu+kBTN hv367IgIhjaYZQzfOHlqT36Gs6FrkiGqMMW/hGL6DiT1L+JzcJDZL3yalKIyM00KCWR2Xgw8mbW FKbb0f5ZiBuQ5l1ygykkM7oGL499qIBllG7M8OWi+MiGQB5lL8kJIFH/LUX4bZEaTCzG12tMQqO Gfd4y6RVySLl9dH1UG29bMr7oa6w+4Z4zg4cryAr9DxxZAO0u5KXVvdLW7yY3XtfLRHg9zdVZbC 8ROCoZE7UhC98B558DibZjFLK5Jd X-Received: by 2002:a17:906:f59b:b0:c20:7cb1:9046 with SMTP id a640c23a62f3a-c24924b7508mr2666855366b.8.1787649957973; Tue, 25 Aug 2026 02:25:57 -0700 (PDT) Received: from fractal.tuxedo-gray.ts.net (c-78-82-25-228.bbcust.telenor.se. [78.82.25.228]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-c249606bd05sm1612570866b.2.2026.08.25.02.25.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 25 Aug 2026 02:25:57 -0700 (PDT) From: Johan Dahlin To: Guenter Roeck Cc: linux-hwmon@vger.kernel.org, linux-kernel@vger.kernel.org, Johan Dahlin Subject: [PATCH 4/5] hwmon: (nct6683) Restore fan control mode on driver removal Date: Tue, 25 Aug 2026 11:25:45 +0200 Message-ID: <20260825092546.669450-5-jdahlin@gmail.com> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260825092546.669450-1-jdahlin@gmail.com> References: <20260825092546.669450-1-jdahlin@gmail.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" A fan switched to manual mode stays there when the driver is unloaded, leaving it pinned at whatever pwm value was last written with nothing left to update it. Record the fan control mode register during probe and put it back with a devres action, so the EC resumes control of the fans the driver took over while anything the firmware had already set is left alone. The action is registered before the hwmon device, so it runs after the attributes are gone and cannot race with a pwm write, and it is a no-op if probe fails before the driver touches the register. Boards where the driver does not manage the register do not register it. Signed-off-by: Johan Dahlin --- drivers/hwmon/nct6683.c | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/drivers/hwmon/nct6683.c b/drivers/hwmon/nct6683.c index 0324ace707a5..6825e6c3af34 100644 --- a/drivers/hwmon/nct6683.c +++ b/drivers/hwmon/nct6683.c @@ -344,6 +344,7 @@ struct nct6683_data { u16 have_fan; /* some fan inputs can be disabled */ =20 u8 have_pwm; + u8 initial_fan_ctrl_mode; u8 pwm[NCT6683_NUM_REG_PWM]; =20 #ifdef CONFIG_PM @@ -1275,6 +1276,17 @@ static void nct6683_setup_sensors(struct nct6683_dat= a *data) } } =20 +/* Put the fan control mode register back the way probe found it. */ +static void nct6683_restore_fan_control(void *_data) +{ + struct nct6683_data *data =3D _data; + + mutex_lock(&data->update_lock); + nct6683_write(data, NCT6683_REG_FAN_CTRL_MODE, + data->initial_fan_ctrl_mode); + mutex_unlock(&data->update_lock); +} + static int nct6683_probe(struct platform_device *pdev) { struct device *dev =3D &pdev->dev; @@ -1284,6 +1296,7 @@ static int nct6683_probe(struct platform_device *pdev) struct device *hwmon_dev; struct resource *res; int groups =3D 0; + int err; char build[16]; =20 res =3D platform_get_resource(pdev, IORESOURCE_IO, 0); @@ -1401,6 +1414,15 @@ static int nct6683_probe(struct platform_device *pde= v) nct6683_read(data, NCT6683_REG_VERSION_LO), build); =20 + if (nct6683_has_fan_control(data)) { + data->initial_fan_ctrl_mode =3D + nct6683_read(data, NCT6683_REG_FAN_CTRL_MODE); + err =3D devm_add_action_or_reset(dev, nct6683_restore_fan_control, + data); + if (err) + return err; + } + hwmon_dev =3D devm_hwmon_device_register_with_groups(dev, nct6683_device_names[data->kind], data, data->groups); return PTR_ERR_OR_ZERO(hwmon_dev); --=20 2.53.0 From nobody Mon Sep 28 07:17:18 2026 Received: from mail-ej1-f50.google.com (mail-ej1-f50.google.com [209.85.218.50]) (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 0613B38F941 for ; Tue, 25 Aug 2026 09:26:00 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.218.50 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1787649962; cv=none; b=iCEmjp8slGrzX8a8i0VDP2yktzhD7OpR8HK9GY7YTnfN4mzKrTXNP2uzmagnM1M40DHRwGD7bBJMom7o/iT5y8D5ky0LTSmwgFrDHlH3KAtToj1Ee2KgOztG0gxH4dh61oIYcHuYO3I1CA91jjvdS3jWc7JZvlQNcIVeoBiOY/Y= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1787649962; c=relaxed/simple; bh=XND/vrnNdGnRRh6HJniJijvZPaDsItJ2CT/DFUG7XLI=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=lxCpVloeXwFYgfqMAbx48AWndEJ7Lwy4NICBM5Wp5ZUjKLAOY2E6tEAXzPmEtQsDo1DruAlEgs+P5xMEJB5v3cP0wQ/YD7gbC5BkoiRsJK3zquO5LwCj3g6bYH7HRJ/KBIupZ8PP1ku7igdfMPeGa23Ex97rPt654NQ2Qyy3hxk= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=plhqprVe; arc=none smtp.client-ip=209.85.218.50 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="plhqprVe" Received: by mail-ej1-f50.google.com with SMTP id a640c23a62f3a-c214e625259so680573366b.2 for ; Tue, 25 Aug 2026 02:26:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1787649959; x=1788254759; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to:content-type; bh=aK2NBAZNJ7hyQkISsggpnV+gCwOX0/yVfqvSX9ZERHA=; b=plhqprVeUgBvrRRE86R7A5KaIVfYnkEoO3EUr9GKeiTS0Nl+c+XLkR4EOwZnPfLFom HiVivZ7y0uMUEBLgjt9dINNpniLAPNkvM7Cirm0bmLDhmXqd00LALH9SxXT9ob0AJddf nn3Dd8W5Yg/AGoKvEq82DmU+3KD98RwXBoqEp5NnTgfwKfX86Mh52JKI1RezV7Pgo0hy 2kmsbfJbLl5i84FziIhG4Cnckk7E1wQLI9t7NbZyUapOLi5RQ74ZwuSHopztG763ep9X GA8XSAhK13R9mFEWwAZzWA38XOTlklHhwWRN327kdxNZStFtcwUt96CgKkW36Msm+lZa iRAA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1787649959; x=1788254759; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to:content-type; bh=aK2NBAZNJ7hyQkISsggpnV+gCwOX0/yVfqvSX9ZERHA=; b=L36WYYOsqzmrOVR8JVBzEC/JLeEa2z0E9rQK8DhLGgwxVMiN4Wyn6Fmu+YEK1Rro6J hL4SLarXDmTLOuwIHCd7Ao6zyS+wU7YXD68LO2cnlzIxou9hmSa8i371O8Sj4gjTo/Iv zqiNhl+gEomDUm6BmJGI6ULGrU+Fe5+JQ5WUAQahy/4RflV4XXnJk+uUajyETKecAKTm bIfAxRQgiV477Wc4J1UaP+hPb1ofNADDgMqGcs6XE/cXc7ro+FJLvwNRSHOCpjw151hw 2j9yRwF7iFFl0w1qMSYTZ/ym472uSHYn2TE4qLFzC5EFscgrif2Piny7vmDxxgj+IVOG kbMg== X-Forwarded-Encrypted: i=1; AHgh+RqS+Jw6VvnC5ut+5WI6EdimM+i3scxDQ2NkthWNNFozPrUOsB30o54Uag7n2bhcOnMDfn3/CImyCwWdzak=@vger.kernel.org X-Gm-Message-State: AFuF++kb/AMr2pChPwatIIM7BcCXM2t7gg0ske1461NBD2EZswxRiB/9 YLlGuG4PsNWkmS5YTu5wrwnZvaPJ8Dyi2mu7ugnSOoYdpJk6a09DeeGmhvqtbw== X-Gm-Gg: AR+sD10BHhLtbLbxxoBtgWyNrLPB6I25UL2fLVSD372qG8mXfkjB0L7o4aPiHq9zXgN aIlUjW6eH/7qr/FXYIk0cuunDF3sOoTTn0uyFLKTOGYGogzy0n4cV0ISYivFZKTQVss4+clNM7q W0aYFqv0q+7sYE1byvVq9q7OXketmdH4ou0nMhH1kgL2gG+God5RjrgX7fwkskxzZP7S1Mfwj3P Qr2dQ2mPPzVSekNfCrfr/7L4vh9jsQOHtUypLyDSzzQpjmcu3cvUS/HxFs1bQw9dqf+XOV01V4U CJZN8vdieiFpKrHpgm/zX6q6Jvgr/pXXOVrOWGhzWbJFCHYp+hrnK1PsjLfuHtrohvB4ONz68Lr 4y5lF3Q1iqYM5yug0F/VtmvOZtDsbzQgRamVAuFHYD3FlskRkHBSQ+AfTNgt6tnujb+0MAS/4VR jpvb54JRyUvyci/fXhOznHZtye/VGqYbUAXBnuxAbZP1K4EgxTHxyDzP4s2RZZevCAPA4X1E2Jd LbHForVd+wAMMDkmm1gwLo2Rv+GSfCinFJs7Lu9RqE27sK+NdIFIyEty2AtICHPI+5792bKP1+S oy4AN0/FmFbMc3BrMpCRCUE= X-Received: by 2002:a17:907:d0c:b0:c20:53c7:488d with SMTP id a640c23a62f3a-c24e5ade3a4mr545156366b.14.1787649958817; Tue, 25 Aug 2026 02:25:58 -0700 (PDT) Received: from fractal.tuxedo-gray.ts.net (c-78-82-25-228.bbcust.telenor.se. [78.82.25.228]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-c249606bd05sm1612570866b.2.2026.08.25.02.25.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 25 Aug 2026 02:25:58 -0700 (PDT) From: Johan Dahlin To: Guenter Roeck Cc: linux-hwmon@vger.kernel.org, linux-kernel@vger.kernel.org, Johan Dahlin Subject: [PATCH 5/5] hwmon: (nct6683) Enable pwm control on ASRock B850 Steel Legend WiFi Date: Tue, 25 Aug 2026 11:25:46 +0200 Message-ID: <20260825092546.669450-6-jdahlin@gmail.com> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260825092546.669450-1-jdahlin@gmail.com> References: <20260825092546.669450-1-jdahlin@gmail.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Fan control has been measured on this board: with a fan in manual mode the applied pwm value tracks what is written, and the fan responds proportionally from 337 RPM at pwm 60 to 933 RPM at pwm 255. Allow pwm writes on this board. Signed-off-by: Johan Dahlin Tested-by: Fabio Baltieri ). Or I'm happy to --- drivers/hwmon/nct6683.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/hwmon/nct6683.c b/drivers/hwmon/nct6683.c index 6825e6c3af34..df28055b1a1c 100644 --- a/drivers/hwmon/nct6683.c +++ b/drivers/hwmon/nct6683.c @@ -972,7 +972,8 @@ SENSOR_TEMPLATE(pwm, "pwm%d", S_IRUGO, show_pwm, store_= pwm, 0); */ static bool nct6683_has_fan_control(struct nct6683_data *data) { - return data->customer_id =3D=3D NCT6683_CUSTOMER_ID_MITAC; + return data->customer_id =3D=3D NCT6683_CUSTOMER_ID_MITAC || + data->customer_id =3D=3D NCT6683_CUSTOMER_ID_ASROCK8; } =20 /* --=20 2.53.0