kernel: b53: add support for GPIO reset
[lede.git] / target / linux / generic / files / drivers / net / phy / b53 / b53_priv.h
index fca74ae4b90d4c7c9670b0428c3c951a255649a6..53da4064072b7829e4dd285a13513a6c64480f41 100644 (file)
@@ -75,6 +75,7 @@ struct b53_device {
        u8 duplex_reg;
        u8 jumbo_pm_reg;
        u8 jumbo_size_reg;
+       int reset_gpio;
 
        /* used ports mask */
        u16 enabled_ports;
@@ -275,4 +276,17 @@ static inline int b53_write64(struct b53_device *dev, u8 page, u8 reg,
        return ret;
 }
 
+#ifdef CONFIG_BCM47XX
+
+#include <bcm47xx_nvram.h>
+static inline int b53_switch_get_reset_gpio(struct b53_device *dev)
+{
+       return bcm47xx_nvram_gpio_pin("robo_reset");
+}
+#else
+static inline int b53_switch_get_reset_gpio(struct b53_device *dev)
+{
+       return -ENOENT;
+}
+#endif
 #endif