power: reset: add driver for LinkStation power off
PATCH v2 1/2 power: reset: add driver for LinkStation power off
Some Buffalo LinkStations perform the power off operation, at restart time, depending on the state of an output pin (LED2/INTn) at the ethernet PHY. This pin is also used to wake the machine when a WoL packet is received by the PHY.
The driver is required by the Buffalo LinkStation LS421DE (ARM MVEBU), and other models. Without it, the board remains forever halted if a power off command is executed, unless the PSU is disconnected and connected again.
Add the driver to provide the power off function and also make the WoL feature to be available.
---
Changes in v2:
- The driver is now compatible with the WoL function, the LED2 pin output is now used as INTn. Added the required code to make INTn work properly.
- Code for PHY autodectection deleted, "phy-handle,intn" is now mandatory.
- Replace a dev_info with a dev_dbg.
- Use phy_device_free in the driver remove.
- Cosmetic changes.
drivers/power/reset/Kconfig | 11 ++ drivers/power/reset/Makefile | 1 + drivers/power/reset/linkstation-poweroff.c | 140 +++++++++++++++++++++ 3 files changed, 152 insertions(+) create mode 100644 drivers/power/reset/linkstation-poweroff.c
drivers/power/reset/Kconfig +11 -0
@@ -99,6 +99,17 @@ config POWER_RESET_HISI help Reboot support for Hisilicon boards. +config POWER_RESET_LINKSTATION + tristate "Buffalo LinkStation power-off driver" + depends on ARCH_MVEBU || COMPILE_TEST + depends on OF_MDIO && PHYLIB + help + This driver supports turning off some Buffalo LinkStations by + setting an output pin at the ethernet PHY to the correct state. + It also makes the device compatible with the WoL function. + + Say Y here if you have Buffalo LinkStation LS421D/E. + config POWER_RESET_MSM bool "Qualcomm MSM power-off driver" depends on ARCH_QCOM
drivers/power/reset/Makefile +1 -0
@@ -10,6 +10,7 @@ obj-$(CONFIG_POWER_RESET_GEMINI_POWEROFF) += gemini-poweroff.o obj-$(CONFIG_POWER_RESET_GPIO) += gpio-poweroff.o obj-$(CONFIG_POWER_RESET_GPIO_RESTART) += gpio-restart.o obj-$(CONFIG_POWER_RESET_HISI) += hisi-reboot.o +obj-${CONFIG_POWER_RESET_LINKSTATION} += linkstation-poweroff.o obj-$(CONFIG_POWER_RESET_MSM) += msm-poweroff.o obj-$(CONFIG_POWER_RESET_MT6323) += mt6323-poweroff.o obj-$(CONFIG_POWER_RESET_OXNAS) += oxnas-restart.o
drivers/power/reset/linkstation-poweroff.c new file +140 -0
140 lines not on this page · raw message
Signature · 1 line
2.27.0