blob: a5d58f22193967d19d947b368fe3ae810079e0b5 [file] [log] [blame]
David Daney0ca29972012-05-02 15:16:38 +00001/*
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>
Pramod Kumarf20e6652016-06-10 11:03:45 +053013#include <linux/phy.h>
David Daney0ca29972012-05-02 15:16:38 +000014
Corentin Labbe5482a972017-09-04 18:30:14 +020015/* mdio_mux_init() - Initialize a MDIO mux
16 * @dev The device owning the MDIO mux
17 * @mux_node The device node of the MDIO mux
18 * @switch_fn The function called for switching target MDIO child
19 * mux_handle A pointer to a (void *) used internaly by mdio-mux
20 * @data Private data used by switch_fn()
21 * @mux_bus An optional parent bus (Other case are to use parent_bus property)
22 */
David Daney0ca29972012-05-02 15:16:38 +000023int mdio_mux_init(struct device *dev,
Corentin Labbe5482a972017-09-04 18:30:14 +020024 struct device_node *mux_node,
David Daney0ca29972012-05-02 15:16:38 +000025 int (*switch_fn) (int cur, int desired, void *data),
26 void **mux_handle,
Pramod Kumarf20e6652016-06-10 11:03:45 +053027 void *data,
28 struct mii_bus *mux_bus);
David Daney0ca29972012-05-02 15:16:38 +000029
30void mdio_mux_uninit(void *mux_handle);
31
32#endif /* __LINUX_MDIO_MUX_H */