Back to home page

OSCL-LXR

 
 

    


0001 /*
0002  * MDIO bus multiplexer framwork.
0003  *
0004  * This file is subject to the terms and conditions of the GNU General Public
0005  * License.  See the file "COPYING" in the main directory of this archive
0006  * for more details.
0007  *
0008  * Copyright (C) 2011, 2012 Cavium, Inc.
0009  */
0010 #ifndef __LINUX_MDIO_MUX_H
0011 #define __LINUX_MDIO_MUX_H
0012 #include <linux/device.h>
0013 #include <linux/phy.h>
0014 
0015 /* mdio_mux_init() - Initialize a MDIO mux
0016  * @dev     The device owning the MDIO mux
0017  * @mux_node    The device node of the MDIO mux
0018  * @switch_fn   The function called for switching target MDIO child
0019  * mux_handle   A pointer to a (void *) used internaly by mdio-mux
0020  * @data    Private data used by switch_fn()
0021  * @mux_bus An optional parent bus (Other case are to use parent_bus property)
0022  */
0023 int mdio_mux_init(struct device *dev,
0024           struct device_node *mux_node,
0025           int (*switch_fn) (int cur, int desired, void *data),
0026           void **mux_handle,
0027           void *data,
0028           struct mii_bus *mux_bus);
0029 
0030 void mdio_mux_uninit(void *mux_handle);
0031 
0032 #endif /* __LINUX_MDIO_MUX_H */