History log of /drivers/platform/olpc/olpc-ec.c
Revision Date Author Comments
93dbc1b3b506e16c1f6d5b5dcfe756a85cb1dc58 23-Aug-2013 Daniel Drake <dsd@laptop.org> drivers/platform/olpc/olpc-ec.c: initialise earlier

Being a low-level component, various drivers (e.g. olpc-battery) assume
that it is ok to communicate with the OLPC Embedded Controller during
probe. Therefore the OLPC EC driver must be initialised before other
drivers try to use it. This was the case until it was recently moved
out of arch/x86 and restructured around commits ac2504151f5a ("Platform:
OLPC: turn EC driver into a platform_driver") and 85f90cf6ca56 ("x86:
OLPC: switch over to using new EC driver on x86").

Use arch_initcall so that olpc-ec is readied earlier, matching the
previous behaviour.

Fixes a regression introduced in Linux-3.6 where various drivers such as
olpc-battery and olpc-xo1-sci failed to load due to an inability to
communicate with the EC. The user-visible effect was a lack of battery
monitoring, missing ebook/lid switch input devices, etc.

Signed-off-by: Daniel Drake <dsd@laptop.org>
Cc: Andres Salomon <dilinger@queued.net>
Cc: Paul Fox <pgf@laptop.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: <stable@vger.kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
99ecb01cdf0378783b317b8f839ac9cc5e128aa5 14-Jul-2012 Andres Salomon <dilinger@queued.net> Platform: OLPC: move global variables into priv struct

Populate olpc_ec_priv with variables that were previously global. This
makes things a tad bit clearer, IMO.

Signed-off-by: Andres Salomon <dilinger@queued.net>
Acked-by: Paul Fox <pgf@laptop.org>
Reviewed-by: Thomas Gleixner <tglx@linutronix.de>
6cca83d498bda0999302079bd59786370590c5c2 13-Jul-2012 Andres Salomon <dilinger@queued.net> Platform: OLPC: move debugfs support from x86 EC driver

There's nothing about the debugfs interface for the EC driver that is
architecture-specific, so move it into the arch-independent driver.

The code is mostly unchanged with the exception of renamed variables, coding
style changes, and API updates.

Signed-off-by: Andres Salomon <dilinger@queued.net>
Acked-by: Paul Fox <pgf@laptop.org>
Reviewed-by: Thomas Gleixner <tglx@linutronix.de>
85f90cf6ca569b19cee212844b543a7355b77163 13-Jul-2012 Andres Salomon <dilinger@queued.net> x86: OLPC: switch over to using new EC driver on x86

This uses the new EC driver framework in drivers/platform/olpc. The
XO-1 and XO-1.5-specific code is still in arch/x86, but the generic stuff
(including a new workqueue; no more running EC commands with IRQs disabled!)
can be shared with other architectures.

Signed-off-by: Andres Salomon <dilinger@queued.net>
Acked-by: Paul Fox <pgf@laptop.org>
Reviewed-by: Thomas Gleixner <tglx@linutronix.de>
d278b7a2f90f91f908b19b50cfa59e10632b5afc 14-Jul-2012 Andres Salomon <dilinger@queued.net> Platform: OLPC: add a suspended flag to the EC driver

A problem we've noticed on XO-1.75 is when we suspend in the middle of
an EC command. Don't allow that.

In the process, create a private object for the generic EC driver to use;
we have a framework for passing around a struct, use that rather than a
proliferation of global variables.

Signed-off-by: Andres Salomon <dilinger@queued.net>
Acked-by: Paul Fox <pgf@laptop.org>
Reviewed-by: Thomas Gleixner <tglx@linutronix.de>
ac2504151f5af27bbf0c0362b7da5951e05dfc43 13-Jul-2012 Andres Salomon <dilinger@queued.net> Platform: OLPC: turn EC driver into a platform_driver

The 1.75-based OLPC EC driver already does this; let's do it for all EC
drivers. This gives us nice suspend/resume hooks, amongst other things.

We want to run the EC's suspend hooks later than other drivers (which may
be setting wakeup masks or be running EC commands). We also want to run
the EC's resume hooks earlier than other drivers (which may want to run EC
commands).

Signed-off-by: Andres Salomon <dilinger@queued.net>
Acked-by: Paul Fox <pgf@laptop.org>
Reviewed-by: Thomas Gleixner <tglx@linutronix.de>
3d26c20bae9e97c98f7240184427d3a38515d406 12-Jul-2012 Andres Salomon <dilinger@queued.net> Platform: OLPC: allow EC cmd to be overridden, and create a workqueue to call it

This provides a new API allows different OLPC architectures to override the
EC driver. x86 and ARM OLPC machines use completely different EC backends.

The olpc_ec_cmd is synchronous, and waits for the workqueue to send the
command to the EC. Multiple callers can run olpc_ec_cmd() at once, and
they will by serialized and sleep while only one executes on the EC at a time.

We don't provide an unregister function, as that doesn't make sense within
the context of OLPC machines - there's only ever 1 EC, it's critical to
functionality, and it certainly not hotpluggable.

Signed-off-by: Andres Salomon <dilinger@queued.net>
Acked-by: Paul Fox <pgf@laptop.org>
Reviewed-by: Thomas Gleixner <tglx@linutronix.de>
392a325c4351339cfbf182bb5a1444df1cf65dbb 11-Jul-2012 Andres Salomon <dilinger@queued.net> Platform: OLPC: add a stub to drivers/platform/ for the OLPC EC driver

The OLPC EC driver has outgrown arch/x86/platform/. It's time to both
share common code amongst different architectures, as well as move it out
of arch/x86/. The XO-1.75 is ARM-based, and the EC driver shares a lot of
code with the x86 code.

Signed-off-by: Andres Salomon <dilinger@queued.net>
Acked-by: Paul Fox <pgf@laptop.org>
Reviewed-by: Thomas Gleixner <tglx@linutronix.de>