linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v3 0/4] usb: dwc2: fill in gadget caps, configure it for stm32mp15
@ 2021-10-13 13:57 Fabrice Gasnier
  2021-10-13 13:57 ` [PATCH v3 1/4] dt-bindings: usb: dwc2: Add reference to usb-drd.yaml Fabrice Gasnier
                   ` (3 more replies)
  0 siblings, 4 replies; 7+ messages in thread
From: Fabrice Gasnier @ 2021-10-13 13:57 UTC (permalink / raw)
  To: hminas, gregkh, robh+dt
  Cc: linux-usb, linux-kernel, linux-stm32, devicetree,
	amelie.delaunay, fabrice.gasnier, alexandre.torgue

This patchset fills in 'otg_caps' of the usb_gadget structure, and
configures it on stm32mp15.

When dwc2 is configured as dual role (OTG), the USB gadget descriptors
(device mode) are configured via configfs. This lead in calling
usb_otg_descriptor_init().
In usb_otg_descriptor_init() (drivers/usb/gadget/config.c):
- If otg caps structure is provided -> use it
- If otg caps structure isn't provided -> HNP and SRP are enabled by default

This could lead to a configuration mismatch beetween:
- OTG controller: HNP and SRP aren't enabled
- gadget descriptors: HNP and SRP are advertised

---
Changes in v3:
- Add dt-bindings patch, as adding properties from usb-drd.yaml is
  currently not handled in dwc2.yaml. This lead to have
  "make dtbs_check" reports errors like:
  ...'otg-rev' does not match any of the regexes: 'pinctrl-[0-9]+'
  From schema: /local/home/fgasni00/baseline/linux-stm32/Documentation/devicetree/bindings/usb/dwc2.yaml
- Could/should the dt-bindings be ported to stable ?
  (the DT patch for stm32mp151 in v1 got merged already)

Changes in v2:
- replace otg_cap bit field by otg_caps structure.
- Fix build issue when HOST only mode is selected [1]
- DT patch for stm32mp151 merged in v1, so not resent

[1] https://lore.kernel.org/all/000000000000b01f1505cda8e03c@google.com

Fabrice Gasnier (4):
  dt-bindings: usb: dwc2: Add reference to usb-drd.yaml
  dt-bindings: usb: dwc2: adopt otg properties defined in usb-drd.yaml
  usb: dwc2: add otg_rev and otg_caps information for gadget driver
  usb: dwc2: stm32mp15: set otg_rev

 Documentation/devicetree/bindings/usb/dwc2.yaml | 16 ++++--
 drivers/usb/dwc2/core.h                         | 19 +++----
 drivers/usb/dwc2/debugfs.c                      |  4 +-
 drivers/usb/dwc2/gadget.c                       |  1 +
 drivers/usb/dwc2/hcd.c                          | 12 ++--
 drivers/usb/dwc2/params.c                       | 75 ++++++++++++++-----------
 6 files changed, 70 insertions(+), 57 deletions(-)

-- 
2.7.4


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

end of thread, other threads:[~2021-10-18 19:19 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-10-13 13:57 [PATCH v3 0/4] usb: dwc2: fill in gadget caps, configure it for stm32mp15 Fabrice Gasnier
2021-10-13 13:57 ` [PATCH v3 1/4] dt-bindings: usb: dwc2: Add reference to usb-drd.yaml Fabrice Gasnier
2021-10-18 19:19   ` Rob Herring
2021-10-13 13:57 ` [PATCH v3 2/4] dt-bindings: usb: dwc2: adopt otg properties defined in usb-drd.yaml Fabrice Gasnier
2021-10-18 19:19   ` Rob Herring
2021-10-13 13:57 ` [PATCH v3 3/4] usb: dwc2: add otg_rev and otg_caps information for gadget driver Fabrice Gasnier
2021-10-13 13:57 ` [PATCH v3 4/4] usb: dwc2: stm32mp15: set otg_rev Fabrice Gasnier

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