Skip to contentSkip to conversation

linux-next: manual merge of the usb-gadget tree with the usb tree

DISCUSSION Stephen Rothwell 2 participants 3 messages Mar 16, 2020 Linux-next tree

lore
Share & tools
lore
#0 lore raw

Hi all,

Today's linux-next merge of the usb-gadget tree got a conflict in:

drivers/usb/dwc3/dwc3-meson-g12a.c

between commit:

bce3052f0c16 ("usb: roles: Provide the switch drivers handle to the switch in the API")

from the usb tree and commit:

1e355f21d3fb ("usb: dwc3: Add Amlogic A1 DWC3 glue")

from the usb-gadget tree.

I fixed it up (see below) and can carry the fix as necessary. This is now fixed as far as linux-next is concerned, but any non trivial conflicts should be mentioned to your upstream maintainer when your tree is submitted for merging. You may also want to consider cooperating with the maintainer of the conflicting tree to minimise any particularly complex conflicts.

Signature · 62 lines
Cheers,
Stephen Rothwell

diff --cc drivers/usb/dwc3/dwc3-meson-g12a.c
index 3309ce90ca14,902553f39889..000000000000
--- a/drivers/usb/dwc3/dwc3-meson-g12a.c
+++ b/drivers/usb/dwc3/dwc3-meson-g12a.c
@@@ -381,6 -408,53 +409,54 @@@ static struct device *dwc3_meson_g12_fi
  	return &pdev->dev;
  }
  
+ static int dwc3_meson_g12a_otg_init(struct platform_device *pdev,
+ 				    struct dwc3_meson_g12a *priv)
+ {
+ 	enum phy_mode otg_id;
+ 	int ret, irq;
+ 	struct device *dev = &pdev->dev;
+ 
+ 	if (!priv->drvdata->otg_switch_supported)
+ 		return 0;
+ 
+ 	if (priv->otg_mode == USB_DR_MODE_OTG) {
+ 		/* Ack irq before registering */
+ 		regmap_update_bits(priv->regmap, USB_R5,
+ 				   USB_R5_ID_DIG_IRQ, 0);
+ 
+ 		irq = platform_get_irq(pdev, 0);
+ 		ret = devm_request_threaded_irq(&pdev->dev, irq, NULL,
+ 						dwc3_meson_g12a_irq_thread,
+ 						IRQF_ONESHOT, pdev->name, priv);
+ 		if (ret)
+ 			return ret;
+ 	}
+ 
+ 	/* Setup OTG mode corresponding to the ID pin */
+ 	if (priv->otg_mode == USB_DR_MODE_OTG) {
+ 		otg_id = dwc3_meson_g12a_get_id(priv);
+ 		if (otg_id != priv->otg_phy_mode) {
+ 			if (dwc3_meson_g12a_otg_mode_set(priv, otg_id))
+ 				dev_warn(dev, "Failed to switch OTG mode\n");
+ 		}
+ 	}
+ 
+ 	/* Setup role switcher */
+ 	priv->switch_desc.usb2_port = dwc3_meson_g12_find_child(dev,
+ 								"snps,dwc3");
+ 	priv->switch_desc.udc = dwc3_meson_g12_find_child(dev, "snps,dwc2");
+ 	priv->switch_desc.allow_userspace_control = true;
+ 	priv->switch_desc.set = dwc3_meson_g12a_role_set;
+ 	priv->switch_desc.get = dwc3_meson_g12a_role_get;
++	priv->switch_desc.driver_data = priv;
+ 
+ 	priv->role_switch = usb_role_switch_register(dev, &priv->switch_desc);
+ 	if (IS_ERR(priv->role_switch))
+ 		dev_warn(dev, "Unable to register Role Switch\n");
+ 
+ 	return 0;
+ }
+ 
  static int dwc3_meson_g12a_probe(struct platform_device *pdev)
  {
  	struct dwc3_meson_g12a	*priv;
#1 lore raw
Quoted 8 lines · Stephen Rothwell

Hi all,

Today's linux-next merge of the usb-gadget tree got a conflict in:

drivers/usb/dwc3/dwc3-meson-g12a.c

between commit:

Quoted 7 lines

bce3052f0c16 ("usb: roles: Provide the switch drivers handle to the switch in the API")

from the usb tree and commit:

1e355f21d3fb ("usb: dwc3: Add Amlogic A1 DWC3 glue")

from the usb-gadget tree.

Thanks for this, I just hit this issue as I just merged the gadget tree into mine. I'll queue it up into my tree...

thanks,

greg k-h

#2 lore raw
In reply to Stephen Rothwell
Quoted 14 lines · Stephen Rothwell

Hi all,

Today's linux-next merge of the usb-gadget tree got a conflict in:

drivers/usb/dwc3/dwc3-meson-g12a.c

between commit:

bce3052f0c16 ("usb: roles: Provide the switch drivers handle to the switch in the API")

from the usb tree and commit:

1e355f21d3fb ("usb: dwc3: Add Amlogic A1 DWC3 glue")

Quoted 8 lines

from the usb-gadget tree.

I fixed it up (see below) and can carry the fix as necessary. This is now fixed as far as linux-next is concerned, but any non trivial conflicts should be mentioned to your upstream maintainer when your tree is submitted for merging. You may also want to consider cooperating with the maintainer of the conflicting tree to minimise any particularly complex conflicts.

Thanks, this matched up with my merge, I've now done this in my tree.

greg k-h