From nobody Sat Jul 25 03:20:17 2026 Received: from mx0a-00128a01.pphosted.com (mx0a-00128a01.pphosted.com [148.163.135.77]) (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 F3D26299923; Mon, 20 Jul 2026 03:15:28 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=148.163.135.77 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784517330; cv=none; b=GQkhsu2d3BWeazte35+AWEurWBpeTolcerywJAo+IwtCWnhmVzk7j3wztFOAn9td0MUe25vPTn9NgmFFRBAOOjqUuPaueJAx4z+cBw8RXJhduGutEJEhINFSVvKEK/1SXtsAmGRyfqfmkNcxR0weVMCuf6nGea0Q6opXnClPDoo= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784517330; c=relaxed/simple; bh=9lmRbWMhwDV39UeYBnp3CF5EU4MF+aBpFA9+KLtpUkU=; h=From:Date:Subject:MIME-Version:Content-Type:Message-ID:References: In-Reply-To:To:CC; b=McJcfNa93UXzXWlOKv5lN4GXaRZh6qd4GcWQB3+riwRwMrS3ks24EOAY6uZnYFim1CJOwR0PvJbVTq+NEjjuqyKLDL6oGhW5xxquTw0jXWm9nt+AOBuXvd5q9nRWiKe66ru/5e/xq6QLYMTSdcARWNu+qMLslABbFc3/rMQKG+M= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=analog.com; spf=pass smtp.mailfrom=analog.com; dkim=pass (2048-bit key) header.d=analog.com header.i=@analog.com header.b=UmH/BY2k; arc=none smtp.client-ip=148.163.135.77 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=analog.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=analog.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=analog.com header.i=@analog.com header.b="UmH/BY2k" Received: from pps.filterd (m0516787.ppops.net [127.0.0.1]) by mx0a-00128a01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 66JNt2GE452843; Sun, 19 Jul 2026 23:15:13 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=analog.com; h=cc :content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to; s=DKIM; bh=RALi2 yKmlNj/tKZec+lFPKu0Vba894q0zZCPSQPKgdk=; b=UmH/BY2khMcXG90vvG1+3 vELLd9Do0f1eq5wKoLLa5e+CmJ9bMkyEEKPOYFRDdVxGdLp+Nm0PipSctFbWSssW 94x6I2hHsuWGHz3t9nFwK1dRgtQxxD7P+jEMIyNPv8t47NB0kmVX6Ncj7x94yJBp JTCW9jFge7Cdl4JhOfmzwYyF0qndG5U2S/GlOQLi1mg8tfi7z/3sZRXCyRaSq6Zi 5h05S3WjRalLyAsxEB8G+NkO9nmqkkYRQfrye74UX3MJkOa+HihWlhRco/Da6x1/ TtRbpFWlreBp1Egpm9sGwIeNUkSHOYey7kUjeoq+IB71LRCUFGORstrjrGqTodpK A== Received: from nwd2mta4.analog.com ([137.71.173.58]) by mx0a-00128a01.pphosted.com (PPS) with ESMTPS id 4fgttga5aj-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Sun, 19 Jul 2026 23:15:13 -0400 (EDT) Received: from ASHBMBX9.ad.analog.com (ASHBMBX9.ad.analog.com [10.64.17.10]) by nwd2mta4.analog.com (8.14.7/8.14.7) with ESMTP id 66K3FCJP054360 (version=TLSv1/SSLv3 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Sun, 19 Jul 2026 23:15:12 -0400 Received: from ASHBMBX9.ad.analog.com (10.64.17.10) by ASHBMBX9.ad.analog.com (10.64.17.10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1748.37; Sun, 19 Jul 2026 23:15:11 -0400 Received: from zeus.spd.analog.com (10.66.68.11) by ashbmbx9.ad.analog.com (10.64.17.10) with Microsoft SMTP Server id 15.2.1748.37 via Frontend Transport; Sun, 19 Jul 2026 23:15:11 -0400 Received: from ATORRENO-L02.ad.analog.com ([10.66.6.192]) by zeus.spd.analog.com (8.15.1/8.15.1) with ESMTP id 66K3EoFT021622; Sun, 19 Jul 2026 23:15:03 -0400 From: Alexis Czezar Torreno Date: Mon, 20 Jul 2026 11:14:42 +0800 Subject: [PATCH v3 1/4] dt-bindings: hwmon: (pmbus/max20830): add VOUT feedback resistor properties and complete examples 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: quoted-printable Message-ID: <20260720-dev-max20830c-v3-1-9d06d27d6da3@analog.com> References: <20260720-dev-max20830c-v3-0-9d06d27d6da3@analog.com> In-Reply-To: <20260720-dev-max20830c-v3-0-9d06d27d6da3@analog.com> To: Guenter Roeck , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Jonathan Corbet , Shuah Khan CC: , , , , Alexis Czezar Torreno , Krzysztof Kozlowski X-Mailer: b4 0.14.2 X-Developer-Signature: v=1; a=ed25519-sha256; t=1784517290; l=2332; i=alexisczezar.torreno@analog.com; s=20250213; h=from:subject:message-id; bh=9lmRbWMhwDV39UeYBnp3CF5EU4MF+aBpFA9+KLtpUkU=; b=5UAqgIQmo95KbEw+r2kJtAPk7ZiwUSOzdGXkXbiIPfwtv8AIYhutCRIs53nkEZDIJsJz4MoWs MoC/66VuN/iB5GkKVy51D6MEX+3Ej0U6pXIY+LJYwYIG6b3yEsXjGZ6 X-Developer-Key: i=alexisczezar.torreno@analog.com; a=ed25519; pk=XpXmJnRjnsKdDil6YpOlj9+44S+XYXVFnxvkbmaZ+10= X-ADIRuleOP-NewSCL: Rule Triggered X-Proofpoint-ORIG-GUID: 0A8hFulF3mUWBr8k_AOOFpa9NT4XK1uC X-Authority-Analysis: v=2.4 cv=DagnbPtW c=1 sm=1 tr=0 ts=6a5d92c1 cx=c_pps a=3WNzaoukacrqR9RwcOSAdA==:117 a=3WNzaoukacrqR9RwcOSAdA==:17 a=IkcTkHD0fZMA:10 a=RAioF0-LDSMA:10 a=VkNPw1HP01LnGYTKEx00:22 a=0sLvza09kfJOxVLZPwjg:22 a=OmVn7CZJonkx5R5zMQLL:22 a=EUspDBNiAAAA:8 a=gAnH3GRIAAAA:8 a=rWBwxEM6VC-iK73SjNoA:9 a=3ZKOabzyN94A:10 a=QEXdDO2ut3YA:10 X-Proofpoint-Spam-Info: AW1haW4tMjYwNzIwMDAzMyBTYWx0ZWRfX+TxUnZZaKAys /W/K27kc7F8XeZzv3qxqIEnJH4HXZOE9YZvs4lAx7TTHkfASZaWAx7fki77KrUyt4OOEggzixD9 xSKQCZ3V4nGUW60iSG/Cqp82XZijkQYTDUYA0oaqYmUclQ14rbeZ X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwNzIwMDAzMyBTYWx0ZWRfX3iIfDSPhhqam 65W470yWCmwWyPp4A7wFpi8d4EoNg/EAMJnqMWTQ9RL2AcuR0Q7i0J3r8onFdRDIYko4qMlXH0q 4DJXKw5W1eRDO0054KtarjJo0uQZXgeCQMkmlabl/7qYEXvKS4CFTf7xxH5xsXXG5ykbFhmdbax mjshDYJOSkKpaUISxJnyL4uIcnbfCz8YpPv5jKoUVoPCO+OCh0LicZS8pQK+ETlNHFJ7zKaSzbH XFsr31DLBMc45Z5FRHFdpXl6gtYACfg+1RfQUAtyvkaLfYu3LGqeJd8TmAMNyaLG/YBgeT0uk9p K5eUwovoCD+aXGFSNOQrrAFRsSY75rY1/f63lgivAeKSP0uwsGGWpZJ7KauEVXZWwgjML7xu+6m uuWruObMuaiTJWgOsJMxnOzSsjxB2sxm40alWXIFBMa0E9FVBxRDGCLoHldGnA5Oix5/rS09uP/ n/fLVTYcXujfiWWe7dA== X-Proofpoint-GUID: 0A8hFulF3mUWBr8k_AOOFpa9NT4XK1uC X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1143,Hydra:6.1.134,FMLib:17.12.100.49 definitions=2026-07-19_08,2026-07-17_01,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 impostorscore=0 spamscore=0 clxscore=1015 suspectscore=0 bulkscore=0 phishscore=0 lowpriorityscore=0 priorityscore=1501 adultscore=0 malwarescore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2606150000 definitions=main-2607200033 Add adi,vout-rfb1-ohms and adi,vout-rfb2-ohms properties to support external voltage divider configuration for VOUT sensing. When the desired output voltage is higher than VREF, a resistor divider (RFB1 and RFB2) is required to reach the intended value. The properties use a dependency constraint to ensure both resistors are specified together, or neither. This prevents misconfiguration where only one resistor value is provided. This patch also added missing entries in the examples. Reviewed-by: Krzysztof Kozlowski Signed-off-by: Alexis Czezar Torreno --- .../bindings/hwmon/pmbus/adi,max20830.yaml | 20 ++++++++++++++++= ++++ 1 file changed, 20 insertions(+) diff --git a/Documentation/devicetree/bindings/hwmon/pmbus/adi,max20830.yam= l b/Documentation/devicetree/bindings/hwmon/pmbus/adi,max20830.yaml index 1625dd59417f1b3ca689a9c86ca266da913d1217..214adf1a3b9e9efdeca7db3bd76= 79c70656e9a7e 100644 --- a/Documentation/devicetree/bindings/hwmon/pmbus/adi,max20830.yaml +++ b/Documentation/devicetree/bindings/hwmon/pmbus/adi,max20830.yaml @@ -44,11 +44,26 @@ properties: GPIO connected to the power-good status output pin. maxItems: 1 =20 + adi,vout-rfb1-ohms: + description: + Top feedback resistor (RFB1) value in ohms for VOUT sensing divider. + When the desired output voltage is higher than VREF, a resistor divi= der + is required. VOUT =3D VREF =C3=97 (1 + RFB1/RFB2) + + adi,vout-rfb2-ohms: + description: + Bottom feedback resistor (RFB2) value in ohms for VOUT sensing divid= er. + Datasheet recommends that RFB2 does not exceed 2.5k=CE=A9. + required: - compatible - reg - vddh-supply =20 +dependencies: + adi,vout-rfb1-ohms: ['adi,vout-rfb2-ohms'] + adi,vout-rfb2-ohms: ['adi,vout-rfb1-ohms'] + unevaluatedProperties: false =20 examples: @@ -61,6 +76,11 @@ examples: compatible =3D "adi,max20830"; reg =3D <0x30>; vddh-supply =3D <&vddh>; + avdd-supply =3D <&avdd>; + ldoin-supply =3D <&ldoin>; + pwr-good-gpios =3D <&gpio 2 GPIO_ACTIVE_HIGH>; + adi,vout-rfb1-ohms =3D <10000>; + adi,vout-rfb2-ohms =3D <2000>; }; }; ... --=20 2.34.1 From nobody Sat Jul 25 03:20:17 2026 Received: from mx0b-00128a01.pphosted.com (mx0a-00128a01.pphosted.com [148.163.135.77]) (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 560A838AC7D; Mon, 20 Jul 2026 03:15:30 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=148.163.135.77 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784517332; cv=none; b=MygZ7YezumH9n46FnDRSsF78fs6bfw9CrF2JyO8ovHO7oBcLAYsBuzettSKV2Dp59fGOry4fhU4U2ouVsyCAh0jtB4N97tRUU/cH5dYlJswOGVL6/F3g/gTqr37ugmhXoMZAOinadris8HhK01PRsDpdLhq68woEZGUkXZK8a0I= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784517332; c=relaxed/simple; bh=whGwy8iUdQ+uED3tZKui/NXJQJHb5yViykND/HeI5zo=; h=From:Date:Subject:MIME-Version:Content-Type:Message-ID:References: In-Reply-To:To:CC; b=EGpFKYV7wjHDcx7rz5UKaFNFL3dlfjq2ngrFhRt1JH6/WAfy1ekCW2R2EKb/7JxY1LBz5KBUB1XzgHMSPQ2vraJbDYtlWlcMvhZluoV1jdVAb0BOlr2jtTcHM0NDyxhK6ROvbzOLEr31J6S1F8OVbbEN9ZjoFZ/geLZ4Z84lO0o= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=analog.com; spf=pass smtp.mailfrom=analog.com; dkim=pass (2048-bit key) header.d=analog.com header.i=@analog.com header.b=jgp7AX0k; arc=none smtp.client-ip=148.163.135.77 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=analog.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=analog.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=analog.com header.i=@analog.com header.b="jgp7AX0k" Received: from pps.filterd (m0375855.ppops.net [127.0.0.1]) by mx0b-00128a01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 66JNuA0D170741; Sun, 19 Jul 2026 23:15:17 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=analog.com; h=cc :content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to; s=DKIM; bh=jU2O3 flkt7aA7BZV/fk5ltrP01HBFw01b7Y15gm1ZAs=; b=jgp7AX0ksPxIoQ5T++wDu X7D+54cxGFdCCJ40S/ubZ3ZXRn4asl0GHiPzm4nRqrzRL8TBdqvtCYAagJIpXFnw bCFswYq8npzWy7zfFZSD5a+6XwmTSNk37v4oXahA+nneujzttJXBY+MKSzDu2foh GXks78igNeHHTuk75s5A6dGkC5ClXc/EkQwcWDHlgTVPyFGaEXqazMm2LK1xeiy3 LrYalAFvQ92k2uJb6qlGmFkxzcbaJ0h77s34IdFdcCg4awAKnm8PCE5l/7UQWfdQ gI6mW1o2FV6fqmy2gswmYb0U5LfkV9ddMWfaTySzxMjiTnyXFMPnoVfeFfk5kRTV w== Received: from nwd2mta4.analog.com ([137.71.173.58]) by mx0b-00128a01.pphosted.com (PPS) with ESMTPS id 4fgqte2fuj-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Sun, 19 Jul 2026 23:15:16 -0400 (EDT) Received: from ASHBMBX8.ad.analog.com (ASHBMBX8.ad.analog.com [10.64.17.5]) by nwd2mta4.analog.com (8.14.7/8.14.7) with ESMTP id 66K3FFJ5054369 (version=TLSv1/SSLv3 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Sun, 19 Jul 2026 23:15:15 -0400 Received: from ASHBCASHYB5.ad.analog.com (10.64.17.133) by ASHBMBX8.ad.analog.com (10.64.17.5) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1748.37; Sun, 19 Jul 2026 23:15:15 -0400 Received: from ASHBMBX9.ad.analog.com (10.64.17.10) by ASHBCASHYB5.ad.analog.com (10.64.17.133) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1748.37; Sun, 19 Jul 2026 23:15:15 -0400 Received: from zeus.spd.analog.com (10.66.68.11) by ashbmbx9.ad.analog.com (10.64.17.10) with Microsoft SMTP Server id 15.2.1748.37 via Frontend Transport; Sun, 19 Jul 2026 23:15:15 -0400 Received: from ATORRENO-L02.ad.analog.com ([10.66.6.192]) by zeus.spd.analog.com (8.15.1/8.15.1) with ESMTP id 66K3EoFU021622; Sun, 19 Jul 2026 23:15:07 -0400 From: Alexis Czezar Torreno Date: Mon, 20 Jul 2026 11:14:43 +0800 Subject: [PATCH v3 2/4] hwmon: (pmbus/max20830): add VOUT feedback resistor scaling support 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: quoted-printable Message-ID: <20260720-dev-max20830c-v3-2-9d06d27d6da3@analog.com> References: <20260720-dev-max20830c-v3-0-9d06d27d6da3@analog.com> In-Reply-To: <20260720-dev-max20830c-v3-0-9d06d27d6da3@analog.com> To: Guenter Roeck , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Jonathan Corbet , Shuah Khan CC: , , , , "Alexis Czezar Torreno" X-Mailer: b4 0.14.2 X-Developer-Signature: v=1; a=ed25519-sha256; t=1784517290; l=4032; i=alexisczezar.torreno@analog.com; s=20250213; h=from:subject:message-id; bh=whGwy8iUdQ+uED3tZKui/NXJQJHb5yViykND/HeI5zo=; b=a0+7Uo7M7Zaqsb+rf5pz6wWrMKXpBzyCrLCCxMxP8V8ZDDccKr0+EhgeeZoDV9uCH4KCi3Agy Zpz8XfhsZOjAfoVbnHRiZMA8PvZJ81ZzZh667JUQm6aLnlrcD0V5LnY X-Developer-Key: i=alexisczezar.torreno@analog.com; a=ed25519; pk=XpXmJnRjnsKdDil6YpOlj9+44S+XYXVFnxvkbmaZ+10= X-ADIRuleOP-NewSCL: Rule Triggered X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwNzIwMDAzMyBTYWx0ZWRfX86LUIPrH55uP m+bb3HcnXAc9tpWbL6F5N5HWD5bq65XLZbffYkcgX8H5qfC/0Up5qimfko58b8WmEh1VQGDEy3i pZc1BekHgCmX04rJLUoOK5xw+DTgiQxNpOMVOENUaSXnvuDJ4mxCRCXN0dlh5sNrqI/dkwdowaJ vHtTsc5TlwoXX+Sq82yKQIs/1aARWPTz0bhIpgFsEbgu+/UL0F5kOkijLEHcN4TLe9dOVT5AX2n GyFObexywyvv5RQXncVHPMcRIixO9zar7QoQrclLNW1QeAkI2r1R9+qH/M7hSIS6bcBxGbQc9fq nGB+Z+/6170glPf9huhJulOpDzZS7CphtLZRsJOvTQBLqNFmBhC8B+UVG+1YKN0WQoeIR6qEI/G 3WvpsMI+LA9LZ00pv4ZbR5Xu7e9GMxAh4GRhmVlaYaWPjXrAUfpLCB+7o9722zRjjASrnKkzdY6 mQ8ISsZZ+uNTVlo2oAA== X-Proofpoint-GUID: 2LxV8JYLUi3s-_dgRoUBcwbnEDAo8bkA X-Authority-Analysis: v=2.4 cv=Ed/4hvmC c=1 sm=1 tr=0 ts=6a5d92c4 cx=c_pps a=3WNzaoukacrqR9RwcOSAdA==:117 a=3WNzaoukacrqR9RwcOSAdA==:17 a=IkcTkHD0fZMA:10 a=RAioF0-LDSMA:10 a=VkNPw1HP01LnGYTKEx00:22 a=0sLvza09kfJOxVLZPwjg:22 a=N--XFCr6TIEc_64PeIT2:22 a=gAnH3GRIAAAA:8 a=_8IsL081WaPWLXqRiQAA:9 a=3ZKOabzyN94A:10 a=QEXdDO2ut3YA:10 X-Proofpoint-ORIG-GUID: 2LxV8JYLUi3s-_dgRoUBcwbnEDAo8bkA X-Proofpoint-Spam-Info: AW1haW4tMjYwNzIwMDAzMyBTYWx0ZWRfX2N20fKmyB9Xa AQY1W9Ynx2NdOC3uCLVkuhJAQlFR8jtj7K3CD7R5pYlTB0BDbZ2niytqpI36jmJANZh13FiZrKX zR3I02fkXPu5NLPoecEavACpkV/kE+SJ3iWNS4jyT4F7wjnr17pw X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1143,Hydra:6.1.134,FMLib:17.12.100.49 definitions=2026-07-19_08,2026-07-17_01,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 adultscore=0 impostorscore=0 lowpriorityscore=0 priorityscore=1501 phishscore=0 clxscore=1015 spamscore=0 bulkscore=0 suspectscore=0 malwarescore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2606150000 definitions=main-2607200033 Implement support for external voltage divider scaling using the adi,vout-rfb1-ohms and adi,vout-rfb2-ohms device tree properties. When the desired output voltage exceeds VREF, a resistor divider (RFB1 and RFB2) is used to scale down the feedback voltage. The driver reads these resistor values from device tree and applies the scaling formula: VOUT_actual =3D VOUT_measured =C3=97 (1 + RFB1/RFB2) The properties are optional. If not specified, the driver assumes no voltage divider is present and reports the raw VOUT reading. Signed-off-by: Alexis Czezar Torreno --- drivers/hwmon/pmbus/max20830.c | 59 ++++++++++++++++++++++++++++++++++++++= +++- 1 file changed, 58 insertions(+), 1 deletion(-) diff --git a/drivers/hwmon/pmbus/max20830.c b/drivers/hwmon/pmbus/max20830.c index cb2c23672166d641852199ca07eb716924f4f286..7a5e67bd33c0a8b84511d138ac5= f5f48334a0a45 100644 --- a/drivers/hwmon/pmbus/max20830.c +++ b/drivers/hwmon/pmbus/max20830.c @@ -7,6 +7,7 @@ =20 #include #include +#include #include #include #include @@ -14,6 +15,50 @@ =20 #define MAX20830_IC_DEVICE_ID_LENGTH 9 =20 +struct max20830_data { + struct pmbus_driver_info info; + u32 vout_rfb1; + u32 vout_rfb2; +}; + +/* + * MAX20830 only supports READ_VOUT for VOUT monitoring. + * + * MAX20830 uses an external resistor divider for voltage sensing: + * - VOUT_COMMAND and VOUT_MAX set the reference voltage at the feedback p= in + * - READ_VOUT reports the feedback voltage, which needs to be scaled for = actual + * output voltage + * + * Scaling formula: vout_actual =3D vout_fb =C3=97 (1 + RFB1 / RFB2) + * + * If regulator support is added in the future, some adjustments are neede= d to + * ensure correct feedback voltages are set. + */ +static int max20830_read_word_data(struct i2c_client *client, int page, + int phase, int reg) +{ + const struct pmbus_driver_info *info =3D pmbus_get_driver_info(client); + const struct max20830_data *data =3D container_of(info, struct max20830_d= ata, info); + int ret; + + switch (reg) { + case PMBUS_READ_VOUT: + ret =3D pmbus_read_word_data(client, page, phase, reg); + if (ret < 0) + return ret; + + /* Apply voltage divider scaling if resistors are non-zero */ + if (data->vout_rfb1 && data->vout_rfb2) { + ret =3D DIV_ROUND_CLOSEST_ULL((u64)ret * (data->vout_rfb1 + + data->vout_rfb2), data->vout_rfb2); + ret =3D clamp_val(ret, 0, 0xFFFF); + } + return ret; + default: + return -ENODATA; + } +} + static struct pmbus_driver_info max20830_info =3D { .pages =3D 1, .format[PSC_VOLTAGE_IN] =3D linear, @@ -24,13 +69,25 @@ static struct pmbus_driver_info max20830_info =3D { PMBUS_HAVE_TEMP | PMBUS_HAVE_STATUS_VOUT | PMBUS_HAVE_STATUS_IOUT | PMBUS_HAVE_STATUS_INPUT | PMBUS_HAVE_STATUS_TEMP, + .read_word_data =3D max20830_read_word_data, }; =20 static int max20830_probe(struct i2c_client *client) { u8 buf[I2C_SMBUS_BLOCK_MAX + 1] =3D {}; + struct max20830_data *data; int ret; =20 + data =3D devm_kzalloc(&client->dev, sizeof(*data), GFP_KERNEL); + if (!data) + return -ENOMEM; + + data->info =3D max20830_info; + + /* Read optional voltage divider resistor values */ + device_property_read_u32(&client->dev, "adi,vout-rfb1-ohms", &data->vout_= rfb1); + device_property_read_u32(&client->dev, "adi,vout-rfb2-ohms", &data->vout_= rfb2); + if (!i2c_check_functionality(client->adapter, I2C_FUNC_SMBUS_READ_BLOCK_D= ATA) && !i2c_check_functionality(client->adapter, I2C_FUNC_SMBUS_READ_I2C_BLO= CK)) return -ENODEV; @@ -78,7 +135,7 @@ static int max20830_probe(struct i2c_client *client) return dev_err_probe(&client->dev, -ENODEV, "Unsupported device: '%s'\n", buf); =20 - return pmbus_do_probe(client, &max20830_info); + return pmbus_do_probe(client, &data->info); } =20 static const struct i2c_device_id max20830_id[] =3D { --=20 2.34.1 From nobody Sat Jul 25 03:20:17 2026 Received: from mx0a-00128a01.pphosted.com (mx0a-00128a01.pphosted.com [148.163.135.77]) (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 44CB938C42A; Mon, 20 Jul 2026 03:15:35 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=148.163.135.77 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784517336; cv=none; b=p5SJKzZwi0P2Qsgxn1e2sUWsFdBc9cf2fS5BMLT4OFcOSVFili6bUuzjH6rTN63kR1n+mEVddU46cW4KOqOcwh3z0xmzxO2g+vhwoF65e6A+Dz87R4pjdIkyyuIpe9qcSwI6Qo7wwlVISRoVBJAgPGxZFSXcpz2JEeCCFfuhOoU= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784517336; c=relaxed/simple; bh=5g8Dnxx69PBSR1rQuA/7t1j7VQIS8+yxojE8MWhyzps=; h=From:Date:Subject:MIME-Version:Content-Type:Message-ID:References: In-Reply-To:To:CC; b=M2V2i+7RJiijK8rizZIrt61qehkvYN/ZMjzLkNJxpomOdBqXF7WUdQct3kPfgXvnvPIHBpdWSnVzZxXSnv3diSgkWHNGQ0HLPTdST+rIg/2x+8rE5iLiG7yIJo0nXBMaf7h8bAzuNPkkO3tVWFwQa6FfiGWnoHfLqy1MsriksAw= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=analog.com; spf=pass smtp.mailfrom=analog.com; dkim=pass (2048-bit key) header.d=analog.com header.i=@analog.com header.b=M+oXT8At; arc=none smtp.client-ip=148.163.135.77 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=analog.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=analog.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=analog.com header.i=@analog.com header.b="M+oXT8At" Received: from pps.filterd (m0167088.ppops.net [127.0.0.1]) by mx0a-00128a01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 66JNuXt0585674; Sun, 19 Jul 2026 23:15:19 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=analog.com; h=cc :content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to; s=DKIM; bh=TIFDp /uhWBZi5IipxdwlpT25q6I49VFqfZ7u1ol+RTA=; b=M+oXT8At8cFh+ZPaeBeKW lNpho9oukBwOH4jt9LWzS4bClGr9vEEGwJZWdjrA+gd4b9TG0k3hsO33UkBhZuro gb6v9rWasvj8FDd1Zgu2Z0gy+iC/l1+PEptiM0Ne8UQ11z6OZKHLACbW0xh2JT/L refwNW73VIrgW9ba3BsEwSWiH+cqJ6jp0eEdI4MX9mvkU52x7Nqoypad+kslakGO dHIaMbDt6MOZ+S1Si4A5hFzoOgRKCuuQ7ZJEdUeJFLba3+UAiLMrMmNvUu7CRxhi CXp9o5auO+gB9IYGvOQl2efp7SYpr3eGTrP+z3j5Jc8MrYNPVoB0qvrHA4ZIEcB0 w== Received: from nwd2mta4.analog.com ([137.71.173.58]) by mx0a-00128a01.pphosted.com (PPS) with ESMTPS id 4fg3axw2jg-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Sun, 19 Jul 2026 23:15:19 -0400 (EDT) Received: from ASHBMBX8.ad.analog.com (ASHBMBX8.ad.analog.com [10.64.17.5]) by nwd2mta4.analog.com (8.14.7/8.14.7) with ESMTP id 66K3FINq054378 (version=TLSv1/SSLv3 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Sun, 19 Jul 2026 23:15:18 -0400 Received: from ASHBCASHYB4.ad.analog.com (10.64.17.132) by ASHBMBX8.ad.analog.com (10.64.17.5) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1748.37; Sun, 19 Jul 2026 23:15:18 -0400 Received: from ASHBMBX9.ad.analog.com (10.64.17.10) by ASHBCASHYB4.ad.analog.com (10.64.17.132) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1748.37; Sun, 19 Jul 2026 23:15:17 -0400 Received: from zeus.spd.analog.com (10.66.68.11) by ashbmbx9.ad.analog.com (10.64.17.10) with Microsoft SMTP Server id 15.2.1748.37 via Frontend Transport; Sun, 19 Jul 2026 23:15:17 -0400 Received: from ATORRENO-L02.ad.analog.com ([10.66.6.192]) by zeus.spd.analog.com (8.15.1/8.15.1) with ESMTP id 66K3EoFV021622; Sun, 19 Jul 2026 23:15:11 -0400 From: Alexis Czezar Torreno Date: Mon, 20 Jul 2026 11:14:44 +0800 Subject: [PATCH v3 3/4] dt-bindings: hwmon: (pmbus/max20830): add max20830c and max20840c support 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: quoted-printable Message-ID: <20260720-dev-max20830c-v3-3-9d06d27d6da3@analog.com> References: <20260720-dev-max20830c-v3-0-9d06d27d6da3@analog.com> In-Reply-To: <20260720-dev-max20830c-v3-0-9d06d27d6da3@analog.com> To: Guenter Roeck , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Jonathan Corbet , Shuah Khan CC: , , , , "Alexis Czezar Torreno" , Krzysztof Kozlowski X-Mailer: b4 0.14.2 X-Developer-Signature: v=1; a=ed25519-sha256; t=1784517290; l=1157; i=alexisczezar.torreno@analog.com; s=20250213; h=from:subject:message-id; bh=5g8Dnxx69PBSR1rQuA/7t1j7VQIS8+yxojE8MWhyzps=; b=636bHH46kKk5FSvEa4j5arAL/8o34/yeW5cDE5LACMXo5hHgyiCaw310P8SsbuCK8P5BITlYi ZI6ch5kiD3zCSo28CyE4GGW5OxcsHtWHbixX514ZU1rGFphx5v7fHOx X-Developer-Key: i=alexisczezar.torreno@analog.com; a=ed25519; pk=XpXmJnRjnsKdDil6YpOlj9+44S+XYXVFnxvkbmaZ+10= X-ADIRuleOP-NewSCL: Rule Triggered X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwNzIwMDAzMyBTYWx0ZWRfXyNStOfSlGNs/ WI4YpNOZyyDcDQjWiQ+h3kPrxxJChdTyvyaHpgnX6yV6pnZUsN0Z+C89URqqggkyzdBmJcnDPMT 9GGHmhMWaW9VG/CkEqIoMMBTA5g8W7yCmxgDFiBFM4kywmMihbGquDw4KSf71Wwt4eNPhmzK9cg ZWTA4389TCYHLDU+1OsGWsflbCIQmtoigx8YS4V7JdEk+w1OdCZlhdXJKp4vpO3BNg6ArDM7mVB CtC52nJX6YWfvAun0rvlrT5cD84oy/TS0eRg/ayKcD9598k+zI/3LnF8peYEfWCZbfElh/+EwgQ mR0zZZ1YDEmBBhNpHGmuRY5K+PoD8hidCJ8AK8Gf7kNt47EL3MRrZ5mlmsxLbitmh2GwmkR+Ftu zyc89oGptwBzxu8lcZK6m/2Wmc8Q5hReUHAwZTL2dV9DROxiFq0arD+q9ohumHyEdzKEwakeVVh lamNY/qAQUxUlhDDfKw== X-Authority-Analysis: v=2.4 cv=evjvCIpX c=1 sm=1 tr=0 ts=6a5d92c7 cx=c_pps a=3WNzaoukacrqR9RwcOSAdA==:117 a=3WNzaoukacrqR9RwcOSAdA==:17 a=IkcTkHD0fZMA:10 a=RAioF0-LDSMA:10 a=VkNPw1HP01LnGYTKEx00:22 a=0sLvza09kfJOxVLZPwjg:22 a=uXIjobp8t2wMuQ0fPvqm:22 a=EUspDBNiAAAA:8 a=gAnH3GRIAAAA:8 a=wmL6Cgq2dR32m5AAhy0A:9 a=QEXdDO2ut3YA:10 X-Proofpoint-GUID: jUcHJZIXOSKKRo5UqlXo_GH1Svs2mM0P X-Proofpoint-Spam-Info: AW1haW4tMjYwNzIwMDAzMyBTYWx0ZWRfXy92LBoFR8trs rUiWdjFd+YxP9FIUAx86ozFgbc+q00j57OE9JHZKYWbPfpHzImZ2lVRs+O6LSTKBgGMhgyYz9LE vliCh4m1C3f8xDj0OCthJfNZ4ICuzwTTo4RCqNYTfPa3/EbQzVja X-Proofpoint-ORIG-GUID: jUcHJZIXOSKKRo5UqlXo_GH1Svs2mM0P X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1143,Hydra:6.1.134,FMLib:17.12.100.49 definitions=2026-07-19_08,2026-07-17_01,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 phishscore=0 lowpriorityscore=0 suspectscore=0 clxscore=1015 malwarescore=0 adultscore=0 priorityscore=1501 bulkscore=0 spamscore=0 impostorscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2606150000 definitions=main-2607200033 Add compatible strings for variants of MAX20830 which are MAX20830C and MAX20840C. These devices have the same register functionality with MAX20830 but with a longer IC_DEVICE_ID. Reviewed-by: Krzysztof Kozlowski Signed-off-by: Alexis Czezar Torreno --- Documentation/devicetree/bindings/hwmon/pmbus/adi,max20830.yaml | 8 ++++++= +- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/Documentation/devicetree/bindings/hwmon/pmbus/adi,max20830.yam= l b/Documentation/devicetree/bindings/hwmon/pmbus/adi,max20830.yaml index 214adf1a3b9e9efdeca7db3bd7679c70656e9a7e..b7d3b6152b58273a4c35581bbd6= 6ec293fb2e925 100644 --- a/Documentation/devicetree/bindings/hwmon/pmbus/adi,max20830.yaml +++ b/Documentation/devicetree/bindings/hwmon/pmbus/adi,max20830.yaml @@ -22,7 +22,13 @@ allOf: =20 properties: compatible: - const: adi,max20830 + oneOf: + - const: adi,max20830 + - items: + - enum: + - adi,max20830c + - adi,max20840c + - const: adi,max20830 =20 reg: maxItems: 1 --=20 2.34.1 From nobody Sat Jul 25 03:20:17 2026 Received: from mx0a-00128a01.pphosted.com (mx0a-00128a01.pphosted.com [148.163.135.77]) (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 702C938B7D2; Mon, 20 Jul 2026 03:15:37 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=148.163.135.77 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784517338; cv=none; b=qLPr963KAYO7XTp3wjSS2NLONmPpiXBJjcXzVTYFJgrvwwWu8OGnjJg9dnvRV4dJIowGNHxYcWB9jPVsD8MBJJGRNFsDI/FWm8zaLh0HYv+uL+KSP3aJ+WAOP9aGXbKUTEZ2NjNRQOeAV5UFmdNQGHmgBka5SvwbBOWhh2p1cf4= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784517338; c=relaxed/simple; bh=kjaX/N0J4k0Qbohi7pWb4Cr7bmClXL3maWg6hpb687s=; h=From:Date:Subject:MIME-Version:Content-Type:Message-ID:References: In-Reply-To:To:CC; b=LZL+zpnZh/9WjGTsMqN5PuImWPF8ayYB2+9UXxCSE3YKii1eehtuUHRryyz8TVYZxt5lp4dJG3n8zeqv4dLbd8vBYiUcKyEWWQQpp+AtTulbKKiIsgMVUKEfumXrEIJG7k/3XfAVhnK/mq1ny+pL4fY8crtV+kVnYVjo8OJYEOg= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=analog.com; spf=pass smtp.mailfrom=analog.com; dkim=pass (2048-bit key) header.d=analog.com header.i=@analog.com header.b=CMGuRU9e; arc=none smtp.client-ip=148.163.135.77 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=analog.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=analog.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=analog.com header.i=@analog.com header.b="CMGuRU9e" Received: from pps.filterd (m0167088.ppops.net [127.0.0.1]) by mx0a-00128a01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 66JNuXt1585674; Sun, 19 Jul 2026 23:15:23 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=analog.com; h=cc :content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to; s=DKIM; bh=4O+b1 VwYUV1PO6NJvto3kojMjTuzIsGRocbBXHVeaQU=; b=CMGuRU9eF13D2wszJIFa9 6TQTdbPjL9/GFxJhp+Zg6UOhzIUuOeZ0lzE/7jJPSih0n83Yj4KhVPsHmDUYWyDN 6tY3bj7QP7lNUDtB/VoOUxlAZIFiBD5IjBVvr1pkIhMHhkSrJcIT5D7h83x68Aqd kZ1xphnqkDbDWcc4y17zn6Mm912g7YBXydyrSWxMMWa6vik0apGaxy/XDwpAapd2 B8SmVX9jeGaEupAYQlhOFiSaIhshm8XZTdPwnCaZYerj49xOBQv267inn93+rG8J tM5gLQetjMTx7ZOD6hB4oVNOzju9ATrozX7prMQgXxUZPma5W/frU1/y8IUOcZQz w== Received: from nwd2mta4.analog.com ([137.71.173.58]) by mx0a-00128a01.pphosted.com (PPS) with ESMTPS id 4fg3axw2jn-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Sun, 19 Jul 2026 23:15:23 -0400 (EDT) Received: from ASHBMBX9.ad.analog.com (ASHBMBX9.ad.analog.com [10.64.17.10]) by nwd2mta4.analog.com (8.14.7/8.14.7) with ESMTP id 66K3FMDE054399 (version=TLSv1/SSLv3 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Sun, 19 Jul 2026 23:15:22 -0400 Received: from ASHBMBX9.ad.analog.com (10.64.17.10) by ASHBMBX9.ad.analog.com (10.64.17.10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1748.37; Sun, 19 Jul 2026 23:15:21 -0400 Received: from zeus.spd.analog.com (10.66.68.11) by ashbmbx9.ad.analog.com (10.64.17.10) with Microsoft SMTP Server id 15.2.1748.37 via Frontend Transport; Sun, 19 Jul 2026 23:15:21 -0400 Received: from ATORRENO-L02.ad.analog.com ([10.66.6.192]) by zeus.spd.analog.com (8.15.1/8.15.1) with ESMTP id 66K3EoFW021622; Sun, 19 Jul 2026 23:15:15 -0400 From: Alexis Czezar Torreno Date: Mon, 20 Jul 2026 11:14:45 +0800 Subject: [PATCH v3 4/4] hwmon: (pmbus/max20830): add support for max20830c and max20840c 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: quoted-printable Message-ID: <20260720-dev-max20830c-v3-4-9d06d27d6da3@analog.com> References: <20260720-dev-max20830c-v3-0-9d06d27d6da3@analog.com> In-Reply-To: <20260720-dev-max20830c-v3-0-9d06d27d6da3@analog.com> To: Guenter Roeck , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Jonathan Corbet , Shuah Khan CC: , , , , Alexis Czezar Torreno X-Mailer: b4 0.14.2 X-Developer-Signature: v=1; a=ed25519-sha256; t=1784517290; l=4454; i=alexisczezar.torreno@analog.com; s=20250213; h=from:subject:message-id; bh=kjaX/N0J4k0Qbohi7pWb4Cr7bmClXL3maWg6hpb687s=; b=O9fz88Q8aKFOA7jeYbYWr2pQd8cH86BnLZg0lQAJui5Q1m8CofY2DqzXhTxCfKEM3dlA01MEX n0kh38oOXfBC6fHFji5elpskY3lN7tgK1agTe9d+qqVrxVHJUmk3i3Q X-Developer-Key: i=alexisczezar.torreno@analog.com; a=ed25519; pk=XpXmJnRjnsKdDil6YpOlj9+44S+XYXVFnxvkbmaZ+10= X-ADIRuleOP-NewSCL: Rule Triggered X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwNzIwMDAzMyBTYWx0ZWRfX1P6FbUcglEcg ve2/YzBw+UviMtJKqUy3gd3xLfabV7W4ql6utwxZGgCbyXlLURmGaUCwKztqssnDTeX3OOAy9oD LnogWisvPcNr0clFt6aVyazFT2Tm0K+iYNmgsMhpm0yxvWZrm40AT5eekW6TrUMsROhY/rH4uTT ubfeGm7UHGESoYww5Wqsxv9Gs0Lhkw1V5D0IJnDUyNpuE074bRFEdlEMLCTNv3F2o3tDzvK0br7 vJ3N8niqAzEjCltwwoFoYzYwjlfGNCtDDhe8HfI962v2hOejVbwrvaOBvIB1p4vEwGadThgdVDS JXd8IQuc6a39Tkwh5QLvhZdhd5EgcC2nYYignNtD4SVzKR+UfuTCFqRyTefUdo4Xxe3bYWGDn7Y tfM7s8TmLV+jjozT0zF9sb3Z5ZfBYsoSmjd6D3pto5SeBzfoxD5ABXbFJ7kPrMZl5m5PZAadMyf VuvL6UTsOsFIDLBlRTQ== X-Authority-Analysis: v=2.4 cv=evjvCIpX c=1 sm=1 tr=0 ts=6a5d92cb cx=c_pps a=3WNzaoukacrqR9RwcOSAdA==:117 a=3WNzaoukacrqR9RwcOSAdA==:17 a=IkcTkHD0fZMA:10 a=RAioF0-LDSMA:10 a=VkNPw1HP01LnGYTKEx00:22 a=0sLvza09kfJOxVLZPwjg:22 a=uXIjobp8t2wMuQ0fPvqm:22 a=gAnH3GRIAAAA:8 a=v52DSUhV1VzBc46Xrp8A:9 a=QEXdDO2ut3YA:10 X-Proofpoint-GUID: MJ3Azoo2mojZv7tJ_xVVBN1kWd9GsQUH X-Proofpoint-Spam-Info: AW1haW4tMjYwNzIwMDAzMyBTYWx0ZWRfX35H8/J9DaN7h Hqx733w7ULYaTC7TtkDv+RA78ymYYdMVZLVNSCCXp8hzY/ZRLF0D+EdPC5w4Qu+mSiAZ9cccJae AMg51uFpE6j3hTcNfp/57NqAmlVZlHCNwyVBkXG91Ughoo2qZL8q X-Proofpoint-ORIG-GUID: MJ3Azoo2mojZv7tJ_xVVBN1kWd9GsQUH X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1143,Hydra:6.1.134,FMLib:17.12.100.49 definitions=2026-07-19_08,2026-07-17_01,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 phishscore=0 lowpriorityscore=0 suspectscore=0 clxscore=1015 malwarescore=0 adultscore=0 priorityscore=1501 bulkscore=0 spamscore=0 impostorscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2606150000 definitions=main-2607200033 Add support for MAX20830C and MAX20840 step-down DC-DC switching regulator with PMBus interface. MAX20830C is a different packaging for MAX20830, and MAX20840C supports 40A regulation compared to MAX20830 that is only 30A. Signed-off-by: Alexis Czezar Torreno --- Documentation/hwmon/max20830.rst | 27 ++++++++++++++++++++++----- drivers/hwmon/pmbus/max20830.c | 27 ++++++++++++++------------- 2 files changed, 36 insertions(+), 18 deletions(-) diff --git a/Documentation/hwmon/max20830.rst b/Documentation/hwmon/max2083= 0.rst index 936e409dcc5c0898dde27d782308d4a7e1357e73..b850f3b6e40d1f1d0cec944be40= af02265aced59 100644 --- a/Documentation/hwmon/max20830.rst +++ b/Documentation/hwmon/max20830.rst @@ -13,6 +13,22 @@ Supported chips: =20 Datasheet: https://www.analog.com/media/en/technical-documentation/dat= a-sheets/max20830.pdf =20 + * Analog Devices MAX20830C + + Prefix: 'max20830c' + + Addresses scanned: - + + Datasheet: + + * Analog Devices MAX20840C + + Prefix: 'max20840c' + + Addresses scanned: - + + Datasheet: + Author: =20 - Alexis Czezar Torreno @@ -21,12 +37,13 @@ Author: Description ----------- =20 -This driver supports hardware monitoring for Analog Devices MAX20830 -Step-Down Switching Regulator with PMBus Interface. +This driver supports hardware monitoring for Analog Devices MAX20830, MAX2= 0830C +and MAX20840C. These are Step-Down Switching Regulator with PMBus Interfac= e. =20 -The MAX20830 is a 2.7V to 16V, 30A fully integrated step-down DC-DC switch= ing -regulator. Through the PMBus interface, the device can monitor input/output -voltages, output current and temperature. +MAX20830, and MAX20830C are 2.7V to 16V, 30A fully integrated step-down DC= -DC +switching regulators. MAX20840C is similar but can reach 40A. Through the = PMBus +interface, these devices can monitor input/output voltages, output current= and +temperature. =20 The driver is a client driver to the core PMBus driver. Please see Documentation/hwmon/pmbus.rst for details on PMBus client drivers. diff --git a/drivers/hwmon/pmbus/max20830.c b/drivers/hwmon/pmbus/max20830.c index 7a5e67bd33c0a8b84511d138ac5f5f48334a0a45..73fe59685cf157cc27c1011ad9c= c045486bbeab0 100644 --- a/drivers/hwmon/pmbus/max20830.c +++ b/drivers/hwmon/pmbus/max20830.c @@ -98,13 +98,12 @@ static int max20830_probe(struct i2c_client *client) * which do not support SMBus block reads. */ if (i2c_check_functionality(client->adapter, I2C_FUNC_SMBUS_READ_BLOCK_DA= TA)) { - /* Reads 9 Data bytes from MAX20830 */ ret =3D i2c_smbus_read_block_data(client, PMBUS_IC_DEVICE_ID, buf); if (ret < 0) return dev_err_probe(&client->dev, ret, "Failed to read IC_DEVICE_ID\n"); } else { - /* Reads 1 length byte + 9 Data bytes from MAX20830 */ + /* Reads 1 length byte + data bytes */ ret =3D i2c_smbus_read_i2c_block_data(client, PMBUS_IC_DEVICE_ID, MAX20830_IC_DEVICE_ID_LENGTH + 1, buf); @@ -120,26 +119,28 @@ static int max20830_probe(struct i2c_client *client) ret =3D ret - 1; } =20 - /* - * MAX20830 IC_DEVICE_ID sends string data "MAX20830\0". - * Return value should at least be 9 bytes of data. - */ + /* Verify we read the expected number of bytes */ if (ret < MAX20830_IC_DEVICE_ID_LENGTH) return dev_err_probe(&client->dev, -ENODEV, - "IC_DEVICE_ID too short: expected at least 9 bytes, got %d\n", - ret); + "IC_DEVICE_ID too short: expected %d bytes, got %d\n", + MAX20830_IC_DEVICE_ID_LENGTH, ret); + + /* Null-terminate the string */ + buf[ret] =3D '\0'; =20 - /* 9 bytes of data, buf[0]-buf[7] =3D "MAX20830", buf[8] =3D '\0' */ - buf[MAX20830_IC_DEVICE_ID_LENGTH - 1] =3D '\0'; - if (strncmp(buf, "MAX20830", MAX20830_IC_DEVICE_ID_LENGTH - 1)) + /* Verify the device ID matches what we expect */ + if ((strcmp(buf, "MAX20830") && strcmp(buf, "MAX20830C") && + strcmp(buf, "MAX20840C"))) return dev_err_probe(&client->dev, -ENODEV, - "Unsupported device: '%s'\n", buf); + "Unsupported device: '%*pE'\n", ret, buf); =20 return pmbus_do_probe(client, &data->info); } =20 static const struct i2c_device_id max20830_id[] =3D { - {"max20830"}, + { "max20830" }, + { "max20830c" }, + { "max20840c" }, { } }; MODULE_DEVICE_TABLE(i2c, max20830_id); --=20 2.34.1