netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [RFC] net: qcom/emac: mdiobus-dev fwnode should point to emac-adev
@ 2018-01-25  6:14 Wang Dongsheng
  2018-01-25 14:15 ` Andrew Lunn
  2018-01-25 14:36 ` Timur Tabi
  0 siblings, 2 replies; 8+ messages in thread
From: Wang Dongsheng @ 2018-01-25  6:14 UTC (permalink / raw)
  To: timur; +Cc: hpuranik, yu.zheng, netdev, Wang Dongsheng

mdiobus always try to get a GPIO "reset" consumer, based on ACPI
the GPIO should be described in emac-adev _DSD or _CRS.

ACPI uses mido common API to register, however mdio->dev->fwnode is not
pointing to any adev. So the "reset" consumer can never be found.

OF has done this by using an of_mdiobus_register. The mdiobus get emac
of_node and go through the of_node to find a GPIO "reset" consumer.

Not sure, ACPI needs to add the same API for mdio just like OF because
mdio isn't a real entity in ACPI. So I think there isn't any work in
ACPI, the mac driver needs to take adev to mdiobus when mido-bus is
registering.

Signed-off-by: Wang Dongsheng <dongsheng.wang@hxt-semitech.com>
---
 drivers/net/ethernet/qualcomm/emac/emac-phy.c | 4 ++++
 1 file changed, 4 insertions(+)

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;
 
 		ret = mdiobus_register(mii_bus);
 		if (ret) {
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2018-01-30 13:21 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-01-25  6:14 [RFC] net: qcom/emac: mdiobus-dev fwnode should point to emac-adev Wang Dongsheng
2018-01-25 14:15 ` Andrew Lunn
2018-01-25 15:40   ` Timur Tabi
2018-01-25 15:59     ` Andrew Lunn
2018-01-25 16:05       ` Timur Tabi
2018-01-26  7:20         ` Wang, Dongsheng
2018-01-30 13:21           ` Andrew Lunn
2018-01-25 14:36 ` Timur Tabi

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).