From patchwork Mon Mar 4 09:26:10 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dmitry Baryshkov X-Patchwork-Id: 13580297 Received: from mail-lj1-f173.google.com (mail-lj1-f173.google.com [209.85.208.173]) (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 AD35C376F9 for ; Mon, 4 Mar 2024 09:26:21 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.208.173 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709544383; cv=none; b=YuVHITAVLAwmXPAulcosXn3uCWv4jDEaZKzps/0yazCLXEo5ggl4pu4zUoc/jdLa5jpZEbVMs1TXJigBCAfLe0bTnKbiuQNOFhI7QhG+jQIouFo3i0pil/64mlXHM2mZr3O2JljRdE42IPDR/oY1u7E1Q3OijlR5MdKSyKBqp6A= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709544383; c=relaxed/simple; bh=BLdwy43z/rG1Rfpc+lH91NU7tpMZxCQtKA1bbNGBffA=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=mqhFYGUSzJ1WNNpfmo4yrc4CIBhorS0F8OWDYHXvZTxLGJ7IvLupKmo5Xng67cth9jkmWtWmjkmVW0QFZu3svFqfd3dYTZaPwf3P4DVH2rDn4tS1mlTlbg5GMO34knuGXYWEXNR5+V/PmFnKzFDSpCULVyaFbiCX2MD1afBYkGI= 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=sccp+cUZ; arc=none smtp.client-ip=209.85.208.173 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="sccp+cUZ" Received: by mail-lj1-f173.google.com with SMTP id 38308e7fff4ca-2d208be133bso55589111fa.2 for ; Mon, 04 Mar 2024 01:26:21 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1709544380; x=1710149180; 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=a1EHXJV66KU5I2HyAJg6Z5WojMOe0j/B2mp0hbceKc4=; b=sccp+cUZgRsSC+uwDV+w3YNhROGf/zJhtP6a0gNu/uqqPGd7b5s+91r1RRCoSedZHm Haj9Mn6LSoYgmBknkOn1tNdKVGL7qYkoehi1BEQonHVx+Brr/E+b8tMonj5Mefzq/D4J hB5ixmCfZv46+/kUYSYkS5M+cHDFBU8XpeGrs81qgUQyxAtZmeM/MM6MiQbj3ekWfOfa QuJJRKBGGoMuR5OWVA43rcWCIa/4fxNfNY67ztLCvucsJlRfDSHrZxXSSY6xdAOLTqoX xVmCqwG3zHocj8lQMAEBEOVMLZavOk5Ic8KrIX3/qXpHwfl8BfwCKFktyy2SckL2ojl3 gOWQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1709544380; x=1710149180; 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=a1EHXJV66KU5I2HyAJg6Z5WojMOe0j/B2mp0hbceKc4=; b=n8Hetq0WhpkbydgxkTlRNt6ZCtjguy3+69GBZlXPth7JRXBuYLR1h6akriYGhbCTVr t7cTZEuNu3GgIoALy5k8XXtCAbpInu5hJLP35wMH9u6cvC/I/c4/wyOVZk80CReJYuTZ rSiYEds5+ao+d6/K53p/Iduxc4C0rRlRuSGV7RtWWuypFFp8REMdAcn7huq/xsg4+cHP OzFr6P9xN09kS4M2ZyVVhLofYD9Y3mI0f0Gm9zjWln6NBy4u2cQnjtfJVlO7bzGqUGDO W7L8k9v4rkTcN9uhjXIRz0EWwA9nKwXhb90xBjhspakZVC/jFhjOFiTdUUYCRUrC5LPk mEGA== X-Forwarded-Encrypted: i=1; AJvYcCVbBh4+ZoNSKiwgJQtZjKIAE2kjB+UWHmewYP2gNauZL2/GI3TMPQXxjLMZkkNLUL7khO9cdAcf+s1UNa8A5AGB5TYp+5VPhC8K X-Gm-Message-State: AOJu0Yy57wKhZhxMW5rPkH0VfH9HMbDFfVt/bK5FejGupOlqw8MocfHE 5dDF8A8Imamtz1ysz5gMf8uveeuFFpl6Z5EfuJ8uezOLlYnvSqruFRjxk3r8ywo= X-Google-Smtp-Source: AGHT+IFHo1dlHA0Un/Y5N7elzZmKF2DShDHbXQsK0ewHvAmNi2oM9Exs3hmHfZiYnClTEB82LBLgxQ== X-Received: by 2002:a05:651c:2124:b0:2d3:b502:3ff1 with SMTP id a36-20020a05651c212400b002d3b5023ff1mr2147615ljq.11.1709544379963; Mon, 04 Mar 2024 01:26:19 -0800 (PST) Received: from umbar.lan (dzyjmhybhls-s--zn36gy-3.rev.dnainternet.fi. [2001:14ba:a00e:a300:264b:feff:fe8b:be8a]) by smtp.gmail.com with ESMTPSA id r4-20020a2e9944000000b002d2a4431fc4sm1651146ljj.119.2024.03.04.01.26.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 04 Mar 2024 01:26:19 -0800 (PST) From: Dmitry Baryshkov Date: Mon, 04 Mar 2024 11:26:10 +0200 Subject: [PATCH v4 1/2] dt-bindings: usb: qcom,pmic-typec: add support for the PM4125 block Precedence: bulk X-Mailing-List: linux-usb@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20240304-pm4125-typec-v4-1-f3601a16f9ea@linaro.org> References: <20240304-pm4125-typec-v4-0-f3601a16f9ea@linaro.org> In-Reply-To: <20240304-pm4125-typec-v4-0-f3601a16f9ea@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 Cc: linux-arm-msm@vger.kernel.org, devicetree@vger.kernel.org, linux-usb@vger.kernel.org, Dmitry Baryshkov , Krzysztof Kozlowski X-Mailer: b4 0.13.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1052; i=dmitry.baryshkov@linaro.org; h=from:subject:message-id; bh=BLdwy43z/rG1Rfpc+lH91NU7tpMZxCQtKA1bbNGBffA=; b=owEBbQGS/pANAwAKAYs8ij4CKSjVAcsmYgBl5ZO6Nmr/dG9oq0HlsK1EjB3Po7iJeHU/LCLBI po6GchmI/aJATMEAAEKAB0WIQRMcISVXLJjVvC4lX+LPIo+Aiko1QUCZeWTugAKCRCLPIo+Aiko 1evyB/0QA+GgU8s2dhcfA5EDxnvzY/gMO5ZwB0ybL171QRpFQV+Nlw3KxQgK5nBYxQ6S7q2sztk Usq00lgSKxqZP5f4vUql5T3c0Ll0LCVWnDsRBiiXY+3Np7IAZGcpK+pEoAaX1Z3zwSB3icpMQO2 cIVduE5jvS/Q9PrTAY55OIbOqJvQ6tY+lpxIlFDsZqqJG5z1/NgtLbpb6UL/G2yG5xAKQiJJ2LD UK/NmDpJF/o8RzHI6CaKXlflCWH/5LdSxKozCd2oKnknjTR9L4+cQSHSs940D3NqNyKJAow80Zj m27csqXaFkYECa7LaBF+upfyeFAdtt509xrTvFrZUP/w8KLt X-Developer-Key: i=dmitry.baryshkov@linaro.org; a=openpgp; fpr=8F88381DD5C873E4AE487DA5199BF1243632046A The PM4125 PMIC has the same Type-C register block as the PMI632. Likewise it doesn't support USB Power Delivery. Define the compatible for the TypeC block found on PM4125, using PMI632 as a compatible. Reviewed-by: Krzysztof Kozlowski Signed-off-by: Dmitry Baryshkov --- Documentation/devicetree/bindings/usb/qcom,pmic-typec.yaml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Documentation/devicetree/bindings/usb/qcom,pmic-typec.yaml b/Documentation/devicetree/bindings/usb/qcom,pmic-typec.yaml index 976d1732137b..d9694570c419 100644 --- a/Documentation/devicetree/bindings/usb/qcom,pmic-typec.yaml +++ b/Documentation/devicetree/bindings/usb/qcom,pmic-typec.yaml @@ -22,6 +22,11 @@ properties: - enum: - qcom,pm6150-typec - const: qcom,pm8150b-typec + - items: + - enum: + - qcom,pm4125-typec + - const: qcom,pmi632-typec + connector: type: object From patchwork Mon Mar 4 09:26:11 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dmitry Baryshkov X-Patchwork-Id: 13580298 Received: from mail-lj1-f169.google.com (mail-lj1-f169.google.com [209.85.208.169]) (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 6D190376F8 for ; Mon, 4 Mar 2024 09:26:22 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.208.169 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709544385; cv=none; b=onWITPY11e2zrBLunlusqnNwJ8uqNK/EBltVenoCp0gOiSpfzBftg7FizF95xaPY1oYPuIV7+rZ0FcrfS8bsWcptct9oT3aS7nYUoicB3S55nddKeH3UYjduUcyBZPZ7UNGS1nVWP+vSZSqDclYQXUjwIdI+nbBkSn3Gm0LffT4= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709544385; c=relaxed/simple; bh=AeFQeV88ZRaoI5+oi21Zl174Y0LNQdQHWgjrk5kLjUQ=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=RQejYa4DMQXnM+MiH5EexECxyXLz0N8lqgC/9vW0oDN80n3rTHg5CU1cRlJPrIzXosFKMhnIQaMfuywBuYO/ER8co7mdauU+IIx3daUM9rS3aZVHO/0qL1ME2UIuCJUcj+P+Yd9q24fx29LbNMeqoI6lFOufOHyuJ6KfanCNfr8= 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=jLfA7UNs; arc=none smtp.client-ip=209.85.208.169 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="jLfA7UNs" Received: by mail-lj1-f169.google.com with SMTP id 38308e7fff4ca-2d228a132acso54965611fa.0 for ; Mon, 04 Mar 2024 01:26:22 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1709544381; x=1710149181; 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=ZpuuV28YyYnISt2K5ObSrV0aZBgPNxOMDlX9h4xVaEQ=; b=jLfA7UNs6JzcVjhHiY2x3D76iFqCivb+AP1lK6HP6fS7b8kGTEL2yw9KTPg30X9Mt5 R/pOO3+NDKDTGcWunT6USLXk5zqEl2TTbg/93w4Lt3/Ud6XOyh+MjP1kzqQLy1N4F+8i DBZM2eVC5sFEI9tSUpANjt7IgTBETNzzOIz5L5B1pFv/HgJJfMeTnd18vpqEC2173KQe EunubrVJtONnhAdNwAvX1+k7el6E4DIkUee5o6YkF/YdqrcjfMGcK062xcapzh8dlRgk V81AaZfNJmVbel6cRYU5C5Dkd6Qtjrm4gppNs/reejFi5Ep0pnm28y6w2/czwSfihTYg 2l7Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1709544381; x=1710149181; 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=ZpuuV28YyYnISt2K5ObSrV0aZBgPNxOMDlX9h4xVaEQ=; b=FHtNE3kZs52xSgtyHvQu05Vk752w78COAMjcO3F+qhLavg8dShfHodGgeVo3mburpE s3O1+w02IHPUVrwzHB4z9tndAkAV8swZaNENwy/D7WGsRmDoNPMlJkU5ULwd7M8JyhwC GMOrE9vn3d81CSkYe9IZ4v6AB/ABRb9WSwEo7NDPhBenkLJapLiBfn5mU816tzzJF3IC NBCSkSLkqMBTH8rh9OWu9ri5WQhimGHqtM9S6k6WspShklc3AjM91QfNprjvHqnTR9Mh 7zX0ZTh/anbKxUDlKqsE3F9xtGgRBbcGPxmJkcX0MxOKNuTW2woZmIcqrkkqI4pDYNYv CzTg== X-Forwarded-Encrypted: i=1; AJvYcCVVn1yKk+ELDRQ8s4sqK8XNCrEodc1K4vN1OhhGMm1VVIUaSIJNrTd/+JY3yIoslGSK4S/WQPc+vZfidwCuEFY/gDWROs/BsV8/ X-Gm-Message-State: AOJu0YxHIKKjXwoQvvVZRW5/QledI9EdL14jjE2SexX0Qm37XYiFtG6r /fJSOawNVnlSs8N4kKTovId44HBfFqQdcuHsTHmKJmo0CJ73y+GHsTJv0XHokmg= X-Google-Smtp-Source: AGHT+IHjnCEVdQxm5mCAb7PdOuCZCRuJzjyG4toVk44berGu1MWxHAYXsYFbVzrpAbiWlI2iqk+Thw== X-Received: by 2002:a2e:8ecc:0:b0:2d2:42ff:483c with SMTP id e12-20020a2e8ecc000000b002d242ff483cmr6004977ljl.33.1709544380686; Mon, 04 Mar 2024 01:26:20 -0800 (PST) Received: from umbar.lan (dzyjmhybhls-s--zn36gy-3.rev.dnainternet.fi. [2001:14ba:a00e:a300:264b:feff:fe8b:be8a]) by smtp.gmail.com with ESMTPSA id r4-20020a2e9944000000b002d2a4431fc4sm1651146ljj.119.2024.03.04.01.26.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 04 Mar 2024 01:26:20 -0800 (PST) From: Dmitry Baryshkov Date: Mon, 04 Mar 2024 11:26:11 +0200 Subject: [PATCH v4 2/2] arm64: dts: qcom: qrb2210-rb1: enable USB-C port handling Precedence: bulk X-Mailing-List: linux-usb@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20240304-pm4125-typec-v4-2-f3601a16f9ea@linaro.org> References: <20240304-pm4125-typec-v4-0-f3601a16f9ea@linaro.org> In-Reply-To: <20240304-pm4125-typec-v4-0-f3601a16f9ea@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 Cc: linux-arm-msm@vger.kernel.org, devicetree@vger.kernel.org, linux-usb@vger.kernel.org, Dmitry Baryshkov X-Mailer: b4 0.13.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=3474; i=dmitry.baryshkov@linaro.org; h=from:subject:message-id; bh=AeFQeV88ZRaoI5+oi21Zl174Y0LNQdQHWgjrk5kLjUQ=; b=owEBbQGS/pANAwAKAYs8ij4CKSjVAcsmYgBl5ZO6h5R6Zr0RQFjwJjzDDln+TsMOAIOIOunzI dPi+SYyQIyJATMEAAEKAB0WIQRMcISVXLJjVvC4lX+LPIo+Aiko1QUCZeWTugAKCRCLPIo+Aiko 1Qc9B/9p99jj0jQEu2ZrXMGSZ9qhLQVBF8dSgh7FUJIJ8xG8sdoJzLP95GV2YCWbC4EUxl8QsUf j8kRAGyE+Elkwb7yFZ4IQg+DWh+8hkxDbfCJE0/l6ktAthSNK/8dQNmjcR/z4TnAu9rYU/96pII 3cTQA2O/vOklUlF2hu6DLaTmjrZHVeNQiatc5h7CDnFtAtYo4mvAKCiw8wG522uyfC63gw59TU3 F++u7lY7KRwZ/2RlM563sSk9/ZymAl+f+dgrcsFBxXbWEQLtZPpeITjk8j2rV7b9ku6ukQzBduT P2QUWGtLpDKLOVqm+533haBcalrE05mwVdKawiRFL9EwZnfd 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 RB1 board. Reviewed-by: Konrad Dybcio Reviewed-by: Bryan O'Donoghue Signed-off-by: Dmitry Baryshkov --- arch/arm64/boot/dts/qcom/qcm2290.dtsi | 42 ++++++++++++++++++++++ arch/arm64/boot/dts/qcom/qrb2210-rb1.dts | 60 +++++++++++++++++++++++++++----- 2 files changed, 94 insertions(+), 8 deletions(-) diff --git a/arch/arm64/boot/dts/qcom/qcm2290.dtsi b/arch/arm64/boot/dts/qcom/qcm2290.dtsi index 89beac833d43..967bc98d02dd 100644 --- a/arch/arm64/boot/dts/qcom/qcm2290.dtsi +++ b/arch/arm64/boot/dts/qcom/qcm2290.dtsi @@ -694,10 +694,31 @@ usb_qmpphy: phy@1615000 { clock-output-names = "usb3_phy_pipe_clk_src"; #phy-cells = <0>; + orientation-switch; qcom,tcsr-reg = <&tcsr_regs 0xb244>; 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 { @@ -1380,6 +1401,27 @@ usb_dwc3: usb@4e00000 { snps,usb3_lpm_capable; maximum-speed = "super-speed"; dr_mode = "otg"; + 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>; + }; + }; + }; }; }; diff --git a/arch/arm64/boot/dts/qcom/qrb2210-rb1.dts b/arch/arm64/boot/dts/qcom/qrb2210-rb1.dts index 6e9dd0312adc..fca341300521 100644 --- a/arch/arm64/boot/dts/qcom/qrb2210-rb1.dts +++ b/arch/arm64/boot/dts/qcom/qrb2210-rb1.dts @@ -262,6 +262,46 @@ &pm4125_resin { status = "okay"; }; +&pm4125_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>; + pm4125_hs_in: endpoint { + remote-endpoint = <&usb_dwc3_hs>; + }; + }; + + port@1 { + reg = <1>; + pm4125_ss_in: endpoint { + remote-endpoint = <&usb_qmpphy_out>; + }; + }; + }; + }; +}; + +&pm4125_vbus { + regulator-min-microamp = <500000>; + regulator-max-microamp = <500000>; + status = "okay"; +}; + &qupv3_id_0 { status = "okay"; }; @@ -535,14 +575,8 @@ &usb { status = "okay"; }; -&usb_qmpphy { - vdda-phy-supply = <&pm4125_l12>; - vdda-pll-supply = <&pm4125_l13>; - status = "okay"; -}; - -&usb_dwc3 { - dr_mode = "host"; +&usb_dwc3_hs { + remote-endpoint = <&pm4125_hs_in>; }; &usb_hsphy { @@ -552,6 +586,16 @@ &usb_hsphy { status = "okay"; }; +&usb_qmpphy { + vdda-phy-supply = <&pm4125_l12>; + vdda-pll-supply = <&pm4125_l13>; + status = "okay"; +}; + +&usb_qmpphy_out { + remote-endpoint = <&pm4125_ss_in>; +}; + &wifi { vdd-0.8-cx-mx-supply = <&pm4125_l7>; vdd-1.8-xo-supply = <&pm4125_l13>;