mdio-mux.h 1021 B

1234567891011121314151617181920212223242526272829303132
  1. /*
  2. * MDIO bus multiplexer framwork.
  3. *
  4. * This file is subject to the terms and conditions of the GNU General Public
  5. * License. See the file "COPYING" in the main directory of this archive
  6. * for more details.
  7. *
  8. * Copyright (C) 2011, 2012 Cavium, Inc.
  9. */
  10. #ifndef __LINUX_MDIO_MUX_H
  11. #define __LINUX_MDIO_MUX_H
  12. #include <linux/device.h>
  13. #include <linux/phy.h>
  14. /* mdio_mux_init() - Initialize a MDIO mux
  15. * @dev The device owning the MDIO mux
  16. * @mux_node The device node of the MDIO mux
  17. * @switch_fn The function called for switching target MDIO child
  18. * mux_handle A pointer to a (void *) used internaly by mdio-mux
  19. * @data Private data used by switch_fn()
  20. * @mux_bus An optional parent bus (Other case are to use parent_bus property)
  21. */
  22. int mdio_mux_init(struct device *dev,
  23. struct device_node *mux_node,
  24. int (*switch_fn) (int cur, int desired, void *data),
  25. void **mux_handle,
  26. void *data,
  27. struct mii_bus *mux_bus);
  28. void mdio_mux_uninit(void *mux_handle);
  29. #endif /* __LINUX_MDIO_MUX_H */