[brcm63xx] add preliminary support for 3.6 kernel
[openwrt.git] / target / linux / brcm63xx / patches-3.6 / 526-board_CT6373-1.patch
1 --- a/arch/mips/bcm63xx/boards/board_bcm963xx.c
2 +++ b/arch/mips/bcm63xx/boards/board_bcm963xx.c
3 @@ -51,6 +51,13 @@
4  #define NB4_SPI_GPIO_CLK       6
5  #define NB4_74HC64_GPIO(X)     (NB4_74X164_GPIO_BASE + (X))
6  
7 +#define CT6373_PID_OFFSET              0xff80
8 +#define CT6373_74X164_GPIO_BASE        64
9 +#define CT6373_SPI_GPIO_MOSI   7
10 +#define CT6373_SPI_GPIO_CLK            6
11 +#define CT6373_74HC64_GPIO(X)  (CT6373_74X164_GPIO_BASE + (X))
12 +
13 +
14  static struct board_info board;
15  
16  /*
17 @@ -2261,6 +2268,111 @@ static struct board_info __initdata boar
18         .num_spis = ARRAY_SIZE(nb4_spi_devices),
19  };
20  
21 +
22 +struct spi_gpio_platform_data ct6373_spi_gpio_data = {
23 +       .sck            = CT6373_SPI_GPIO_CLK,
24 +       .mosi           = CT6373_SPI_GPIO_MOSI,
25 +       .miso           = SPI_GPIO_NO_MISO,
26 +       .num_chipselect = 1,
27 +};
28 +
29 +static struct platform_device ct6373_spi_gpio = {
30 +       .name = "spi_gpio",
31 +       .id   = 1,
32 +       .dev = {
33 +               .platform_data = &ct6373_spi_gpio_data,
34 +       },
35 +};
36 +
37 +static struct platform_device * __initdata ct6373_devices[] = {
38 +       &ct6373_spi_gpio,
39 +};
40 +
41 +const struct gen_74x164_chip_platform_data ct6373_74x164_platform_data = {
42 +       .base = CT6373_74X164_GPIO_BASE
43 +};
44 +
45 +static struct spi_board_info ct6373_spi_devices[] = {
46 +       {
47 +               .modalias = "74x164",
48 +               .max_speed_hz = 781000,
49 +               .bus_num = 1,
50 +               .controller_data = (void *) SPI_GPIO_NO_CHIPSELECT,
51 +               .mode = SPI_MODE_0,
52 +               .platform_data = &ct6373_74x164_platform_data
53 +       }
54 +};
55 +
56 +static struct board_info __initdata board_ct6373_1 = {
57 +       .name                           = "CT6373-1",
58 +       .expected_cpu_id        = 0x6358,
59 +
60 +       .has_uart0                      = 1,
61 +       .has_pci                        = 1,
62 +       .has_ohci0                      = 1,
63 +       .has_ehci0                      = 1,
64 +
65 +       .has_enet1                      = 1,
66 +       .enet1 = {
67 +               .force_speed_100        = 1,
68 +               .force_duplex_full      = 1,
69 +       },
70 +
71 +       .leds = {
72 +               {
73 +                       .name           = "CT6373-1:green:power",
74 +                       .gpio           = 0,
75 +                       .default_trigger = "default-on",
76 +               },
77 +               {
78 +                       .name           = "CT6373-1:green:usb",
79 +                       .gpio           = 3,
80 +                       .active_low     = 1,
81 +               },
82 +               {
83 +                       .name           = "CT6373-1:green:wlan",
84 +                       .gpio           = 9,
85 +                       .active_low     = 1,
86 +               },
87 +               {
88 +                       .name           = "CT6373-1:green:adsl",
89 +                       .gpio           = CT6373_74HC64_GPIO(0),
90 +                       .active_low     = 1,
91 +               },
92 +               {
93 +                       .name           = "CT6373-1:green:line",
94 +                       .gpio           = CT6373_74HC64_GPIO(1),
95 +                       .active_low     = 1,
96 +               },
97 +               {
98 +                       .name           = "CT6373-1:green:fxs1",
99 +                       .gpio           = CT6373_74HC64_GPIO(2),
100 +                       .active_low     = 1,
101 +               },
102 +               {
103 +                       .name           = "CT6373-1:green:fxs2",
104 +                       .gpio           = CT6373_74HC64_GPIO(3),
105 +                       .active_low     = 1,
106 +               },
107 +       },
108 +
109 +       .buttons = {
110 +               {
111 +                       .desc           = "reset",
112 +                       .gpio           = 35,
113 +                       .active_low     = 1,
114 +                       .type           = EV_KEY,
115 +                       .code           = KEY_RESTART,
116 +                       .debounce_interval = BCM963XX_KEYS_DEBOUNCE_INTERVAL,
117 +               },
118 +       },
119 +
120 +       .devs = ct6373_devices,
121 +       .num_devs = ARRAY_SIZE(ct6373_devices),
122 +       .spis = ct6373_spi_devices,
123 +       .num_spis = ARRAY_SIZE(ct6373_spi_devices),
124 +};
125 +
126  static struct board_info __initdata board_HW553 = {
127         .name                           = "HW553",
128         .expected_cpu_id                = 0x6358,
129 @@ -2592,6 +2704,7 @@ static const struct board_info __initdat
130         &board_nb4_ser_r2,
131         &board_nb4_fxc_r1,
132         &board_nb4_fxc_r2,
133 +       &board_ct6373_1,
134         &board_HW553,
135         &board_spw303v,
136  #endif