projects
/
openwrt.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
133f6e8
)
ar71xx: add helper function to setup ath9k LED/GPIO on the AP94 based boards
author
juhosg
<juhosg@3c298f89-4303-0410-b956-a3cf2f4a3e73>
Fri, 17 Dec 2010 17:10:19 +0000
(17:10 +0000)
committer
juhosg
<juhosg@3c298f89-4303-0410-b956-a3cf2f4a3e73>
Fri, 17 Dec 2010 17:10:19 +0000
(17:10 +0000)
git-svn-id: svn://svn.openwrt.org/openwrt/trunk@24649
3c298f89
-4303-0410-b956-
a3cf2f4a3e73
target/linux/ar71xx/files/arch/mips/ar71xx/dev-ap94-pci.c
patch
|
blob
|
history
target/linux/ar71xx/files/arch/mips/ar71xx/dev-ap94-pci.h
patch
|
blob
|
history
target/linux/ar71xx/files/arch/mips/ar71xx/mach-wndr3700.c
patch
|
blob
|
history
diff --git
a/target/linux/ar71xx/files/arch/mips/ar71xx/dev-ap94-pci.c
b/target/linux/ar71xx/files/arch/mips/ar71xx/dev-ap94-pci.c
index
c91aada
..
05b5be4
100644
(file)
--- a/
target/linux/ar71xx/files/arch/mips/ar71xx/dev-ap94-pci.c
+++ b/
target/linux/ar71xx/files/arch/mips/ar71xx/dev-ap94-pci.c
@@
-54,19
+54,30
@@
static int ap94_pci_plat_dev_init(struct pci_dev *dev)
return 0;
}
return 0;
}
-
void __init ap94_pci_enable_quirk_wndr3700(void
)
+
__init void ap94_pci_setup_wmac_led_pin(unsigned wmac, int pin
)
{
{
- /* WNDR3700 uses GPIO 6-9 for antenna configuration */
-
- ap94_wmac0_data.led_pin = 5;
- ap94_wmac0_data.gpio_mask = (0xf << 6);
- /* 2.4 GHz uses the first fixed antenna group (0, 1, 0, 1) */
- ap94_wmac0_data.gpio_val = (10 << 6);
+ switch (wmac) {
+ case 0:
+ ap94_wmac0_data.led_pin = pin;
+ break;
+ case 1:
+ ap94_wmac1_data.led_pin = pin;
+ break;
+ }
+}
- ap94_wmac1_data.led_pin = 5;
- ap94_wmac1_data.gpio_mask = (0xf << 6);
- /* 5 GHz uses the second fixed antenna group (0, 1, 1, 0) */
- ap94_wmac1_data.gpio_val = (6 << 6);
+__init void ap94_pci_setup_wmac_gpio(unsigned wmac, u32 mask, u32 val)
+{
+ switch (wmac) {
+ case 0:
+ ap94_wmac0_data.gpio_mask = mask;
+ ap94_wmac0_data.gpio_val = val;
+ break;
+ case 1:
+ ap94_wmac1_data.gpio_mask = mask;
+ ap94_wmac1_data.gpio_val = val;
+ break;
+ }
}
void __init ap94_pci_init(u8 *cal_data0, u8 *mac_addr0,
}
void __init ap94_pci_init(u8 *cal_data0, u8 *mac_addr0,
diff --git
a/target/linux/ar71xx/files/arch/mips/ar71xx/dev-ap94-pci.h
b/target/linux/ar71xx/files/arch/mips/ar71xx/dev-ap94-pci.h
index
e69ba55
..
84ce27b
100644
(file)
--- a/
target/linux/ar71xx/files/arch/mips/ar71xx/dev-ap94-pci.h
+++ b/
target/linux/ar71xx/files/arch/mips/ar71xx/dev-ap94-pci.h
@@
-15,13
+15,16
@@
void ap94_pci_init(u8 *cal_data0, u8 *mac_addr0,
u8 *cal_data1, u8 *mac_addr1) __init;
void ap94_pci_init(u8 *cal_data0, u8 *mac_addr0,
u8 *cal_data1, u8 *mac_addr1) __init;
-void ap94_pci_enable_quirk_wndr3700(void) __init;
+void ap94_pci_setup_wmac_led_pin(unsigned wmac, int pin) __init;
+void ap94_pci_setup_wmac_gpio(unsigned wmac, u32 mask, u32 val) __init;
#else
static inline void ap94_pci_init(u8 *cal_data0, u8 *mac_addr0,
u8 *cal_data1, u8 *mac_addr1) {}
#else
static inline void ap94_pci_init(u8 *cal_data0, u8 *mac_addr0,
u8 *cal_data1, u8 *mac_addr1) {}
-static inline void ap94_pci_enable_quirk_wndr3700(void) {}
+static inline void ap94_pci_setup_wmac_led_pin(unsigned wmac, int pin) {};
+static inline void ap94_pci_setup_wmac_gpio(unsigned wmac,
+ u32 mask, u32 val) {};
#endif
#endif /* _AR71XX_DEV_AP94_PCI_H */
#endif
#endif /* _AR71XX_DEV_AP94_PCI_H */
diff --git
a/target/linux/ar71xx/files/arch/mips/ar71xx/mach-wndr3700.c
b/target/linux/ar71xx/files/arch/mips/ar71xx/mach-wndr3700.c
index
bc7c900
..
7b1ee90
100644
(file)
--- a/
target/linux/ar71xx/files/arch/mips/ar71xx/mach-wndr3700.c
+++ b/
target/linux/ar71xx/files/arch/mips/ar71xx/mach-wndr3700.c
@@
-203,7
+203,15
@@
static void __init wndr3700_setup(void)
platform_device_register(&wndr3700_rtl8366s_device);
platform_device_register_simple("wndr3700-led-usb", -1, NULL, 0);
platform_device_register(&wndr3700_rtl8366s_device);
platform_device_register_simple("wndr3700-led-usb", -1, NULL, 0);
- ap94_pci_enable_quirk_wndr3700();
+ ap94_pci_setup_wmac_led_pin(0, 5);
+ ap94_pci_setup_wmac_led_pin(1, 5);
+
+ /* 2.4 GHz uses the first fixed antenna group (1, 0, 1, 0) */
+ ap94_pci_setup_wmac_gpio(0, (0xf << 6), (0xa << 6));
+
+ /* 5 GHz uses the second fixed antenna group (0, 1, 1, 0) */
+ ap94_pci_setup_wmac_gpio(1, (0xf << 6), (0x6 << 6));
+
ap94_pci_init(art + WNDR3700_CALDATA0_OFFSET,
art + WNDR3700_WMAC0_MAC_OFFSET,
art + WNDR3700_CALDATA1_OFFSET,
ap94_pci_init(art + WNDR3700_CALDATA0_OFFSET,
art + WNDR3700_WMAC0_MAC_OFFSET,
art + WNDR3700_CALDATA1_OFFSET,
This page took
0.024316 seconds
and
4
git commands to generate.