linux-usb.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v4 00/18] Add Qualcomm PMIC TPCM support
@ 2023-03-18 12:18 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
                   ` (18 more replies)
  0 siblings, 19 replies; 72+ messages in thread
From: Bryan O'Donoghue @ 2023-03-18 12:18 UTC (permalink / raw)
  To: linux, heikki.krogerus, gregkh, andersson, robh+dt,
	krzysztof.kozlowski+dt, linux-usb, linux-arm-msm, devicetree
  Cc: wcheng, caleb.connolly, bryan.odonoghue, konrad.dybcio, subbaram,
	jackp, robertom

v4:
- Per Rob's input the pdphy and type-c appear as stadalone blocks
  inside of the PMIC declaration which is a 1:1 mapping of PMIC hardware.
  The TCPM virtual device is declared at the top-level.
  https://lore.kernel.org/all/YY7p7jviA3ZG05gL@robh.at.kernel.org/

- Squashes the removal of the old driver with the addition of the new. - Heikki, Gunter
  https://lore.kernel.org/all/YYVHcHC1Gm92VxEM@kuha.fi.intel.com/

- Reworked Dmitry's old patch for the QMP to account for file renames and
  very minimal code-drift in the interregnum.

- New yaml checks drive update of PMIC VBUS yaml

- Some housekeeping on the sc7180 yaml side. sc7180 is not supported yet.

- Expands and fixes the examples being added in the PMIC tcpm examples.

Previous set:
https://lore.kernel.org/all/20211105033558.1573552-1-bryan.odonoghue@linaro.org/

Bootable:
https://git.codelinaro.org/bryan.odonoghue/kernel/-/commits/linux-next-23-03-18-pm8150b-tcpm-qcom-wrapper-typec-mux

V3:
Rob Herrings review

- Drops use of remote-endpoint and ports to bind
  tcpm to pdphy and typec replacing with phandle

- Drops pmic-pdphy-* and pmic-typec-* from interrupt names
  as suggested

- Passes make dt_binding_check DT_CHECKER_FLAGS=-m

BOD
- Noticed qcom_pmic_tcpm_pdphy_enable() was missing a
  regulator_disable in case of an error, added.

- qcom_pmic_tcpm_pdphy_probe()
  devm_regulator_get() should come before regmap_get()
  as is the case in qcom_pmic_tcpm_typec_probe()

- Fixes compatible name in qcom,pmic-typec.yaml should
  have read qcom,pm8150b-typec not qcom,pm8150b-usb-typec

- Makes sure compat for core is "qcom,pm8150b-tcpm" in
  docs and driver

- Drops redundant return in void qcom_pmic_tcpm_pdphy_reset_off()

Kernel Robot
- Drops unused variable debounced in qcom_pmic_tcpm_typec_get_cc()

- Drops unsused variable orientation in qcom_pmic_tcpm_typec_set_cc()

Latest bootable series can be found here:
Link: https://git.linaro.org/people/bryan.odonoghue/kernel.git/log/?h=usb-next-04-11-21-pm8150b-tcpm-v3

git diff usb-next-27-10-21-pm8150b-tcpm-v2 -- drivers/usb/typec/tcpm/qcom/
git diff usb-next-27-10-21-pm8150b-tcpm-v2 -- Documentation/devicetree/bindings/usb/qcom,pmic*

Previous set:
Link: https://lore.kernel.org/linux-usb/20211028164941.831918-1-bryan.odonoghue@linaro.org/T/#t

V2 resend:
- Adding omitted devicetree mailing list

V2:

Guenter Roeck's review
- Converts suggested qcom_pmic_tcpm_core.c into one-liners

- Adds comment on how polarity is set in set_polarity()

- Removes optional set_current_limit()

- regmap_read/regmap_write
  Reviwing other pm8150b/spmi drivers I then added in checks for all
  reamap_read()/regmap_write() calls.

- Fixes (type == TCPC_TX_CABLE_RESET || TCPC_TX_HARD_RESET)
  thanks I definitely had the blinkers on there and didn't see that at all

- qcom_pmic_tcpm_pdphy_pd_transmit_payload()
  Treats regmap_read and read value as separate error paths

- qcom_pmic_tcpm_pdphy_set_pd_rx()
  Replaces boolean if/else with !on as suggested

- Returns -ENODEV not -EINVAL on dev_get_regmap() error

- qcom_pmic_tcpm_pdphy_pd_receive()
  Guenter asks: "No error return ?"
  bod: No we are inside an ISR here if we read data we pass that off to TCPM
       if somehow we don't read the data - it is "junk" there's no value IMO
       in pushing an error upwards back to the handler.

Heikki Krogerus' review
- Includes Makefile I missed adding to my git index

- Removes old Kconfig entry for remove driver

Randy Dunlap's review 
- Rewords drivers/usb/typec/tcpm/Kconfig

- Drops tautology "aggregates togther"

- Corrects spelling typos

BOD's own review
- Drops redundant include of regmap.h in qcom_pmic_tcpm_core.c

- Propogates qcom_pmic_tcpm_pdphy_disable() error upwards

- Propogates pmic_pdphy_reset() error upwards

- Drops error prints in qcom_pmic_tcpm_pdphy_pd_transmit_payload()
  I had these in-place during development and don't recall them being
  triggered even once, they are redundant, remove.
 
Differences between the two can be seen by
git diff usb-next-27-10-21-pm8150b-tcpm-v2..usb-next-25-10-21-pm8150b-tcpm -- drivers/usb/typec/tcpm

Latest bootable series can be found here:
Link: https://git.linaro.org/people/bryan.odonoghue/kernel.git/log/?h=usb-next-27-10-21-pm8150b-tcpm-v2

Previous set:
Link: https://lore.kernel.org/all/20211025150906.176686-1-bryan.odonoghue@linaro.org/T/#t

V1:
This series adds a set of yaml and a driver to bind together the type-c and
pdphy silicon in qcom's pm8150b block as a Linux type-c port manager.

As part of that we retire the existing qcom-pmic-typec driver and fully
replicate its functionality inside of the new block with the additional
pdphy stuff along with it.

An additional series will follow this one for the SoC and RB5 dtsi and dts
respectively.

A bootable series can be found here

Link: https://git.linaro.org/people/bryan.odonoghue/kernel.git/log/?h=usb-next-25-10-21-pm8150b-tcpm


Bryan O'Donoghue (17):
  dt-bindings: regulator: qcom,usb-vbus-regulator: Mark reg as required
  dt-bindings: regulator: qcom,usb-vbus-regulator: Mark
    regulator-*-microamp required
  dt-bindings: phy: qcom,sc7180-qmp-usb3-dp-phy: Add orientation-switch
    as optional
  dt-bindings: phy: qcom,sc7180-qmp-usb3-dp-phy: Add port as an optional
  dt-bindings: usb: Add qcom,pmic-typec dt-binding header
  dt-bindings: usb: Add Qualcomm PMIC Type-C controller YAML schema
  dt-bindings: usb: Add qcom,pmic-pdphy dt-binding header
  dt-bindings: usb: Add Qualcomm PMIC PDPHY controller YAML schema
  dt-bindings: usb: Add Qualcomm PMIC TCPM YAML schema
  dt-bindings: mfd: qcom,spmi-pmic: Add pdphy to SPMI device types
  dt-bindings: mfd: qcom,spmi-pmic: Add typec to SPMI device types
  usb: typec: qcom: Add Qualcomm PMIC TCPM support
  arm64: dts: qcom: pm8150b: Add a TCPM description
  arm64: dts: qcom: qrb5165-rb5: Switch on Type-C VBUS boost
  arm64: dts: qcom: qrb5165-rb5: Switch on basic TCPM
  arm64: dts: qcom: qrb5165-rb5: Switch on TCPM usb-role-switching for
    usb_1
  arm64: dts: qcom: qrb5165-rb5: Switch on TCPM orientation-switch for
    usb_1_qmpphy

Dmitry Baryshkov (1):
  phy: qcom-qmp: Register as a typec switch for orientation detection

 .../bindings/mfd/qcom,spmi-pmic.yaml          |   8 +
 .../phy/qcom,sc7180-qmp-usb3-dp-phy.yaml      |  10 +
 .../regulator/qcom,usb-vbus-regulator.yaml    |  10 +-
 .../bindings/usb/qcom,pmic-pdphy.yaml         |  89 +++
 .../bindings/usb/qcom,pmic-typec.yaml         |  88 +++
 .../bindings/usb/qcom,pmic-virt-tcpm.yaml     |  88 +++
 MAINTAINERS                                   |  10 +
 arch/arm64/boot/dts/qcom/pm8150b.dtsi         |  70 ++
 arch/arm64/boot/dts/qcom/qrb5165-rb5.dts      |  63 +-
 drivers/phy/qualcomm/Kconfig                  |   8 +
 drivers/phy/qualcomm/phy-qcom-qmp-combo.c     |  80 ++-
 drivers/usb/typec/Kconfig                     |  13 -
 drivers/usb/typec/Makefile                    |   1 -
 drivers/usb/typec/qcom-pmic-typec.c           | 261 -------
 drivers/usb/typec/tcpm/Kconfig                |  11 +
 drivers/usb/typec/tcpm/Makefile               |   1 +
 drivers/usb/typec/tcpm/qcom/Makefile          |   6 +
 drivers/usb/typec/tcpm/qcom/qcom_pmic_pdphy.c | 605 +++++++++++++++++
 drivers/usb/typec/tcpm/qcom/qcom_pmic_pdphy.h |  85 +++
 drivers/usb/typec/tcpm/qcom/qcom_pmic_typec.c | 637 ++++++++++++++++++
 drivers/usb/typec/tcpm/qcom/qcom_pmic_typec.h | 163 +++++
 .../usb/typec/tcpm/qcom/qcom_pmic_virt_tcpm.c | 326 +++++++++
 .../dt-bindings/usb/typec/qcom,pmic-pdphy.h   |  18 +
 .../dt-bindings/usb/typec/qcom,pmic-typec.h   |  18 +
 24 files changed, 2388 insertions(+), 281 deletions(-)
 create mode 100644 Documentation/devicetree/bindings/usb/qcom,pmic-pdphy.yaml
 create mode 100644 Documentation/devicetree/bindings/usb/qcom,pmic-typec.yaml
 create mode 100644 Documentation/devicetree/bindings/usb/qcom,pmic-virt-tcpm.yaml
 delete mode 100644 drivers/usb/typec/qcom-pmic-typec.c
 create mode 100644 drivers/usb/typec/tcpm/qcom/Makefile
 create mode 100644 drivers/usb/typec/tcpm/qcom/qcom_pmic_pdphy.c
 create mode 100644 drivers/usb/typec/tcpm/qcom/qcom_pmic_pdphy.h
 create mode 100644 drivers/usb/typec/tcpm/qcom/qcom_pmic_typec.c
 create mode 100644 drivers/usb/typec/tcpm/qcom/qcom_pmic_typec.h
 create mode 100644 drivers/usb/typec/tcpm/qcom/qcom_pmic_virt_tcpm.c
 create mode 100644 include/dt-bindings/usb/typec/qcom,pmic-pdphy.h
 create mode 100644 include/dt-bindings/usb/typec/qcom,pmic-typec.h

-- 
2.39.2


^ permalink raw reply	[flat|nested] 72+ messages in thread

end of thread, other threads:[~2023-03-31 14:58 UTC | newest]

Thread overview: 72+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
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
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

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).