Skip to contentSkip to conversation

Add OLPC XO-1 rfkill driver

PATCH Superseded Daniel Drake 2 participants 3 messages Oct 4, 2010 – Oct 14, 2010

Subsystems (2)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Add OLPC XO-1 rfkill driver

Add a software rfkill switch for the WLAN interface in the OLPC XO-1 laptop. It uses the OLPC embedded controller to cut/restore power to the Marvell WLAN chip on the motherboard.

---
 arch/x86/include/asm/olpc.h       |    2 +
 drivers/platform/x86/Kconfig      |    8 +++
 drivers/platform/x86/Makefile     |    1 +
 drivers/platform/x86/xo1-rfkill.c |   86 +++++++++++++++++++++++++++++++++++++
 4 files changed, 97 insertions(+), 0 deletions(-)
 create mode 100644 drivers/platform/x86/xo1-rfkill.c
arch/x86/include/asm/olpc.h +2 -0
index 101229b..42a978c 100644
@@ -89,6 +89,8 @@ extern int olpc_ec_mask_unset(uint8_t bits);
 /* EC commands */
 
 #define EC_FIRMWARE_REV		0x08
+#define EC_WLAN_ENTER_RESET	0x35
+#define EC_WLAN_LEAVE_RESET	0x25
 
 /* SCI source values */
 
drivers/platform/x86/Kconfig +8 -0
index b49f9b1..d7e56b3 100644
@@ -595,4 +595,12 @@ config INTEL_IPS
 	  functionality.  If in doubt, say Y here; it will only load on
 	  supported platforms.
 
+config XO1_RFKILL
+	tristate "OLPC XO-1 software RF kill switch"
+	depends on OLPC
+	depends on RFKILL
+	---help---
+	  Support for enabling/disabling the WLAN interface on the OLPC XO-1
+	  laptop.
+
 endif # X86_PLATFORM_DEVICES
drivers/platform/x86/Makefile +1 -0
index b26df2e..cd87f83 100644
@@ -30,4 +30,5 @@ obj-$(CONFIG_INTEL_SCU_IPC)	+= intel_scu_ipc.o
 obj-$(CONFIG_RAR_REGISTER)	+= intel_rar_register.o
 obj-$(CONFIG_INTEL_IPS)		+= intel_ips.o
 obj-$(CONFIG_GPIO_INTEL_PMIC)	+= intel_pmic_gpio.o
+obj-$(CONFIG_XO1_RFKILL)	+= xo1-rfkill.o
 
drivers/platform/x86/xo1-rfkill.c new file +86 -0

86 lines not on this page · raw message

Signature · 1 line
1.7.2.3
#1 lore raw

drivers/platform/x86/xo1-rfkill.c line 38

Quoted 6 lines · Daniel Drake
drivers/platform/x86/xo1-rfkill.c new file +6 -0
+static int __devinit xo1_rfkill_probe(struct platform_device *pdev)
+{
+	struct rfkill *rfk;
+	int r;
+
+	printk(KERN_INFO "%s: loading\n", pdev->name);

Probably don't need this. Otherwise, looks fine.

Signature · 1 line
Matthew Garrett | [email protected]
#2 lore raw

Hi Matthew,

Quoted 3 lines · Matthew Garrett
Quoted 1 line

+     printk(KERN_INFO "%s: loading\n", pdev->name);

Probably don't need this. Otherwise, looks fine.

Thanks for reviewing.
I posted an updated patch here:
https://patchwork.kernel.org/patch/233031/

The supporting arch/x86 code has now been merged into the x86 tree, so can the rfkill driver now go into yours?

Thanks,
Daniel