generic: ar8216: use ar8216_read_port_link to get the CPU port link parameters
[openwrt.git] / target / linux / lantiq / patches / 820-fix-falcon-ltq_gpio_request.patch
1 --- a/arch/mips/include/asm/mach-lantiq/falcon/lantiq_soc.h
2 +++ b/arch/mips/include/asm/mach-lantiq/falcon/lantiq_soc.h
3 @@ -129,8 +129,8 @@ extern __iomem void *ltq_sys1_membase;
4 ltq_sys1_w32((ltq_sys1_r32(reg) & ~(clear)) | (set), reg)
5
6 /* gpio_request wrapper to help configure the pin */
7 -extern int ltq_gpio_request(unsigned int pin, unsigned int val,
8 - unsigned int dir, const char *name);
9 +extern int ltq_gpio_request(unsigned int pin, unsigned int alt0,
10 + unsigned int alt1, unsigned int dir, const char *name);
11 extern int ltq_gpio_mux_set(unsigned int pin, unsigned int mux);
12
13 /* to keep the irq code generic we need to define these to 0 as falcon
14 --- a/arch/mips/lantiq/falcon/gpio.c
15 +++ b/arch/mips/lantiq/falcon/gpio.c
16 @@ -96,11 +96,12 @@ int ltq_gpio_mux_set(unsigned int pin, u
17 }
18 EXPORT_SYMBOL(ltq_gpio_mux_set);
19
20 -int ltq_gpio_request(unsigned int pin, unsigned int val,
21 - unsigned int dir, const char *name)
22 +int ltq_gpio_request(unsigned int pin, unsigned int alt0,
23 + unsigned int alt1, unsigned int dir, const char *name)
24 {
25 int port = pin / 100;
26 int offset = pin % 100;
27 + unsigned int mux = (!!alt0) & ((!!alt1) << 1);
28
29 if (offset >= PINS_PER_PORT || port >= MAX_PORTS)
30 return -EINVAL;
31 @@ -115,7 +116,7 @@ int ltq_gpio_request(unsigned int pin, u
32 else
33 gpio_direction_input(pin);
34
35 - return ltq_gpio_mux_set(pin, val);
36 + return ltq_gpio_mux_set(pin, mux);
37 }
38 EXPORT_SYMBOL(ltq_gpio_request);
39
40 --- a/arch/mips/lantiq/falcon/prom.c
41 +++ b/arch/mips/lantiq/falcon/prom.c
42 @@ -43,9 +43,9 @@ ltq_soc_setup(void)
43 falcon_register_gpio();
44 if (register_asc1) {
45 ltq_register_asc(1);
46 - if (ltq_gpio_request(MUXC_SIF_RX_PIN, 3, 0, "asc1-rx"))
47 + if (ltq_gpio_request(MUXC_SIF_RX_PIN, 1, 1, 0, "asc1-rx"))
48 pr_err("failed to request asc1-rx");
49 - if (ltq_gpio_request(MUXC_SIF_TX_PIN, 3, 1, "asc1-tx"))
50 + if (ltq_gpio_request(MUXC_SIF_TX_PIN, 1, 1, 1, "asc1-tx"))
51 pr_err("failed to request asc1-tx");
52 ltq_sysctl_activate(SYSCTL_SYS1, ACTS_ASC1_ACT);
53 }
This page took 0.049588 seconds and 5 git commands to generate.