Re: [PATCH] usb: dwc3: pci: passing forward the ACPI companion

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, Aug 17, 2015 at 12:59:52PM -0500, Felipe Balbi wrote:
> On Mon, Aug 17, 2015 at 10:26:53AM -0700, David Cohen wrote:
> > On Mon, Aug 17, 2015 at 08:41:19AM -0500, Felipe Balbi wrote:
> > > On Mon, Aug 17, 2015 at 02:32:06PM +0300, Heikki Krogerus wrote:
> > > > Sharing the APCI companion with the core platforms device so
> > >               ^^^^
> > > 	      ACPI :-)
> > > 
> > > > it has access to all DWC3's resources.
> > > 
> > > and which resources are these ? and why can't they be abstrated out in
> > > dwc3-pci ?
> > 
> > I could think about USB phy devices on legacy BYT-CR products. But since
> > we got Heikki's ULPI bus we are able to move ACPI companion to their own
> > phy device on future.
> 
> we need a better commit log explaining why this is really needed.

OK.

I'm also thinking about the properties with this. If we convert core.c
to use the unified device property interface (check the attached
diff), like we ultimately will need to do, the driver is then ready to
pick those properties also from ACPI tables.

It does not actually have any functional affect on DT platforms. It
only makes it possible to read the property also from ACPI (and
later from "build-in" property), so I'll prepare a patch from that
diff and send it together with this one if you guys are OK with that?


Cheers,

-- 
heikki
diff --git a/drivers/usb/dwc3/core.c b/drivers/usb/dwc3/core.c
index 064123e..8221ad8 100644
--- a/drivers/usb/dwc3/core.c
+++ b/drivers/usb/dwc3/core.c
@@ -844,49 +844,10 @@ static int dwc3_probe(struct platform_device *pdev)
 
 	if (node) {
 		dwc->maximum_speed = of_usb_get_maximum_speed(node);
-		dwc->has_lpm_erratum = of_property_read_bool(node,
-				"snps,has-lpm-erratum");
-		of_property_read_u8(node, "snps,lpm-nyet-threshold",
-				&lpm_nyet_threshold);
-		dwc->is_utmi_l1_suspend = of_property_read_bool(node,
-				"snps,is-utmi-l1-suspend");
-		of_property_read_u8(node, "snps,hird-threshold",
-				&hird_threshold);
-		dwc->usb3_lpm_capable = of_property_read_bool(node,
-				"snps,usb3_lpm_capable");
-
-		dwc->needs_fifo_resize = of_property_read_bool(node,
-				"tx-fifo-resize");
 		dwc->dr_mode = of_usb_get_dr_mode(node);
+	}
 
-		dwc->disable_scramble_quirk = of_property_read_bool(node,
-				"snps,disable_scramble_quirk");
-		dwc->u2exit_lfps_quirk = of_property_read_bool(node,
-				"snps,u2exit_lfps_quirk");
-		dwc->u2ss_inp3_quirk = of_property_read_bool(node,
-				"snps,u2ss_inp3_quirk");
-		dwc->req_p1p2p3_quirk = of_property_read_bool(node,
-				"snps,req_p1p2p3_quirk");
-		dwc->del_p1p2p3_quirk = of_property_read_bool(node,
-				"snps,del_p1p2p3_quirk");
-		dwc->del_phy_power_chg_quirk = of_property_read_bool(node,
-				"snps,del_phy_power_chg_quirk");
-		dwc->lfps_filter_quirk = of_property_read_bool(node,
-				"snps,lfps_filter_quirk");
-		dwc->rx_detect_poll_quirk = of_property_read_bool(node,
-				"snps,rx_detect_poll_quirk");
-		dwc->dis_u3_susphy_quirk = of_property_read_bool(node,
-				"snps,dis_u3_susphy_quirk");
-		dwc->dis_u2_susphy_quirk = of_property_read_bool(node,
-				"snps,dis_u2_susphy_quirk");
-
-		dwc->tx_de_emphasis_quirk = of_property_read_bool(node,
-				"snps,tx_de_emphasis_quirk");
-		of_property_read_u8(node, "snps,tx_de_emphasis",
-				&tx_de_emphasis);
-		of_property_read_string(node, "snps,hsphy_interface",
-					&dwc->hsphy_interface);
-	} else if (pdata) {
+	if (pdata) {
 		dwc->maximum_speed = pdata->maximum_speed;
 		dwc->has_lpm_erratum = pdata->has_lpm_erratum;
 		if (pdata->lpm_nyet_threshold)
@@ -915,6 +876,48 @@ static int dwc3_probe(struct platform_device *pdev)
 			tx_de_emphasis = pdata->tx_de_emphasis;
 
 		dwc->hsphy_interface = pdata->hsphy_interface;
+	} else {
+		dwc->has_lpm_erratum = device_property_read_bool(dev,
+				"snps,has-lpm-erratum");
+		of_property_read_u8(node, "snps,lpm-nyet-threshold",
+				&lpm_nyet_threshold);
+		dwc->is_utmi_l1_suspend = device_property_read_bool(dev,
+				"snps,is-utmi-l1-suspend");
+		of_property_read_u8(node, "snps,hird-threshold",
+				&hird_threshold);
+		dwc->usb3_lpm_capable = device_property_read_bool(dev,
+				"snps,usb3_lpm_capable");
+
+		dwc->needs_fifo_resize = device_property_read_bool(dev,
+				"tx-fifo-resize");
+
+		dwc->disable_scramble_quirk = device_property_read_bool(dev,
+				"snps,disable_scramble_quirk");
+		dwc->u2exit_lfps_quirk = device_property_read_bool(dev,
+				"snps,u2exit_lfps_quirk");
+		dwc->u2ss_inp3_quirk = device_property_read_bool(dev,
+				"snps,u2ss_inp3_quirk");
+		dwc->req_p1p2p3_quirk = device_property_read_bool(dev,
+				"snps,req_p1p2p3_quirk");
+		dwc->del_p1p2p3_quirk = device_property_read_bool(dev,
+				"snps,del_p1p2p3_quirk");
+		dwc->del_phy_power_chg_quirk = device_property_read_bool(dev,
+				"snps,del_phy_power_chg_quirk");
+		dwc->lfps_filter_quirk = device_property_read_bool(dev,
+				"snps,lfps_filter_quirk");
+		dwc->rx_detect_poll_quirk = device_property_read_bool(dev,
+				"snps,rx_detect_poll_quirk");
+		dwc->dis_u3_susphy_quirk = device_property_read_bool(dev,
+				"snps,dis_u3_susphy_quirk");
+		dwc->dis_u2_susphy_quirk = device_property_read_bool(dev,
+				"snps,dis_u2_susphy_quirk");
+
+		dwc->tx_de_emphasis_quirk = device_property_read_bool(dev,
+				"snps,tx_de_emphasis_quirk");
+		device_property_read_u8(dev, "snps,tx_de_emphasis",
+					&tx_de_emphasis);
+		device_property_read_string(dev, "snps,hsphy_interface",
+					    &dwc->hsphy_interface);
 	}
 
 	/* default to superspeed if no maximum_speed passed */

[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux