On Sat, 13 Jun 2009 19:00:41 +0300 Kalle Valo <kalle.valo@xxxxxx> wrote: > > When the power line is pulled up, the chip will power on itself. > Whenever the power line goes down, the chip will power off. For example, > the power line can be controlled with a GPIO pin from the host. But how > the power line is really controlled, is board specific and should be > handled in the board file. And here comes the set_power() function to > the picture. The wl1251 driver will call set_power() function every time > user space calls wlan interface up or down. > That doesn't make sense. If the card doesn't have power then there will be no device and no interface to bring up. I suspect we're not talking about the same thing. I'm referring to this: +static int wifi_probe(struct platform_device *pdev) +{ + struct wifi_platform_data *wifi_ctrl = + (struct wifi_platform_data *)(pdev->dev.platform_data); + + if (!wifi_ctrl) + return -ENODEV; + + wifi_ctrl->set_power(1); /* Power On */ + wifi_ctrl->set_reset(0); /* Reset clear */ + wifi_ctrl->set_carddetect(1); /* CardDetect (0->1) */ + + return 0; +} This seems very board specific and not something that should be in the chip driver. > Pierre, how do you propose we should do this? I understood based on > discussions from linux-omap that this is a common way. I haven't seen anything like this before, but it might just be that I've looked in the wrong places. I think this should be somewhere under arch/ in the board setup code, where currently you have some code adding the "msm_wifi" platform device. (I also agree with Marcel that this looks like RFKILL material) Rgds -- -- Pierre Ossman WARNING: This correspondence is being monitored by the Swedish government. Make sure your server uses encryption for SMTP traffic and consider using PGP for end-to-end encryption.
Attachment:
signature.asc
Description: PGP signature