We have a custom iMX53 based platform running Android Gingerbread, Linux kernel 2.6.35 with a TiWi-BLE Wlan/Bluetooth device using the SDIO interface for WLAN.
We have a problem when the radio is being restarted where the OS loses communication with the radio.
It looks like the problem is caused by the fact that the power control initialisation in the platform-specific section is not being done correctly. The WL12xx porting guide
has a section on power control and details how to register the power control function with the MMC device. Specifically the key piece of code is as follows:
static void wl12xx_init(int evm_id, int profile)
struct device *dev;
struct omap_mmc_platform_data *pdata;
dev = am335x_mmc.dev;
pdata->slots.set_power = wl12xx_set_power;
I have done a similar thing on our platform in the WL1271 driver. I dont think this is correct and the right approach is to do this in the board-specific code as specified in the porting guide. However the example above is TI/OMAP-specific and I'm unsure how to do this on the Freescale platform since the structures are different and the Freescale structures do no appear to support this in the same way.
Can anyone clarify if this is the right thing to do and how this is done on the Freescale platform?
That way (following TI's instructions) leads to disaster!
We wrote some notes about this a while back:
The gist of it is in the sdhci.c file, which expects to be able to toggle a GPIO through
the SDHCI registers.
Since the i.MX5x and i.MX6x SDHCI controller doesn't support this, you need to allow a call-back
into platform-specific code to toggle the RESET pin on the WL1271.
I've implemented this scheme but the problem is still there. My understanding is that I should see the set power function called at the correct time. The correct time being when the interface is configured up and down. However this is not happening and I still have the problem. There seems to some linkage missing between the SDIO/MMC stack and the low level set-power.
The Android and kernel version are older than the one used in the IMX6 but I believe I've implemented an equivalent functionality.