mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: David Heidelberg <david@ixit.cz>
To: Bryan O'Donoghue <bryan.odonoghue@linaro.org>,
	Alexey Minnekhanov <alexeymin@minlexx.ru>,
	Heikki Krogerus <heikki.krogerus@linux.intel.com>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	Liam Girdwood <lgirdwood@gmail.com>,
	Mark Brown <broonie@kernel.org>,
	Bjorn Andersson <andersson@kernel.org>,
	Konrad Dybcio <konradybcio@kernel.org>,
	Rob Herring <robh@kernel.org>,
	Krzysztof Kozlowski <krzk+dt@kernel.org>,
	Conor Dooley <conor+dt@kernel.org>,
	Konrad Dybcio <konrad.dybcio@oss.qualcomm.com>,
	Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>,
	Lee Jones <lee@kernel.org>, Stephen Boyd <sboyd@kernel.org>
Cc: linux-arm-msm@vger.kernel.org, linux-usb@vger.kernel.org,
	linux-kernel@vger.kernel.org, devicetree@vger.kernel.org,
	phone-devel@vger.kernel.org, mfd@lists.linux.dev
Subject: Re: [PATCH RFC 06/12] usb: typec: qcom: Add gen1 Type-C port support
Date: Mon, 19 Oct 2026 01:29:53 +0200	[thread overview]
Message-ID: <391498ea-51f1-4390-b84a-d0d738ec409d@ixit.cz> (raw)
In-Reply-To: <4f089c98-a479-45c9-9b11-0207c895367a@linaro.org>

On 26/09/2026 16:22, Bryan O'Donoghue wrote:
> On 26/09/2026 13:40, David Heidelberg via B4 Relay wrote:
>> From: David Heidelberg <david@ixit.cz>
>>
>> Add a port backend for the first generation of the Qualcomm PMIC Type-C
>> block, found on PM660 and PMI8998.
>>
>> On gen1 the Type-C CC logic is part of the charger's USBIN peripheral
>> (base 0x1300) instead of the standalone Type-C peripheral used by
>> PM8150B and later PMICs. All Type-C events (CC state change,
>> tCCDebounce done, VBUS change and error) are signalled through a single
>> aggregate "type-c-change" interrupt, the handler re-reads TYPEC_STATUS_4
>> to find out what changed. The PD PHY is register compatible with PM8150B
>> and is reused as is.
>>
>> Differences to the PM8150B backend:
>>   - get_cc() returns -EBUSY until the hardware reports tCCDebounce done,
>>     instead of using a software debounce.
>>   - As a source, only the default and 1.5A Rp can be advertised, 3.0A
>>     requests are advertised as 1.5A.
>>   - The PBS workaround of the downstream SMB2 driver (TM_IO_DTEST4_SEL)
>>     is applied on every power role change.
>>
>> VBUS sourcing is optional and only used when the connector provides
>> a vbus-supply, as the charger doesn't expose a VBUS regulator yet.
>>
>> Assisted-by: LLM
>> Co-developed-by: Alexey Minnekhanov <alexeymin@minlexx.ru>
>> Signed-off-by: Alexey Minnekhanov <alexeymin@minlexx.ru>
>> Signed-off-by: David Heidelberg <david@ixit.cz>
>> ---
>>   drivers/usb/typec/tcpm/qcom/Makefile               |   1 +
>>   drivers/usb/typec/tcpm/qcom/qcom_pmic_typec.c      |   9 +
>>   .../typec/tcpm/qcom/qcom_pmic_typec_port_gen1.c    | 605 +++++++++++++++++++++
>>   .../typec/tcpm/qcom/qcom_pmic_typec_port_gen1.h    |  15 +
>>   4 files changed, 630 insertions(+)
>>
>> diff --git a/drivers/usb/typec/tcpm/qcom/Makefile b/drivers/usb/typec/tcpm/ 
>> qcom/Makefile
>> index cc23042b94878..b8b9350184c19 100644
>> --- a/drivers/usb/typec/tcpm/qcom/Makefile
>> +++ b/drivers/usb/typec/tcpm/qcom/Makefile
>> @@ -1,7 +1,8 @@
>>   # SPDX-License-Identifier: GPL-2.0
>>   #
>>   obj-$(CONFIG_TYPEC_QCOM_PMIC)        += qcom_pmic_tcpm.o
>>   qcom_pmic_tcpm-y            += qcom_pmic_typec.o \
>>                          qcom_pmic_typec_port.o \
>> +                       qcom_pmic_typec_port_gen1.o \
>>                          qcom_pmic_typec_pdphy.o \
>>                          qcom_pmic_typec_pdphy_stub.o \
>> diff --git a/drivers/usb/typec/tcpm/qcom/qcom_pmic_typec.c b/drivers/usb/ 
>> typec/tcpm/qcom/qcom_pmic_typec.c
>> index 41aaae6bb3724..ea1d5b0927436 100644
>> --- a/drivers/usb/typec/tcpm/qcom/qcom_pmic_typec.c
>> +++ b/drivers/usb/typec/tcpm/qcom/qcom_pmic_typec.c
>> @@ -12,16 +12,17 @@
>>   #include <linux/slab.h>
>>   #include <linux/usb/tcpm.h>
>>   #include <drm/bridge/aux-bridge.h>
>>   #include "qcom_pmic_typec.h"
>>   #include "qcom_pmic_typec_pdphy.h"
>>   #include "qcom_pmic_typec_port.h"
>> +#include "qcom_pmic_typec_port_gen1.h"
>>   typedef int (*pmic_typec_port_probe_fn)(struct platform_device *pdev,
>>                       struct pmic_typec *tcpm,
>>                       const struct pmic_typec_port_resources *res,
>>                       struct regmap *regmap, u32 base);
>>   struct pmic_typec_resources {
>>       const struct pmic_typec_pdphy_resources    *pdphy_res;
>> @@ -134,31 +135,39 @@ static void qcom_pmic_typec_remove(struct 
>> platform_device *pdev)
>>       struct pmic_typec *tcpm = platform_get_drvdata(pdev);
>>       tcpm->pdphy_stop(tcpm);
>>       tcpm->port_stop(tcpm);
>>       tcpm_unregister_port(tcpm->tcpm_port);
>>       fwnode_handle_put(tcpm->tcpc.fwnode);
>>   }
>> +static const struct pmic_typec_resources gen1_typec_res = {
>> +    .pdphy_res = &pm8150b_pdphy_res,
>> +    .port_res = &gen1_port_res,
>> +    .port_probe = qcom_pmic_typec_gen1_port_probe,
>> +};
>> +
>>   static const struct pmic_typec_resources pm8150b_typec_res = {
>>       .pdphy_res = &pm8150b_pdphy_res,
>>       .port_res = &pm8150b_port_res,
>>       .port_probe = qcom_pmic_typec_port_probe,
>>   };
>>   static const struct pmic_typec_resources pmi632_typec_res = {
>>       /* PD PHY not present */
>>       .port_res = &pm8150b_port_res,
>>       .port_probe = qcom_pmic_typec_port_probe,
>>   };
>>   static const struct of_device_id qcom_pmic_typec_table[] = {
>> +    { .compatible = "qcom,pm660-typec", .data = &gen1_typec_res },
>>       { .compatible = "qcom,pm8150b-typec", .data = &pm8150b_typec_res },
>>       { .compatible = "qcom,pmi632-typec", .data = &pmi632_typec_res },
>> +    { .compatible = "qcom,pmi8998-typec", .data = &gen1_typec_res },
> 
> I think this should be
> 
>  > +    { .compatible = "qcom,pm660-typec", .data = &pm660_typec_res },
>  >       { .compatible = "qcom,pm8150b-typec", .data = &pm8150b_typec_res },
>  >       { .compatible = "qcom,pmi632-typec", .data = &pmi632_typec_res },
>  > +    { .compatible = "qcom,pmi8998-typec", .data = &pmi8998_typec_res },
> 
> Since I'm not sure "gen1" is a real thing and besides, I see this gen1/gen2/gen3 
> stuff in CAMSS and it means almost nothing. The silicon version is the salient 
> thing.

Best I can do is GenZ.
But now seriously, I hoped someone from Qualcomm will chime in and tells me how 
is this type-c block generation properly called.

David

[...]

  parent reply	other threads:[~2026-10-18 23:29 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-26 12:40 [PATCH RFC 00/12] Qualcomm Type-C support for 1st generation David Heidelberg via B4 Relay
2026-09-26 12:40 ` [PATCH RFC 01/12] usb: typec: tcpm: qcom: Release the connector fwnode reference David Heidelberg via B4 Relay
2026-09-28 13:48   ` Heikki Krogerus
2026-09-26 12:40 ` [PATCH RFC 02/12] dt-bindings: usb: qcom,pmic-typec: Update example with vbus-supply David Heidelberg via B4 Relay
2026-09-26 13:34   ` Bryan O'Donoghue
2026-09-26 12:40 ` [PATCH RFC 03/12] dt-bindings: usb: Add Qualcomm 1st-gen PMIC Type-C David Heidelberg via B4 Relay
2026-09-26 12:40 ` [PATCH RFC 04/12] usb: typec: qcom: Make PMIC port probe selectable David Heidelberg via B4 Relay
2026-09-26 13:39   ` Bryan O'Donoghue
2026-09-26 12:40 ` [PATCH RFC 05/12] usb: typec: qcom: Make typec_port accept also different structure David Heidelberg via B4 Relay
2026-09-26 13:40   ` Bryan O'Donoghue
2026-09-26 12:40 ` [PATCH RFC 06/12] usb: typec: qcom: Add gen1 Type-C port support David Heidelberg via B4 Relay
2026-09-26 14:22   ` Bryan O'Donoghue
2026-09-26 14:32     ` David Heidelberg
2026-09-26 14:41       ` Bryan O'Donoghue
2026-09-26 14:45         ` David Heidelberg
2026-10-18 23:29     ` David Heidelberg [this message]
2026-10-18 23:45       ` Dmitry Baryshkov
2026-09-26 12:40 ` [PATCH RFC 07/12] arm64: dts: qcom: pm660: Add USB Type-C port controller node David Heidelberg via B4 Relay
2026-09-26 14:25   ` Bryan O'Donoghue
2026-09-26 12:40 ` [PATCH RFC 08/12] arm64: dts: qcom: pmi8998: " David Heidelberg via B4 Relay
2026-09-26 14:28   ` Bryan O'Donoghue
2026-09-26 12:40 ` [PATCH RFC 09/12] arm64: dts: qcom: sdm670-google-common: Enable USB Type-C port controller David Heidelberg via B4 Relay
2026-09-26 12:40 ` [PATCH RFC 10/12] arm64: dts: qcom: sdm845-google-common: " David Heidelberg via B4 Relay
2026-09-26 12:40 ` [PATCH RFC 11/12] arm64: dts: qcom: sdm845-oneplus-common: " David Heidelberg via B4 Relay
2026-09-26 12:40 ` [PATCH RFC 12/12] arm64: dts: qcom: sdm845-shift-axolotl: " David Heidelberg via B4 Relay
2026-09-27 13:05 ` [PATCH RFC 00/12] Qualcomm Type-C support for 1st generation Dmitry Baryshkov
2026-09-27 15:16   ` David Heidelberg
2026-09-27 16:33     ` Dmitry Baryshkov
2026-09-28 15:54       ` Bryan O'Donoghue
2026-10-18 23:53         ` 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=391498ea-51f1-4390-b84a-d0d738ec409d@ixit.cz \
    --to=david@ixit.cz \
    --cc=alexeymin@minlexx.ru \
    --cc=andersson@kernel.org \
    --cc=broonie@kernel.org \
    --cc=bryan.odonoghue@linaro.org \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=dmitry.baryshkov@oss.qualcomm.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=heikki.krogerus@linux.intel.com \
    --cc=konrad.dybcio@oss.qualcomm.com \
    --cc=konradybcio@kernel.org \
    --cc=krzk+dt@kernel.org \
    --cc=lee@kernel.org \
    --cc=lgirdwood@gmail.com \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=mfd@lists.linux.dev \
    --cc=phone-devel@vger.kernel.org \
    --cc=robh@kernel.org \
    --cc=sboyd@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

all inboxes | Powered by JetHome®