Skip to contentSkip to conversation

OLPC platform updates for 3.6

GIT PULL Andres Salomon 1 participant 1 message Aug 1, 2012

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

Hi Linus,

These move the OLPC Embedded Controller driver out of arch/x86/platform and into drivers/platform/olpc. OLPC machines are now ARM-based (which means lots of x86 and ARM changes), but are typically pretty self-contained.. so it makes more sense to go through a separate OLPC tree after getting the appropriate review/ACKs.

The following changes since commit 08843b79fb35d33859e0f8f11a7318341076e4d1:

Merge branch 'nfsd-next' of git://linux-nfs.org/~bfields/linux (2012-07-31 14:42:28 -0700)

are available in the git repository at:

git://dev.laptop.org/users/dilinger/linux-olpc/ for-linus-3.6

Andres Salomon (9):
Platform: OLPC: add a stub to drivers/platform/ for the OLPC EC driver
drivers: OLPC: update various drivers to include olpc-ec.h
Platform: OLPC: allow EC cmd to be overridden, and create a workqueue to call it
Platform: OLPC: turn EC driver into a platform_driver
Platform: OLPC: add a suspended flag to the EC driver
x86: OLPC: switch over to using new EC driver on x86
Platform: OLPC: move debugfs support from x86 EC driver
Platform: OLPC: move global variables into priv struct
x86: OLPC: move s/r-related EC cmds to EC driver

 arch/x86/include/asm/olpc.h            |   19 --
 arch/x86/platform/olpc/olpc-xo1-pm.c   |   16 +--
 arch/x86/platform/olpc/olpc-xo1-sci.c  |    1 +
 arch/x86/platform/olpc/olpc-xo15-sci.c |    1 +
 arch/x86/platform/olpc/olpc.c          |  190 ++++++------------
 drivers/net/wireless/libertas/if_usb.c |    1 +
 drivers/platform/Makefile              |    1 +
 drivers/platform/olpc/Makefile         |    4 +
 drivers/platform/olpc/olpc-ec.c        |  336 ++++++++++++++++++++++++++++++++
 drivers/platform/x86/xo1-rfkill.c      |    3 +-
 drivers/power/olpc_battery.c           |    1 +
 drivers/staging/olpc_dcon/olpc_dcon.c  |    1 +
 include/linux/olpc-ec.h                |   41 ++++
 13 files changed, 451 insertions(+), 164 deletions(-)
 create mode 100644 drivers/platform/olpc/Makefile
 create mode 100644 drivers/platform/olpc/olpc-ec.c
 create mode 100644 include/linux/olpc-ec.h
arch/x86/include/asm/olpc.h +0 -19
index 87bdbca..72f9adf6 100644
@@ -100,25 +100,6 @@ extern void olpc_xo1_pm_wakeup_clear(u16 value);
 
 extern int pci_olpc_init(void);
 
-/* EC related functions */
-
-extern int olpc_ec_cmd(unsigned char cmd, unsigned char *inbuf, size_t inlen,
-		unsigned char *outbuf, size_t outlen);
-
-/* EC commands */
-
-#define EC_FIRMWARE_REV			0x08
-#define EC_WRITE_SCI_MASK		0x1b
-#define EC_WAKE_UP_WLAN			0x24
-#define EC_WLAN_LEAVE_RESET		0x25
-#define EC_READ_EB_MODE			0x2a
-#define EC_SET_SCI_INHIBIT		0x32
-#define EC_SET_SCI_INHIBIT_RELEASE	0x34
-#define EC_WLAN_ENTER_RESET		0x35
-#define EC_WRITE_EXT_SCI_MASK		0x38
-#define EC_SCI_QUERY			0x84
-#define EC_EXT_SCI_QUERY		0x85
-
 /* SCI source values */
 
 #define EC_SCI_SRC_EMPTY	0x00
arch/x86/platform/olpc/olpc-xo1-pm.c +1 -15
index 0ce8616c..d75582d 100644
@@ -18,6 +18,7 @@
 #include <linux/pm.h>
 #include <linux/mfd/core.h>
 #include <linux/suspend.h>
+#include <linux/olpc-ec.h>
 
 #include <asm/io.h>
 #include <asm/olpc.h>
@@ -51,16 +52,11 @@ EXPORT_SYMBOL_GPL(olpc_xo1_pm_wakeup_clear);
 static int xo1_power_state_enter(suspend_state_t pm_state)
 {
 	unsigned long saved_sci_mask;
-	int r;
 
 	/* Only STR is supported */
 	if (pm_state != PM_SUSPEND_MEM)
 		return -EINVAL;
 
-	r = olpc_ec_cmd(EC_SET_SCI_INHIBIT, NULL, 0, NULL, 0);
-	if (r)
-		return r;
-
 	/*
 	 * Save SCI mask (this gets lost since PM1_EN is used as a mask for
 	 * wakeup events, which is not necessarily the same event set)
@@ -76,16 +72,6 @@ static int xo1_power_state_enter(suspend_state_t pm_state)
 	/* Restore SCI mask (using dword access to CS5536_PM1_EN) */
 	outl(saved_sci_mask, acpi_base + CS5536_PM1_STS);
 
-	/* Tell the EC to stop inhibiting SCIs */
-	olpc_ec_cmd(EC_SET_SCI_INHIBIT_RELEASE, NULL, 0, NULL, 0);
-
-	/*
-	 * Tell the wireless module to restart USB communication.
-	 * Must be done twice.
-	 */
-	olpc_ec_cmd(EC_WAKE_UP_WLAN, NULL, 0, NULL, 0);
-	olpc_ec_cmd(EC_WAKE_UP_WLAN, NULL, 0, NULL, 0);
-
 	return 0;
 }
 
arch/x86/platform/olpc/olpc-xo1-sci.c +1 -0
index 04b8c73..63d4aa4 100644
@@ -23,6 +23,7 @@
 #include <linux/power_supply.h>
 #include <linux/suspend.h>
 #include <linux/workqueue.h>
+#include <linux/olpc-ec.h>
 
 #include <asm/io.h>
 #include <asm/msr.h>
arch/x86/platform/olpc/olpc-xo15-sci.c +1 -0
index 599be49..2fdca25 100644
@@ -13,6 +13,7 @@
 #include <linux/slab.h>
 #include <linux/workqueue.h>
 #include <linux/power_supply.h>
+#include <linux/olpc-ec.h>
 
 #include <acpi/acpi_bus.h>
 #include <acpi/acpi_drivers.h>
arch/x86/platform/olpc/olpc.c +62 -128

262 lines not on this page · raw message

drivers/net/wireless/libertas/if_usb.c +1 -0
index 55a77e4..2798077 100644
@@ -10,6 +10,7 @@
 #include <linux/netdevice.h>
 #include <linux/slab.h>
 #include <linux/usb.h>
+#include <linux/olpc-ec.h>
 
 #ifdef CONFIG_OLPC
 #include <asm/olpc.h>
drivers/platform/Makefile +1 -0
index 782953a..b17c16c 100644
@@ -3,3 +3,4 @@
 #
 
 obj-$(CONFIG_X86)		+= x86/
+obj-$(CONFIG_OLPC)		+= olpc/
drivers/platform/olpc/Makefile new file +4 -0
new file mode 100644
index 0000000..dc8b26b
@@ -0,0 +1,4 @@
+#
+# OLPC XO platform-specific drivers
+#
+obj-$(CONFIG_OLPC)		+= olpc-ec.o
drivers/platform/olpc/olpc-ec.c new file +336 -0

336 lines not on this page · raw message

drivers/platform/x86/xo1-rfkill.c +1 -2
index b57ad86..1da13ed 100644
@@ -12,8 +12,7 @@
 #include <linux/module.h>
 #include <linux/platform_device.h>
 #include <linux/rfkill.h>
-
-#include <asm/olpc.h>
+#include <linux/olpc-ec.h>
 
 static bool card_blocked;
 
drivers/power/olpc_battery.c +1 -0
index 7385092..eaf917d 100644
@@ -17,6 +17,7 @@
 #include <linux/power_supply.h>
 #include <linux/jiffies.h>
 #include <linux/sched.h>
+#include <linux/olpc-ec.h>
 #include <asm/olpc.h>
 
 
drivers/staging/olpc_dcon/olpc_dcon.c +1 -0
index 992275c..2c4bd74 100644
@@ -27,6 +27,7 @@
 #include <linux/uaccess.h>
 #include <linux/ctype.h>
 #include <linux/reboot.h>
+#include <linux/olpc-ec.h>
 #include <asm/tsc.h>
 #include <asm/olpc.h>
 
include/linux/olpc-ec.h new file +41 -0

41 lines not on this page · raw message