sync hh.org
[hh.org.git] / drivers / net / wireless / acx / rx3715_acx.c
blob787f71b5ef968ea2ce4925b0cb844ad2da39daa7
1 /*
2 * WLAN (TI TNETW1100B) support in the rx3715
4 * Copyright (c) 2006 SDG Systems, LLC
5 * Copyright (c) 2006 Roman Moravcik
7 * This file is subject to the terms and conditions of the GNU General Public
8 * License. See the file COPYING in the main directory of this archive for
9 * more details.
11 * Based on hx4700_acx.c
15 #include <linux/kernel.h>
16 #include <linux/platform_device.h>
17 #include <linux/delay.h>
18 #include <linux/leds.h>
20 #include <asm/hardware.h>
22 #include <asm/arch/regs-gpio.h>
23 #include <linux/soc/asic3_base.h>
24 #include <asm/arch/rx3715-asic3.h>
25 #include <asm/arch/rx3715-leds.h>
26 #include <asm/io.h>
28 #include "acx_hw.h"
30 extern struct platform_device s3c_device_asic3;
32 #define WLAN_BASE 0x20000000
34 static int rx3715_wlan_start(void)
36 printk( "rx3715_wlan_start\n" );
37 asic3_set_gpio_out_b(&s3c_device_asic3.dev, ASIC3_GPB3, ASIC3_GPB3);
38 mdelay(20);
39 asic3_set_gpio_out_c(&s3c_device_asic3.dev, ASIC3_GPC13, ASIC3_GPC13);
40 mdelay(20);
41 asic3_set_gpio_out_c(&s3c_device_asic3.dev, ASIC3_GPC11, ASIC3_GPC11);
42 mdelay(100);
43 asic3_set_gpio_out_b(&s3c_device_asic3.dev, ASIC3_GPB3, ASIC3_GPB3);
44 mdelay(20);
45 s3c2410_gpio_cfgpin(S3C2410_GPA15, S3C2410_GPA15_nGCS4);
46 mdelay(100);
47 s3c2410_gpio_setpin(S3C2410_GPA11, 0);
48 mdelay(50);
49 s3c2410_gpio_setpin(S3C2410_GPA11, 1);
50 led_trigger_event_shared(rx3715_radio_trig, LED_FULL);
51 return 0;
54 static int rx3715_wlan_stop(void)
56 printk( "rx3715_wlan_stop\n" );
57 s3c2410_gpio_setpin(S3C2410_GPA15, 1);
58 s3c2410_gpio_cfgpin(S3C2410_GPA15, S3C2410_GPA15_OUT);
59 asic3_set_gpio_out_b(&s3c_device_asic3.dev, ASIC3_GPB3, 0);
60 asic3_set_gpio_out_c(&s3c_device_asic3.dev, ASIC3_GPC13, 0);
61 asic3_set_gpio_out_c(&s3c_device_asic3.dev, ASIC3_GPC11, 0);
62 led_trigger_event_shared(rx3715_radio_trig, LED_OFF);
63 return 0;
66 static struct resource acx_resources[] = {
67 [0] = {
68 .start = WLAN_BASE,
69 .end = WLAN_BASE + 0x20,
70 .flags = IORESOURCE_MEM,
72 [1] = {
73 .start = IRQ_EINT16,
74 .end = IRQ_EINT16,
75 .flags = IORESOURCE_IRQ,
79 static struct acx_hardware_data acx_data = {
80 .start_hw = rx3715_wlan_start,
81 .stop_hw = rx3715_wlan_stop,
84 static struct platform_device acx_device = {
85 .name = "acx-mem",
86 .dev = {
87 .platform_data = &acx_data,
89 .num_resources = ARRAY_SIZE(acx_resources),
90 .resource = acx_resources,
93 static int __init rx3715_wlan_init(void)
95 printk("rx3715_wlan_init: acx-mem platform_device_register\n");
96 return platform_device_register(&acx_device);
100 static void __exit rx3715_wlan_exit(void)
102 platform_device_unregister(&acx_device);
105 module_init(rx3715_wlan_init);
106 module_exit(rx3715_wlan_exit);
108 MODULE_AUTHOR("Todd Blumer <todd@sdgsystems.com>");
109 MODULE_DESCRIPTION("WLAN driver for rx3715");
110 MODULE_LICENSE("GPL");