branch Attitude Adjustment
[12.09/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
16 enum rtl8367_port_speed {
17         RTL8367_PORT_SPEED_10 = 0,
18         RTL8367_PORT_SPEED_100,
19         RTL8367_PORT_SPEED_1000,
20 };
21
22 struct rtl8367_port_ability {
23         int force_mode;
24         int nway;
25         int txpause;
26         int rxpause;
27         int link;
28         int duplex;
29         enum rtl8367_port_speed speed;
30 };
31
32 enum rtl8367_extif_mode {
33         RTL8367_EXTIF_MODE_DISABLED = 0,
34         RTL8367_EXTIF_MODE_RGMII,
35         RTL8367_EXTIF_MODE_MII_MAC,
36         RTL8367_EXTIF_MODE_MII_PHY,
37         RTL8367_EXTIF_MODE_TMII_MAC,
38         RTL8367_EXTIF_MODE_TMII_PHY,
39         RTL8367_EXTIF_MODE_GMII,
40         RTL8367_EXTIF_MODE_RGMII_33V,
41 };
42
43 struct rtl8367_extif_config {
44         unsigned int txdelay;
45         unsigned int rxdelay;
46         enum rtl8367_extif_mode mode;
47         struct rtl8367_port_ability ability;
48 };
49
50 struct rtl8367_platform_data {
51         unsigned gpio_sda;
52         unsigned gpio_sck;
53         void (*hw_reset)(bool active);
54
55         struct rtl8367_extif_config *extif0_cfg;
56         struct rtl8367_extif_config *extif1_cfg;
57 };
58
59 #endif /*  _RTL8367_H */