return buflen;
}
-#ifdef TIWLAN_MSM7000
+#if 0 /* def TIWLAN_MSM7000 */
#define WIFI_NVS_LEN_OFFSET 0x0C
#define WIFI_NVS_DATA_OFFSET 0x40
#define WIFI_NVS_MAX_SIZE 0x800UL
#ifdef TIWLAN_MSM7000
-#define TROUT_IRQ MSM_GPIO_TO_INT(29)
+#include <mach/gpio.h>
+
+#define PANDORA_WIFI_IRQ OMAP_GPIO_IRQ(21)
static void tiwlan_sdio_irq(struct sdio_func *func)
{
SDIO_SetFunc( func );
- rc = tiwlan_create_drv(0, 0, 0, 0, 0, TROUT_IRQ, NULL, NULL);
+ rc = tiwlan_create_drv(0, 0, 0, 0, 0, PANDORA_WIFI_IRQ, NULL, NULL);
printk(KERN_INFO "TIWLAN: Driver initialized (rc %d)\n", rc);
complete(&sdio_wait);
#elif defined(TIWLAN_MSM7000)
#ifdef CONFIG_WIFI_CONTROL_FUNC
wifi_add_dev();
-#else
+#elif 0
trout_wifi_power(1); /* Power On */
trout_wifi_reset(0); /* Reset clear */
trout_wifi_set_carddetect(1); /* CardDetect (0->1) */
#endif
+ rc = gpio_request(PANDORA_WIFI_GPIO, "wifi");
+ if (rc != 0) {
+ printk(KERN_ERR "can't get wifi GPIO\n");
+ return rc;
+ }
+
+ rc = gpio_direction_output(PANDORA_WIFI_GPIO, 1);
+ if (rc != 0) {
+ gpio_free(PANDORA_WIFI_GPIO);
+ printk(KERN_ERR "can't set wifi GPIO out\n");
+ return rc;
+ }
+
+ msleep(50);
+
+ omap_mmc_fake_detect_mmc3(1);
/* Register ourselves as an SDIO driver */
rc = sdio_register_driver(&tiwlan_sdio_drv);
}
/* rc = tiwlan_create_drv(0, 0, 0, 0, 0, TROUT_IRQ, NULL, NULL); -- Called in probe */
+#if 0
tiwlan_calibration = create_proc_entry("calibration", 0644, NULL);
if (tiwlan_calibration == NULL)
return -EINVAL;
tiwlan_calibration->size = tiwlan_get_nvs_size();
tiwlan_calibration->read_proc = tiwlan_calibration_read_proc;
tiwlan_calibration->write_proc = tiwlan_calibration_write_proc;
+#endif
if (!wait_for_completion_timeout(&sdio_wait, msecs_to_jiffies(10000))) {
printk(KERN_ERR "%s: Timed out waiting for device detect\n", __func__);
+#if 0
remove_proc_entry("calibration", NULL);
+#endif
sdio_unregister_driver(&tiwlan_sdio_drv);
#ifdef CONFIG_WIFI_CONTROL_FUNC
wifi_del_dev();
-#else
+#elif 0
trout_wifi_set_carddetect(0); /* CardDetect (1->0) */
trout_wifi_reset(1); /* Reset active */
trout_wifi_power(0); /* Power Off */
-#endif
+#endif
+ gpio_set_value(PANDORA_WIFI_GPIO, 0);
+ gpio_free(PANDORA_WIFI_GPIO);
return -ENODEV;
}
printk(KERN_INFO "TIWLAN: Driver loaded\n");
sdio_unregister_driver(&tiwlan_sdio_drv);
#ifdef CONFIG_WIFI_CONTROL_FUNC
wifi_del_dev();
-#else
+#elif 0
trout_wifi_set_carddetect(0); /* CardDetect (1->0) */
trout_wifi_reset(1); /* Reset active */
trout_wifi_power(0); /* Power Off */
#endif
+ gpio_set_value(PANDORA_WIFI_GPIO, 0);
+ gpio_free(PANDORA_WIFI_GPIO);
+ msleep(50);
+ omap_mmc_fake_detect_mmc3(0);
#endif
printk(KERN_INFO "TIWLAN: Driver unloaded\n");
}