From: Jianhua Lu <lujianhua000@gmail.com>
To: Bryan O'Donoghue <bryan.odonoghue@linaro.org>
Cc: linux@roeck-us.net, heikki.krogerus@linux.intel.com,
gregkh@linuxfoundation.org, andersson@kernel.org,
robh+dt@kernel.org, krzysztof.kozlowski+dt@linaro.org,
linux-usb@vger.kernel.org, linux-arm-msm@vger.kernel.org,
devicetree@vger.kernel.org, wcheng@codeaurora.org,
caleb.connolly@linaro.org, konrad.dybcio@linaro.org,
subbaram@quicinc.com, jackp@quicinc.com,
robertom@qti.qualcomm.com
Subject: Re: [PATCH v4 12/18] usb: typec: qcom: Add Qualcomm PMIC TCPM support
Date: Fri, 24 Mar 2023 08:43:23 +0800 [thread overview]
Message-ID: <ZBzyK0ILtUDr986r@Gentoo> (raw)
In-Reply-To: <89bca327-a860-672c-b4ae-766698d38639@linaro.org>
On Thu, Mar 23, 2023 at 05:31:26PM +0000, Bryan O'Donoghue wrote:
> On 23/03/2023 14:36, Jianhua Lu wrote:
> >> + /* Poll waiting for transition to required vSafe5V or vSafe0V */
> >> + ret = regmap_read_poll_timeout(pmic_typec->regmap,
> >> + pmic_typec->base + TYPEC_SM_STATUS_REG,
> >> + sm_stat, sm_stat & val,
> >> + 100, 250000);
> > This statement isn't very useful and will case a error,
> > After I remove it, usb-c works well. What's about dropping this statement?
> >
> > [ 63.030672] xhci-hcd xhci-hcd.1.auto: xHCI Host Controller
> > [ 63.030702] xhci-hcd xhci-hcd.1.auto: new USB bus registered, assigned bus number 1
> > [ 63.030895] xhci-hcd xhci-hcd.1.auto: hcc params 0x0230ffe5 hci version 0x110 quirks 0x0000000000010010
> > [ 63.030926] xhci-hcd xhci-hcd.1.auto: irq 168, io mem 0x0a600000
> > [ 63.031043] xhci-hcd xhci-hcd.1.auto: xHCI Host Controller
> > [ 63.031054] xhci-hcd xhci-hcd.1.auto: new USB bus registered, assigned bus number 2
> > [ 63.031063] xhci-hcd xhci-hcd.1.auto: Host supports USB 3.1 Enhanced SuperSpeed
> > [ 63.031835] hub 1-0:1.0: USB hub found
> > [ 63.031863] hub 1-0:1.0: 1 port detected
> > [ 63.032151] usb usb2: We don't know the algorithms for LPM for this host, disabling LPM.
> > [ 63.032690] hub 2-0:1.0: USB hub found
> > [ 63.032713] hub 2-0:1.0: 1 port detected
> > [ 63.168912] qcom,pmic-typec c440000.spmi:pmic@2:typec@1500: vbus vsafe5v fail
> > [ 63.169185] xhci-hcd xhci-hcd.1.auto: remove, state 1
> > [ 63.169195] usb usb2: USB disconnect, device number 1
> > [ 63.178808] xhci-hcd xhci-hcd.1.auto: USB bus 2 deregistered
> > [ 63.178825] xhci-hcd xhci-hcd.1.auto: remove, state 1
> > [ 63.178832] usb usb1: USB disconnect, device number 1
> > [ 63.182114] hub 1-0:1.0: activate --> -19
> > [ 63.182791] xhci-hcd xhci-hcd.1.auto: USB bus 1 deregistered
>
> Interesting.
>
> What's your hardware configuration ? Could it be you don't have the VBUS
> regulator pointed to the correct place ?
>
> &pm8150b_vbus {
> regulator-min-microamp = <500000>;
> regulator-max-microamp = <3000000>;
> status = "okay";
> };
>
> &pm8150b_typec {
> vdd-vbus-supply = <&pm8150b_vbus>;
> };
I think I configure it correctly, I have disassemble the compiled dtb,
don't find anything wrong.
usb-vbus-regulator@1100 {
compatible = "qcom,pm8150b-vbus-reg";
status = "okay";
reg = <0x1100>;
regulator-min-microamp = <0x7a120>;
regulator-max-microamp = <0x2dc6c0>;
phandle = <0xc9>;
};
typec@1500 {
compatible = "qcom,pm8150b-typec";
reg = <0x1500>;
interrupts = <0x02 0x15 0x00 0x01 0x02 0x15 0x01 0x03 0x02 0x15 0x02 0x01 0x02 0x15 0x03 0x03 0x02 0x15 0x04 0x01 0x02 0x15 0x05 0x01 0x02 0x15 0x06 0x03 0x02 0x15 0x07 0x01>;
interrupt-names = "or-rid-detect-change\0vpd-detect\0cc-state-change\0vconn-oc\0vbus-change\0attach-detach\0legacy-cable-detect\0try-snk-src-detect";
vdd-vbus-supply = <0xc9>;
status = "okay";
phandle = <0x103>;
};
>
> i.e. something else on your board supplies VBUS ?
pm8150b_vbus only. I try to disable regulator permanently in code and
usb-c doesn't work.
---
static int qcom_pmic_virt_tcpm_set_vbus(struct tcpc_dev *tcpc, bool on,
bool sink)
{
struct pmic_virt_tcpm *tcpm = tcpc_to_tcpm(tcpc);
int ret = 0;
mutex_lock(&tcpm->lock);
if (tcpm->vbus_enabled == on)
goto done;
ret = qcom_pmic_typec_set_vbus(tcpm->pmic_typec, 0);
---
I hack it here.
>
> vSafe5V should indicate to the controller that you have successfully
> switched on vBus, so what this indicates to me is that on your hardware
> VBUS either hasn't been asserted or hasn't been detected.
>
> Can you show the printout of *(pmic_typec->base + TYPEC_SM_STATUS_REG) ?
[ 53.120005] hub 1-1:1.0: 4 ports detected
[ 58.675134] typec base is 0x1500
[ 58.675148] TYPEC_SM_STATUS_REG is 0xa
[ 58.675153] typec status reg is 0x150a
It should be correct.
> And can you check your schematics and verify VBUS is supplied by
> pm8150b_vbus and not say by an external IC ?
I haven't schematics, so I can only use hacking code to test it.
>
> ---
> bod
next prev parent reply other threads:[~2023-03-24 0:43 UTC|newest]
Thread overview: 72+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-03-18 12:18 [PATCH v4 00/18] Add Qualcomm PMIC TPCM support Bryan O'Donoghue
2023-03-18 12:18 ` [PATCH v4 01/18] dt-bindings: regulator: qcom,usb-vbus-regulator: Mark reg as required Bryan O'Donoghue
2023-03-19 11:41 ` Krzysztof Kozlowski
2023-03-18 12:18 ` [PATCH v4 02/18] dt-bindings: regulator: qcom,usb-vbus-regulator: Mark regulator-*-microamp required Bryan O'Donoghue
2023-03-19 11:42 ` Krzysztof Kozlowski
2023-03-19 11:53 ` Krzysztof Kozlowski
2023-03-18 12:18 ` [PATCH v4 03/18] dt-bindings: phy: qcom,sc7180-qmp-usb3-dp-phy: Add orientation-switch as optional Bryan O'Donoghue
2023-03-19 11:42 ` Krzysztof Kozlowski
2023-03-18 12:18 ` [PATCH v4 04/18] dt-bindings: phy: qcom,sc7180-qmp-usb3-dp-phy: Add port as an optional Bryan O'Donoghue
2023-03-19 11:45 ` Krzysztof Kozlowski
2023-03-21 20:49 ` Rob Herring
2023-03-22 14:01 ` Bryan O'Donoghue
2023-03-23 13:39 ` Bryan O'Donoghue
2023-03-18 12:18 ` [PATCH v4 05/18] dt-bindings: usb: Add qcom,pmic-typec dt-binding header Bryan O'Donoghue
2023-03-19 11:50 ` Krzysztof Kozlowski
2023-03-19 14:50 ` Bryan O'Donoghue
2023-03-18 12:18 ` [PATCH v4 06/18] dt-bindings: usb: Add Qualcomm PMIC Type-C controller YAML schema Bryan O'Donoghue
2023-03-19 11:53 ` Krzysztof Kozlowski
2023-03-18 12:18 ` [PATCH v4 07/18] dt-bindings: usb: Add qcom,pmic-pdphy dt-binding header Bryan O'Donoghue
2023-03-19 11:50 ` Krzysztof Kozlowski
2023-03-18 12:18 ` [PATCH v4 08/18] dt-bindings: usb: Add Qualcomm PMIC PDPHY controller YAML schema Bryan O'Donoghue
2023-03-19 11:55 ` Krzysztof Kozlowski
2023-03-18 12:18 ` [PATCH v4 09/18] dt-bindings: usb: Add Qualcomm PMIC TCPM " Bryan O'Donoghue
2023-03-19 11:58 ` Krzysztof Kozlowski
2023-03-19 14:59 ` Bryan O'Donoghue
2023-03-19 15:10 ` Krzysztof Kozlowski
2023-03-19 15:44 ` Bryan O'Donoghue
2023-03-19 17:50 ` Krzysztof Kozlowski
2023-03-19 21:31 ` Caleb Connolly
2023-03-19 22:34 ` Bryan O'Donoghue
2023-03-19 22:32 ` Bryan O'Donoghue
2023-03-19 15:50 ` Bryan O'Donoghue
2023-03-18 12:18 ` [PATCH v4 10/18] dt-bindings: mfd: qcom,spmi-pmic: Add pdphy to SPMI device types Bryan O'Donoghue
2023-03-19 11:58 ` Krzysztof Kozlowski
2023-03-21 20:58 ` Rob Herring
2023-03-21 23:52 ` Bryan O'Donoghue
2023-03-18 12:18 ` [PATCH v4 11/18] dt-bindings: mfd: qcom,spmi-pmic: Add typec " Bryan O'Donoghue
2023-03-19 11:59 ` Krzysztof Kozlowski
2023-03-18 12:18 ` [PATCH v4 12/18] usb: typec: qcom: Add Qualcomm PMIC TCPM support Bryan O'Donoghue
2023-03-23 14:36 ` Jianhua Lu
2023-03-23 17:31 ` Bryan O'Donoghue
2023-03-24 0:43 ` Jianhua Lu [this message]
2023-03-24 0:53 ` Bryan O'Donoghue
2023-03-24 1:13 ` Jianhua Lu
2023-03-24 2:37 ` Bryan O'Donoghue
2023-03-24 10:16 ` Jianhua Lu
2023-03-24 13:25 ` Bryan O'Donoghue
2023-03-24 15:09 ` Jianhua Lu
2023-03-24 16:03 ` Bryan O'Donoghue
2023-03-24 14:00 ` Heikki Krogerus
2023-03-24 14:22 ` Bryan O'Donoghue
2023-03-18 12:18 ` [PATCH v4 13/18] phy: qcom-qmp: Register as a typec switch for orientation detection Bryan O'Donoghue
2023-03-18 16:42 ` kernel test robot
2023-03-20 11:15 ` Neil Armstrong
2023-03-20 11:19 ` Bryan O'Donoghue
2023-03-18 12:18 ` [PATCH v4 14/18] arm64: dts: qcom: pm8150b: Add a TCPM description Bryan O'Donoghue
2023-03-18 13:13 ` Konrad Dybcio
2023-03-18 21:09 ` kernel test robot
2023-03-18 12:18 ` [PATCH v4 15/18] arm64: dts: qcom: qrb5165-rb5: Switch on Type-C VBUS boost Bryan O'Donoghue
2023-03-18 12:18 ` [PATCH v4 16/18] arm64: dts: qcom: qrb5165-rb5: Switch on basic TCPM Bryan O'Donoghue
2023-03-18 13:09 ` Konrad Dybcio
2023-03-18 12:18 ` [PATCH v4 17/18] arm64: dts: qcom: qrb5165-rb5: Switch on TCPM usb-role-switching for usb_1 Bryan O'Donoghue
2023-03-18 13:10 ` Konrad Dybcio
2023-03-18 17:46 ` Bryan O'Donoghue
2023-03-18 12:18 ` [PATCH v4 18/18] arm64: dts: qcom: qrb5165-rb5: Switch on TCPM orientation-switch for usb_1_qmpphy Bryan O'Donoghue
2023-03-18 13:11 ` Konrad Dybcio
2023-03-18 17:47 ` Bryan O'Donoghue
2023-03-24 15:10 ` [PATCH v4 00/18] Add Qualcomm PMIC TPCM support Luca Weiss
2023-03-24 15:28 ` Bryan O'Donoghue
2023-03-31 8:48 ` Luca Weiss
2023-03-31 13:52 ` Bryan O'Donoghue
2023-03-31 14:58 ` Luca Weiss
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=ZBzyK0ILtUDr986r@Gentoo \
--to=lujianhua000@gmail.com \
--cc=andersson@kernel.org \
--cc=bryan.odonoghue@linaro.org \
--cc=caleb.connolly@linaro.org \
--cc=devicetree@vger.kernel.org \
--cc=gregkh@linuxfoundation.org \
--cc=heikki.krogerus@linux.intel.com \
--cc=jackp@quicinc.com \
--cc=konrad.dybcio@linaro.org \
--cc=krzysztof.kozlowski+dt@linaro.org \
--cc=linux-arm-msm@vger.kernel.org \
--cc=linux-usb@vger.kernel.org \
--cc=linux@roeck-us.net \
--cc=robertom@qti.qualcomm.com \
--cc=robh+dt@kernel.org \
--cc=subbaram@quicinc.com \
--cc=wcheng@codeaurora.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).