summaryrefslogtreecommitdiffstats
path: root/target/linux/generic/hack-6.1/765-mxl-gpy-control-LED-reg-from-DT.patch
diff options
context:
space:
mode:
authorDaniel Golle <daniel@makrotopia.org>2023-12-10 01:15:36 +0000
committerDaniel Golle <daniel@makrotopia.org>2023-12-10 01:21:27 +0000
commit90fbec89be263a3838558c5b674f3c4072cc2f1d (patch)
treed5facc48073afea13cb3b0bb7601c2c9b41264df /target/linux/generic/hack-6.1/765-mxl-gpy-control-LED-reg-from-DT.patch
parent45c85c1827d45f8041b8f270d80bf6fff328069c (diff)
downloadopenwrt-90fbec89be263a3838558c5b674f3c4072cc2f1d.tar.gz
openwrt-90fbec89be263a3838558c5b674f3c4072cc2f1d.tar.bz2
openwrt-90fbec89be263a3838558c5b674f3c4072cc2f1d.zip
kernel: hack: support inverted LEDs on MaxLinear GPY211 PHY
Add downstream DT property to setup the PHY LEDs of the MaxLinear GPY211 PHY in such way that the VDD of the LED is driven by the SoC pin rather than the GND (which is the default). Signed-off-by: Daniel Golle <daniel@makrotopia.org>
Diffstat (limited to 'target/linux/generic/hack-6.1/765-mxl-gpy-control-LED-reg-from-DT.patch')
-rw-r--r--target/linux/generic/hack-6.1/765-mxl-gpy-control-LED-reg-from-DT.patch10
1 files changed, 7 insertions, 3 deletions
diff --git a/target/linux/generic/hack-6.1/765-mxl-gpy-control-LED-reg-from-DT.patch b/target/linux/generic/hack-6.1/765-mxl-gpy-control-LED-reg-from-DT.patch
index d7165cb30a..2724efa15e 100644
--- a/target/linux/generic/hack-6.1/765-mxl-gpy-control-LED-reg-from-DT.patch
+++ b/target/linux/generic/hack-6.1/765-mxl-gpy-control-LED-reg-from-DT.patch
@@ -55,7 +55,7 @@ Signed-off-by: David Bauer <mail@david-bauer.net>
/* SGMII */
#define VSPEC1_SGMII_CTRL 0x08
#define VSPEC1_SGMII_CTRL_ANEN BIT(12) /* Aneg enable */
-@@ -241,6 +248,31 @@ out:
+@@ -241,6 +248,35 @@ out:
return ret;
}
@@ -64,6 +64,7 @@ Signed-off-by: David Bauer <mail@david-bauer.net>
+ struct device_node *node = phydev->mdio.dev.of_node;
+ u32 led_regs[PHY_LED_NUM_LEDS];
+ int i, ret;
++ u16 val = 0xff00;
+
+ if (!IS_ENABLED(CONFIG_OF_MDIO))
+ return 0;
@@ -71,8 +72,11 @@ Signed-off-by: David Bauer <mail@david-bauer.net>
+ if (of_property_read_u32_array(node, "mxl,led-config", led_regs, PHY_LED_NUM_LEDS))
+ return 0;
+
++ if (of_property_read_bool(node, "mxl,led-drive-vdd"))
++ val &= 0x0fff;
++
+ /* Enable LED function handling on all ports*/
-+ phy_write(phydev, PHY_LED, 0xFF00);
++ phy_write(phydev, PHY_LED, val);
+
+ /* Write LED register values */
+ for (i = 0; i < PHY_LED_NUM_LEDS; i++) {
@@ -87,7 +91,7 @@ Signed-off-by: David Bauer <mail@david-bauer.net>
static int gpy_config_init(struct phy_device *phydev)
{
int ret;
-@@ -252,7 +284,10 @@ static int gpy_config_init(struct phy_de
+@@ -252,7 +288,10 @@ static int gpy_config_init(struct phy_de
/* Clear all pending interrupts */
ret = phy_read(phydev, PHY_ISTAT);