Werner Almesberger wrote:
Sean McNeil wrote:
Android has moved to expecting what is now a standard interface to RF devices for switching them on and off. Attached is a patch to stable-tracking to add support of turning on/off bluetooth via. rfkill.

Hmm, with gta02-moredrivers-defconfig the kernel cheerfully announces

[21474539.295000] ------------[ cut here ]------------
[21474539.300000] WARNING: at net/rfkill/rfkill.c:752 
rfkill_register+0x60/0x218()
[21474539.305000] rfkill: attempt to register a badly initialized rfkill struct
[...]
[21474539.340000] [<c035b1a4>] (rfkill_register+0x0/0x218) from [<c0012bf8>] 
(gta01_bt_probe+0x94/0xc0)
[21474539.350000]  r7:00000000 r6:c046a138 r5:c046a130 r4:c799a800
[21474539.355000] [<c0012b64>] (gta01_bt_probe+0x0/0xc0) from [<c01c81b0>] 
(platform_drv_probe+0x20/0x24)
[21474539.365000]  r6:c0470078 r5:c046a138 r4:00000000
[...]

Yikes! I didn't see this as my debug board is being shipped by boat and my dmesg buffer is flooded with jffs2 complaints. Thanks for pointing it out.

I guess it doesn't like the
        rfkill->state = -1;

Should this be RFKILL_STATE_SOFT_BLOCKED ?

It should be RFKILL_STATE_OFF.

By the way, while you're at it, the initialization logic in
gta01_bt_probe is almost the same as what would happen if you
bt_rfkill_toggle_radio(pdev->dev, RFKILL_STATE_OFF);

Close, but in the GTA02 case we wouldn't set the regulator to 0 as the enable pin would probably already be off.

- Werner


Reply via email to