|
|
@@ -49,7 +49,7 @@ Signed-off-by: Sander Vanheule <[email protected]>
|
|
|
obj-$(CONFIG_MDIO_THUNDER) += mdio-thunder.o
|
|
|
--- /dev/null
|
|
|
+++ b/drivers/net/mdio/mdio-realtek-otto-aux.c
|
|
|
-@@ -0,0 +1,175 @@
|
|
|
+@@ -0,0 +1,187 @@
|
|
|
+// SPDX-License-Identifier: GPL-2.0-or-later
|
|
|
+
|
|
|
+#include <linux/mfd/core.h>
|
|
|
@@ -65,6 +65,7 @@ Signed-off-by: Sander Vanheule <[email protected]>
|
|
|
+#define RTL8380_EXT_GPIO_INDIRECT_ACCESS 0xA09C
|
|
|
+#define RTL8390_EXT_GPIO_INDIRECT_ACCESS 0x0224
|
|
|
+#define RTL9300_EXT_GPIO_INDIRECT_ACCESS 0xC620
|
|
|
++#define RTL9310_EXT_GPIO_INDIRECT_ACCESS 0x07F4
|
|
|
+
|
|
|
+#define RTL83XX_AUX_MDIO_DATA_OFFSET 16
|
|
|
+#define RTL83XX_AUX_MDIO_RCMD_FAIL 0
|
|
|
@@ -106,6 +107,13 @@ Signed-off-by: Sander Vanheule <[email protected]>
|
|
|
+ .timeout_us = 19000,
|
|
|
+};
|
|
|
+
|
|
|
++static const struct realtek_aux_mdio_info info_rtl931x = {
|
|
|
++ .cmd_reg = RTL9310_EXT_GPIO_INDIRECT_ACCESS,
|
|
|
++ .data_offset = RTL93XX_AUX_MDIO_DATA_OFFSET,
|
|
|
++ .rcmd_fail_mask = RTL93XX_AUX_MDIO_RCMD_FAIL,
|
|
|
++ .timeout_us = 19000,
|
|
|
++};
|
|
|
++
|
|
|
+struct realtek_aux_mdio_ctrl {
|
|
|
+ struct device *dev;
|
|
|
+ struct regmap *map;
|
|
|
@@ -209,6 +217,10 @@ Signed-off-by: Sander Vanheule <[email protected]>
|
|
|
+ .compatible = "realtek,rtl9300-aux-mdio",
|
|
|
+ .data = &info_rtl930x,
|
|
|
+ },
|
|
|
++ {
|
|
|
++ .compatible = "realtek,rtl9310-aux-mdio",
|
|
|
++ .data = &info_rtl931x,
|
|
|
++ },
|
|
|
+ { /* sentinel */ }
|
|
|
+};
|
|
|
+MODULE_DEVICE_TABLE(of, realtek_aux_mdio_of_match);
|