History log of /drivers/platform/x86/panasonic-laptop.c
Revision Date Author Comments
e424fb8cc4e6634c10f8159b1ff5618cf7bab9c6 29-Dec-2011 Xi Wang <xi.wang@gmail.com> panasonic-laptop: avoid overflow in acpi_pcc_hotkey_add()

num_sifr could go negative since acpi_pcc_get_sqty() returns -EINVAL
on error. Then it could bypass the sanity check (num_sifr > 255).
The subsequent call to kzalloc() would allocate a small buffer, leading
to a memory corruption.

Signed-off-by: Xi Wang <xi.wang@gmail.com>
Signed-off-by: Matthew Garrett <mjg@redhat.com>
bb7ca747f8d6243b3943c5b133048652020f4a50 23-Mar-2011 Matthew Garrett <mjg@redhat.com> backlight: add backlight type

There may be multiple ways of controlling the backlight on a given
machine. Allow drivers to expose the type of interface they are
providing, making it possible for userspace to make appropriate policy
decisions.

Signed-off-by: Matthew Garrett <mjg@redhat.com>
Cc: Richard Purdie <rpurdie@rpsys.net>
Cc: Chris Wilson <chris@chris-wilson.co.uk>
Cc: David Airlie <airlied@linux.ie>
Cc: Alex Deucher <alexdeucher@gmail.com>
Cc: Ben Skeggs <bskeggs@redhat.com>
Cc: Zhang Rui <rui.zhang@intel.com>
Cc: Len Brown <lenb@kernel.org>
Cc: Jesse Barnes <jbarnes@virtuousgeek.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
e253fb944d3335a29bc392eafbe14c43832e806a 21-Oct-2010 Jean Delvare <jdelvare@suse.de> panasonic-laptop: Simplify calls to acpi_pcc_retrieve_biosdata

Function acpi_pcc_retrieve_biosdata is always called with parameters
(pcc, pcc->sinf), so we can drop the second parameter. It was
dangerous to pass the sinf array separately anyway, as its length is
checked as pcc->num_sifr, which pretty much assumed it was pcc->sinf
(or at least had the same size.)

This change makes the code slightly more compact and thus marginally
faster.

Signed-off-by: Jean Delvare <jdelvare@suse.de>
Cc: Harald Welte <laforge@gnumonks.org>
Signed-off-by: Matthew Garrett <mjg@redhat.com>
aa13857f13c3d5535904781e264d8f9115e30438 21-Oct-2010 Jean Delvare <jdelvare@suse.de> panasonic-laptop: Handle errors properly if they happen

acpi_pcc_retrieve_biosdata() returns success instead of error if
HKEY.SINF is invalid. Fix this.

Furthermore, if acpi_pcc_retrieve_biosdata() returns an error
during device addition, initialization is properly reverted but value
0 is returned, which means success. This would cause a crash when
later using or removing the device, so fix this too.

Signed-off-by: Jean Delvare <jdelvare@suse.de>
Cc: Harald Welte <laforge@gnumonks.org>
Cc: Bruno Premont <bonbons@linux-vserver.org>
Signed-off-by: Matthew Garrett <mjg@redhat.com>
1a765cac9a241380511a3b1dd4edf74a41cbfdf9 05-Aug-2010 Dmitry Torokhov <dmitry.torokhov@gmail.com> panasonic-laptop - switch to using sparse keymap library

nstead of implementing its own version of keymap hanlding switch over to
using sparse keymap library.

Cc: Harald Welte <laforge@gnumonks.org>
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
Signed-off-by: Matthew Garrett <mjg@redhat.com>
9fab10cdf58099beff08d74f6b4a6633305c5754 07-Jul-2010 Axel Lin <axel.lin@gmail.com> panasonic-laptop: fix acpi_pcc_write_sset return value

In current implementation, acpi_pcc_write_sset return 1
if write is successful, 0 if write is failed.
But all the callers consider acpi_pcc_write_sset return 0
if write is successful and return negtive if write is failed.

This patch changes the implementation of acpi_pcc_write_sset to
return 0 if write is successful, -EIO if write is failed.

Signed-off-by: Axel Lin <axel.lin@gmail.com>
Signed-off-by: Matthew Garrett <mjg@redhat.com>
5a0e3ad6af8660be21ca98a971cd00f331318c05 24-Mar-2010 Tejun Heo <tj@kernel.org> include cleanup: Update gfp.h and slab.h includes to prepare for breaking implicit slab.h inclusion from percpu.h

percpu.h is included by sched.h and module.h and thus ends up being
included when building most .c files. percpu.h includes slab.h which
in turn includes gfp.h making everything defined by the two files
universally available and complicating inclusion dependencies.

percpu.h -> slab.h dependency is about to be removed. Prepare for
this change by updating users of gfp and slab facilities include those
headers directly instead of assuming availability. As this conversion
needs to touch large number of source files, the following script is
used as the basis of conversion.

http://userweb.kernel.org/~tj/misc/slabh-sweep.py

The script does the followings.

* Scan files for gfp and slab usages and update includes such that
only the necessary includes are there. ie. if only gfp is used,
gfp.h, if slab is used, slab.h.

* When the script inserts a new include, it looks at the include
blocks and try to put the new include such that its order conforms
to its surrounding. It's put in the include block which contains
core kernel includes, in the same order that the rest are ordered -
alphabetical, Christmas tree, rev-Xmas-tree or at the end if there
doesn't seem to be any matching order.

* If the script can't find a place to put a new include (mostly
because the file doesn't have fitting include block), it prints out
an error message indicating which .h file needs to be added to the
file.

The conversion was done in the following steps.

1. The initial automatic conversion of all .c files updated slightly
over 4000 files, deleting around 700 includes and adding ~480 gfp.h
and ~3000 slab.h inclusions. The script emitted errors for ~400
files.

2. Each error was manually checked. Some didn't need the inclusion,
some needed manual addition while adding it to implementation .h or
embedding .c file was more appropriate for others. This step added
inclusions to around 150 files.

3. The script was run again and the output was compared to the edits
from #2 to make sure no file was left behind.

4. Several build tests were done and a couple of problems were fixed.
e.g. lib/decompress_*.c used malloc/free() wrappers around slab
APIs requiring slab.h to be added manually.

5. The script was run on all .h files but without automatically
editing them as sprinkling gfp.h and slab.h inclusions around .h
files could easily lead to inclusion dependency hell. Most gfp.h
inclusion directives were ignored as stuff from gfp.h was usually
wildly available and often used in preprocessor macros. Each
slab.h inclusion directive was examined and added manually as
necessary.

6. percpu.h was updated not to include slab.h.

7. Build test were done on the following configurations and failures
were fixed. CONFIG_GCOV_KERNEL was turned off for all tests (as my
distributed build env didn't work with gcov compiles) and a few
more options had to be turned off depending on archs to make things
build (like ipr on powerpc/64 which failed due to missing writeq).

* x86 and x86_64 UP and SMP allmodconfig and a custom test config.
* powerpc and powerpc64 SMP allmodconfig
* sparc and sparc64 SMP allmodconfig
* ia64 SMP allmodconfig
* s390 SMP allmodconfig
* alpha SMP allmodconfig
* um on x86_64 SMP allmodconfig

8. percpu.h modifications were reverted so that it could be applied as
a separate patch and serve as bisection point.

Given the fact that I had only a couple of failures from tests on step
6, I'm fairly confident about the coverage of this conversion patch.
If there is a breakage, it's likely to be something in one of the arch
headers which should be easily discoverable easily on most builds of
the specific arch.

Signed-off-by: Tejun Heo <tj@kernel.org>
Guess-its-ok-by: Christoph Lameter <cl@linux-foundation.org>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: Lee Schermerhorn <Lee.Schermerhorn@hp.com>
ec57af9c2ece22ae6234189972105d777ff5f939 26-Feb-2010 Bruno Prémont <bonbons@linux-vserver.org> backlight: panasonic-laptop - Fix incomplete registration failure handling

Properly return backlight registration error to parent.
Mark struct backlight_ops as const.

Signed-off-by: Bruno Prémont <bonbons@linux-vserver.org>
Acked-by: Harald Welte <laforge@gnumonks.org> (registration failure)
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
a19a6ee6cad2b20292a774c2f56ba8039b0fac9c 17-Feb-2010 Matthew Garrett <mjg@redhat.com> backlight: Allow properties to be passed at registration

Values such as max_brightness should be set before backlights are
registered, but the current API doesn't allow that. Add a parameter to
backlight_device_register and update drivers to ensure that they
set this correctly.

Signed-off-by: Matthew Garrett <mjg@redhat.com>
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
58b939959d228681208ba997595411fddc860849 09-Mar-2010 Dmitry Torokhov <dmitry.torokhov@gmail.com> Input: scancode in get/set_keycodes should be unsigned

The HID layer has some scan codes of the form 0xffbc0000 for logitech
devices which do not work if scancode is typed as signed int, so we need
to switch to unsigned it instead. While at it keycode being signed does
not make much sense either.

Acked-by: Márton Németh <nm127@freemail.hu>
Acked-by: Matthew Garrett <mjg@redhat.com>
Acked-by: Jiri Kosina <jkosina@suse.cz>
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
cddd1f71d972a43c88f0ef91e1b71023539cd6e0 07-Apr-2009 Bjorn Helgaas <bjorn.helgaas@hp.com> panasonic-laptop: use .notify method instead of installing handler directly

This patch adds a .notify() method. The presence of .notify() causes
Linux/ACPI to manage event handlers and notify handlers on our behalf,
so we don't have to install and remove them ourselves.

Signed-off-by: Bjorn Helgaas <bjorn.helgaas@hp.com>
CC: Harald Welte <laforge@gnumonks.org>
Signed-off-by: Len Brown <len.brown@intel.com>
a3c270561ea4455cbcea0ac2b53335655d9fc805 05-Mar-2009 Hannes Eder <hannes@hanneseder.net> NULL noise: drivers/platform/x86/panasonic-laptop.c

Fix this sparse warning:
drivers/platform/x86/panasonic-laptop.c:273:70: warning: Using plain integer as NULL pointer

Signed-off-by: Hannes Eder <hannes@hanneseder.net>
Signed-off-by: Len Brown <len.brown@intel.com>
ba256b41bd58f0821c9c0e203982fb260f09bdeb 14-Jan-2009 Harald Welte <laforge@gnumonks.org> panasonic-laptop: use snprintf with PAGE_SIZE in sysfs attributes

Instead of just sprintf() into the page-sized buffer provided
by the sysfs/device_attribute API, we use snprintf with PAGE_SIZE
as an additional safeguard.

Signed-off-by: Martin Lucina <mato@kotelna.sk>
Signed-off-by: Harald Welte <laforge@gnumonks.org>
Signed-off-by: Len Brown <len.brown@intel.com>
c542aadeb4700bc316834d862d52ba3d2664f13a 14-Jan-2009 Harald Welte <laforge@gnumonks.org> panasonic-laptop: Fix autoloading

This patch adds MODULE_DEVICE_TABLE() to panasonic-laptop.c in order
to ensure automatic loading of the module on systems with the respective
"MAT*" ACPI devices.

Signed-off-by: Martin Lucina <mato@kotelna.sk>
Signed-off-by: Harald Welte <laforge@gnumonks.org>
Signed-off-by: Len Brown <len.brown@intel.com>
2b190e76def5233c542f6025b4a133b1d4bd1a37 17-Jan-2009 Roel Kluin <roel.kluin@gmail.com> panasonic-laptop: fix X[ ARRAY_SIZE(X) ]

Ensure pcc->keymap[ ARRAY_SIZE(pcc->keymap) ] does not occur.

Signed-off-by: Roel Kluin <roel.kluin@gmail.com>
Signed-off-by: Len Brown <len.brown@intel.com>
41b16dce390510f550a4d2b12b98e0258bbed6e2 01-Dec-2008 Len Brown <len.brown@intel.com> create drivers/platform/x86/ from drivers/misc/

Move x86 platform specific drivers from drivers/misc/
to a new home under drivers/platform/x86/.

The community has been maintaining x86 vendor-specific
platform specific drivers under /drivers/misc/ for a few years.
The oldest ones started life under drivers/acpi.
They moved out of drivers/acpi/ because they don't actually
implement the ACPI specification, but either simply
use ACPI, or implement vendor-specific ACPI extensions.

In the future we anticipate...
drivers/misc/ will go away.
other architectures will create drivers/platform/<arch>

Signed-off-by: Len Brown <len.brown@intel.com>