10 #include <linux/device.h>
12 #include <linux/module.h>
18 #define DRV_VERSION "1.0"
19 #define DRV_DESCRIPTION "GPIO controlled MDIO bus multiplexer driver"
21 #define MDIO_MUX_GPIO_MAX_BITS 8
29 static int mdio_mux_gpio_switch_fn(
int current_child,
int desired_child,
36 if (current_child == desired_child)
39 change = current_child == -1 ? -1 : current_child ^ desired_child;
44 (desired_child & 1) != 0);
60 if (!pdev->
dev.of_node)
63 num_gpios = of_gpio_count(pdev->
dev.of_node);
74 int gpio = of_get_gpio_flags(pdev->
dev.of_node, n, &f);
96 pdev->
dev.platform_data =
s;
116 .compatible =
"mdio-mux-gpio",
120 .compatible =
"cavium,mdio-mux-sn74cbtlv3253",
128 .name =
"mdio-mux-gpio",
130 .of_match_table = mdio_mux_gpio_match,
132 .probe = mdio_mux_gpio_probe,