Linux wireless drivers development
 help / color / mirror / Atom feed
From: Denis 'GNUtoo' Carikli <GNUtoo@no-log.org>
To: Grazvydas Ignotas <notasas@gmail.com>
Cc: Bob Copeland <me@bobcopeland.com>, Kalle Valo <kvalo@adurom.com>,
	"John W.Linville" <linville@tuxdriver.com>,
	linux-wireless@vger.kernel.org
Subject: Re: [PATCH 2/2] wl1251: fix ELP_CTRL register reads
Date: Wed, 23 Jun 2010 01:33:27 +0200	[thread overview]
Message-ID: <1277249607.2233.270.camel@gnutoo-laptop> (raw)
In-Reply-To: <AANLkTildbagKqzTQbcZ8cT53s4L2OWpJ5fkBUTcejj0h@mail.gmail.com>

On Tue, 2010-06-22 at 01:48 +0300, Grazvydas Ignotas wrote:
> >> Probably not relevant to power saving, but:
> >>
> >> Are you using the dedicated irq line or sdio interrupt?
> >> It makes a big difference in overall throughput to use
> >> the former.
> > I don't know. what should I grep for?
> 
> It might actually be related.. Try adding this to your board file to
> enable GPIO irq:
> 
> static void wl1251_set_power(bool enable)
> {
> }
> 
> static struct wl12xx_platform_data wl1251_pdata = {
>         .set_power      = wl1251_set_power,
> };
> 
> static struct platform_device wl1251_data = {
>         .name           = "wl1251_data",
>         .id             = -1,
>         .dev            = {
>                 .platform_data  = &wl1251_pdata,
>         },
> };
> 
> .. then from some init function:
> 
> // WIFI_IRQ_GPIO is the GPIO number connected to wl1251 irq line
> wl1251_pdata.irq = gpio_to_irq(WIFI_IRQ_GPIO);
> platform_device_register(&wl1251_pdata);
Thanks a lot for the infos,they were really helpfull.

I've applied that patch(as it was not for submitting,just for reading I
didn't bother sending with git-send-email): 
Index: sources/arch/arm/mach-msm/board-trout.c
===================================================================
--- sources.orig/arch/arm/mach-msm/board-trout.c	2010-06-23
00:41:54.601288614 +0200
+++ sources/arch/arm/mach-msm/board-trout.c	2010-06-23
00:43:59.893158944 +0200
@@ -52,6 +52,7 @@
 #include <asm/mach/mmc.h>
 #include <linux/mmc/sdio_ids.h>
 #include <linux/msm_audio.h>
+#include <linux/spi/wl12xx.h>
 
 #include "board-trout.h"
 
@@ -363,6 +364,17 @@
 	},
 };
 
+struct wl12xx_platform_data wl12xx_data = {
+};
+
+static struct platform_device  wl12xx = {
+	.name		= "wl1251_data",
+	.id		= -1,
+	.dev		= {
+		.platform_data = &wl12xx_data,
+	},
+};
+
 #ifdef CONFIG_HTC_HEADSET
 static void h2w_config_cpld(int route)
 {
@@ -650,6 +662,7 @@
 	&trout_pwr_sink,
 #endif
 	&trout_snd,
+	&wl12xx,
 };
 
 extern struct sys_timer msm_timer;
@@ -745,6 +758,7 @@
 
 static void __init config_gpios(void)
 {
+	wl12xx_data.irq = gpio_to_irq(29);
 	config_gpio_table(gpio_table, ARRAY_SIZE(gpio_table));
 	config_camera_off_gpios();
 }
Index: sources/include/linux/spi/wl12xx.h
===================================================================
--- sources.orig/include/linux/spi/wl12xx.h	2010-06-23
00:42:03.641283312 +0200
+++ sources/include/linux/spi/wl12xx.h	2010-06-23 00:42:48.103178185
+0200
@@ -26,6 +26,7 @@
 
 struct wl12xx_platform_data {
 	void (*set_power)(bool enable);
+	int irq;
 };
 
 #endif

The patch was made from someone in irc and modified by me later.

Then I load the wifi as usual:
modprobe wl1251_sdio #it doesn't crash
modprobe msm_wifi
the modprobe msm_wifi gives the following result:
[ 1366.500427] wifi probe start
[ 1366.500457] trout_wifi_power: 1
[ 1366.927185] trout_wifi_reset: 0
[ 1367.030944] trout_wifi_set_carddetect: 1
[ 1367.030975] mmc0: card_present 1
[ 1367.030975] mmc0: Slot status change detected (0 -> 1)
[ 1367.031036] wifi probe done
And then I've an invisible crash/kernel panic which result in the
machine lockup and then reboot(so it should be a kernel panic).
Note that I've no serial yet(I think I should really get a serial cable
for this machine)

msm_wifi comes from here:
http://bobcopeland.com/srcs/android/msm_wifi.patch

I had already some wifi structures which may have conflicted:

struct wifi_platform_data trout_wifi_control = {
	.set_power		= trout_wifi_power,
	.set_reset		= trout_wifi_reset,
	.set_carddetect		= trout_wifi_set_carddetect,
#ifdef CONFIG_WIFI_MEM_PREALLOC
	.mem_prealloc		= trout_wifi_mem_prealloc,
#else
	.mem_prealloc		= NULL,
#endif	
};

static struct platform_device trout_wifi = {
	.name		= "msm_wifi",
	.id		= 1,
	.num_resources	= 0,
	.resource	= NULL,
	.dev		= {
		.platform_data = &trout_wifi_control,
	},
};

Thanks a lot for the help so far.
Denis




  reply	other threads:[~2010-06-22 23:34 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-06-04 23:25 [PATCH 1/2] wl1251: fix a memory leak in probe Grazvydas Ignotas
2010-06-04 23:25 ` [PATCH 2/2] wl1251: fix ELP_CTRL register reads Grazvydas Ignotas
2010-06-05  7:04   ` Kalle Valo
2010-06-21 12:46     ` Denis 'GNUtoo' Carikli
2010-06-21 17:54       ` Bob Copeland
2010-06-21 18:45         ` Denis 'GNUtoo' Carikli
2010-06-21 22:48           ` Grazvydas Ignotas
2010-06-22 23:33             ` Denis 'GNUtoo' Carikli [this message]
2010-06-24 23:09               ` Denis 'GNUtoo' Carikli
2010-06-24 23:34                 ` Grazvydas Ignotas
2010-06-25 16:01                   ` Denis 'GNUtoo' Carikli
2010-06-25 18:06                     ` Denis 'GNUtoo' Carikli
2010-06-05  7:00 ` [PATCH 1/2] wl1251: fix a memory leak in probe Kalle Valo

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1277249607.2233.270.camel@gnutoo-laptop \
    --to=gnutoo@no-log.org \
    --cc=kvalo@adurom.com \
    --cc=linux-wireless@vger.kernel.org \
    --cc=linville@tuxdriver.com \
    --cc=me@bobcopeland.com \
    --cc=notasas@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox