Re: [RFC] net: qcom/emac: mdiobus-dev fwnode should point to emac-adev
From: Timur Tabi <hidden>
Date: 2018-01-25 14:36:04
On 01/25/2018 12:14 AM, Wang Dongsheng wrote:
mdiobus always try to get a GPIO "reset" consumer, based on ACPI the GPIO should be described in emac-adev _DSD or _CRS.
Are you talking about this:
/* de-assert bus level PHY GPIO reset */
gpiod = devm_gpiod_get_optional(&bus->dev, "reset", GPIOD_OUT_LOW);
if (IS_ERR(gpiod)) {
dev_err(&bus->dev, "mii_bus %s couldn't get reset GPIO\n",
bus->id);
return PTR_ERR(gpiod);
If so, I don't think we support named gpios in ACPI. Do you have an
actual test case for your patch? Our ACPI tables don't specify any
GPIOs for EMAC. I wouldn't even know what that should look like.
quoted hunk ↗ jump to hunk
diff --git a/drivers/net/ethernet/qualcomm/emac/emac-phy.c b/drivers/net/ethernet/qualcomm/emac/emac-phy.c index 53dbf1e..69171d5 100644 --- a/drivers/net/ethernet/qualcomm/emac/emac-phy.c +++ b/drivers/net/ethernet/qualcomm/emac/emac-phy.c@@ -117,6 +117,10 @@ int emac_phy_config(struct platform_device *pdev, struct emac_adapter *adpt) if (has_acpi_companion(&pdev->dev)) { u32 phy_addr; + struct fwnode_handle *fwnode; + + fwnode = acpi_fwnode_handle(ACPI_COMPANION(&pdev->dev)); + mii_bus->dev.fwnode = fwnode;
You don't need fwnode: mii_bus->dev.fwnode = acpi_fwnode_handle(ACPI_COMPANION(&pdev->dev)); -- Qualcomm Datacenter Technologies, Inc. as an affiliate of Qualcomm Technologies, Inc. Qualcomm Technologies, Inc. is a member of the Code Aurora Forum, a Linux Foundation Collaborative Project.