From patchwork Tue Jan 30 19:32:55 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dmitry Baryshkov X-Patchwork-Id: 768123 Received: from mail-lf1-f49.google.com (mail-lf1-f49.google.com [209.85.167.49]) (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 141147B3F2 for ; Tue, 30 Jan 2024 19:33:10 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.167.49 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706643193; cv=none; b=Yjm4sK4bWknIhfPAXFcPLcPmL6iWSh8GE/xiySSHEseNYMdpQ7H8nosFxuwefnOYm8r4hskU98+yILlAg/Py9dcTZRMhlFx5dSAI/b8hndmmj9rzOWxMCuscxbHaas8RrTWlH39wsG41pRAjH1iWPKWAMHZXsm6bwqPFfUz/InE= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706643193; c=relaxed/simple; bh=Ow4yR6ctjY/xEto4RfYBtSJOP3Dtx+46NhV6h4aXJaY=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=dDmZrtp5ch0f5ot68oSn+ssNAJMV6PxckSdvzmQ+UqHU51aGPrw+gDzNr8XRDTOw6sjaG472eT9MhLgTff3Kr1kRN5CchyAmteA3jl0xivoaj0tGMLoHIvIZ0K8SwWcOa4T0B34vzZKxNaoXS1HloijTbB7grjqgHduPRZZpH44= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org; spf=pass smtp.mailfrom=linaro.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b=z8iJydgk; arc=none smtp.client-ip=209.85.167.49 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="z8iJydgk" Received: by mail-lf1-f49.google.com with SMTP id 2adb3069b0e04-5102a877d50so4791751e87.0 for ; Tue, 30 Jan 2024 11:33:10 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1706643189; x=1707247989; 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=PIOls1rDbmjiI7zQY4HMCjRALFzPkzCrHv4ccP/WN1c=; b=z8iJydgkLglk88uMBlTU0xdGXRGaufzl7rkNvnlYLIxQB0WN5wgfPC0TOM1PbVORPe bNnXK0SSLGAFuDAp0kkI3eVqV9n2t/GpJg2w68dPQ+VA/hGM095EY4gVQ3xbqL1D/ftQ +9unQbTlMznu5K8yMFPPil+dZBhH4tGf34wvrUIaRPy0MPS302eSye80WwKvMMTU9Vbv wsAJphObz4YOP+VWi+Bjs+gFR2bu0vUDPP0y7yuPLFdoMU3tSUWz+/I7N2TcvvgZ4U10 NQdVAhYK2Cef/6XRUdbIYs2ayk6AWzbEkrEv+cSSGT7RFrbpCFkEnWFtVg9jfuQo/eUs 81rw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1706643189; x=1707247989; 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=PIOls1rDbmjiI7zQY4HMCjRALFzPkzCrHv4ccP/WN1c=; b=a9fvp5HOeoBBJT76T4UyMoX8S2Ytm9z73G4aPNelKiuDL8c28Lpu6o7p6X0J9HG/8R c0cM5hW+gn2m8CNGEC+kUq4x4GLOc2CjoU6/OmViYDQL47bF52p6YL8lkcvN9juRQSXP LyOqZwS4zC+20iQAOFP3owW0e5yjJSxvdELEVjN+cHAOe9UDg7wpkmH5CXoYtg66JcAk Lk8vXv54BpoCUjcCVoxbPclf9QdvLP58PvrlA+T38P1ltmNNnZKtj/dNpV/kyTT92EmC +Dm07RgjQXLoijryqrxkHAKaHOKRJm5ICoObhKruzKU8J5jgs+nLHPkWlz2urWn4bNXr xw+g== X-Gm-Message-State: AOJu0Yz7jmnhtLQGAlRYKDEbmztste5bcEud1paytqoXd7Ge4z64MSzf p8exgdlE+unkiYoRPJP3Bdyf0mbqdgOcdZ22nDY5D8OoX7FRD27CwEB1zqfLjRc= X-Google-Smtp-Source: AGHT+IG1dEVgfk/rWiEWIJSTmCl2hCeZIAQWlKHhCjW891Qo61yTMMIKfGJhzIMg9E70etfpLY5Acg== X-Received: by 2002:a05:6512:70c:b0:511:1796:aad6 with SMTP id b12-20020a056512070c00b005111796aad6mr2556925lfs.35.1706643189043; Tue, 30 Jan 2024 11:33:09 -0800 (PST) X-Forwarded-Encrypted: i=0; AJvYcCUp+MpkTQXH/5XRhcowQAQh0KJ8oE3k9Ghu3oOyvrS+Nz8DXuSa2BVaeT3a1bDjN2voKHMN2Uw0NyedwxPMBs/1GdDUdJ5fdTkBmSjhr2mZuhKnhifkNKlvAygtS+WM52WdnEmgMShnOygVUUQ8rSBjbGQPIGQnlyaimbHEnYPa1KpqlIi/d7puc7XeGtMF1xko6typsWgeIipLWlPSCiUMRcAgudUuL/9WzMZoUekIUKSIKkurYtDxKNbz3GIt78l1k69xthgKgEQsQucjXMPQ+KNifGdwCS/RScSDzfRqwaIUHsDW60/HxYIm6ICMepf5okjdBwkUlkMwJFLEWjb4odG11TGqoxuCec32PjB3EezKyuDskjQDxR9WgBR2E+UnJUUvjco6spwz1m/I6m5k1nwN3usAbOC8LPGfpHh6E1m1h7OmUVqXlsrG0WTuQs6a3sN0CR+MYl+YwaJkfIXEm986JZIfhX7xdZ8vAL+FccAZtOTwpCvI9Gnw6hpP1UY8VgogFyfMRBDN0205U3uFMrbqb6OsMBGDLDqbsruASmc/2irbbfr/k5cedJ7SkyXeCzlUd8k6mEUnAQSY0xmrIggnma29L/cX8oKWnkfT Received: from umbar.lan ([192.130.178.91]) by smtp.gmail.com with ESMTPSA id u25-20020a05651220d900b0051119371e7csm366525lfr.120.2024.01.30.11.33.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 30 Jan 2024 11:33:08 -0800 (PST) From: Dmitry Baryshkov Date: Tue, 30 Jan 2024 21:32:55 +0200 Subject: [PATCH v3 2/6] dt-bindings: usb: qcom,pmic-typec: add support for the PMI632 block Precedence: bulk X-Mailing-List: linux-arm-msm@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20240130-pmi632-typec-v3-2-b05fe44f0a51@linaro.org> References: <20240130-pmi632-typec-v3-0-b05fe44f0a51@linaro.org> In-Reply-To: <20240130-pmi632-typec-v3-0-b05fe44f0a51@linaro.org> To: Bjorn Andersson , Konrad Dybcio , Liam Girdwood , Mark Brown , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Wesley Cheng , Bryan O'Donoghue , Greg Kroah-Hartman , Guenter Roeck , Heikki Krogerus Cc: linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, linux-usb@vger.kernel.org, Dmitry Baryshkov , Luca Weiss X-Mailer: b4 0.12.4 X-Developer-Signature: v=1; a=openpgp-sha256; l=2243; i=dmitry.baryshkov@linaro.org; h=from:subject:message-id; bh=Ow4yR6ctjY/xEto4RfYBtSJOP3Dtx+46NhV6h4aXJaY=; b=owEBbQGS/pANAwAKAYs8ij4CKSjVAcsmYgBluU7x+nuSup/ei3JgHFWe//JXcCdfSiDNirSRn q+aDe/1t2WJATMEAAEKAB0WIQRMcISVXLJjVvC4lX+LPIo+Aiko1QUCZblO8QAKCRCLPIo+Aiko 1XWvB/9ZFdURtS5La2iK9oZ/lQFWJd8RO05uAdlJR7pwQ4aqPzycVjolDaeEi3KaO7XrlTfOTVX AwPXozCY6oWCspC0L/IKSXNRXzhpQ9mh9TysyILhc0HUjGG8Eumt66FbfPUpCOTSv59zW2suSBO uilHdAS3bbTAmpdafw4jICNUgxx+uEGbJM+OjG3PRYETk48BMNcqFs1L84qDQVne9esW2TcuPKu KuZIRflK7/uIptULJoWKbNgwc+u8m5JQbakQFB6BHAjKqYkP6wGmQoq7ybZYTxA+o5fsMCKmipE yK9EkvbD//3ILqQ/b313jc9Un/o2bppUl1YGhMbFqCbjbjyw X-Developer-Key: i=dmitry.baryshkov@linaro.org; a=openpgp; fpr=8F88381DD5C873E4AE487DA5199BF1243632046A The PMI632 PMIC has the same Type-C register block as the PM8150B. However this PMIC doesn't support USB Power Delivery. As such it doesn't have the second region used by the existing pm8150b bindings. Add if clauses to handle the PMI632 usecase. Tested-by: Luca Weiss # sdm632-fairphone-fp3 Signed-off-by: Dmitry Baryshkov Reviewed-by: Rob Herring --- .../devicetree/bindings/usb/qcom,pmic-typec.yaml | 32 +++++++++++++++++++++- 1 file changed, 31 insertions(+), 1 deletion(-) diff --git a/Documentation/devicetree/bindings/usb/qcom,pmic-typec.yaml b/Documentation/devicetree/bindings/usb/qcom,pmic-typec.yaml index 55df3129a0bc..6c0c6b337693 100644 --- a/Documentation/devicetree/bindings/usb/qcom,pmic-typec.yaml +++ b/Documentation/devicetree/bindings/usb/qcom,pmic-typec.yaml @@ -15,6 +15,7 @@ description: properties: compatible: enum: + - qcom,pmi632-typec - qcom,pm8150b-typec connector: @@ -24,9 +25,11 @@ properties: reg: description: Type-C port and pdphy SPMI register base offsets + minItems: 1 maxItems: 2 interrupts: + minItems: 8 items: - description: Type-C CC attach notification, VBUS error, tCCDebounce done - description: Type-C VCONN powered @@ -46,6 +49,7 @@ properties: - description: Power Domain Fast Role Swap event interrupt-names: + minItems: 8 items: - const: or-rid-detect-change - const: vpd-detect @@ -81,7 +85,33 @@ required: - interrupts - interrupt-names - vdd-vbus-supply - - vdd-pdphy-supply + +allOf: + - if: + properties: + compatible: + contains: + enum: + - qcom,pmi632-typec + then: + properties: + reg: + maxItems: 1 + interrupts: + maxItems: 8 + interrupt-names: + maxItems: 8 + vdd-pdphy-supply: false + else: + properties: + reg: + maxItems: 2 + interrupts: + minItems: 16 + interrupt-names: + maxItems: 16 + required: + - vdd-pdphy-supply additionalProperties: false From patchwork Tue Jan 30 19:32:57 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dmitry Baryshkov X-Patchwork-Id: 768122 Received: from mail-lf1-f52.google.com (mail-lf1-f52.google.com [209.85.167.52]) (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 DFC8369974 for ; Tue, 30 Jan 2024 19:33:12 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.167.52 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706643194; cv=none; b=RDZLiA5CY0fJXcAkFOcZ8y492CYCbiCXqBkrWXPBvmBIUGtCrr+Z4Hs0ciIvqLK8oZR/Ipk+HJo5zcA9FAzVZb2WnIFJdmiSHOsKqwwnPNf2Qef8Om5yWWkN2qsjUiAP50lqdBBnxfY9A0B2XrEc/CPXhwqZDxqvG5RpKiIOVd0= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706643194; c=relaxed/simple; bh=e+7CRtRAacURKucn1FqVR2dXzWBJwCNvoq64fS8ryjQ=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=f+dpxno1R2pTr+Ze8k1aPFq1uxVopXL1Mtl6Q/wZWcN49hx0xQQ4zBBziyrFVx8E6EVwUh6GbCUc6mlVnYOZ3v1nySMpZVqpZTEtPmWl/Su1sb5skGoCH+V2E3ZQH5tL93wQjnZ/rsE93rG36NQIzBTDoaA9+ZJs+XWzntxs8qQ= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org; spf=pass smtp.mailfrom=linaro.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b=c0zHAK5C; arc=none smtp.client-ip=209.85.167.52 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="c0zHAK5C" Received: by mail-lf1-f52.google.com with SMTP id 2adb3069b0e04-5102b00c2cdso3889219e87.3 for ; Tue, 30 Jan 2024 11:33:12 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1706643191; x=1707247991; 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=bAdX4i2NJPZ3tcAGVz1AnNprMjFuZ9CFGYxnwfX0ydY=; b=c0zHAK5CpZLpr4Ue2Oo0HcjiyimktZYNnIVfJ0RuZ8p8K7ICYT4T9PaS6qTYK7j/YN JpbZLXoODcmveuGUh+p1Z/D3oCJPuwjrOxSi83cwPAuTtbNGdFgMHp3oT4nZ6mRq1p16 OosgZgTNPA2n+QAgeJOWsGBtryn5pJVA+KfW8b4L7/lgV1OcrzOzptFnKVkRoZzz3Ejk gyhxUBYCrQtQTQl1tJSC3+mr9S607In3T61emXFc95s5EEd0eSYl4tCMCrxH4p+Mbd0T qOKeVX5Jzjx6zU6GNPILdAZ9M0t4Qzi99nik4ImclEo3g0L800SVm01cxCE/gawvJ/2q Jy/g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1706643191; x=1707247991; 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=bAdX4i2NJPZ3tcAGVz1AnNprMjFuZ9CFGYxnwfX0ydY=; b=U4M9XKz5f5LWllAFOzxBYdZz+wgUUVkY/UK7v4oQGnZO9jr+TMOjlRHFzw57tkaNaD z6QPE/5q+RHya3b5vNkeitdPLK2gPWV4b7G3LT5FwP3lRH3RRGwVW2ECzFJSCU7rbxfj szTIEHRWWvgr5FgoCeezG7SqrWD62CwZhSogEsGmMpfW4peDBpdh+2uUeCrNOug7QS/Q vUkOWN5dXuWEkMxs5P2TblEL+sLpMS2CuIX/dhxMb0xXn6M7oG+IwGGXhixKp6gbcAjv E1qbb1ROtNfKagG4mT7M4QT7ifKWSDjvytkxoKu4vE0TgMjNJdnyaaJ6FhHkNLrhXcbt VNqQ== X-Gm-Message-State: AOJu0Yw2H9/tyAmna15U7nfCrPjXvUu0/C5y421GYuVngHmU7rknOn8w 6NyvIb4+Ll3zAIAqxYKxuClPVpz+D4Nas0t+hlxk4emJgkLXENy1FBCF/iPuilI= X-Google-Smtp-Source: AGHT+IEwGgxN/pxyOI/n9OlFEQY7Ysm28C7yKvfF7B/40/pYneKwnhG1emIXCGae/T+CRL663Qr0PA== X-Received: by 2002:a05:6512:2f1:b0:50e:e66c:4d8 with SMTP id m17-20020a05651202f100b0050ee66c04d8mr6367952lfq.30.1706643190877; Tue, 30 Jan 2024 11:33:10 -0800 (PST) X-Forwarded-Encrypted: i=0; AJvYcCWBgUwJy9yFcg80lFx4LvV45RkyaE5BGSXIIUjCJ1FKqaXg6kLeec28AN0MrjklcUoYqcz7pGSMznWam243z6QzpGYlTI7aawbX93tEmJmJTE7zVqYt3T5coVheY9F4yPXgt9VCGc8f+BU23QnqGREKzgU0uJ7q8yhneit5f67hiY8xESlMGYFrUJw1n+1VNH59ufTnTOIAGK5Rm19aiH2buA2Ucv+jOXNHiuGIo6oPpQTKxKwYQUcNdjc2p8S3RAhoK5nAf/dObnWoSKb26o+JoiwUsACdFZodFGBedFbSr/JDe6dzqsvIOTQRWJ7M7mZF6g1wqQGJdl33lZHyCcMLom+nhHhI6/tKWkSxfva03shqFYgNI+Rl9mBxZ/7oVxZq0+cltXafZr/hCvVZgChj8puGT2rFiEnERt2x7JVXI9XZcD7Rfq40D7BBKPwb5C34DbOwDtPkxp3gLrpqbk36Rp4mV29Z/oL2jgPxxKutE+7lYwnNkfZi5fb+dawWlAReNql57SQccehMVjMrRcSTUBQsGcYBgC4LcmJIrjCfehuTkA7Wsxy12YfdKs9lUT8BJb2LfgqVJ1axdPkmHFnHXrkuCGXoRI1pGnOU5yIZ Received: from umbar.lan ([192.130.178.91]) by smtp.gmail.com with ESMTPSA id u25-20020a05651220d900b0051119371e7csm366525lfr.120.2024.01.30.11.33.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 30 Jan 2024 11:33:10 -0800 (PST) From: Dmitry Baryshkov Date: Tue, 30 Jan 2024 21:32:57 +0200 Subject: [PATCH v3 4/6] arm64: dts: qcom: pmi632: define USB-C related blocks Precedence: bulk X-Mailing-List: linux-arm-msm@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20240130-pmi632-typec-v3-4-b05fe44f0a51@linaro.org> References: <20240130-pmi632-typec-v3-0-b05fe44f0a51@linaro.org> In-Reply-To: <20240130-pmi632-typec-v3-0-b05fe44f0a51@linaro.org> To: Bjorn Andersson , Konrad Dybcio , Liam Girdwood , Mark Brown , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Wesley Cheng , Bryan O'Donoghue , Greg Kroah-Hartman , Guenter Roeck , Heikki Krogerus Cc: linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, linux-usb@vger.kernel.org, Dmitry Baryshkov , Luca Weiss X-Mailer: b4 0.12.4 X-Developer-Signature: v=1; a=openpgp-sha256; l=1837; i=dmitry.baryshkov@linaro.org; h=from:subject:message-id; bh=e+7CRtRAacURKucn1FqVR2dXzWBJwCNvoq64fS8ryjQ=; b=owEBbQGS/pANAwAKAYs8ij4CKSjVAcsmYgBluU7yfPGjEMS4G+a6+qLxZMu7xaY/rudE7cDJm ff2GojBB/CJATMEAAEKAB0WIQRMcISVXLJjVvC4lX+LPIo+Aiko1QUCZblO8gAKCRCLPIo+Aiko 1Wn0B/49odzSXpl4G+EnhuhaCBuZUo6qELnB3FM3676nG1iFdHcrF5Qe2xaTOvk5vK/rYzndN45 4O1UFJI1OHezf9N8sASSr0xaNt6Cb8KrJMWEnQvsuHcQ9EJMXugjPbppVti4uWMnqjtSeUinELS kdGslOgfg2R/WZUQjLUGWSWN7fuOhoepbaEYZ0xTda1j33/KsmGZP+OXSVcxgT1g+dROBRGJw4g QA6CZenzB06Es1OB0YUzhC3NklsnG0EoIyynEvMVqI9qdOI6carYy/Z+xWNZcU6RLh4Ij4UazVv 6N0Wf9r9zbqmjK6EeuLcJa50YyakepPJ+sIyOtULoKwdyCOz X-Developer-Key: i=dmitry.baryshkov@linaro.org; a=openpgp; fpr=8F88381DD5C873E4AE487DA5199BF1243632046A Define VBUS regulator and the Type-C handling block as present on the Quacomm PMI632 PMIC. Reviewed-by: Bryan O'Donoghue Reviewed-by: Konrad Dybcio Tested-by: Luca Weiss # sdm632-fairphone-fp3 Signed-off-by: Dmitry Baryshkov --- arch/arm64/boot/dts/qcom/pmi632.dtsi | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/arch/arm64/boot/dts/qcom/pmi632.dtsi b/arch/arm64/boot/dts/qcom/pmi632.dtsi index 4eb79e0ce40a..d6832f0b7b80 100644 --- a/arch/arm64/boot/dts/qcom/pmi632.dtsi +++ b/arch/arm64/boot/dts/qcom/pmi632.dtsi @@ -45,6 +45,36 @@ pmic@2 { #address-cells = <1>; #size-cells = <0>; + pmi632_vbus: usb-vbus-regulator@1100 { + compatible = "qcom,pmi632-vbus-reg", "qcom,pm8150b-vbus-reg"; + reg = <0x1100>; + status = "disabled"; + }; + + pmi632_typec: typec@1500 { + compatible = "qcom,pmi632-typec"; + reg = <0x1500>; + interrupts = <0x2 0x15 0x00 IRQ_TYPE_EDGE_RISING>, + <0x2 0x15 0x01 IRQ_TYPE_EDGE_BOTH>, + <0x2 0x15 0x02 IRQ_TYPE_EDGE_RISING>, + <0x2 0x15 0x03 IRQ_TYPE_EDGE_BOTH>, + <0x2 0x15 0x04 IRQ_TYPE_EDGE_RISING>, + <0x2 0x15 0x05 IRQ_TYPE_EDGE_RISING>, + <0x2 0x15 0x06 IRQ_TYPE_EDGE_BOTH>, + <0x2 0x15 0x07 IRQ_TYPE_EDGE_RISING>; + interrupt-names = "or-rid-detect-change", + "vpd-detect", + "cc-state-change", + "vconn-oc", + "vbus-change", + "attach-detach", + "legacy-cable-detect", + "try-snk-src-detect"; + vdd-vbus-supply = <&pmi632_vbus>; + + status = "disabled"; + }; + pmi632_temp: temp-alarm@2400 { compatible = "qcom,spmi-temp-alarm"; reg = <0x2400>; From patchwork Tue Jan 30 19:32:59 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dmitry Baryshkov X-Patchwork-Id: 768121 Received: from mail-lf1-f44.google.com (mail-lf1-f44.google.com [209.85.167.44]) (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 9B14671B52 for ; Tue, 30 Jan 2024 19:33:14 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.167.44 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706643198; cv=none; b=DBAb7AqQobNsEXVwyFq2HgrF42+Kmw63NiIKMcI9F3P2BQqV3PViKpvAzNo3vyf9CJ5DHo/G77I7Lq2ITwzvkX/P6+0gUI+DK3iOrojBVnbfDLgktYAfptBsYxfLKgUPgGgR5edZRaXxSyI6MNdyqwOZx7BpdSdYdF2Sf2A6tOU= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706643198; c=relaxed/simple; bh=YbJxbniUvZ2znwhQdVnnHP7RPDLL9PQ/9YgOwMvOdms=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=mDySL7qUAwgcEhhwVL3xOAfq4DoYWMU8EsmJmkB0WKjtl1NTB8yfVOVYV+9tRoX8A4nbSDer22u/Ux9honuqAnnXATJUPdGJOe7QtwtuyArPHw6Rniry8IHiS2s/SfbQvo3S+Q2M6nXSVvfOcqYlur2/K7sXdJdAKnBP1wvgs50= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org; spf=pass smtp.mailfrom=linaro.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b=aTsBM1HJ; arc=none smtp.client-ip=209.85.167.44 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="aTsBM1HJ" Received: by mail-lf1-f44.google.com with SMTP id 2adb3069b0e04-5111e5e4e2bso1221877e87.3 for ; Tue, 30 Jan 2024 11:33:14 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1706643192; x=1707247992; 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=npFpjUqBQIf0VOW9142O+6ls59GJzjW57cq62091hkw=; b=aTsBM1HJ3ybzyso8rlkcyXleQFLxqQcFB8kZ/2U6B5U7b1HcgilWo6HMT/aQK3T3Kw HSAjJQ3vEOMeMQhVR7119d0HmGmLFzeFXXcpKcs4SjRZfuEbYOS9dRssVPXBtiq1DJib eF194UoAt3IXOO3Byz9mCE/QxGSG63+iViWpcE8wrgtqkoJ2u3HY19NwZKrasTrH/GKQ CfMZOPcCxe6CsPiJr/Z6JKngtG+nX4qdHY6jl5nzN03+siq1n68GTm96Y8gMrQ2DcEbu 3MpS3cYCQ0ovxksJDdou7wG3rBgRbdJCvX7CL6F7FYYDC9i9yFlimE5PJ+6tjh10kwoI 7qDA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1706643192; x=1707247992; 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=npFpjUqBQIf0VOW9142O+6ls59GJzjW57cq62091hkw=; b=jw/zpA17MP5kgyy173stBfrL1rsaNBCaOntvdspRmjnZYsHKEIQlc+BKYgcGzzpttc 0X1A5xh+Wct+suFoe7iogZZk48V9P9+mLaL1pKOHiExYYhwxhzrtIUqndIBgNNz8ZNdc 41siTXnUSIbeE9+9VF6iEyrDgIuRCY1a1sozVIp+zuNexwTY9bv+XoDXOXDrBTRQQONX eNrkb3rpiiZVeZObgNjU5f8ttOfrSg246jJtNcoGeeop3HonQMEJp92vI+gdgr/G412u Tnk1aFJhiNpUeOzDV1Wcx3MueFrCv8iX2WPLxV6+/d6sKooycFqcjjzJ06wahUFoaOiy JAlg== X-Gm-Message-State: AOJu0YzN8FOwfdNAMrjdt0bAEKOvGwnHnTHt0fF+itCNaSGNyVAfsaTr AeV3bX+Lgyh+vSqPogJyKAaYgUwWaZMMWyj6p+IdOAU9SIe6Z4zzGakhT39oA9yVv+FQ6olUgXR E X-Google-Smtp-Source: AGHT+IHUP1ABqsZ6nXpGibVLqqJMZsucIp6CxCj/NrOOIjsjUMw8sINviWHWc7EiFPsQVq1flA5Tiw== X-Received: by 2002:a05:6512:2247:b0:511:b42:1711 with SMTP id i7-20020a056512224700b005110b421711mr6489732lfu.29.1706643192636; Tue, 30 Jan 2024 11:33:12 -0800 (PST) X-Forwarded-Encrypted: i=0; AJvYcCUSqZ4Pp0+rGe3h1XuVfHnXuz9flYBJ2RgG3iZrkS3SGbmR2kP5hwwv5auDro9ELAr58+GqR8q9IvHXUNU8w6FLCAN6IkF4+ynfEGH6yXOqBn42iedWu23M9CXa3KUCOpCMhJCk5mdkSmc7d9EPKkjl56mN3iltZ6MQQ9x1xTZXXVZ4pPfBInOTL7FxVM4rgDuXsJqqDImWxONCLDTk6bUx86tZNIvqtjcQJyU7PtK8zc+yK5EVfvitbMnBSgOPwuekE6yUAf5b/TrKODytSlkhyJjwaL14epagecv5tDe9/VceOR//OZlAVEWOs4sPWJ6rd1bG4uO9hUn02DYsuL2h/NG6dIvZcNv24n9eTYNaDde6P6dfCNha63ISVCuBOu96sYyMk0ZkeCIVk6W/SrottyDH9/clGTRWOUEgeU66aQd7bnclaQXae9hmmzIg4oh4fAdfzcHj55jSycxdIEcyo6UxM9tCPuUg4A3l9YsWfZrEWL+J+ia8Dn+CbqvUMH+hb2VjIGx846iyVgtWwVwpy+gZKsWfes+VHILxzYN4qEMslinLh7VmQQ9Q7EDRUiKUWZkGSAyuZXSlj90BKmpb9dIDDQOZ4+35J3i4qPqt Received: from umbar.lan ([192.130.178.91]) by smtp.gmail.com with ESMTPSA id u25-20020a05651220d900b0051119371e7csm366525lfr.120.2024.01.30.11.33.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 30 Jan 2024 11:33:12 -0800 (PST) From: Dmitry Baryshkov Date: Tue, 30 Jan 2024 21:32:59 +0200 Subject: [PATCH v3 6/6] arm64: dts: qcom: qrb4210-rb2: enable USB-C port handling Precedence: bulk X-Mailing-List: linux-arm-msm@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20240130-pmi632-typec-v3-6-b05fe44f0a51@linaro.org> References: <20240130-pmi632-typec-v3-0-b05fe44f0a51@linaro.org> In-Reply-To: <20240130-pmi632-typec-v3-0-b05fe44f0a51@linaro.org> To: Bjorn Andersson , Konrad Dybcio , Liam Girdwood , Mark Brown , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Wesley Cheng , Bryan O'Donoghue , Greg Kroah-Hartman , Guenter Roeck , Heikki Krogerus Cc: linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, linux-usb@vger.kernel.org, Dmitry Baryshkov , Luca Weiss X-Mailer: b4 0.12.4 X-Developer-Signature: v=1; a=openpgp-sha256; l=3453; i=dmitry.baryshkov@linaro.org; h=from:subject:message-id; bh=YbJxbniUvZ2znwhQdVnnHP7RPDLL9PQ/9YgOwMvOdms=; b=owEBbQGS/pANAwAKAYs8ij4CKSjVAcsmYgBluU7ys02dGfoXOH6zWBHf56+8dD3I7yrm5IOYp noffzriEvGJATMEAAEKAB0WIQRMcISVXLJjVvC4lX+LPIo+Aiko1QUCZblO8gAKCRCLPIo+Aiko 1ZscB/0TM6+7mWmBslzwMev5SmlCLwN6InfSSgJL5GL4i4T/3fc5AP1OYV+bD0lbPQ62rujoGtu 0Pcerd1WXTQpWLNXf0K090n7jxCUj0Bk7vqOz3tmq6DzJgT7tGXHqH05e6DFWNd3NzKoNhqQCM7 uPYleNhS83xRJPony2dycfRa6X6ZVp1MZ/QwtyYPqIBq2sU1ddlbswQ2Zgz053TDgtvxtbW0M8Z WxvPsTxfGXFdvNBIaTIbt6CzULWhulfu6SD5AKaTpmwrJiMZKUDU4itzmHHx2IMELHPgxSH8QTl +rwdyTUfQAi/U1/YLyMM44p6iyuXcrX9RpiOYBt0UoH7+lXu X-Developer-Key: i=dmitry.baryshkov@linaro.org; a=openpgp; fpr=8F88381DD5C873E4AE487DA5199BF1243632046A Plug in USB-C related bits and pieces to enable USB role switching and USB-C orientation handling for the Qualcomm RB2 board. Tested-by: Luca Weiss # sdm632-fairphone-fp3 Signed-off-by: Dmitry Baryshkov Reviewed-by: Konrad Dybcio --- arch/arm64/boot/dts/qcom/qrb4210-rb2.dts | 50 ++++++++++++++++++++++++++++++++ arch/arm64/boot/dts/qcom/sm6115.dtsi | 43 +++++++++++++++++++++++++++ 2 files changed, 93 insertions(+) diff --git a/arch/arm64/boot/dts/qcom/qrb4210-rb2.dts b/arch/arm64/boot/dts/qcom/qrb4210-rb2.dts index 52f31f3166c2..696d6d43c56b 100644 --- a/arch/arm64/boot/dts/qcom/qrb4210-rb2.dts +++ b/arch/arm64/boot/dts/qcom/qrb4210-rb2.dts @@ -6,8 +6,10 @@ /dts-v1/; #include +#include #include "sm4250.dtsi" #include "pm6125.dtsi" +#include "pmi632.dtsi" / { model = "Qualcomm Technologies, Inc. QRB4210 RB2"; @@ -256,6 +258,46 @@ kypd_vol_up_n: kypd-vol-up-n-state { }; }; +&pmi632_typec { + status = "okay"; + + connector { + compatible = "usb-c-connector"; + + power-role = "dual"; + data-role = "dual"; + self-powered; + + typec-power-opmode = "default"; + pd-disable; + + ports { + #address-cells = <1>; + #size-cells = <0>; + + port@0 { + reg = <0>; + pmi632_hs_in: endpoint { + remote-endpoint = <&usb_dwc3_hs>; + }; + }; + + port@1 { + reg = <1>; + pmi632_ss_in: endpoint { + remote-endpoint = <&usb_qmpphy_out>; + }; + }; + }; + }; +}; + +&pmi632_vbus { + regulator-min-microamp = <500000>; + regulator-max-microamp = <3000000>; + status = "okay"; +}; + &pon_pwrkey { status = "okay"; }; @@ -607,6 +649,10 @@ &usb { status = "okay"; }; +&usb_dwc3_hs { + remote-endpoint = <&pmi632_hs_in>; +}; + &usb_hsphy { vdd-supply = <&vreg_l4a_0p9>; vdda-pll-supply = <&vreg_l12a_1p8>; @@ -622,6 +668,10 @@ &usb_qmpphy { status = "okay"; }; +&usb_qmpphy_out { + remote-endpoint = <&pmi632_ss_in>; +}; + &wifi { vdd-0.8-cx-mx-supply = <&vreg_l8a_0p664>; vdd-1.8-xo-supply = <&vreg_l16a_1p3>; diff --git a/arch/arm64/boot/dts/qcom/sm6115.dtsi b/arch/arm64/boot/dts/qcom/sm6115.dtsi index e151b874eaf3..dd3d97ef5cc7 100644 --- a/arch/arm64/boot/dts/qcom/sm6115.dtsi +++ b/arch/arm64/boot/dts/qcom/sm6115.dtsi @@ -879,8 +879,29 @@ usb_qmpphy: phy@1615000 { clock-output-names = "usb3_phy_pipe_clk_src"; #phy-cells = <0>; + orientation-switch; status = "disabled"; + + ports { + #address-cells = <1>; + #size-cells = <0>; + + port@0 { + reg = <0>; + + usb_qmpphy_out: endpoint { + }; + }; + + port@1 { + reg = <1>; + + usb_qmpphy_usb_ss_in: endpoint { + remote-endpoint = <&usb_dwc3_ss>; + }; + }; + }; }; system_noc: interconnect@1880000 { @@ -1620,6 +1641,28 @@ usb_dwc3: usb@4e00000 { snps,has-lpm-erratum; snps,hird-threshold = /bits/ 8 <0x10>; snps,usb3_lpm_capable; + + usb-role-switch; + + ports { + #address-cells = <1>; + #size-cells = <0>; + + port@0 { + reg = <0>; + + usb_dwc3_hs: endpoint { + }; + }; + + port@1 { + reg = <1>; + + usb_dwc3_ss: endpoint { + remote-endpoint = <&usb_qmpphy_usb_ss_in>; + }; + }; + }; }; };