Skip to content

Commit

Permalink
ubnt: Changeset for 1.12.30
Browse files Browse the repository at this point in the history
This commit represents the changeset for the UniFi Dream Machine firmware
release version v1.12.30 compared to Linux v4.19.152 (with public
patches applied).
  • Loading branch information
fabianishere committed Sep 30, 2022
1 parent 171ace5 commit 261fc64
Showing 1 changed file with 30 additions and 0 deletions.
30 changes: 30 additions & 0 deletions drivers/net/phy/realtek.c
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
#include <linux/bitops.h>
#include <linux/phy.h>
#include <linux/module.h>
#include <linux/of_address.h>

#define RTL821x_PHYSR 0x11
#define RTL821x_PHYSR_DUPLEX BIT(13)
Expand Down Expand Up @@ -162,6 +163,33 @@ static int rtl8211c_config_init(struct phy_device *phydev)
return genphy_config_init(phydev);
}

static void rtl8211f_led_config(struct phy_device *phydev)
{
struct device_node *node;
u32 led_config;
struct of_device_id of_realtek_table[] = {
{.compatible = "realtek,rtl8211fs"},
{ /* end of list */ },
};

node = of_find_matching_node(NULL, of_realtek_table);
if (!node) {
/* rtl8211fs entry could not be found */
return;
}

dev_info(&phydev->mdio.dev, "rtl8211fs entry is found\n");
/* configure LED setup accordingly */
if (!of_property_read_u32(node, "led-mode", &led_config)) {
dev_info(&phydev->mdio.dev, "led-mode: 0x%04x\n", led_config);
phy_write(phydev, RTL821x_PAGE_SELECT, 0xd04);
phy_write(phydev, 0x10, led_config);
phy_write(phydev, RTL821x_PAGE_SELECT, 0x0);
}

return;
}

static int rtl8211f_config_init(struct phy_device *phydev)
{
int ret;
Expand All @@ -171,6 +199,8 @@ static int rtl8211f_config_init(struct phy_device *phydev)
if (ret < 0)
return ret;

rtl8211f_led_config(phydev);

/* enable TX-delay for rgmii-id and rgmii-txid, otherwise disable it */
if (phydev->interface == PHY_INTERFACE_MODE_RGMII_ID ||
phydev->interface == PHY_INTERFACE_MODE_RGMII_TXID)
Expand Down

0 comments on commit 261fc64

Please sign in to comment.