summaryrefslogtreecommitdiffstats
path: root/include/linux/phy.h
diff options
context:
space:
mode:
authorMichael Walle <michael@walle.cc>2023-01-09 13:30:12 +0100
committerPaolo Abeni <pabeni@redhat.com>2023-01-10 13:38:37 +0100
commit7d885863e716757553197687f304da1f538f61e1 (patch)
treed2a10429a046e3ba9c30b8959b621f5196078322 /include/linux/phy.h
parent90c47eb169ac5538c3376a1577cfe858c4efcf27 (diff)
downloadlinux-stable-7d885863e716757553197687f304da1f538f61e1.tar.gz
linux-stable-7d885863e716757553197687f304da1f538f61e1.tar.bz2
linux-stable-7d885863e716757553197687f304da1f538f61e1.zip
net: phy: allow a phy to opt-out of interrupt handling
Until now, it is not possible for a PHY driver to disable interrupts during runtime. If a driver offers the .config_intr() as well as the .handle_interrupt() ops, it is eligible for interrupt handling. Introduce a new flag for the dev_flags property of struct phy_device, which can be set by PHY driver to skip interrupt setup and fall back to polling mode. At the moment, this is used for the MaxLinear PHY which has broken interrupt handling and there is a need to disable interrupts in some cases. Signed-off-by: Michael Walle <michael@walle.cc> Reviewed-by: Andrew Lunn <andrew@lunn.ch> Signed-off-by: Paolo Abeni <pabeni@redhat.com>
Diffstat (limited to 'include/linux/phy.h')
-rw-r--r--include/linux/phy.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/include/linux/phy.h b/include/linux/phy.h
index 6378c997ded5..742754d72fc0 100644
--- a/include/linux/phy.h
+++ b/include/linux/phy.h
@@ -739,6 +739,9 @@ struct phy_device {
#endif
};
+/* Generic phy_device::dev_flags */
+#define PHY_F_NO_IRQ 0x80000000
+
static inline struct phy_device *to_phy_device(const struct device *dev)
{
return container_of(to_mdio_device(dev), struct phy_device, mdio);