diff mbox series

[v5,2/3] usb: dwc3: imx8mp: add 2 software managed quirk properties for host mode

Message ID 20240906-dwc-mp-v5-2-ea8ec6774e7b@nxp.com (mailing list archive)
State Accepted
Commit a9400f1979a0820113a7216a69385cad3a9badde
Headers show
Series usb: imx8mp: collect some improvement | expand

Commit Message

Frank Li Sept. 6, 2024, 4:30 p.m. UTC
Add 2 software manage quirk properties (xhci-missing-cas-quirk and
xhci-skip-phy-init-quirk) for xhci host.

dwc3 driver have PHY management to cover both device and host mode, so add
xhci-skip-phy-init-quirk to skip PHY management from HCD core.

Cold Attach Status (CAS) bit can't be set at i.MX8MP after resume from
suspend state. So set xhci-missing-cas-quirk.

Signed-off-by: Frank Li <Frank.Li@nxp.com>
---
Change from v4 to v5
- fix the wrong when rebase
- drop Thinh ack

Change from v3 to v4
- rebase usb-next

Change from v2 to v3
- rework commit message to descript why need set quirk.

Change from v1 to v2
- use {0}
---
 drivers/usb/dwc3/dwc3-imx8mp.c | 18 ++++++++++++++++++
 1 file changed, 18 insertions(+)

Comments

Thinh Nguyen Sept. 7, 2024, 12:40 a.m. UTC | #1
On Fri, Sep 06, 2024, Frank Li wrote:
> Add 2 software manage quirk properties (xhci-missing-cas-quirk and
> xhci-skip-phy-init-quirk) for xhci host.
> 
> dwc3 driver have PHY management to cover both device and host mode, so add
> xhci-skip-phy-init-quirk to skip PHY management from HCD core.
> 
> Cold Attach Status (CAS) bit can't be set at i.MX8MP after resume from
> suspend state. So set xhci-missing-cas-quirk.
> 
> Signed-off-by: Frank Li <Frank.Li@nxp.com>
> ---
> Change from v4 to v5
> - fix the wrong when rebase
> - drop Thinh ack
> 
> Change from v3 to v4
> - rebase usb-next
> 
> Change from v2 to v3
> - rework commit message to descript why need set quirk.
> 
> Change from v1 to v2
> - use {0}
> ---
>  drivers/usb/dwc3/dwc3-imx8mp.c | 18 ++++++++++++++++++
>  1 file changed, 18 insertions(+)
> 
> diff --git a/drivers/usb/dwc3/dwc3-imx8mp.c b/drivers/usb/dwc3/dwc3-imx8mp.c
> index 8b88649b569fe..cfb59f6bf5dde 100644
> --- a/drivers/usb/dwc3/dwc3-imx8mp.c
> +++ b/drivers/usb/dwc3/dwc3-imx8mp.c
> @@ -145,6 +145,17 @@ static irqreturn_t dwc3_imx8mp_interrupt(int irq, void *_dwc3_imx)
>  	return IRQ_HANDLED;
>  }
>  
> +static int dwc3_imx8mp_set_software_node(struct device *dev)
> +{
> +	struct property_entry props[3] = { 0 };
> +	int prop_idx = 0;
> +
> +	props[prop_idx++] = PROPERTY_ENTRY_BOOL("xhci-missing-cas-quirk");
> +	props[prop_idx++] = PROPERTY_ENTRY_BOOL("xhci-skip-phy-init-quirk");
> +
> +	return device_create_managed_software_node(dev, props, NULL);
> +}
> +
>  static int dwc3_imx8mp_probe(struct platform_device *pdev)
>  {
>  	struct device		*dev = &pdev->dev;
> @@ -207,6 +218,13 @@ static int dwc3_imx8mp_probe(struct platform_device *pdev)
>  	if (err < 0)
>  		goto disable_rpm;
>  
> +	err = dwc3_imx8mp_set_software_node(dev);
> +	if (err) {
> +		err = -ENODEV;
> +		dev_err(dev, "failed to create software node\n");
> +		goto disable_rpm;
> +	}
> +
>  	err = of_platform_populate(node, NULL, NULL, dev);
>  	if (err) {
>  		dev_err(&pdev->dev, "failed to create dwc3 core\n");
> 
> -- 
> 2.34.1
> 

Acked-by: Thinh Nguyen <Thinh.Nguyen@synopsys.com>

Thanks,
Thinh
diff mbox series

Patch

diff --git a/drivers/usb/dwc3/dwc3-imx8mp.c b/drivers/usb/dwc3/dwc3-imx8mp.c
index 8b88649b569fe..cfb59f6bf5dde 100644
--- a/drivers/usb/dwc3/dwc3-imx8mp.c
+++ b/drivers/usb/dwc3/dwc3-imx8mp.c
@@ -145,6 +145,17 @@  static irqreturn_t dwc3_imx8mp_interrupt(int irq, void *_dwc3_imx)
 	return IRQ_HANDLED;
 }
 
+static int dwc3_imx8mp_set_software_node(struct device *dev)
+{
+	struct property_entry props[3] = { 0 };
+	int prop_idx = 0;
+
+	props[prop_idx++] = PROPERTY_ENTRY_BOOL("xhci-missing-cas-quirk");
+	props[prop_idx++] = PROPERTY_ENTRY_BOOL("xhci-skip-phy-init-quirk");
+
+	return device_create_managed_software_node(dev, props, NULL);
+}
+
 static int dwc3_imx8mp_probe(struct platform_device *pdev)
 {
 	struct device		*dev = &pdev->dev;
@@ -207,6 +218,13 @@  static int dwc3_imx8mp_probe(struct platform_device *pdev)
 	if (err < 0)
 		goto disable_rpm;
 
+	err = dwc3_imx8mp_set_software_node(dev);
+	if (err) {
+		err = -ENODEV;
+		dev_err(dev, "failed to create software node\n");
+		goto disable_rpm;
+	}
+
 	err = of_platform_populate(node, NULL, NULL, dev);
 	if (err) {
 		dev_err(&pdev->dev, "failed to create dwc3 core\n");