mbox series

[v2,0/3] usb: ChipIdea: add Nuvoton NPCM UDC support

Message ID 20230927095509.267029-1-tmaimon77@gmail.com
Headers show
Series usb: ChipIdea: add Nuvoton NPCM UDC support | expand

Message

Tomer Maimon Sept. 27, 2023, 9:55 a.m. UTC
This patch set add USB device controller for the NPCM Baseboard
Management Controllers (BMC).

NPCM UDC driver is a part of the USB ChipIdea driver.

Adding CI_HDRC_FORCE_VBUS_ACTIVE_ALWAYS flag to modify the vbus_active
parameter to active in case the ChipIdea USB IP role is device-only and
there is no otgsc register.

BMC NPCM7XX and BMC NPCM8XX has ten identical NPCM UDC modules,

The NPCM UDC were tested on NPCM845 evaluation board.

Addressed comments from:
 - Rob Herring : https://www.spinics.net/lists/linux-usb/msg246811.html
 - Krzysztof Kozlowski : https://www.spinics.net/lists/linux-usb/msg246773.html
 - kernel test robot : https://www.spinics.net/lists/devicetree/msg634160.html
 - Jonathan Neuschäfer : https://www.spinics.net/lists/linux-usb/msg246790.html

Changes since version 1:
 - Add SoC specific compatible.
 - Remove USB phy mux property from dt-binding, will be handled differently.
 - Add CI_HDRC_FORCE_VBUS_ACTIVE_ALWAYS commit to this patch set.

Tomer Maimon (3):
  usb: chipidea: add CI_HDRC_FORCE_VBUS_ACTIVE_ALWAYS flag
  dt-bindings: usb: ci-hdrc-usb2: add npcm750 and npcm845 compatible
  usb: chipidea: Add support for NPCM

 .../devicetree/bindings/usb/ci-hdrc-usb2.yaml |   4 +
 drivers/usb/chipidea/Kconfig                  |   4 +
 drivers/usb/chipidea/Makefile                 |   1 +
 drivers/usb/chipidea/ci_hdrc_npcm.c           | 117 ++++++++++++++++++
 drivers/usb/chipidea/otg.c                    |   5 +-
 include/linux/usb/chipidea.h                  |   1 +
 6 files changed, 131 insertions(+), 1 deletion(-)
 create mode 100644 drivers/usb/chipidea/ci_hdrc_npcm.c

Comments

Krzysztof Kozlowski Sept. 30, 2023, 3:54 p.m. UTC | #1
On 27/09/2023 11:55, Tomer Maimon wrote:
> Add Nuvoton NPCM BMC SoCs support to USB ChipIdea driver.
> NPCM SoC include ChipIdea IP block that used for USB device controller
> mode.

...

> +	ci = devm_kzalloc(&pdev->dev, sizeof(*ci), GFP_KERNEL);
> +	if (!ci)
> +		return -ENOMEM;
> +	platform_set_drvdata(pdev, ci);
> +
> +	ci->core_clk = devm_clk_get_optional(dev, NULL);
> +	if (IS_ERR(ci->core_clk))
> +		return PTR_ERR(ci->core_clk);
> +
> +	ret = clk_prepare_enable(ci->core_clk);
> +	if (ret) {
> +		dev_err(dev, "failed to enable the clock: %d\n", ret);
> +		return ret;

return dev_err_probe()

...

> +
> +module_platform_driver(npcm_udc_driver);
> +
> +MODULE_DESCRIPTION("NPCM USB device controller driver");
> +MODULE_AUTHOR("Tomer Maimon <tomer.maimon@nuvoton.com>");
> +MODULE_ALIAS("platform:npcm-udc");

Nope... if you need it, your tables are wrong.


Best regards,
Krzysztof