From nobody Mon Feb 9 01:51:23 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 90742266188; Tue, 25 Feb 2025 09:15:22 +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=1740474924; cv=none; b=kf1MaFbScjbwUOPRKR/B2m7cgUzQLyPi5bVtkNycrUuDOYkxQECa7CW3W+Rgx2RGmTGaEaCgDoPr9On8Nhs2f0URYcQbnG3l5ItgEgcZJz9cV3Uq5JugHb9RnMal2bW91Bk6dMPsd4wqEm/RRMWt+tRHBzhN2EGFKjRhSwNb1U4= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1740474924; c=relaxed/simple; bh=h0vqqt1ua47j4kAk66xx/6qi0qu4jn52FFohCRkEja4=; h=From:Date:Subject:MIME-Version:Content-Type:Message-ID:References: In-Reply-To:To:CC; b=qD+Pc9eBfJT0KDSH7YEPihd/oPAwoA6NsFFihJTLlxtO2QA03W4Pl7nu0FTCa7kpG0OCT8TYnROwLjkOtAl5/Qczk9h/CRhJ3gAI9VpBfmmtArGFTkcE7wBD86aw/4rIhsgH4IUR+yILXa3p8Z+YjQrpVz0JZrtr6tQG69vXKYc= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none 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=SUsScpCU; arc=none smtp.client-ip=148.163.135.77 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none 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="SUsScpCU" Received: from pps.filterd (m0375855.ppops.net [127.0.0.1]) by mx0b-00128a01.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 51P8Axc3014531; Tue, 25 Feb 2025 04:15:07 -0500 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=6PUoa EmWn/mjHqFZuB+SD1P3YFtjCZeUHkBWLl0cVdI=; b=SUsScpCUG7kpBV/Hdyb39 ts/694Z8H3diFY2Sd0rlp/UNnTfQEy+xzS+1KemthEKKOFpL0x25z8Y1Ob+zaN/Q KT7IdbL5O0wl9kAPrNqf4PFPugAy7wqYvlvkbvAfyQbIlUf3uxbrHFvSHA8lEFP2 rWOOVoJuq3D/fRSUlAiSDWzphDU6A0Dz+KOw6nFT2ayi0o6hh9hGkr/so/KNpHny apFc8EBjEC96aHtGan1aCDLNvb0Kj+zKZZNZKZ63KJBxvhHE+dYKOm2o1F4fAW1w jv/G63T+WwMeH0/agM0+W3r2jo49gHFcmz1FwJs6lUOC0nxndatb562beB0bNm6i A== Received: from nwd2mta3.analog.com ([137.71.173.56]) by mx0b-00128a01.pphosted.com (PPS) with ESMTPS id 451a4kra85-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 25 Feb 2025 04:15:07 -0500 (EST) Received: from ASHBMBX9.ad.analog.com (ASHBMBX9.ad.analog.com [10.64.17.10]) by nwd2mta3.analog.com (8.14.7/8.14.7) with ESMTP id 51P9F6oK033346 (version=TLSv1/SSLv3 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Tue, 25 Feb 2025 04:15:06 -0500 Received: from ASHBMBX8.ad.analog.com (10.64.17.5) 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.986.14; Tue, 25 Feb 2025 04:15:06 -0500 Received: from zeus.spd.analog.com (10.66.68.11) by ashbmbx8.ad.analog.com (10.64.17.5) with Microsoft SMTP Server id 15.2.986.14 via Frontend Transport; Tue, 25 Feb 2025 04:15:06 -0500 Received: from ATORRENO-L02.ad.analog.com (ATORRENO-L02.ad.analog.com [10.116.45.25]) by zeus.spd.analog.com (8.15.1/8.15.1) with ESMTP id 51P9Eof9011564; Tue, 25 Feb 2025 04:14:58 -0500 From: Alexis Czezar Torreno Date: Tue, 25 Feb 2025 17:08:33 +0800 Subject: [PATCH 1/2] dt-bindings: regulator: add adi,adp5055-regulator 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: <20250225-upstream-adp5055-v1-1-a5a7f8e46986@analog.com> References: <20250225-upstream-adp5055-v1-0-a5a7f8e46986@analog.com> In-Reply-To: <20250225-upstream-adp5055-v1-0-a5a7f8e46986@analog.com> To: Liam Girdwood , Mark Brown , Rob Herring , Krzysztof Kozlowski , Conor Dooley CC: , , Alexis Czezar Torreno X-Mailer: b4 0.14.2 X-Developer-Signature: v=1; a=ed25519-sha256; t=1740474891; l=8103; i=alexisczezar.torreno@analog.com; s=20250213; h=from:subject:message-id; bh=h0vqqt1ua47j4kAk66xx/6qi0qu4jn52FFohCRkEja4=; b=Xn3rfiXeJsjyEeFbk0aj06GhCeEd7luLo+msdPZ5Kh3Jtu/KTwxsxZFfYHiMBZjiiK3pyRD3+ iiXmSW3S9PGCFddeNnoUdibW6svX08hbcUbJ5eEWNW8W9BbuDhyrsn8 X-Developer-Key: i=alexisczezar.torreno@analog.com; a=ed25519; pk=XpXmJnRjnsKdDil6YpOlj9+44S+XYXVFnxvkbmaZ+10= X-ADIRuleOP-NewSCL: Rule Triggered X-Proofpoint-ORIG-GUID: ldIRVjbtu54jhhvxzTp6Nf_ej-En85Jd X-Authority-Analysis: v=2.4 cv=cK4askeN c=1 sm=1 tr=0 ts=67bd8a1b cx=c_pps a=PpDZqlmH/M8setHirZLBMw==:117 a=PpDZqlmH/M8setHirZLBMw==:17 a=IkcTkHD0fZMA:10 a=T2h4t0Lz3GQA:10 a=gEfo2CItAAAA:8 a=gAnH3GRIAAAA:8 a=VwQbUJbxAAAA:8 a=u7U2QtmpIHLnvIsJR1wA:9 a=QEXdDO2ut3YA:10 a=sptkURWiP4Gy88Gu7hUp:22 a=oVHKYsEdi7-vN-J5QA_j:22 X-Proofpoint-GUID: ldIRVjbtu54jhhvxzTp6Nf_ej-En85Jd X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1057,Hydra:6.0.680,FMLib:17.12.68.34 definitions=2025-02-25_03,2025-02-24_02,2024-11-22_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 phishscore=0 priorityscore=1501 impostorscore=0 bulkscore=0 mlxlogscore=999 suspectscore=0 lowpriorityscore=0 adultscore=0 clxscore=1011 malwarescore=0 spamscore=0 mlxscore=0 classifier=spam authscore=0 authtc=n/a authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.19.0-2502100000 definitions=main-2502250063 Add documentation for devicetree bindings for ADP5055. The device consists of 3 buck regulators able to connect to high input voltages of up to 18V with no preregulators. Signed-off-by: Alexis Czezar Torreno --- .../bindings/regulator/adi,adp5055-regulator.yaml | 214 +++++++++++++++++= ++++ MAINTAINERS | 6 + 2 files changed, 220 insertions(+) diff --git a/Documentation/devicetree/bindings/regulator/adi,adp5055-regula= tor.yaml b/Documentation/devicetree/bindings/regulator/adi,adp5055-regulato= r.yaml new file mode 100644 index 0000000000000000000000000000000000000000..52cebfd48b3c4cf4ecf16b660c2= 04c38c94e0eec --- /dev/null +++ b/Documentation/devicetree/bindings/regulator/adi,adp5055-regulator.yaml @@ -0,0 +1,214 @@ +# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause) +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/regulator/adi,adp5055-regulator.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: Analog Devices ADP5055 Triple Buck Regulator + +maintainers: + - Alexis Czezar Torreno + +description: | + The ADP5055 combines three high performance buck regulators. + The device enables direct connection to high input voltages + up to 18 V with no preregulators. + https://www.analog.com/media/en/technical-documentation/data-sheets/adp5= 055.pdf + +properties: + compatible: + enum: + - adi,adp5055 + + reg: + enum: + - 0x70 + - 0x71 + + adi,tset-us: + description: + Setting time used by the device. This is changed via soldering + specific resistor values on the CFG2 pin. + enum: [2600, 20800] + default: 2600 + + adi,hw-en-array-gpios: + description: + Asserted during driver probe. Each array entry acts as the + hardware enable for channels 0-2. Should be marked 0 for active + low. Requires all three channels to be initialized. Not adding + the property turns the system to a software only enable mode. + minItems: 3 + maxItems: 3 + + adi,ocp-blanking: + description: + If present, the over current protection + blanking (OCP) for all channels is on. + type: boolean + + adi,delay-power-good: + description: + Configures delay timer of the power good (PWRGD) pin. + Delay is based on Tset which can be 2.6 ms or 20.8 ms. + type: boolean + + '#address-cells': + const: 1 + + '#size-cells': + const: 0 + +patternProperties: + "^channel@([0-2])$": + type: object + additionalProperties: false + + properties: + reg: + description: The channel number representing each buck converter. + maximum: 2 + + adi,power-saving-mode: + description: + If present, enables power saving mode for + individual channels. + type: boolean + + adi,output-discharge-function: + description: + If present, enable output discharge functionality + for individual channels. + type: boolean + + adi,disable-delay-us: + description: + Configures the disable delay for each channel. Dependent on Tset. + enum: [0, 5200, 10400, 15600, 20800, 26000, 31200, 36400] + default: 0 + + adi,enable-delay-us: + description: + Configures the disable delay for each channel. Dependent on Tset. + enum: [0, 2600, 5200, 7800, 10400, 13000, 15600, 18200] + default: 0 + + adi,dvs-limit-upper-microvolt: + description: + Configure the allowable upper side limit of the + voltage output of each channel in microvolt. + Voltages are in 12mV steps, value is autoadjusted. + Vout_high =3D Vout + DVS_upper_limit. + minimum: 12000 + maximum: 192000 + default: 192000 + + adi,dvs-limit-lower-microvolt: + description: + Configure the allowable lower side limit of the + voltage output of each channel in microvolt. + Voltages are in 12mV steps, value is autoadjusted. + Vout_low =3D Vout + DVS_lower_limit. + minimum: -190500 + maximum: -10500 + default: -190500 + + adi,fast-transient: + description: + Configures the fast transient sensitivity for each channel. + "none" - No fast transient. + "3G_1.5%" - 1.5% window with 3*350uA/V + "5G_1.5%" - 1.5% window with 5*350uA/V + "5G_2.5%" - 2.5% window with 5*350uA/V + enum: [none, 3G_1.5%, 5G_1.5%, 5G_2.5%] + default: 5G_2.5% + + adi,mask-power-good: + description: + If present, masks individual channels to the external + PWRGD hardware pin. + type: boolean + + required: + - reg + +allOf: + - $ref: regulator.yaml# + + - if: + properties: + adi,tset-us: + contains: + enum: + - 20800 + then: + properties: + adi,disable-delay-us: + enum: [0, 41600, 83200, 124800, 166400, 208000, 249600, 291200] + + adi,enable-delay-us: + enum: [0, 20800, 41600, 62400, 83200, 104000, 124800, 145600] + +required: + - compatible + - reg + +unevaluatedProperties: false + +examples: + - | + i2c { + #address-cells =3D <1>; + #size-cells =3D <0>; + + regulator@70 { + compatible =3D "adi,adp5055"; + reg =3D <0x70>; + #address-cells =3D <1>; + #size-cells =3D <0>; + + adi,tset-us =3D <2600>; + adi,hw-en-array-gpios =3D <&gpio 17 0>, + <&gpio 18 0>, + <&gpio 19 0>; + + adi,ocp-blanking; + adi,delay-power-good; + + channel@0 { + reg =3D <0>; + adi,power-saving-mode; + adi,output-discharge-function; + adi,disable-delay-us =3D <0>; + adi,enable-delay-us =3D <0>; + adi,dvs-limit-upper-microvolt =3D <192000>; + adi,dvs-limit-lower-microvolt =3D <(-190500)>; + adi,fast-transient =3D "5G_2.5%"; + adi,mask-power-good; + }; + + channel@1 { + reg =3D <1>; + adi,power-saving-mode; + adi,output-discharge-function; + adi,disable-delay-us =3D <0>; + adi,enable-delay-us =3D <0>; + adi,dvs-limit-upper-microvolt =3D <192000>; + adi,dvs-limit-lower-microvolt =3D <(-190500)>; + adi,fast-transient =3D "5G_2.5%"; + adi,mask-power-good; + }; + + channel@2 { + reg =3D <2>; + adi,power-saving-mode; + adi,output-discharge-function; + adi,disable-delay-us =3D <0>; + adi,enable-delay-us =3D <0>; + adi,dvs-limit-upper-microvolt =3D <192000>; + adi,dvs-limit-lower-microvolt =3D <(-190500)>; + adi,fast-transient =3D "5G_2.5%"; + adi,mask-power-good; + }; + }; + }; diff --git a/MAINTAINERS b/MAINTAINERS index 896a307fa06545e2861abe46ea7029f9b4d3628e..b2ec43f84d84765c319d8403fb5= 650afa273db83 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -1525,6 +1525,12 @@ W: https://ez.analog.com/linux-software-drivers F: Documentation/devicetree/bindings/iio/filter/adi,admv8818.yaml F: drivers/iio/filter/admv8818.c =20 +ANALOG DEVICES INC ADP5055 DRIVER +M: Alexis Czezar Torreno +S: Supported +W: https://ez.analog.com/linux-software-drivers +F: Documentation/devicetree/bindings/regulator/adi,adp5055-regulator.yaml + ANALOG DEVICES INC ADP5061 DRIVER M: Michael Hennerich L: linux-pm@vger.kernel.org --=20 2.34.1 From nobody Mon Feb 9 01:51:23 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 CBBD6266577; Tue, 25 Feb 2025 09:15:24 +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=1740474926; cv=none; b=UN4DESYGikFkzvrMCjRhy8pKvjAt1gYfINfhDTFQj9T2KePHWiA7As/XKSpRGf7tIUxZ2d7pgWMq13818ZVYhv5MikQAkZ125J41Vl0++CagDssZL6Qv2yHEV//u9FsymnuUEgeEyMJvy+1INm/iVRtTpJlglr3DfFXn5pjySQk= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1740474926; c=relaxed/simple; bh=LB4YsfToFr8m2tj7regQWa5LvzlGwsx5Gm1AYSd+I6c=; h=From:Date:Subject:MIME-Version:Content-Type:Message-ID:References: In-Reply-To:To:CC; b=o8YfQ2t8cb6Isgs4ohOitsFLlAukjPKVhJ0W93eXj0RAUrGE1TtXwyGB97U5vQgRF/DMCTgyCcLKQsxs/dEiwA7Mv2DyNVeDyJ0hoC09R9pwcTDlK9O5SWImYEzmwSQAdaxLtc+bwwu4ZAwE7YZt6+p4z+b+Z+NeVFwLpvFZ6bY= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none 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=vYDtFzib; arc=none smtp.client-ip=148.163.135.77 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none 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="vYDtFzib" Received: from pps.filterd (m0375855.ppops.net [127.0.0.1]) by mx0b-00128a01.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 51P8B3Gd014630; Tue, 25 Feb 2025 04:15:14 -0500 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=Q7FU3 mJc8b+NepCFT6Jnh0XD4ZecHnRascaluQTYmGw=; b=vYDtFzibNpynv3o4wvITY szyasuYXXps9G2ldcCncB7o3XTqF5B78pkvhBx+M0hvc+yTeMz8Bphp76NZFrWh2 zX0OiPUi1+JYcXgWAs6jNo2BEqGuJyj7qFqqhCZ6wEyRkKyaZ0gjh5GS+i37iGk1 9VeEVzcvdbLVOSDLc8CSatMkRxUiC0T+ItX8quzF+H6AYwfl8V1ehXbULWiQzy2E ixbjbz9mICa7Eg8llMLPpR0HIczLa+HIA2UPYkZjEoW3G3ZMxEYPVxP2FqCN+KK6 Nqfl8UMwHLODKpdHcToHmd3pnDFZwMBa90UXmnSgrh+kpUXILXPJIn32etFV+Ecw w== Received: from nwd2mta4.analog.com ([137.71.173.58]) by mx0b-00128a01.pphosted.com (PPS) with ESMTPS id 451a4kra8h-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 25 Feb 2025 04:15:13 -0500 (EST) 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 51P9F9Wj003900 (version=TLSv1/SSLv3 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Tue, 25 Feb 2025 04:15:09 -0500 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.986.14; Tue, 25 Feb 2025 04:15:09 -0500 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.986.14; Tue, 25 Feb 2025 04:15:08 -0500 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.986.14 via Frontend Transport; Tue, 25 Feb 2025 04:15:08 -0500 Received: from ATORRENO-L02.ad.analog.com (ATORRENO-L02.ad.analog.com [10.116.45.25]) by zeus.spd.analog.com (8.15.1/8.15.1) with ESMTP id 51P9EofA011564; Tue, 25 Feb 2025 04:15:01 -0500 From: Alexis Czezar Torreno Date: Tue, 25 Feb 2025 17:08:34 +0800 Subject: [PATCH 2/2] regulator: adp5055: Add driver for adp5055 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: <20250225-upstream-adp5055-v1-2-a5a7f8e46986@analog.com> References: <20250225-upstream-adp5055-v1-0-a5a7f8e46986@analog.com> In-Reply-To: <20250225-upstream-adp5055-v1-0-a5a7f8e46986@analog.com> To: Liam Girdwood , Mark Brown , "Rob Herring" , Krzysztof Kozlowski , "Conor Dooley" CC: , , "Alexis Czezar Torreno" X-Mailer: b4 0.14.2 X-Developer-Signature: v=1; a=ed25519-sha256; t=1740474891; l=17136; i=alexisczezar.torreno@analog.com; s=20250213; h=from:subject:message-id; bh=LB4YsfToFr8m2tj7regQWa5LvzlGwsx5Gm1AYSd+I6c=; b=jWN1FM853xcMaciEOqvv37izzbJxzLGuKKO5C94Dn5DXvoeWFlUsurTSnh2n/tA0K+bJ4xIuc 2QO/YOZYOxHCvjMdF01qX1f2jtYCygYgqFi/EgkYZGU443IvOBdCQS2 X-Developer-Key: i=alexisczezar.torreno@analog.com; a=ed25519; pk=XpXmJnRjnsKdDil6YpOlj9+44S+XYXVFnxvkbmaZ+10= X-ADIRuleOP-NewSCL: Rule Triggered X-Proofpoint-ORIG-GUID: _1alP-tL-N4D1uM6JJfdFHlBHdPg6bcj X-Authority-Analysis: v=2.4 cv=cK4askeN c=1 sm=1 tr=0 ts=67bd8a21 cx=c_pps a=3WNzaoukacrqR9RwcOSAdA==:117 a=3WNzaoukacrqR9RwcOSAdA==:17 a=IkcTkHD0fZMA:10 a=T2h4t0Lz3GQA:10 a=gAnH3GRIAAAA:8 a=TZCsTV-SBRFodM4dN0cA:9 a=QEXdDO2ut3YA:10 a=oVHKYsEdi7-vN-J5QA_j:22 X-Proofpoint-GUID: _1alP-tL-N4D1uM6JJfdFHlBHdPg6bcj X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1057,Hydra:6.0.680,FMLib:17.12.68.34 definitions=2025-02-25_03,2025-02-24_02,2024-11-22_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 phishscore=0 priorityscore=1501 impostorscore=0 bulkscore=0 mlxlogscore=999 suspectscore=0 lowpriorityscore=0 adultscore=0 clxscore=1015 malwarescore=0 spamscore=0 mlxscore=0 classifier=spam authscore=0 authtc=n/a authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.19.0-2502100000 definitions=main-2502250063 Add ADI ADP5055 driver support. The device consists of 3 buck regulators able to connect to high input voltages of up to 18V with no preregulators. Signed-off-by: Alexis Czezar Torreno --- MAINTAINERS | 1 + drivers/regulator/Kconfig | 11 + drivers/regulator/Makefile | 1 + drivers/regulator/adp5055-regulator.c | 490 ++++++++++++++++++++++++++++++= ++++ 4 files changed, 503 insertions(+) diff --git a/MAINTAINERS b/MAINTAINERS index b2ec43f84d84765c319d8403fb5650afa273db83..7ac35d895b4c8297c6de70cd2bf= aec516ff5b100 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -1530,6 +1530,7 @@ M: Alexis Czezar Torreno S: Supported W: https://ez.analog.com/linux-software-drivers F: Documentation/devicetree/bindings/regulator/adi,adp5055-regulator.yaml +F: drivers/regulator/adp5055-regulator.c =20 ANALOG DEVICES INC ADP5061 DRIVER M: Michael Hennerich diff --git a/drivers/regulator/Kconfig b/drivers/regulator/Kconfig index 39297f7d8177193e51c99bc2b360c6d9936e62fe..2378559b3ca12e77db263418144= e9b8598eb97e0 100644 --- a/drivers/regulator/Kconfig +++ b/drivers/regulator/Kconfig @@ -122,6 +122,17 @@ config REGULATOR_AD5398 This driver supports AD5398 and AD5821 current regulator chips. If building into module, its name is ad5398.ko. =20 +config REGULATOR_ADP5055 + tristate "Analog Devices ADP5055 Triple Buck Regulator" + depends on I2C + select REGMAP_I2C + help + This driver controls an Analog Devices ADP5055 with triple buck + regulators using an I2C interface. + + Say M here if you want to include support for the regulator as a + module. + config REGULATOR_ANATOP tristate "Freescale i.MX on-chip ANATOP LDO regulators" depends on ARCH_MXC || COMPILE_TEST diff --git a/drivers/regulator/Makefile b/drivers/regulator/Makefile index 3d5a803dce8a0556ba9557fa069c6e37593b3c69..71f45d9317d24e7081ac919eb31= efff6652edf3f 100644 --- a/drivers/regulator/Makefile +++ b/drivers/regulator/Makefile @@ -22,6 +22,7 @@ obj-$(CONFIG_REGULATOR_AB8500) +=3D ab8500-ext.o ab8500.o obj-$(CONFIG_REGULATOR_ACT8865) +=3D act8865-regulator.o obj-$(CONFIG_REGULATOR_ACT8945A) +=3D act8945a-regulator.o obj-$(CONFIG_REGULATOR_AD5398) +=3D ad5398.o +obj-$(CONFIG_REGULATOR_ADP5055) +=3D adp5055-regulator.o obj-$(CONFIG_REGULATOR_ANATOP) +=3D anatop-regulator.o obj-$(CONFIG_REGULATOR_ARIZONA_LDO1) +=3D arizona-ldo1.o obj-$(CONFIG_REGULATOR_ARIZONA_MICSUPP) +=3D arizona-micsupp.o diff --git a/drivers/regulator/adp5055-regulator.c b/drivers/regulator/adp5= 055-regulator.c new file mode 100644 index 0000000000000000000000000000000000000000..3b99c1b2fcbbeb1ad8c13886da2= 42a45c90cf26f --- /dev/null +++ b/drivers/regulator/adp5055-regulator.c @@ -0,0 +1,490 @@ +// SPDX-License-Identifier: GPL-2.0 +/* + * Regulator driver for Analog Devices ADP5055 + * + * Copyright (C) 2025 Analog Devices, Inc. + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +/* + * ADP5055 Register Map. + */ +#define ADP5055_CTRL123 0xD1 +#define ADP5055_CTRL_MODE1 0xD3 +#define ADP5055_CTRL_MODE2 0xD4 +#define ADP5055_DLY0 0xD5 +#define ADP5055_DLY1 0xD6 +#define ADP5055_DLY2 0xD7 +#define ADP5055_VID0 0xD8 +#define ADP5055_VID1 0xD9 +#define ADP5055_VID2 0xDA +#define ADP5055_DVS_LIM0 0xDC +#define ADP5055_DVS_LIM1 0xDD +#define ADP5055_DVS_LIM2 0xDE +#define ADP5055_FT_CFG 0xDF +#define ADP5055_PG_CFG 0xE0 + +/* + * ADP5055 Field Masks. + */ +#define ADP5055_MASK_EN_MODE BIT(0) +#define ADP5055_MASK_OCP_BLANKING BIT(7) +#define ADP5055_MASK_PSM2 BIT(6) +#define ADP5055_MASK_PSM1 BIT(5) +#define ADP5055_MASK_PSM0 BIT(4) +#define ADP5055_MASK_DIS2 BIT(2) +#define ADP5055_MASK_DIS1 BIT(1) +#define ADP5055_MASK_DIS0 BIT(0) +#define ADP5055_MASK_DIS_DLY GENMASK(6, 4) +#define ADP5055_MASK_EN_DLY GENMASK(2, 0) +#define ADP5055_MASK_DVS_LIM_UPPER GENMASK(7, 4) +#define ADP5055_MASK_DVS_LIM_LOWER GENMASK(3, 0) +#define ADP5055_MASK_FAST_TRANSIENT2 GENMASK(5, 4) +#define ADP5055_MASK_FAST_TRANSIENT1 GENMASK(3, 2) +#define ADP5055_MASK_FAST_TRANSIENT0 GENMASK(1, 0) +#define ADP5055_MASK_DLY_PWRGD BIT(4) +#define ADP5055_MASK_PWRGD2 BIT(2) +#define ADP5055_MASK_PWRGD1 BIT(1) +#define ADP5055_MASK_PWRGD0 BIT(0) + +#define ADP5055_MIN_VOUT 408000 +#define ADP5055_NUM_CH 3 + +struct adp5055 { + struct regmap *regmap; + struct gpio_descs *hw_en_array_gpios; +}; + +static const unsigned int adp5055_tset_vals[] =3D { + 2600, + 20800, +}; + +static const unsigned int adp5055_disable_delay_vals_2_6[] =3D { + 0, + 5200, + 10400, + 15600, + 20800, + 26000, + 31200, + 36400, +}; + +static const unsigned int adp5055_disable_delay_vals_20_8[] =3D { + 0, + 41600, + 83200, + 124800, + 166400, + 208000, + 249600, + 291200, +}; + +static const unsigned int adp5055_enable_delay_vals_2_6[] =3D { + 0, + 2600, + 5200, + 7800, + 10400, + 13000, + 15600, + 18200, +}; + +static const unsigned int adp5055_enable_delay_vals_20_8[] =3D { + 0, + 20800, + 41600, + 62400, + 83200, + 104000, + 124800, + 145600, +}; + +static const char * const adp5055_fast_transient_vals[] =3D { + "none", + "3G_1.5%", + "5G_1.5%", + "5G_2.5%", +}; + +static int adp5055_get_prop_index(const u32 *table, size_t table_size, + u32 value) +{ + int i; + + for (i =3D 0; i < table_size; i++) + if (table[i] =3D=3D value) + return i; + + return -EINVAL; +} + +static const struct regmap_range adp5055_reg_ranges[] =3D { + regmap_reg_range(0xD1, 0xE0), +}; + +static const struct regmap_access_table adp5055_write_ranges_table =3D { + .yes_ranges =3D adp5055_reg_ranges, + .n_yes_ranges =3D ARRAY_SIZE(adp5055_reg_ranges), +}; + +static const struct regmap_access_table adp5055_read_ranges_table =3D { + .yes_ranges =3D adp5055_reg_ranges, + .n_yes_ranges =3D ARRAY_SIZE(adp5055_reg_ranges), +}; + +static const struct regmap_config adp5055_regmap_config =3D { + .reg_bits =3D 8, + .val_bits =3D 8, + .max_register =3D 0xFF, + .wr_table =3D &adp5055_write_ranges_table, + .rd_table =3D &adp5055_read_ranges_table, +}; + +static const struct linear_range adp5055_voltage_ranges[] =3D { + REGULATOR_LINEAR_RANGE(ADP5055_MIN_VOUT, 0, 255, 1500), +}; + +static int adp5055_parse_fw(struct device *dev, struct adp5055 *adp5055) +{ + int i, ret; + struct regmap *regmap =3D adp5055->regmap; + int val; + u32 tset; + bool ocp_blanking; + bool power_saving_mode[ADP5055_NUM_CH]; + bool output_discharge_function[ADP5055_NUM_CH]; + u32 disable_delay[ADP5055_NUM_CH]; + u32 enable_delay[ADP5055_NUM_CH]; + int dvs_limit_upper[ADP5055_NUM_CH]; + int dvs_limit_lower[ADP5055_NUM_CH]; + u32 fast_transient[ADP5055_NUM_CH]; + bool delay_power_good; + bool mask_power_good[ADP5055_NUM_CH]; + + tset =3D 2600; + + adp5055->hw_en_array_gpios =3D devm_gpiod_get_array_optional(dev, + "adi,hw-en-array", GPIOD_OUT_LOW); + if (IS_ERR(adp5055->hw_en_array_gpios)) + return dev_err_probe(dev, PTR_ERR(adp5055->hw_en_array_gpios), + "Failed to get hw_en_array GPIOs\n"); + + if (!adp5055->hw_en_array_gpios) + if (adp5055->hw_en_array_gpios->ndescs !=3D ADP5055_NUM_CH) + return dev_err_probe(dev, adp5055->hw_en_array_gpios->ndescs, + "Invalid amount of channels described\n"); + + ret =3D device_property_read_u32(dev, "adi,tset-us", &tset); + if (!ret) { + ret =3D adp5055_get_prop_index(adp5055_tset_vals, + ARRAY_SIZE(adp5055_tset_vals), tset); + if (ret < 0) + return dev_err_probe(dev, ret, + "Failed to initialize tset."); + tset =3D adp5055_tset_vals[ret]; + } + + ocp_blanking =3D device_property_read_bool(dev, "adi,ocp-blanking"); + + device_for_each_child_node_scoped(dev, child) { + ret =3D fwnode_property_read_u32(child, "reg", &i); + if (ret) + return dev_err_probe(dev, ret, "Failed to read reg value of child node"= ); + if (i >=3D ADP5055_NUM_CH) + return dev_err_probe(dev, ret, "Child node exceeds channel count"); + + power_saving_mode[i] =3D fwnode_property_read_bool(child, + "adi,power-saving-mode"); + + output_discharge_function[i] =3D fwnode_property_read_bool(child, + "adi,output-discharge-function"); + + ret =3D fwnode_property_read_u32(child, "adi,disable-delay-us", + &disable_delay[i]); + if (!ret) { + if (tset =3D=3D 2600) + ret =3D adp5055_get_prop_index(adp5055_disable_delay_vals_2_6, + ARRAY_SIZE(adp5055_disable_delay_vals_2_6), + disable_delay[i]); + else + ret =3D adp5055_get_prop_index(adp5055_disable_delay_vals_20_8, + ARRAY_SIZE(adp5055_disable_delay_vals_20_8), + disable_delay[i]); + if (ret < 0) + return dev_err_probe(dev, ret, + "Failed to initialize disable-delay-us."); + disable_delay[i] =3D ret; + } + + ret =3D fwnode_property_read_u32(child, "adi,enable-delay-us", + &enable_delay[i]); + if (!ret) { + if (tset =3D=3D 2600) + ret =3D adp5055_get_prop_index(adp5055_enable_delay_vals_2_6, + ARRAY_SIZE(adp5055_enable_delay_vals_2_6), + enable_delay[i]); + else + ret =3D adp5055_get_prop_index(adp5055_enable_delay_vals_20_8, + ARRAY_SIZE(adp5055_enable_delay_vals_20_8), + enable_delay[i]); + if (ret < 0) + return dev_err_probe(dev, ret, + "Failed to initialize enable-delay-us."); + enable_delay[i] =3D ret; + } + + ret =3D fwnode_property_read_u32(child, "adi,dvs-limit-upper-microvolt", + &dvs_limit_upper[i]); + if (ret) + dvs_limit_upper[i] =3D 192000; + else + if (dvs_limit_upper[i] > 192000 || dvs_limit_upper[i] < 12000) + return dev_err_probe(dev, dvs_limit_upper[i], + "Out of range - dvs-limit-upper-microvolt value."); + + ret =3D fwnode_property_read_u32(child, "adi,dvs-limit-lower-microvolt", + &dvs_limit_lower[i]); + if (ret) + dvs_limit_lower[i] =3D -190500; + else + if (dvs_limit_lower[i] > -10500 || dvs_limit_lower[i] < -190500) + return dev_err_probe(dev, dvs_limit_lower[i], + "Out of range - dvs-limit-lower-microvolt value."); + + ret =3D fwnode_property_match_string(child, "adi,fast-transient", + *adp5055_fast_transient_vals); + if (ret < 0) + fast_transient[i] =3D 3; + else + fast_transient[i] =3D ret; + + mask_power_good[i] =3D fwnode_property_read_bool(child, + "adi,mask-power-good"); + + val =3D FIELD_PREP(ADP5055_MASK_DIS_DLY, disable_delay[i]); + val |=3D FIELD_PREP(ADP5055_MASK_EN_DLY, enable_delay[i]); + ret =3D regmap_write(regmap, ADP5055_DLY0 + i, val); + if (ret) + return ret; + + val =3D FIELD_PREP(ADP5055_MASK_DVS_LIM_UPPER, + DIV_ROUND_CLOSEST_ULL(192000 - dvs_limit_upper[i], 12000)); + val |=3D FIELD_PREP(ADP5055_MASK_DVS_LIM_LOWER, + DIV_ROUND_CLOSEST_ULL(dvs_limit_lower[i] + 190500, 12000)); + ret =3D regmap_write(regmap, ADP5055_DVS_LIM0 + i, val); + if (ret) + return ret; + + i++; + }; + + delay_power_good =3D device_property_read_bool(dev, + "adi,delay-power-good"); + + if (!adp5055->hw_en_array_gpios) + val =3D FIELD_PREP(ADP5055_MASK_EN_MODE, 1); + else + val =3D FIELD_PREP(ADP5055_MASK_EN_MODE, 0); + ret =3D regmap_write(regmap, ADP5055_CTRL_MODE1, val); + if (ret) + return ret; + + val =3D FIELD_PREP(ADP5055_MASK_OCP_BLANKING, ocp_blanking); + val |=3D FIELD_PREP(ADP5055_MASK_PSM2, power_saving_mode[2]); + val |=3D FIELD_PREP(ADP5055_MASK_PSM1, power_saving_mode[1]); + val |=3D FIELD_PREP(ADP5055_MASK_PSM0, power_saving_mode[0]); + val |=3D FIELD_PREP(ADP5055_MASK_DIS2, output_discharge_function[2]); + val |=3D FIELD_PREP(ADP5055_MASK_DIS1, output_discharge_function[1]); + val |=3D FIELD_PREP(ADP5055_MASK_DIS0, output_discharge_function[0]); + ret =3D regmap_write(regmap, ADP5055_CTRL_MODE2, val); + if (ret) + return ret; + + val =3D FIELD_PREP(ADP5055_MASK_FAST_TRANSIENT2, fast_transient[2]); + val |=3D FIELD_PREP(ADP5055_MASK_FAST_TRANSIENT1, fast_transient[1]); + val |=3D FIELD_PREP(ADP5055_MASK_FAST_TRANSIENT0, fast_transient[0]); + ret =3D regmap_write(regmap, ADP5055_FT_CFG, val); + if (ret) + return ret; + + val =3D FIELD_PREP(ADP5055_MASK_DLY_PWRGD, delay_power_good); + val |=3D FIELD_PREP(ADP5055_MASK_PWRGD2, mask_power_good[2]); + val |=3D FIELD_PREP(ADP5055_MASK_PWRGD1, mask_power_good[1]); + val |=3D FIELD_PREP(ADP5055_MASK_PWRGD0, mask_power_good[0]); + ret =3D regmap_write(regmap, ADP5055_PG_CFG, val); + if (ret) + return ret; + + return 0; +} + +static int adp5055_is_enabled(struct regulator_dev *dev) +{ + struct adp5055 *adp5055 =3D rdev_get_drvdata(dev); + int id, ret; + int mask; + int val_sw, val_hw; + + id =3D rdev_get_id(dev); + mask =3D BIT(id); + ret =3D regmap_read(adp5055->regmap, ADP5055_CTRL_MODE1, &val_sw); + if (ret) + return ret; + + if (!adp5055->hw_en_array_gpios) + return (val_sw & mask) !=3D 0; + + val_hw =3D gpiod_get_value_cansleep(adp5055->hw_en_array_gpios->desc[id]); + + return val_hw; +}; + +static int adp5055_en_func(struct regulator_dev *dev, int en_val) +{ + struct adp5055 *adp5055 =3D rdev_get_drvdata(dev); + int id; + int mask; + + id =3D rdev_get_id(dev); + mask =3D BIT(id); + + if (!adp5055->hw_en_array_gpios) + return regmap_update_bits(adp5055->regmap, ADP5055_CTRL_MODE1, mask, en_= val); + + gpiod_set_value_cansleep(adp5055->hw_en_array_gpios->desc[id], en_val); + + return 0; +} + +static int adp5055_enable(struct regulator_dev *dev) +{ + return adp5055_en_func(dev, 1); +} + +static int adp5055_disable(struct regulator_dev *dev) +{ + return adp5055_en_func(dev, 0); +} + +static const struct regulator_ops adp5055_ops =3D { + .list_voltage =3D regulator_list_voltage_linear_range, + .map_voltage =3D regulator_map_voltage_linear_range, + .set_voltage_sel =3D regulator_set_voltage_sel_regmap, + .get_voltage_sel =3D regulator_get_voltage_sel_regmap, + .enable =3D adp5055_enable, + .disable =3D adp5055_disable, + .is_enabled =3D adp5055_is_enabled, +}; + +#define ADP5055_REG_(_name, _id, _ch, _ops) \ + [_id] =3D { \ + .name =3D _name, \ + .ops =3D _ops, \ + .linear_ranges =3D adp5055_voltage_ranges, \ + .n_linear_ranges =3D ARRAY_SIZE(adp5055_voltage_ranges), \ + .vsel_reg =3D ADP5055_VID##_ch, \ + .vsel_mask =3D GENMASK(7, 0), \ + .enable_reg =3D ADP5055_CTRL123, \ + .enable_mask =3D BIT(_ch), \ + .owner =3D THIS_MODULE, \ + } + +#define ADP5055_REG(_name, _id, _ch) \ + ADP5055_REG_(_name, _id, _ch, &adp5055_ops) + +static const struct regulator_desc adp5055_regulators[] =3D { + ADP5055_REG("DCDC1", 0, 0), + ADP5055_REG("DCDC2", 1, 1), + ADP5055_REG("DCDC3", 2, 2), +}; + +static const struct of_device_id adp5055_dt_ids[] =3D { + { .compatible =3D "adi,adp5055"}, + { } +}; +MODULE_DEVICE_TABLE(of, adp5055_dt_ids); + +static int adp5055_probe(struct i2c_client *client) +{ + struct regulator_init_data *init_data; + struct device *dev =3D &client->dev; + struct adp5055 *adp5055; + int i, ret; + + init_data =3D of_get_regulator_init_data(dev, client->dev.of_node, + &adp5055_regulators[0]); + if (!init_data) + return -EINVAL; + + adp5055 =3D devm_kzalloc(dev, sizeof(struct adp5055), GFP_KERNEL); + if (!adp5055) + return -ENOMEM; + + adp5055->regmap =3D devm_regmap_init_i2c(client, &adp5055_regmap_config); + if (IS_ERR(adp5055->regmap)) + return dev_err_probe(dev, PTR_ERR(adp5055->regmap), "Failed to allocate = reg map"); + + ret =3D adp5055_parse_fw(dev, adp5055); + if (ret < 0) + return ret; + + for (i =3D 0; i < ADP5055_NUM_CH; i++) { + const struct regulator_desc *desc =3D &adp5055_regulators[i]; + struct regulator_config config =3D { }; + struct regulator_dev *rdev; + + config.dev =3D dev; + config.driver_data =3D adp5055; + config.regmap =3D adp5055->regmap; + config.init_data =3D init_data; + + rdev =3D devm_regulator_register(dev, desc, &config); + if (IS_ERR(rdev)) { + return dev_err_probe(dev, PTR_ERR(rdev), + "Failed to register %s\n", desc->name); + } + } + + return 0; +} + +static const struct of_device_id adp5055_of_match[] =3D { + { .compatible =3D "adi,adp5055", }, + { } +}; +MODULE_DEVICE_TABLE(of, adp5055_of_match); + +static const struct i2c_device_id adp5055_ids[] =3D { + { .name =3D "adp5055"}, + { }, +}; +MODULE_DEVICE_TABLE(i2c, adp5055_ids); + +static struct i2c_driver adp5055_driver =3D { + .driver =3D { + .name =3D "adp5055", + .of_match_table =3D adp5055_of_match, + }, + .probe =3D adp5055_probe, + .id_table =3D adp5055_ids, +}; +module_i2c_driver(adp5055_driver); + +MODULE_DESCRIPTION("ADP5055 Voltage Regulator Driver"); +MODULE_AUTHOR("Alexis Czezar Torreno "); +MODULE_LICENSE("GPL"); --=20 2.34.1