diff options
author | Andrey Smirnov <andrew.smirnov@gmail.com> | 2017-12-04 07:27:15 -0800 |
---|---|---|
committer | Sascha Hauer <s.hauer@pengutronix.de> | 2017-12-06 15:49:15 +0100 |
commit | eb00bb9f3865a891f7a37a8f2cf719005008b6a6 (patch) | |
tree | 58532623269d5ef21dd6d95798d0b89c2a1e0061 /include | |
parent | 48df7919f9c2787c23e5efade7d5a7af39d40f13 (diff) | |
download | barebox-eb00bb9f3865a891f7a37a8f2cf719005008b6a6.tar.gz barebox-eb00bb9f3865a891f7a37a8f2cf719005008b6a6.tar.xz |
net: phy: Port MDIO bus miltiplexer framework from Linux kernel
Port mdio-mux.c from Linux kernel to Barebox, to support adding
dirvers that rely on that infrastructure/API.
Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'include')
-rw-r--r-- | include/linux/mdio-mux.h | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/include/linux/mdio-mux.h b/include/linux/mdio-mux.h new file mode 100644 index 0000000000..1730939bfc --- /dev/null +++ b/include/linux/mdio-mux.h @@ -0,0 +1,30 @@ +/* + * MDIO bus multiplexer framwork. + * + * This file is subject to the terms and conditions of the GNU General Public + * License. See the file "COPYING" in the main directory of this archive + * for more details. + * + * Copyright (C) 2011, 2012 Cavium, Inc. + */ +#ifndef __LINUX_MDIO_MUX_H +#define __LINUX_MDIO_MUX_H +#include <driver.h> +#include <linux/phy.h> + +/* mdio_mux_init() - Initialize a MDIO mux + * @dev The device owning the MDIO mux + * @mux_node The device node of the MDIO mux + * @switch_fn The function called for switching target MDIO child + * @data Private data used by switch_fn() + * @mux_bus An optional parent bus (Other case are to use parent_bus property) + */ +int mdio_mux_init(struct device_d *dev, + struct device_node *mux_node, + int (*switch_fn) (int cur, int desired, void *data), + void *data, + struct mii_bus *mux_bus); + +void mdio_mux_uninit(void *mux_handle); + +#endif /* __LINUX_MDIO_MUX_H */ |