kernel: rtl8367b: fix external interface modes
[openwrt/openwrt.git] / target / linux / generic / files / include / linux / rtl8367.h
1 /*
2 * Platform data definition for the Realtek RTL8367 ethernet switch driver
3 *
4 * Copyright (C) 2011 Gabor Juhos <juhosg@openwrt.org>
5 *
6 * This program is free software; you can redistribute it and/or modify it
7 * under the terms of the GNU General Public License version 2 as published
8 * by the Free Software Foundation.
9 */
10
11 #ifndef _RTL8367_H
12 #define _RTL8367_H
13
14 #define RTL8367_DRIVER_NAME "rtl8367"
15 #define RTL8367B_DRIVER_NAME "rtl8367b"
16
17 enum rtl8367_port_speed {
18 RTL8367_PORT_SPEED_10 = 0,
19 RTL8367_PORT_SPEED_100,
20 RTL8367_PORT_SPEED_1000,
21 };
22
23 struct rtl8367_port_ability {
24 int force_mode;
25 int nway;
26 int txpause;
27 int rxpause;
28 int link;
29 int duplex;
30 enum rtl8367_port_speed speed;
31 };
32
33 enum rtl8367_extif_mode {
34 RTL8367_EXTIF_MODE_DISABLED = 0,
35 RTL8367_EXTIF_MODE_RGMII,
36 RTL8367_EXTIF_MODE_MII_MAC,
37 RTL8367_EXTIF_MODE_MII_PHY,
38 RTL8367_EXTIF_MODE_TMII_MAC,
39 RTL8367_EXTIF_MODE_TMII_PHY,
40 RTL8367_EXTIF_MODE_GMII,
41 RTL8367_EXTIF_MODE_RGMII_33V,
42 RTL8367B_EXTIF_MODE_RMII_MAC = 7,
43 RTL8367B_EXTIF_MODE_RMII_PHY,
44 RTL8367B_EXTIF_MODE_RGMII_33V,
45 };
46
47 struct rtl8367_extif_config {
48 unsigned int txdelay;
49 unsigned int rxdelay;
50 enum rtl8367_extif_mode mode;
51 struct rtl8367_port_ability ability;
52 };
53
54 struct rtl8367_platform_data {
55 unsigned gpio_sda;
56 unsigned gpio_sck;
57 void (*hw_reset)(bool active);
58
59 struct rtl8367_extif_config *extif0_cfg;
60 struct rtl8367_extif_config *extif1_cfg;
61 };
62
63 #endif /* _RTL8367_H */