From patchwork Mon Sep 16 16:58:27 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Andr=C3=A9_Draszik?= X-Patchwork-Id: 13805665 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 74284C3ABB2 for ; Mon, 16 Sep 2024 17:03:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Cc:To:In-Reply-To:References :Message-Id:Content-Transfer-Encoding:Content-Type:MIME-Version:Subject:Date: From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=POee83DySvDnOivfI8SVt6siVzJDLaBFoZypeDiY6xs=; b=0dkkNWJPghnaZ17YKQQLtz3ZMX EM1T900WyZKoNIfNfc48FWu+S/bRp0oKGlevBPipXw9DBdn4Ms19wDBGaKWNlyf4P2AK8uvZ7fsTC dEj4XybNF3Ye+ozWnLxnX8LDjAXwVQ9KaKRDDslKO6ofI0mweBc2wbxtDtEgOoKytSKGm3Mp+ECP6 7Amg06xXpbDRkfr/uxdq56jKdsOsLh5B0qGLi1OiIjNx26cE7JTXno2AqWMq8n2Z4TS6yWbQrvFRr 0rCrKjpL9IaS4XnHvguV4BOYPU4akU/0FO/jbVBuF2R5rNM7IRFaTa7SkMjC/ESbj32fPJg9Wl9xi heyinoCw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1sqF7r-00000004XlI-0zvh; Mon, 16 Sep 2024 17:02:59 +0000 Received: from mail-ej1-x62c.google.com ([2a00:1450:4864:20::62c]) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1sqF3W-00000004WYN-3WmU for linux-arm-kernel@lists.infradead.org; Mon, 16 Sep 2024 16:58:34 +0000 Received: by mail-ej1-x62c.google.com with SMTP id a640c23a62f3a-a8d2b24b7a8so1044391266b.1 for ; Mon, 16 Sep 2024 09:58:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1726505909; x=1727110709; darn=lists.infradead.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=POee83DySvDnOivfI8SVt6siVzJDLaBFoZypeDiY6xs=; b=nfxis96ceA8WDWH4VBqfsTxC9z1XRJGEXJtN9GDLRz4Mmgu8u39sMJ91ar5e1JwOq4 LzE0c349h8+N/Pn6LZJnAO9YUmRWw63eMloMrb44nTK+saqE0C4jB1qxENjIqjKYPL+Z 0xfLCUBotOL2TnxK4ghUgeMiSrNvhmOYagjdqkLxIGkmBVQsQxa5l8y7ElHPD/yHl0VD xL+S8MEJ6nQyzjIoEYlEsCWVuIEGOuewRbAMKPRj/2PqgGZ3aPrWaAfbSGjL0f5Lw6Wa b62DTSkOoUyepuEGFgNI0/Y74WTplqLcinmZJytsr/gFsILYmWbIUGN9Zz8tz4yBwe8j 2Lmg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1726505909; x=1727110709; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=POee83DySvDnOivfI8SVt6siVzJDLaBFoZypeDiY6xs=; b=C9779MsdEAFtug0xwn27zG8J4IlnBQhbONcCD+aOROGT7f5FZlbHdRmE8tFes+wvmr vdnujThTRPbWL1j6aF5TTKwXKC6kcbFo0HVWDDYpDt4aXar+YX7PF7r0e0nFgRvL24Pw u+z1KP2UT6I+c4MKE1Dcvej/yWtwNTnwvqWTpNuCxtnxrk1VRbp0EjPadje35fC6lo0/ UVMZqi2eaKQx+yrmgdqxr8BQjIfUX0oZ35OcEUK+o0/uHpzzsvouU1EFAqv9mUoRFVnd SV7z8ciEDpJ558wxRiqN6sv0smm858HVa2Xt8c5DLXpXcWL64SA9VkZP/J3p3aRZSw46 4qbA== X-Forwarded-Encrypted: i=1; AJvYcCX+79/9Q/YbfSJvzDIgrmbpHbRZn7GlyFE9RwKU8ed+yT1yKiohu+LcRpCigo+6gUn+aF4KDFON12Oy3+PWYY11@lists.infradead.org X-Gm-Message-State: AOJu0YzDqiVQy34UGDQbxSZTVvtEdXBR/VGanzdSmiELJXb+tIZfFXWo CIWBOnTQ2MOp16DtRrKVDNY1Z5cwhM0FOzjs1ngeXLnwki8NlGSPp1ds1T3bWls= X-Google-Smtp-Source: AGHT+IG4lR4FfFrt1+aMIT+Isdeh2RHT8IgEpUYl774+4W1+M8HEGgjX7tXlhYp0yOF9k9KIgJQKQA== X-Received: by 2002:a17:907:72d1:b0:a8d:6372:2d38 with SMTP id a640c23a62f3a-a8ffabc1d72mr2373277566b.18.1726505908867; Mon, 16 Sep 2024 09:58:28 -0700 (PDT) Received: from puffmais.c.googlers.com (30.171.91.34.bc.googleusercontent.com. [34.91.171.30]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-a90979ceb67sm32992966b.219.2024.09.16.09.58.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 16 Sep 2024 09:58:28 -0700 (PDT) From: =?utf-8?q?Andr=C3=A9_Draszik?= Date: Mon, 16 Sep 2024 17:58:27 +0100 Subject: [PATCH 2/3] arm64: dts: exynos: gs101-oriole: enable max20339 OVP MIME-Version: 1.0 Message-Id: <20240916-max20339-dts-v1-2-2f7ed7c24e83@linaro.org> References: <20240916-max20339-dts-v1-0-2f7ed7c24e83@linaro.org> In-Reply-To: <20240916-max20339-dts-v1-0-2f7ed7c24e83@linaro.org> To: Catalin Marinas , Will Deacon , Peter Griffin , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Alim Akhtar Cc: Tudor Ambarus , Will McVicker , kernel-team@android.com, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-samsung-soc@vger.kernel.org, devicetree@vger.kernel.org, =?utf-8?q?A?= =?utf-8?q?ndr=C3=A9_Draszik?= X-Mailer: b4 0.13.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240916_095830_903464_32DD9226 X-CRM114-Status: GOOD ( 13.97 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Enable the Maxim max20339 OVP with load switches. This is the first device behind the USB plug and can gate all incoming power as well as protecting the input path from overvoltages. Its load switches are used for wireless charging and for OTG. Regulator and GPIO line names have been chosen to match the schematic. Note that its interrupt line is connected to a Maxim max77759 and supplies are connected to a PMIC and to a boost regulator controlled by that PMIC, none of which we have drivers or DTS entries for at this stage, so those parts have been left out. Signed-off-by: AndrĂ© Draszik --- arch/arm64/boot/dts/exynos/google/gs101-oriole.dts | 51 ++++++++++++++++++++++ 1 file changed, 51 insertions(+) diff --git a/arch/arm64/boot/dts/exynos/google/gs101-oriole.dts b/arch/arm64/boot/dts/exynos/google/gs101-oriole.dts index 387fb779bd29..a3276aa91091 100644 --- a/arch/arm64/boot/dts/exynos/google/gs101-oriole.dts +++ b/arch/arm64/boot/dts/exynos/google/gs101-oriole.dts @@ -68,6 +68,12 @@ ufs_0_fixed_vcc_reg: regulator-1 { regulator-boot-on; enable-active-high; }; + + /* This represents Vbus coming from the USB Type-C connector */ + reg_src_ppvar_usbc_vbus: regulator-src-ppvar-usbc-vbus { + compatible = "regulator-fixed"; + regulator-name = "src_ppvar_usbc_vbus"; + }; }; &ext_24_5m { @@ -90,6 +96,51 @@ eeprom: eeprom@50 { &hsi2c_12 { status = "okay"; /* TODO: add the devices once drivers exist */ + + ovp: ovp@35 { + compatible = "maxim,max20339"; + reg = <0x35>; + /* TODO: add interrupt once driver for max77759-gpio exists */ + /* TODO: Update this once PMIC is implemented (PP1800_L2M_ALIVE) */ + dig-supply = <®_placeholder>; + + insw-supply = <®_src_ppvar_usbc_vbus>; + /* TODO: update this once boost regulator exists */ + lsw1-supply = <®_placeholder>; + lsw2-supply = <®_placeholder>; + + gpio { + gpio-controller; + #gpio-cells = <2>; + /* + * "Human-readable name [SIGNAL_LABEL]" where the + * latter comes from the schematic + */ + gpio-line-names = "Vin valid [SRC_PPVAR_USBC_VBUS]"; + }; + + regulators { + insw_reg: insw { + regulator-name = "PPVAR_VBUS_OVP"; + regulator-active-discharge = <0>; + regulator-min-microvolt = <5850000>; + regulator-max-microvolt = <14500000>; + regulator-ov-protection-microvolt = <14500000>; + }; + lsw1_reg: lsw1 { + regulator-name = "PPVAR_VBUS_OVP_LSW1"; + regulator-oc-protection-microamp = <1460000>; + regulator-ov-protection-microvolt = <1>; + shunt-resistor-micro-ohms = <120000000>; + }; + lsw2_reg: lsw2 { + regulator-name = "PPVAR_QI_VOUT_TX"; + regulator-oc-protection-microamp = <1230000>; + regulator-ov-protection-microvolt = <1>; + shunt-resistor-micro-ohms = <143000000>; + }; + }; + }; }; &pinctrl_far_alive {