linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* htc dream wl1251 and MSM_GPIO_TO_INT(29)
@ 2011-01-14 23:33 Denis 'GNUtoo' Carikli
  2011-01-17 15:08 ` Bob Copeland
  0 siblings, 1 reply; 3+ messages in thread
From: Denis 'GNUtoo' Carikli @ 2011-01-14 23:33 UTC (permalink / raw)
  To: Kalle Valo; +Cc: Grazvydas Ignotas, linux-wireless, Bob Copeland

hi,
In the TI driver available here:
http://android.git.kernel.org/?p=platform/system/wlan/ti.git;a=blob;f=sta_dk_4_0_4_32/pform/linux/src/esta_drv.c;h=a968e20bebf6c22f9983d0a6db50b40f04f1f1e8;hb=refs/heads/froyo
there is:
#define TROUT_IRQ MSM_GPIO_TO_INT(29)
[...]
if (drv->irq)
    [...]
    if ((rc = request_irq (drv->irq, (irq_handler_t)tiwlan_interrupt,
IRQF_SHARED | IRQF_TRIGGER_FALLING /*Dm:*/, drv->netdev->name,
drv))){//error message}
    [...]
    set_irq_type (drv->irq, IRQ_TYPE_EDGE_FALLING);
    [...]
    disable_irq (drv->irq);

So we learn several things here:
*it uses MSM_GPIO_TO_INT(29)
*the irq configuration.

So I took the 2.6.32 kernel version available here:
http://gitorious.org/htc-msm-2-6-32/leviathan-incoming/commits/android-msm-2.6.32-rebase

I also took an old compat-wireless driver(because more recent ones have
the runtime PM capability and I don't know how to make it work with an
old 2.6.32 kernel that lacks such patches)
The version is this one compat-wireless-2010-10-04

I modified both the kernel and compat wireless to be able to pass the
wl12xx struct directly, like in recent kernels, and it seem to work.

The problem is the following:
When I do that:
modprobe msm_wifi, wich is the old wifi activator from bob copeland
available here:
http://bobcopeland.com/srcs/android/msm_wifi.patch

it freeze the phone, and watch -n 0.1 cat /proc/interupts trough ssh
seem frozen too

Here's the code for passing the data :

static void trout_wl1251_init(void)
{
        struct wl12xx_platform_data trout_wl1251_pdata;
        int ret;

        trout_wl1251_pdata.irq = MSM_GPIO_TO_INT(29);
        if (trout_wl1251_pdata.irq < 0)
                goto fail_irq;
        trout_wl1251_pdata.use_eeprom = false;
        ret = wl12xx_set_platform_data(&trout_wl1251_pdata);
        if (ret < 0)
                goto fail_irq;
fail_irq:
        printk("trout wifi GPIO failed\n");
        gpio_free(TROUT_WIFI_IRQ_GPIO);

}

The data is beeing passed(else it wouldn't freesze) and the phone
freezes.

note that the compat wireless irq handling code is different from the ti
driver:
if (wl->irq) {
    ret = request_irq(wl->irq, wl1251_line_irq, 0, "wl1251", wl);
    if (ret < 0) {
        wl1251_error("request_irq() failed: %d", ret);
                goto disable;
    }

     set_irq_type(wl->irq, IRQ_TYPE_EDGE_RISING);
     disable_irq(wl->irq);

     wl1251_sdio_ops.enable_irq = wl1251_enable_line_irq;
     wl1251_sdio_ops.disable_irq = wl1251_disable_line_irq;

     wl1251_info("using dedicated interrupt line");
}

in the TI driver there is IRQ_TYPE_EDGE_FALLING while here there is
IRQ_TYPE_EDGE_RISING.

How should I start debugging that issue? do I need a serial cable for my
device and kgdb(doesn't serial need IRQ?, maybe I should look how msm
serial works)?

Denis.




^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2011-01-20 12:55 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-01-14 23:33 htc dream wl1251 and MSM_GPIO_TO_INT(29) Denis 'GNUtoo' Carikli
2011-01-17 15:08 ` Bob Copeland
2011-01-20 12:55   ` Denis 'GNUtoo' Carikli

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).