From patchwork Thu May 30 15:05:47 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Luca Weiss X-Patchwork-Id: 13680518 Received: from mail-ej1-f53.google.com (mail-ej1-f53.google.com [209.85.218.53]) (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 946AC17D89F for ; Thu, 30 May 2024 15:06:15 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.218.53 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717081577; cv=none; b=n1HPBH5rybmZI/vH0/By+AuQyVP4E5GGcdkAUWoVg03p46Bz27lTKpIepFKcZTWm8RL7nhBjlZtDkjNElfEHt7MVuGJR3XaZmy1an51/CXCEhB9+vyPb28VTxQ/M1sYZ0vrEPVF/TZtWvHsw85mtr3+bkUeXw0GWtSw9QXcs6YY= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717081577; c=relaxed/simple; bh=r46t+UbdZsFkZ6PKeLxNyX7d6B5FRFqXFHDi3FXc7Dc=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=Y88VRHnYim8E2ZaI2zYW1ZcWBBoKP8GqRRsb/NwnwF9AFc9HxM644cIfX/XhMrMs0xr3Nvwgd+ADd5aLhLndj9E0uzS4oiqvcbkkdzDyYQ5bH3C3Awkwlg7EltMM+twuNSgzl8kJQDLwgN3oUbsmfzfHTUKdFuSIZkbaHQV8ZL8= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=fairphone.com; spf=pass smtp.mailfrom=fairphone.com; dkim=pass (2048-bit key) header.d=fairphone.com header.i=@fairphone.com header.b=B9ay13eR; arc=none smtp.client-ip=209.85.218.53 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=fairphone.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=fairphone.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=fairphone.com header.i=@fairphone.com header.b="B9ay13eR" Received: by mail-ej1-f53.google.com with SMTP id a640c23a62f3a-a634e03339dso118867966b.3 for ; Thu, 30 May 2024 08:06:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fairphone.com; s=fair; t=1717081574; x=1717686374; darn=vger.kernel.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=aktSMI6DpVcgUPsFDDefqr2n9jbKbhFj+3ua7mOz+48=; b=B9ay13eRHx2YCl3nG+tohHlpYLK+mHlifH3NfG7BLnAXHZ013P3Ra67NDaiwQE10ZU KKzidM1s4rPA+tOngVPHPQFrSWp7mtuzje2EcYrM2sMkglQSON0F8N1CC+bRrMori385 JuFa8g7Xe0aZXrwg3sY+530fvHaOTM9pFh5G+1W7lwYstrllgMKbeW3UidBRFKzD8Lz1 2EqPFUNLj7uOFieMhMLM1Z+3bwLzV98bKBpdmh/5ZgutccaUZ8L+mJ3ECg6HX44qCpuI vEMyJfh1JGD4fCp2zfbNkoR185MJh4qk9pYwhK1hQ9kUNGLIm33ud6FHvS9/De52nHDf L8Og== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1717081574; x=1717686374; 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=aktSMI6DpVcgUPsFDDefqr2n9jbKbhFj+3ua7mOz+48=; b=jcRaSV39mizNhF0GCC655cTzrquI2Mit7YNsFyBqwah0Tiey2eiEmoJkarJz2ztt66 TUewz+kLxyalHBgRasUhktwSqfdg07muTGStQp9RFK83ZFtXTWhhrXpcaBxwyClc8RsY 4gubATp1dNVULsc/uVarev95Q1q6QQNUcqpxYWIJSxmji3mfbjnKJ8e2barSzLjyvbCH gL1QzUV4PkC3Oz36CtZT7TjFgwbG713Y9eCoOxvuCdyRoRCPbWAk2gk6eDOoMSoowz0e 8eIgpR50QJXPGnYsRovz/EOUhWsEAuE+y+WJFxsAU7rYvaIekkV3uWC1u65ii5i8GmH/ EdbQ== X-Forwarded-Encrypted: i=1; AJvYcCXCgfcfK0WnWAxXkjLjRwxy1xVSCqg7Mtl7b5YHL7Sr55D59i5M+eIBWnviRHVgtnx11d2p/etVAImC3zWnejbhUnyeoRfLdKDEzwnaKA== X-Gm-Message-State: AOJu0YzUCMAXhoIruXFyUxFmWXmPC74eldfeP3bzyosRvMcji9DR8MHR TbaDOTyNFFbMtvR2WGKOl/qNcwcwBJTiZpjB9eQW+hSwkIHbLRCJck14+1ziESc= X-Google-Smtp-Source: AGHT+IEHzFbX4tiyXk81YyWM3vVVyfjaUrcaS+9dBD1mfUbWUGyIFKKKPTITHm/gH/bQeokYyo4eyA== X-Received: by 2002:a17:906:5904:b0:a63:41f7:d44 with SMTP id a640c23a62f3a-a65e8e6c5e8mr162513766b.34.1717081573882; Thu, 30 May 2024 08:06:13 -0700 (PDT) Received: from otso.luca.vpn.lucaweiss.eu (144-178-202-138.static.ef-service.nl. [144.178.202.138]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-a67430f8457sm13531066b.122.2024.05.30.08.06.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 30 May 2024 08:06:13 -0700 (PDT) From: Luca Weiss Date: Thu, 30 May 2024 17:05:47 +0200 Subject: [PATCH v3 1/3] arm64: dts: qcom: pm7250b: Add node for PMIC VBUS booster Precedence: bulk X-Mailing-List: linux-arm-msm@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20240530-fp4-tcpm-v3-1-612d4bbd5e09@fairphone.com> References: <20240530-fp4-tcpm-v3-0-612d4bbd5e09@fairphone.com> In-Reply-To: <20240530-fp4-tcpm-v3-0-612d4bbd5e09@fairphone.com> To: Bjorn Andersson , Konrad Dybcio , Rob Herring , Krzysztof Kozlowski , Conor Dooley Cc: ~postmarketos/upstreaming@lists.sr.ht, phone-devel@vger.kernel.org, linux-arm-msm@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, Luca Weiss , Bryan O'Donoghue X-Mailer: b4 0.13.0 Add the required DTS node for the USB VBUS output regulator, which is available on PM7250B. This will provide the VBUS source to connected peripherals. Reviewed-by: Bryan O'Donoghue Signed-off-by: Luca Weiss Reviewed-by: Dmitry Baryshkov Reviewed-by: Konrad Dybcio --- arch/arm64/boot/dts/qcom/pm7250b.dtsi | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/arch/arm64/boot/dts/qcom/pm7250b.dtsi b/arch/arm64/boot/dts/qcom/pm7250b.dtsi index 3bf7cf5d1700..4faed25a787f 100644 --- a/arch/arm64/boot/dts/qcom/pm7250b.dtsi +++ b/arch/arm64/boot/dts/qcom/pm7250b.dtsi @@ -45,6 +45,12 @@ pmic@PM7250B_SID { #address-cells = <1>; #size-cells = <0>; + pm7250b_vbus: usb-vbus-regulator@1100 { + compatible = "qcom,pm7250b-vbus-reg", "qcom,pm8150b-vbus-reg"; + reg = <0x1100>; + status = "disabled"; + }; + pm7250b_temp: temp-alarm@2400 { compatible = "qcom,spmi-temp-alarm"; reg = <0x2400>; From patchwork Thu May 30 15:05:48 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Luca Weiss X-Patchwork-Id: 13680519 Received: from mail-ed1-f54.google.com (mail-ed1-f54.google.com [209.85.208.54]) (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 2D33117D8B0 for ; Thu, 30 May 2024 15:06:16 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.208.54 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717081577; cv=none; b=J40Cw0SY8GrdGEYumtX4ON/FP2/QVUFM0P6ElBPAgpCIo8TbnGb9hHPn/iUBzHhr97Cq7JG5w3xZ3TGY6pyfk1R6+L+qih4gKKX/lSrAal1/rvTPjZpq+Jur5r0C8lzw+0W+0ocNUm5nBFd7eCmN42g9y7GfDEfwBybu8U3NtE8= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717081577; c=relaxed/simple; bh=GO53uI6GUbwjaW8cPhjYVSZiLvFTBXg7wMm8WUSxda8=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=qQyJkYpgKz85sW8Y0qZn/ejX4FRD6IqBOavFdjAujySVUwoICkCOake44jcqyLncag9It/i5odlLRN6x551qpvrPWd85VdgozQkQ5AePMkmB9inozIa8uRH4hlM5sx0N6fC9KNVqBW7AmaYjBDD5e5X8BkOebUe2hhN8NXTxJjQ= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=fairphone.com; spf=pass smtp.mailfrom=fairphone.com; dkim=pass (2048-bit key) header.d=fairphone.com header.i=@fairphone.com header.b=TTrKwOxm; arc=none smtp.client-ip=209.85.208.54 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=fairphone.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=fairphone.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=fairphone.com header.i=@fairphone.com header.b="TTrKwOxm" Received: by mail-ed1-f54.google.com with SMTP id 4fb4d7f45d1cf-5788eaf5320so1240491a12.0 for ; Thu, 30 May 2024 08:06:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fairphone.com; s=fair; t=1717081574; x=1717686374; darn=vger.kernel.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=MnQFmGhNvzydRfpbiP3XVw/UozOoI6Olw9DBXg7NZ5A=; b=TTrKwOxmURNZzYH3HkB4KqSz5ZwxVPpo7N0uQj7xd+158WKeaQvi4zgsH2PySr0LZP dmIwhYAUswTkG238xxZPj/ri71Obw2+juK8THL3K+h8Yn1pkfXT7QiTIwrCHfo9PXSFr gzHbwbsvgRy2vi2aQBY1hwxqlOu6nA3qex9SzYaky4Iv5DjMNIL9xynelCqDpe1Ntdg9 oSC5R3LoHhUVJO8pt84A7g9G4xtXi5LMLA0XskEuNYXff73SI52EpQOuyST5zp88mJO0 ws/wEPP1WIYsDumgMDjZ/JXorGGpTTjvCSxbui9Ss2fdJCXDG+5oeERA6CvVzbIwZYnv t9ug== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1717081574; x=1717686374; 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=MnQFmGhNvzydRfpbiP3XVw/UozOoI6Olw9DBXg7NZ5A=; b=StXEM223OSXlP6sdcSJYKC8G4+Aj/3wvomdYnvcHFadUedppOxO5ASFhksZjwPLTRh HRYXfAzXozr3/gM940CZHK911Tj3QY5xt3o3c5wwC2NpRG5ntm7HfkTrc5RQ8tFFmsW8 jWsgWkdavaGmlMLnPoaPcWOCHzVeaKgOVfSN0ZqRiwpyxGR7VLB9fb8F925jcSpEZJn7 5/HAydWNL3hJKfJw06wwGrBgzCGjvPOO1vhv9z3/UACR7lh0/DyFMG8jv1elDG2R7Leq 8GU+ID/rOhRgMUuOQMvoo4MU2W7YcVgEwzhxvfplMaOCY6v3OdtmuCWn1gMA3CRX3/XH BqJA== X-Forwarded-Encrypted: i=1; AJvYcCVk4L7wOdwf1izcply5LVjx14z3oYelv/WsrIlPDaVjkvXNLWELAbJ4K+2jtpKnWQMUqdFYleIbQAlhfzzOMKy36kxDCrrDXcTdgp6GSQ== X-Gm-Message-State: AOJu0YyGrrjrERssov5idbhN6snS5ZdZ/6lmro3wCegpGoako9/gMUTL ntO9h2kLUzZG9JgTE8Ji/MzLuFMDxSrEhOwkq0QXutzcmOpNCD/rl/IfMrPuM/w= X-Google-Smtp-Source: AGHT+IHBv+u67ofhYHZYMyXJnaNkoyAVZQqwsp7v4/MrGjYuiauM2L/f+UvdpmMs40e+H+xC8NG6Gg== X-Received: by 2002:a17:906:4913:b0:a67:403a:4bf0 with SMTP id a640c23a62f3a-a67403a4d73mr30681166b.3.1717081574410; Thu, 30 May 2024 08:06:14 -0700 (PDT) Received: from otso.luca.vpn.lucaweiss.eu (144-178-202-138.static.ef-service.nl. [144.178.202.138]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-a67430f8457sm13531066b.122.2024.05.30.08.06.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 30 May 2024 08:06:14 -0700 (PDT) From: Luca Weiss Date: Thu, 30 May 2024 17:05:48 +0200 Subject: [PATCH v3 2/3] arm64: dts: qcom: pm7250b: Add a TCPM description Precedence: bulk X-Mailing-List: linux-arm-msm@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20240530-fp4-tcpm-v3-2-612d4bbd5e09@fairphone.com> References: <20240530-fp4-tcpm-v3-0-612d4bbd5e09@fairphone.com> In-Reply-To: <20240530-fp4-tcpm-v3-0-612d4bbd5e09@fairphone.com> To: Bjorn Andersson , Konrad Dybcio , Rob Herring , Krzysztof Kozlowski , Conor Dooley Cc: ~postmarketos/upstreaming@lists.sr.ht, phone-devel@vger.kernel.org, linux-arm-msm@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, Luca Weiss , Bryan O'Donoghue X-Mailer: b4 0.13.0 Type-C port management functionality lives inside of the PMIC block on pm7250b. The Type-C port management logic controls orientation detection, vbus/vconn sense and to send/receive Type-C Power Domain messages. Reviewed-by: Bryan O'Donoghue Reviewed-by: Konrad Dybcio Signed-off-by: Luca Weiss Reviewed-by: Dmitry Baryshkov --- arch/arm64/boot/dts/qcom/pm7250b.dtsi | 40 +++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) diff --git a/arch/arm64/boot/dts/qcom/pm7250b.dtsi b/arch/arm64/boot/dts/qcom/pm7250b.dtsi index 4faed25a787f..7dc7262f1537 100644 --- a/arch/arm64/boot/dts/qcom/pm7250b.dtsi +++ b/arch/arm64/boot/dts/qcom/pm7250b.dtsi @@ -51,6 +51,46 @@ pm7250b_vbus: usb-vbus-regulator@1100 { status = "disabled"; }; + pm7250b_typec: typec@1500 { + compatible = "qcom,pm7250b-typec", "qcom,pm8150b-typec"; + reg = <0x1500>, + <0x1700>; + interrupts = , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + ; + interrupt-names = "or-rid-detect-change", + "vpd-detect", + "cc-state-change", + "vconn-oc", + "vbus-change", + "attach-detach", + "legacy-cable-detect", + "try-snk-src-detect", + "sig-tx", + "sig-rx", + "msg-tx", + "msg-rx", + "msg-tx-failed", + "msg-tx-discarded", + "msg-rx-discarded", + "fr-swap"; + vdd-vbus-supply = <&pm7250b_vbus>; + status = "disabled"; + }; + pm7250b_temp: temp-alarm@2400 { compatible = "qcom,spmi-temp-alarm"; reg = <0x2400>; From patchwork Thu May 30 15:05:49 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Luca Weiss X-Patchwork-Id: 13680520 Received: from mail-ej1-f54.google.com (mail-ej1-f54.google.com [209.85.218.54]) (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 B9AB717F50A for ; Thu, 30 May 2024 15:06:17 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.218.54 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717081579; cv=none; b=CK0YxyjooI5kEGdgpzfHYoWmDC2Evv4NmKZbDxiIAszVxwF0MPnjb14mKQIxIyoiMCvyIRY/0MaznSRKANLmkxf92yJ3R031R9g4MsOzqIj+Z60uoX7XcuJj2txHno5HIJntYtMuNXz3buSl9JJEFeCq8bRYXJ8aaXyf6v29MoM= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717081579; c=relaxed/simple; bh=Rx0i5stw3yHTMMFsfdlHmWgjJoZmgrVRjC8hBNJvukU=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=sbZ7C2F47V+VpbEPeu6t/AhHYBWdQY88BlkSAQuVQ11shfQD3vA3r+N6PtZt0ytsFlLk47BrEzfJ8DMNnqCsan1BfMqEPKYll3h/1V8gmuuHJXPnD3VGVOlNmeDn8lHzGcQI8mYwp478DYSVI2AIL8FPpCyq40hw7vpaRiU2DAk= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=fairphone.com; spf=pass smtp.mailfrom=fairphone.com; dkim=pass (2048-bit key) header.d=fairphone.com header.i=@fairphone.com header.b=rXb5kkcX; arc=none smtp.client-ip=209.85.218.54 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=fairphone.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=fairphone.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=fairphone.com header.i=@fairphone.com header.b="rXb5kkcX" Received: by mail-ej1-f54.google.com with SMTP id a640c23a62f3a-a5dcb5a0db4so103727866b.2 for ; Thu, 30 May 2024 08:06:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fairphone.com; s=fair; t=1717081576; x=1717686376; darn=vger.kernel.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=GrmTbKVzlO/dGi20qcpezNa/am8OdKspXFwBntBzr0E=; b=rXb5kkcXa5ZBR30f8NUpUHoUYO63ExH2wo9aVkN1Jmcm4P4rn60370ymiSBNI74XpQ cfY+RiSy3gaEhGHHD+morHcReP89mb33ZMjNNkMBWjmpuvU9OjfqGJBpTNUBLjgOAv9n aYf5WaCZirM7V0lCy4g0ZKglpa5XdxuLRoxqKk4sXSHzt9BIxoAsa9RJsO6yPse+Imre VJL/HeW1tJK5BjScY5DdzghMd/ReXsK3tALwXAmxmXLxZTumIFwNn4X20aX5F22MuzbT MBZpu76eCAVNDAVcVK9Kd5mq9X8A//Z0nml78sLLdljmYABFGcSLVT8tj2xhiLNTLpUp tVEg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1717081576; x=1717686376; 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=GrmTbKVzlO/dGi20qcpezNa/am8OdKspXFwBntBzr0E=; b=aLi5a1JjwrwTKR4McHxOZtZeePkoHq9+PkJ5AFYP6WkbAdXEPlk532gZiBxBWW5qh3 QO6ZbrM5iiy36T3HETrOJmAHmek5v+sVfWhU1r07+zL241VtWzWR17d+QbaYEkxKRuqy GxB74hBnEppim/LFfCwREic/fe/8JO0w7M6osEYeRU4TdeGPaVp2Z+uj7bPZ+DPsKtzE x7BMtUYS5KfxnGTYDejIlFXHYYtyJ4y+mhdd4YUOkbs5CsAbK4ccyGzIRthbYDAqqXJV eNSc+fEh8A5IA95X8KmMIJ1M4+rA3Nhv2ia8kKMzO2Yxfg/0V5ugv1Vesivc3tbPVRxI 5yXg== X-Forwarded-Encrypted: i=1; AJvYcCXecsaZmca1WeFREAjTaKJLmq7kKQlRi55wQTYxQoJR6++C5vZMyBiaiNhzGxe5uQeda/gU6cNLezYHzi5Yn2u1UxptWKoFkLcVancvsA== X-Gm-Message-State: AOJu0Ywy91DeBPslwxsggnuit3QRE3fAvJjvOZlsfvzTfYbddnd/oZsO 3Ux/8k/s0KFyBvYeSUcCrwjN0/ETiroXipYCI7bCEFzpcu74sqW1OjKcpPa1viY= X-Google-Smtp-Source: AGHT+IE+urq3VyYXg2gOQDWo+mznsKJWsMrKlQtfLzTcxHU/kvLid8mqwS3XsbK1Ga7ajMo1n6L6zA== X-Received: by 2002:a17:906:5615:b0:a5a:84c8:770b with SMTP id a640c23a62f3a-a65e8e7a1b3mr144527566b.36.1717081576006; Thu, 30 May 2024 08:06:16 -0700 (PDT) Received: from otso.luca.vpn.lucaweiss.eu (144-178-202-138.static.ef-service.nl. [144.178.202.138]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-a67430f8457sm13531066b.122.2024.05.30.08.06.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 30 May 2024 08:06:14 -0700 (PDT) From: Luca Weiss Date: Thu, 30 May 2024 17:05:49 +0200 Subject: [PATCH v3 3/3] arm64: dts: qcom: sm7225-fairphone-fp4: Enable USB role switching Precedence: bulk X-Mailing-List: linux-arm-msm@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20240530-fp4-tcpm-v3-3-612d4bbd5e09@fairphone.com> References: <20240530-fp4-tcpm-v3-0-612d4bbd5e09@fairphone.com> In-Reply-To: <20240530-fp4-tcpm-v3-0-612d4bbd5e09@fairphone.com> To: Bjorn Andersson , Konrad Dybcio , Rob Herring , Krzysztof Kozlowski , Conor Dooley Cc: ~postmarketos/upstreaming@lists.sr.ht, phone-devel@vger.kernel.org, linux-arm-msm@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, Luca Weiss X-Mailer: b4 0.13.0 Configure the Type-C and VBUS regulator on PM7250B and wire it up to the USB PHY, so that USB role and orientation switching works. For now USB Power Delivery properties are skipped / disabled, so that the (presumably) bootloader-configured charger doesn't get messed with and we can charge the phone with at least some amount of power. Reviewed-by: Konrad Dybcio Signed-off-by: Luca Weiss Reviewed-by: Dmitry Baryshkov --- .../dts/qcom/sm6350-sony-xperia-lena-pdx213.dts | 1 + arch/arm64/boot/dts/qcom/sm6350.dtsi | 50 +++++++++++++++++++ arch/arm64/boot/dts/qcom/sm7225-fairphone-fp4.dts | 58 +++++++++++++++++++++- 3 files changed, 108 insertions(+), 1 deletion(-) diff --git a/arch/arm64/boot/dts/qcom/sm6350-sony-xperia-lena-pdx213.dts b/arch/arm64/boot/dts/qcom/sm6350-sony-xperia-lena-pdx213.dts index dddd6e44d280..88ee04973a2f 100644 --- a/arch/arm64/boot/dts/qcom/sm6350-sony-xperia-lena-pdx213.dts +++ b/arch/arm64/boot/dts/qcom/sm6350-sony-xperia-lena-pdx213.dts @@ -375,6 +375,7 @@ &usb_1 { }; &usb_1_dwc3 { + /delete-property/ usb-role-switch; maximum-speed = "super-speed"; dr_mode = "peripheral"; }; diff --git a/arch/arm64/boot/dts/qcom/sm6350.dtsi b/arch/arm64/boot/dts/qcom/sm6350.dtsi index acf0b0f73af9..1ac626d963b8 100644 --- a/arch/arm64/boot/dts/qcom/sm6350.dtsi +++ b/arch/arm64/boot/dts/qcom/sm6350.dtsi @@ -1715,10 +1715,39 @@ usb_1_qmpphy: phy@88e8000 { <&gcc GCC_USB3_DP_PHY_PRIM_BCR>; reset-names = "phy", "common"; + orientation-switch; + #clock-cells = <1>; #phy-cells = <1>; status = "disabled"; + + ports { + #address-cells = <1>; + #size-cells = <0>; + + port@0 { + reg = <0>; + + usb_1_qmpphy_out: endpoint { + }; + }; + + port@1 { + reg = <1>; + + usb_1_qmpphy_usb_ss_in: endpoint { + remote-endpoint = <&usb_1_dwc3_ss_out>; + }; + }; + + port@2 { + reg = <2>; + + usb_1_qmpphy_dp_in: endpoint { + }; + }; + }; }; dc_noc: interconnect@9160000 { @@ -1894,6 +1923,27 @@ usb_1_dwc3: usb@a600000 { snps,hird-threshold = /bits/ 8 <0x10>; phys = <&usb_1_hsphy>, <&usb_1_qmpphy QMP_USB43DP_USB3_PHY>; phy-names = "usb2-phy", "usb3-phy"; + usb-role-switch; + + ports { + #address-cells = <1>; + #size-cells = <0>; + + port@0 { + reg = <0>; + + usb_1_dwc3_hs_out: endpoint { + }; + }; + + port@1 { + reg = <1>; + + usb_1_dwc3_ss_out: endpoint { + remote-endpoint = <&usb_1_qmpphy_usb_ss_in>; + }; + }; + }; }; }; diff --git a/arch/arm64/boot/dts/qcom/sm7225-fairphone-fp4.dts b/arch/arm64/boot/dts/qcom/sm7225-fairphone-fp4.dts index bc67e8c1fe4d..d2632f011353 100644 --- a/arch/arm64/boot/dts/qcom/sm7225-fairphone-fp4.dts +++ b/arch/arm64/boot/dts/qcom/sm7225-fairphone-fp4.dts @@ -19,6 +19,7 @@ #include #include #include +#include #include "sm7225.dtsi" #include "pm6150l.dtsi" #include "pm6350.dtsi" @@ -543,6 +544,53 @@ conn-therm@1 { }; }; +&pm7250b_typec { + vdd-pdphy-supply = <&vreg_l3a>; + + status = "okay"; + + connector { + compatible = "usb-c-connector"; + + power-role = "dual"; + data-role = "dual"; + self-powered; + + /* + * Disable USB Power Delivery for now, seems to need extra work + * to support role switching while also letting the battery + * charge still - without charger driver + */ + typec-power-opmode = "default"; + pd-disable; + + ports { + #address-cells = <1>; + #size-cells = <0>; + + port@0 { + reg = <0>; + pm7250b_hs_in: endpoint { + remote-endpoint = <&usb_1_dwc3_hs_out>; + }; + }; + + port@1 { + reg = <1>; + pm7250b_ss_in: endpoint { + remote-endpoint = <&usb_1_qmpphy_out>; + }; + }; + }; + }; +}; + +&pm7250b_vbus { + regulator-min-microamp = <500000>; + regulator-max-microamp = <1500000>; + status = "okay"; +}; + &pmk8350_rtc { status = "okay"; }; @@ -726,7 +774,11 @@ &usb_1 { &usb_1_dwc3 { maximum-speed = "super-speed"; - dr_mode = "peripheral"; + dr_mode = "otg"; +}; + +&usb_1_dwc3_hs_out { + remote-endpoint = <&pm7250b_hs_in>; }; &usb_1_hsphy { @@ -744,6 +796,10 @@ &usb_1_qmpphy { status = "okay"; }; +&usb_1_qmpphy_out { + remote-endpoint = <&pm7250b_ss_in>; +}; + &wifi { vdd-0.8-cx-mx-supply = <&vreg_l4a>; vdd-1.8-xo-supply = <&vreg_l7a>;