6d6aea86eeacf901195c4c3358b43ec95cd0e7af
[openwrt.git] / target / linux / lantiq / patches-3.0 / 998-easy98000-asc1.patch
1 activate serial driver for ASC1 if "use_asc1=x" is given on kernel commandline
2 mux setup for pins is done via late_initcall, when the gpio driver is initialized
3
4 only implemented for EASY98000, generic version t.b.d.
5 --- a/arch/mips/lantiq/falcon/devices.c
6 +++ b/arch/mips/lantiq/falcon/devices.c
7 @@ -75,6 +75,7 @@ void __init falcon_register_asc(int port
8         case 1:
9                 platform_device_register_simple("ltq_asc", 1,
10                         falcon_asc1_resources, ARRAY_SIZE(falcon_asc1_resources));
11 +               sys1_hw_activate(ACTS_ASC1_ACT);
12                 break;
13         default:
14                 break;
15 --- a/arch/mips/lantiq/falcon/mach-easy98000.c
16 +++ b/arch/mips/lantiq/falcon/mach-easy98000.c
17 @@ -15,6 +15,7 @@
18  #include <linux/spi/spi.h>
19  #include <linux/spi/spi_gpio.h>
20  #include <linux/spi/eeprom.h>
21 +#include <falcon/lantiq_soc.h>
22  
23  #include "../machtypes.h"
24  
25 @@ -206,9 +207,34 @@ static void __init easy98000_spi_gpio_in
26         platform_device_register(&easy98000_spi_gpio_device);
27  }
28  
29 +static int register_asc1 = 0;
30 +static int __init parse_asc1(char *p)
31 +{
32 +       register_asc1 = 1;
33 +       return 0;
34 +}
35 +__setup("use_asc1", parse_asc1);
36 +
37 +#define MUXC_SIF_RX_PIN                112
38 +#define MUXC_SIF_TX_PIN                113
39 +
40 +static int __init asc1_mux_setup(void)
41 +{
42 +       if (register_asc1) {
43 +               if (ltq_gpio_request(MUXC_SIF_RX_PIN, 1, 1, 0, "asc1-rx"))
44 +                       return -1;
45 +               if (ltq_gpio_request(MUXC_SIF_TX_PIN, 1, 1, 1, "asc1-tx"))
46 +                       return -1;
47 +       }
48 +       return 0;
49 +}
50 +late_initcall(asc1_mux_setup);
51 +
52  static void __init easy98000_init_common(void)
53  {
54         falcon_register_asc(0);
55 +       if (register_asc1)
56 +               falcon_register_asc(1);
57         falcon_register_gpio();
58         falcon_register_wdt();
59         falcon_register_i2c();