ODROID-N2: phy/realtek: add to support Wake On Lan enable

Adding new kernel command line "enable_wol=<1|0>" will configure the WOL
features on next power off.

Change-Id: I4830aeb1651e90d4699887199000def1163fb6db
Signed-off-by: Dongjin Kim <tobetter@gmail.com>
(cherry picked from commit 22d698f4d2)
This commit is contained in:
Dongjin Kim
2019-03-13 06:43:20 -04:00
parent d6c634e62f
commit 8a6446fa7a
2 changed files with 23 additions and 0 deletions

View File

@@ -166,10 +166,30 @@ static int rtl8211f_config_init(struct phy_device *phydev)
}
#ifdef CONFIG_AMLOGIC_ETH_PRIVE
#if defined(CONFIG_ARCH_MESON64_ODROID_COMMON)
#include <linux/amlogic/scpi_protocol.h>
static u32 enable_wol = 0;
static int __init enable_wol_setup(char *str)
{
enable_wol = (str[0] != '0');
support_external_phy_wol = enable_wol;
return 0;
}
__setup("enable_wol=", enable_wol_setup);
#endif
int rtl8211f_suspend(struct phy_device *phydev)
{
int value = 0;
#if defined(CONFIG_ARCH_MESON64_ODROID_COMMON)
scpi_send_usr_data(SCPI_CL_WOL, &enable_wol, sizeof(enable_wol));
#endif
if (support_external_phy_wol) {
mutex_lock(&phydev->lock);
phy_write(phydev, RTL8211F_PAGE_SELECT, 0xd8a);

View File

@@ -27,6 +27,9 @@ enum scpi_client_id {
SCPI_CL_THERMAL,
SCPI_CL_REMOTE,
SCPI_CL_LED_TIMER,
#if defined(CONFIG_ARCH_MESON64_ODROID_COMMON)
SCPI_CL_WOL,
#endif
SCPI_MAX,
};