]> git.dujemihanovic.xyz Git - linux.git/commitdiff
net: dsa: microchip: use wakeup-source DT property to enable PME output
authorOleksij Rempel <o.rempel@pengutronix.de>
Mon, 23 Oct 2023 09:33:37 +0000 (11:33 +0200)
committerDavid S. Miller <davem@davemloft.net>
Wed, 25 Oct 2023 07:47:33 +0000 (08:47 +0100)
KSZ switches with WoL support signals wake event over PME pin. If this
pin is attached to some external PMIC or System Controller can't be
described as GPIO, the only way to describe it in the devicetree is to
use wakeup-source property. So, add support for this property and enable
PME switch output if this property is present.

Signed-off-by: Oleksij Rempel <o.rempel@pengutronix.de>
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
Reviewed-by: Florian Fainelli <florian.fainelli@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/dsa/microchip/ksz_common.c
drivers/net/dsa/microchip/ksz_common.h

index e3f797cab8366a18939387fd9603738627bd8453..71c860e0d3af409eedb587b7fa33c05bf1d696b9 100644 (file)
@@ -4159,6 +4159,9 @@ int ksz_switch_register(struct ksz_device *dev)
                        dev_err(dev->dev, "inconsistent synclko settings\n");
                        return -EINVAL;
                }
+
+               dev->wakeup_source = of_property_read_bool(dev->dev->of_node,
+                                                          "wakeup-source");
        }
 
        ret = dsa_register_switch(dev->ds);
index 8842efca08719759b4207b90a45f90cb0c2511ec..f7c471bc040fd03e9642e78bb13f414fb8b94e14 100644 (file)
@@ -163,6 +163,7 @@ struct ksz_device {
        phy_interface_t compat_interface;
        bool synclko_125;
        bool synclko_disable;
+       bool wakeup_source;
 
        struct vlan_table *vlan_cache;