From patchwork Fri Mar 29 12:26:19 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Luca Weiss X-Patchwork-Id: 784557 Received: from mail-ed1-f50.google.com (mail-ed1-f50.google.com [209.85.208.50]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 5932F6BFC7 for ; Fri, 29 Mar 2024 12:26:24 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.208.50 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711715186; cv=none; b=f6LNGl+QWQ4XZF0gVPTn2rnBuSnPqz5ILtN7jHod0XEJDKRrn2EjTf2ZStjVi5Z/W7M0jRjCQ5GlFSyV9eX1Nvw5raZpAxSVlKgpzPRaD7LT4erwshz2uIAjOXym+ZQ5pIrv61IF4fbH4nCgLmMgzIEyD/Cx35IFaP2cOKvKcU4= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711715186; c=relaxed/simple; bh=akWSjL76yI1t/NtiK/Qxt0MG5YrDpdrCGHzwmYEoXqw=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=Sh7I53GNdGnkFK+i2m2+RCqzXzVu688w25W/vZaFTjmpaaOV1u8caWRqx6i67bCF1GOITG7gHzxUaQHTfTupogSNjWlheyer4D5LAAD8+zkJZJMG+i0paK/WtvkMvZ90H+bam35zkTASd9/2skt8tduCgrruxmhIkNBEoQ2Z0Z0= 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=P/3ptKZT; arc=none smtp.client-ip=209.85.208.50 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="P/3ptKZT" Received: by mail-ed1-f50.google.com with SMTP id 4fb4d7f45d1cf-56c5d05128dso615408a12.0 for ; Fri, 29 Mar 2024 05:26:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fairphone.com; s=fair; t=1711715183; x=1712319983; 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=EYSC7gUiCSsUFX60U432osVSa6qQ0jwghFHk91osDZ4=; b=P/3ptKZT03UMDdhl8HelngCcYAzjN10xp5Z7XoDwu769/YqiHsNPiuDoInW4m36bLt eWr44418umDUc4gag8GJb610g4H7CIyvZF1iPEFfTocLcB0KOvZdUGX2vHbrTqTqwJ5u GSa/13hoHlK05Z4P+m9TjqDszXryVkj1eEarQkWpgbzFylIu120yHi3aUPLIhAtg5tVv LtMA79OQl+vdA2/P+XBFjuAPfPUgjuf+64d74PaYO2bphFb/p5oO8kQwMJ3czE0UNj8E To2mTE3k7DBrV4BpsIgHrNQGfxdQ+OGx0S2bpfYwp/HYCBpbrNQ8IBNLHF/AxPI27+1G H8NA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1711715183; x=1712319983; 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=EYSC7gUiCSsUFX60U432osVSa6qQ0jwghFHk91osDZ4=; b=PQRfj8KuI5rA9oKYxnosp8+iq996qnNTN3UW3sLZtCSDzh2I3ieCWAvOUrSAcU1M/l Jler2dHIurRWBDdxOWbw9pymW9AfTDWcgfnaSKmAJfH4tp99g1Bj6b/K/FNsZgWBdSGY yGtu7uED1c6qBorysx43WKg+ZBm7oK06lEwY4B+dsZ9Z+jvG05KgLx/K5DNl1HIdPehq Ow4Y+g/a3Oz0+vLM7ndZP5pEX3B0Y2JEbh+++gRcyZQHN+FN9hQrV4QghK2w98jiDhSx 7WR3qIHsv7fszywDoEYnzuSmk3CLiyECs5/PQPCm9OA7hRZi9Xj5MdZcIYS9UE28/wWF QusQ== X-Forwarded-Encrypted: i=1; AJvYcCWeQ+VxxL+ANssaFoLd0BiUfwRxZ1ha48KTfLznR5Rtr7q7L4JrcoI4tOsQc2AcMjibuS78DuPD4qE8JaT8DwqM5Lg/j+XE61IUmoJ2Bg== X-Gm-Message-State: AOJu0YxgDdfvbcfzXB30xmv2V/neWmCTQerrDG/irQTt5I4OwILsJCi+ nmOvCw5QEuINJ4sdhuJFI+6hcy+LB8SGVfLTTHUUYEN8vINtt5RlltBo695U0jo= X-Google-Smtp-Source: AGHT+IETPeI4hP1qcMA1SZl5hdXCGl5hIuhApsLPvQa8i0wKI9xMZgOUDSc9qMWKBv3rBSyoGyTwxA== X-Received: by 2002:a50:9993:0:b0:56b:cf26:3af0 with SMTP id m19-20020a509993000000b0056bcf263af0mr1363010edb.17.1711715182672; Fri, 29 Mar 2024 05:26:22 -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 m7-20020aa7c487000000b0056bf2e2c898sm1961925edq.1.2024.03.29.05.26.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 29 Mar 2024 05:26:21 -0700 (PDT) From: Luca Weiss Date: Fri, 29 Mar 2024 13:26:19 +0100 Subject: [PATCH v2 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: <20240329-fp4-tcpm-v2-1-d7f8cd165355@fairphone.com> References: <20240329-fp4-tcpm-v2-0-d7f8cd165355@fairphone.com> In-Reply-To: <20240329-fp4-tcpm-v2-0-d7f8cd165355@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 --- 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 Fri Mar 29 12:26:20 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Luca Weiss X-Patchwork-Id: 784130 Received: from mail-ed1-f45.google.com (mail-ed1-f45.google.com [209.85.208.45]) (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 BA2AD7D086 for ; Fri, 29 Mar 2024 12:26:24 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.208.45 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711715186; cv=none; b=P1UAzFejiSo23wlbXkEB3Rsg4cQPr79BHgX4SD74M7omPrl0X2TjgS8Z3xLAeGzk0Ov6PSYCcMN/Ky2Inz3DqDZUi5oUQMX5elywx68ikZSerkKyxtQZP+fuhAR3u8U0k2V/OoBo0EmAFpbR8mMTcLFN5FQmQvMH4RRX3Khms6Q= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711715186; c=relaxed/simple; bh=CO7iFRLXuNJN0ODjWE1Sca9kd08SmHPibAbkSnnLPTQ=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=CI9OgklJ+OLJq5nIFszJA15xCmhywNWsI1azadzNcHYwmVi+BB643BtJV/S4niEsvj02ibWRJstwK2Iw7P+D8wyjUQTA8eODvSjkPbLoNgF2fP4LeEwB5c+5LJBwJE61SeoAOUdLpGlcndmQX+R219PzFed9dzT7c8GEyxa0iNw= 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=Rh/5OMKY; arc=none smtp.client-ip=209.85.208.45 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="Rh/5OMKY" Received: by mail-ed1-f45.google.com with SMTP id 4fb4d7f45d1cf-56c1922096cso2531028a12.0 for ; Fri, 29 Mar 2024 05:26:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fairphone.com; s=fair; t=1711715183; x=1712319983; 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=hGKBeVO2nyh3+Ap/hXwBhTTxhIwQlZ0U8hKP2bY+0Ow=; b=Rh/5OMKYCskGZ5bgNV8TMBntxJ2mdjdnuSMqJnZZduPj7mPJCoVeDA0SKHI4q0LCol FSxcGXoM/OqQhu22clDxUXdCI0NeTfaAov83DPKZjdVU191NIX27J9+1wv6oihFu6WNd EMPoe7tECok+YsI0Cm7EVwdvDdKGYWONSEPbMnO2Y2RQviAbF5o/As4JvDmMvh+YHKWh /ex/qxegFIPoy065J+PVKCgJHjF0t/P1b96M/jSV5IBKP3QB7TpuVZ4dKmttQP6qgSC3 5qPbdMhdXeIz4kPwriU5T1NgGgGFrFoG62/1UM96fxpwGtsRfwyQROi3LKjGQ6sQjetC oWNw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1711715183; x=1712319983; 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=hGKBeVO2nyh3+Ap/hXwBhTTxhIwQlZ0U8hKP2bY+0Ow=; b=gxSCfeo9M7qoJxaobY1CAI6tXp7pElgfcV9XWP4f9s/G+iJkP3YcnDkw/ynMuwGzms nBoq2MTgVvwKX64UzCmvS1RMXSK3ikrKZmFHygLyvoqy59e6YIzBwiWC933LoucYi0sP jICvCDExMdSfnmK/jV0s+iEQgEbZiSWw8d67sHwZOLn7Um2D5tSpKr7D8Y6/1mqq9VN3 KAjWTL5TztqN7Kk9CI1LfVudIX3Ef0j8gbc12ozNdL/4k6c3inLulsLji6WeuVdbBbPo u/09zs8frTISxTjHH52nebmfgkPkhEoJrxL92CYf+cW8qPU/QmAuRncq/ZgcF15PR6JP 6pkg== X-Forwarded-Encrypted: i=1; AJvYcCUJeftYam+6gWqFnkuZUo38xIEI8kXoAPGv7Ck5TSLUjyEnfD4OP0wVk4C4R3d2BRy3dKc6OULmeq0DgTBACwWyHWIJb7jXTWBEwFqgCw== X-Gm-Message-State: AOJu0YxG8FqdlVeC9qM9+Cjo4BFrorlmeIcciXH+lDZm1gOcPLDAC2F1 rzSA1J3TVTBMxdW4WKOGp35c90AtUqB5Ll/LxjyfdlV8km56lhwFghv5QDoqaEg= X-Google-Smtp-Source: AGHT+IFEE27q4B+XksSVFszccNQd8JRIrW5x9djah1vWi9Ji9S0Z8DWEa5cQ8ikzTPzRPEXvnAmFTA== X-Received: by 2002:a05:6402:2349:b0:56b:ee71:9660 with SMTP id r9-20020a056402234900b0056bee719660mr1501118eda.27.1711715183177; Fri, 29 Mar 2024 05:26:23 -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 m7-20020aa7c487000000b0056bf2e2c898sm1961925edq.1.2024.03.29.05.26.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 29 Mar 2024 05:26:22 -0700 (PDT) From: Luca Weiss Date: Fri, 29 Mar 2024 13:26:20 +0100 Subject: [PATCH v2 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: <20240329-fp4-tcpm-v2-2-d7f8cd165355@fairphone.com> References: <20240329-fp4-tcpm-v2-0-d7f8cd165355@fairphone.com> In-Reply-To: <20240329-fp4-tcpm-v2-0-d7f8cd165355@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 --- arch/arm64/boot/dts/qcom/pm7250b.dtsi | 39 +++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) diff --git a/arch/arm64/boot/dts/qcom/pm7250b.dtsi b/arch/arm64/boot/dts/qcom/pm7250b.dtsi index 4faed25a787f..0205c2669093 100644 --- a/arch/arm64/boot/dts/qcom/pm7250b.dtsi +++ b/arch/arm64/boot/dts/qcom/pm7250b.dtsi @@ -51,6 +51,45 @@ 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>; + }; + pm7250b_temp: temp-alarm@2400 { compatible = "qcom,spmi-temp-alarm"; reg = <0x2400>; From patchwork Fri Mar 29 12:26:21 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Luca Weiss X-Patchwork-Id: 784556 Received: from mail-ed1-f48.google.com (mail-ed1-f48.google.com [209.85.208.48]) (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 4B98B86136 for ; Fri, 29 Mar 2024 12:26:26 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.208.48 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711715189; cv=none; b=XU3uDe9xls2eI/zTbRAh/nXArfdT+umTBhGSheU3TueODd/TOAhXUB7wO7O4d8l1f6uVLL9Fxhups28X7FCieEk9WreelM9gBSVb7ulj/MbUDnFRF48+eY5K+JhW5R6B5Gx0h024ZaPo1udD8hpy5ed9eF5AA7kWWPv70uaMNgo= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711715189; c=relaxed/simple; bh=3yrfxxLlXHr1TSNML8zmGI3T0zxyBtPzg2+qP8J15JQ=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=YDLqnQjxdfotqLxuiHS2o01BqrTjDaRX6OL6mdEOdNktNy3++fB2FSEF0RQvhE9yaBkn+JdPWg6sX9pZbDcmAdJFWXIPoUXn1GMojy5URO7CxMVBaCFRUFmJ7I4+zq2DbPwMOZZppuVNNHMpKUigTibZ94nTUsspzKouPaz+Dg4= 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=bleDmb4P; arc=none smtp.client-ip=209.85.208.48 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="bleDmb4P" Received: by mail-ed1-f48.google.com with SMTP id 4fb4d7f45d1cf-56b8e4f38a2so2395894a12.3 for ; Fri, 29 Mar 2024 05:26:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fairphone.com; s=fair; t=1711715184; x=1712319984; 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=hWFp+wGEzzGmw702pw7mP2aroILdba+wI+PTEswgWdE=; b=bleDmb4PpnPFqrGYl0HZ/fQZIzPQyR6qzVWKTthd9C+LDUDNZIZ6GEAWUyUM5BbDQt JxahRF/36ok5I8cfq4KMZsnZbtLmZb0YqTbaycHjJGQxKf/rF8lBbwlMA4sRTJYBYhR8 a6eqSGz89XBRrLo/P/kZKkeaYT1AfRUtGYX7xGbEJPBE5zwWRyE2k1E45dFb0iZp6TYY +6qYpJ67F4p518mEzVUHV3bow9QLRn/vNqA6w0eXgTXGGVhQ0tkNa7Bx7Z6/JvaEgwuA HK+cWtvXVwPMD+hNb2wFqJG88x6dkKX7XAe4X98RKcaY6Q8/h0rwr6KmmDuzbeC8siEI luQQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1711715184; x=1712319984; 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=hWFp+wGEzzGmw702pw7mP2aroILdba+wI+PTEswgWdE=; b=OqZOnNo/ajUz1C3+3HQtUTIURb7ccvJYmshlhNLfjQHm0Xn7EpKtR1zUwfE3TE1+wg Yj67BvDi/UdxekgRpLd4hKXfPWdLIy0yGH+OKfDdYqAdPvcJ+VZfFZcdoW/vM2aOv6Z2 ZWscw14Th7uzVnI37wf21pUNUHYBrsfxPpGMBocMIVXVWffZ00Tiab9QlwCKqcZDS/zB z39+KxOmmP2B5kfKmHkE6Vh5WybHrmBXoXsTFPFhmOrFv6qqDa5uFq1FKiAG0+ZZmqYE RVEiK53Pq31S9UYvBw17HliuYxXAh+wCMoEtehKNKKb6ekEHQaaYWGIfNCCfkn/dTNqV DGgg== X-Forwarded-Encrypted: i=1; AJvYcCXPrV9WesuxfztVb5LgqenL85RoS/UFyRglxfaWaucZ2Y/nUYCPI+7yMgv6LeX8qttb0tsyRrVp+nTvosoI1HZvAZacxptqaKj9KDVtyQ== X-Gm-Message-State: AOJu0Yz5Y2lMS2Rnn0etRdSa6UXdWbYu9VORMofwAh+ejVrVKPJ+knwG P8bybuM3Qzbt4iV9QZ/XqHv6CMoa3uwlL/ZBxBTAJc6zJC20YsJm2NHqYbLRB6I= X-Google-Smtp-Source: AGHT+IEhDdv5aLrLO892IV9pVZwFO9P3DRxkOPPhygvwDIUI0dnZqNXUk7vL3ASQ6HUbB3fASd/JNQ== X-Received: by 2002:a50:9fad:0:b0:568:9cfe:1974 with SMTP id c42-20020a509fad000000b005689cfe1974mr1336606edf.18.1711715184751; Fri, 29 Mar 2024 05:26:24 -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 m7-20020aa7c487000000b0056bf2e2c898sm1961925edq.1.2024.03.29.05.26.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 29 Mar 2024 05:26:23 -0700 (PDT) From: Luca Weiss Date: Fri, 29 Mar 2024 13:26:21 +0100 Subject: [PATCH v2 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: <20240329-fp4-tcpm-v2-3-d7f8cd165355@fairphone.com> References: <20240329-fp4-tcpm-v2-0-d7f8cd165355@fairphone.com> In-Reply-To: <20240329-fp4-tcpm-v2-0-d7f8cd165355@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. Signed-off-by: Luca Weiss Reviewed-by: Konrad Dybcio --- arch/arm64/boot/dts/qcom/sm6350.dtsi | 47 ++++++++++++++++++ arch/arm64/boot/dts/qcom/sm7225-fairphone-fp4.dts | 60 ++++++++++++++++++++++- 2 files changed, 106 insertions(+), 1 deletion(-) diff --git a/arch/arm64/boot/dts/qcom/sm6350.dtsi b/arch/arm64/boot/dts/qcom/sm6350.dtsi index b663c1b18f61..2e135989de8c 100644 --- a/arch/arm64/boot/dts/qcom/sm6350.dtsi +++ b/arch/arm64/boot/dts/qcom/sm6350.dtsi @@ -1717,6 +1717,33 @@ usb_1_qmpphy: phy@88e8000 { #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 { @@ -1892,6 +1919,26 @@ 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"; + + 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..5d7778c48413 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,12 @@ &usb_1 { &usb_1_dwc3 { maximum-speed = "super-speed"; - dr_mode = "peripheral"; + dr_mode = "otg"; + usb-role-switch; +}; + +&usb_1_dwc3_hs_out { + remote-endpoint = <&pm7250b_hs_in>; }; &usb_1_hsphy { @@ -740,10 +793,15 @@ &usb_1_hsphy { &usb_1_qmpphy { vdda-phy-supply = <&vreg_l22a>; vdda-pll-supply = <&vreg_l16a>; + orientation-switch; 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>;