diff mbox series

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

Message ID 20240712-dwc-mp-v1-2-295e5c4e3ec9@nxp.com (mailing list archive)
State Superseded
Headers show
Series usb: imx8mp: collect some improvement | expand

Commit Message

Frank Li July 12, 2024, 3:40 p.m. UTC
Add 2 software manage quirk properites (xhci-missing-cas-quirk and
xhci-skip-phy-init-quirk) for xhci host.

Signed-off-by: Frank Li <Frank.Li@nxp.com>
---
 drivers/usb/dwc3/dwc3-imx8mp.c | 18 ++++++++++++++++++
 1 file changed, 18 insertions(+)

Comments

Thinh Nguyen Aug. 7, 2024, 1:08 a.m. UTC | #1
On Fri, Jul 12, 2024, Frank Li wrote:
> Add 2 software manage quirk properites (xhci-missing-cas-quirk and
> xhci-skip-phy-init-quirk) for xhci host.
> 
> Signed-off-by: Frank Li <Frank.Li@nxp.com>
> ---
>  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 8ee4480685031..5794bb75f7604 100644
> --- a/drivers/usb/dwc3/dwc3-imx8mp.c
> +++ b/drivers/usb/dwc3/dwc3-imx8mp.c
> @@ -144,6 +144,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] = {};

To be safe, use props[3] = { 0 } initialization sematic so to keep
compatibility.

> +	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;
> @@ -226,6 +237,13 @@ static int dwc3_imx8mp_probe(struct platform_device *pdev)
>  		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
> 

The rest looks fine to me.

BR,
Thinh
diff mbox series

Patch

diff --git a/drivers/usb/dwc3/dwc3-imx8mp.c b/drivers/usb/dwc3/dwc3-imx8mp.c
index 8ee4480685031..5794bb75f7604 100644
--- a/drivers/usb/dwc3/dwc3-imx8mp.c
+++ b/drivers/usb/dwc3/dwc3-imx8mp.c
@@ -144,6 +144,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] = {};
+	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;
@@ -226,6 +237,13 @@  static int dwc3_imx8mp_probe(struct platform_device *pdev)
 		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");