devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
To: "Bryan O'Donoghue" <bryan.odonoghue@linaro.org>
Cc: Konrad Dybcio <konrad.dybcio@linaro.org>,
	Bjorn Andersson <andersson@kernel.org>,
	 Liam Girdwood <lgirdwood@gmail.com>,
	Mark Brown <broonie@kernel.org>,
	 Rob Herring <robh+dt@kernel.org>,
	 Krzysztof Kozlowski <krzysztof.kozlowski+dt@linaro.org>,
	Conor Dooley <conor+dt@kernel.org>,
	 Wesley Cheng <quic_wcheng@quicinc.com>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	 Vinod Koul <vkoul@kernel.org>,
	Kishon Vijay Abraham I <kishon@kernel.org>,
	Guenter Roeck <linux@roeck-us.net>,
	 Heikki Krogerus <heikki.krogerus@linux.intel.com>,
	Philipp Zabel <p.zabel@pengutronix.de>,
	 linux-arm-msm@vger.kernel.org, devicetree@vger.kernel.org,
	 linux-usb@vger.kernel.org, linux-phy@lists.infradead.org
Subject: Re: [PATCH v2 13/15] arm64: dts: qcom: pmi632: define USB-C related blocks
Date: Wed, 17 Jan 2024 20:05:56 +0200	[thread overview]
Message-ID: <CAA8EJpoXUMehrcf8sXKPhk7qb4SGXT960SUFHX5AUt1wxxHepw@mail.gmail.com> (raw)
In-Reply-To: <28e019ce-7612-4b10-8068-17c3fef4dba8@linaro.org>

On Wed, 17 Jan 2024 at 19:23, Bryan O'Donoghue
<bryan.odonoghue@linaro.org> wrote:
>
> On 15/01/2024 10:43, Dmitry Baryshkov wrote:
> > On Mon, 15 Jan 2024 at 12:00, Konrad Dybcio <konrad.dybcio@linaro.org> wrote:
> >>
> >> On 13.01.2024 21:55, Dmitry Baryshkov wrote:
> >>> Define VBUS regulator and the Type-C handling block as present on the
> >>> Quacomm PMI632 PMIC.
> >>>
> >>> Reviewed-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org>
> >>> Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
> >>> ---
> >>>   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>;
> >> This differs from the downstream irq types:
> >>
> >> <0x2 0x15 0x0 IRQ_TYPE_EDGE_BOTH>,
> >> <0x2 0x15 0x1 IRQ_TYPE_EDGE_BOTH>,
> >> <0x2 0x15 0x2 IRQ_TYPE_EDGE_RISING>,
> >> <0x2 0x15 0x3 IRQ_TYPE_EDGE_RISING>,
> >> <0x2 0x15 0x4 IRQ_TYPE_EDGE_BOTH>,
> >> <0x2 0x15 0x5 IRQ_TYPE_EDGE_RISING>,
> >> <0x2 0x15 0x6 IRQ_TYPE_EDGE_RISING>,
> >> <0x2 0x15 0x7 IRQ_TYPE_EDGE_RISING>;
> >
> > I must admit, I copied the IRQs from the pm8150b rather than from the
> > vendor kernel.
> >
> > Bryan, any idea which set of flags is more correct?
>
> My € says 1:1 with the downstream pmi632.dtsi
>
> qcom,typec@1500 {
>      reg = <0x1500 0x100>;
>      interrupts = <0x2 0x15 0x0 IRQ_TYPE_EDGE_BOTH>,
>                   <0x2 0x15 0x1 IRQ_TYPE_EDGE_BOTH>,
>                   <0x2 0x15 0x2 IRQ_TYPE_EDGE_RISING>,
>                   <0x2 0x15 0x3 IRQ_TYPE_EDGE_RISING>,
>                   <0x2 0x15 0x4 IRQ_TYPE_EDGE_BOTH>,
>                   <0x2 0x15 0x5 IRQ_TYPE_EDGE_RISING>,
>                   <0x2 0x15 0x6 IRQ_TYPE_EDGE_RISING>,
>                   <0x2 0x15 0x7 IRQ_TYPE_EDGE_RISING>;
>
>      interrupt-names = "typec-or-rid-detect-change",

My 2c say that EDGE_BOTH doesn't make sense for or-rid-detect-change
at least. It is an "or" of several _pulse_ interrupts, so there is no
need to detect the falling edge.

>                        "typec-vpd-detect",

both, correct in both cases

>                        "typec-cc-state-change",

pulse interrupt, raising.

>                        "typec-vconn-oc",

It is a 'level' interrupt, so we probably want to detect both rising
and falling edges.

>                        "typec-vbus-change",

"pulse" interrupt => rising, not both, correct in PM8150B.

>                        "typec-attach-detach",

pulse interrupt, rising only.

>                        "typec-legacy-cable-detect",

level, should be both as in PM8150B.

>                        "typec-try-snk-src-detect";
> };

Pulse interrupt being raised when there is either successful or
unsuccessful try.SNK or try.SRC.

So, after consulting the documentation, I believe the flags being a
part of this patch (and in pm8150b.dtsi) are correct.

-- 
With best wishes
Dmitry

  reply	other threads:[~2024-01-17 18:06 UTC|newest]

Thread overview: 48+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-01-13 20:55 [PATCH v2 00/15] usb: typec: qcom-pmic-typec: enable support for PMI632 PMIC Dmitry Baryshkov
2024-01-13 20:55 ` [PATCH v2 01/15] dt-bindings: regulator: qcom,usb-vbus-regulator: add support for PMI632 Dmitry Baryshkov
2024-01-15  7:58   ` Krzysztof Kozlowski
2024-01-13 20:55 ` [PATCH v2 02/15] dt-bindings: usb: qcom,pmic-typec: add support for the PMI632 block Dmitry Baryshkov
2024-01-15  7:59   ` Krzysztof Kozlowski
2024-01-13 20:55 ` [PATCH v2 03/15] dt-bindings: phy: qcom,msm8998-qmp-usb3-phy: split from sc8280xp PHY schema Dmitry Baryshkov
2024-01-15  8:00   ` Krzysztof Kozlowski
2024-01-13 20:55 ` [PATCH v2 04/15] dt-bindings: phy: qcom,msm8998-qmp-usb3-phy: support USB-C data Dmitry Baryshkov
2024-01-15  9:15   ` Krzysztof Kozlowski
2024-01-15  9:47     ` Dmitry Baryshkov
2024-01-15 10:21   ` Krzysztof Kozlowski
2024-01-13 20:55 ` [PATCH v2 05/15] usb: typec: tcpm: fix the PD disabled case Dmitry Baryshkov
2024-01-15  9:00   ` Alexander Stein
2024-01-18  9:53   ` Heikki Krogerus
2024-01-13 20:55 ` [PATCH v2 06/15] usb: typec: qcom-pmic-typec: fix arguments of qcom_pmic_typec_pdphy_set_roles Dmitry Baryshkov
2024-01-14 15:51   ` Bryan O'Donoghue
2024-01-14 16:13   ` Bryan O'Donoghue
2024-01-13 20:55 ` [PATCH v2 07/15] usb: typec: qcom-pmic-typec: allow different implementations for the PD PHY Dmitry Baryshkov
2024-01-13 20:55 ` [PATCH v2 08/15] usb: typec: qcom-pmic-typec: allow different implementations for the port backend Dmitry Baryshkov
2024-01-14 16:12   ` Bryan O'Donoghue
2024-01-13 20:55 ` [PATCH v2 09/15] usb: typec: qcom-pmic-typec: add support for PMI632 PMIC Dmitry Baryshkov
2024-01-16 12:32   ` Konrad Dybcio
2024-01-16 12:56     ` Dmitry Baryshkov
2024-01-16 14:23       ` Heikki Krogerus
2024-01-25  0:07         ` Dmitry Baryshkov
2024-01-25 11:03           ` Heikki Krogerus
2024-01-13 20:55 ` [PATCH v2 10/15] phy: qcom: qmp-usb: split USB-C PHY driver Dmitry Baryshkov
2024-01-16 12:33   ` Konrad Dybcio
2024-01-13 20:55 ` [PATCH v2 11/15] phy: qcom: qmp-usb: drop dual-lane handling Dmitry Baryshkov
2024-01-17  0:07   ` Jeff Johnson
2024-01-13 20:55 ` [PATCH v2 12/15] phy: qcom: qmp-usbc: add support for the Type-C handling Dmitry Baryshkov
2024-01-13 20:55 ` [PATCH v2 13/15] arm64: dts: qcom: pmi632: define USB-C related blocks Dmitry Baryshkov
2024-01-15 10:00   ` Konrad Dybcio
2024-01-15 10:43     ` Dmitry Baryshkov
2024-01-17 17:23       ` Bryan O'Donoghue
2024-01-17 18:05         ` Dmitry Baryshkov [this message]
2024-01-17 18:23           ` Bryan O'Donoghue
2024-01-17 22:01     ` Bjorn Andersson
2024-01-18 11:17       ` Konrad Dybcio
2024-01-18 13:38         ` Dmitry Baryshkov
2024-01-18 13:54           ` Konrad Dybcio
2024-01-13 20:55 ` [PATCH v2 14/15] arm64: dts: qcom: sm6115: drop pipe clock selection Dmitry Baryshkov
2024-01-13 20:55 ` [PATCH v2 15/15] arm64: dts: qcom: qrb4210-rb2: enable USB-C port handling Dmitry Baryshkov
2024-01-23 20:32   ` Luca Weiss
2024-01-24  1:16     ` Dmitry Baryshkov
2024-01-23 14:20 ` (subset) [PATCH v2 00/15] usb: typec: qcom-pmic-typec: enable support for PMI632 PMIC Vinod Koul
2024-01-23 20:43 ` Luca Weiss
2024-01-24  1:43   ` Dmitry Baryshkov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAA8EJpoXUMehrcf8sXKPhk7qb4SGXT960SUFHX5AUt1wxxHepw@mail.gmail.com \
    --to=dmitry.baryshkov@linaro.org \
    --cc=andersson@kernel.org \
    --cc=broonie@kernel.org \
    --cc=bryan.odonoghue@linaro.org \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=heikki.krogerus@linux.intel.com \
    --cc=kishon@kernel.org \
    --cc=konrad.dybcio@linaro.org \
    --cc=krzysztof.kozlowski+dt@linaro.org \
    --cc=lgirdwood@gmail.com \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=linux-phy@lists.infradead.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=linux@roeck-us.net \
    --cc=p.zabel@pengutronix.de \
    --cc=quic_wcheng@quicinc.com \
    --cc=robh+dt@kernel.org \
    --cc=vkoul@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).