Commit graph android_kernel_sony_sdm845/drivers/acpi/ac.c
Message SHA1
acpi: use non-racy method for proc entries creation
Use proc_create()/proc_create_data() to make sure that ->proc_fops and ->data
be setup before gluing PDE to main tree.

Add correct ->owner to proc_fops to fix reading/module unloading race.

Signed-off-by: Denis V. Lunev <den@openvz.org>
Cc: Len Brown <lenb@kernel.org>
Cc: Alexey Dobriyan <adobriyan@gmail.com>
Cc: "Eric W. Biederman" <ebiederm@xmission.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>

Denis V. Lunev   authored and   Linus Torvalds   commited 2008-04-29 08:06:22 -07:00
cf7acfab03
acpi: Storage class should be before const qualifier
The C99 specification states in section 6.11.5:

The placement of a storage-class specifier other than at the
beginning of the declaration specifiers in a declaration is an
obsolescent feature.

Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
Signed-off-by: Jesper Juhl <jesper.juhl@gmail.com>

Tobias Klauser   authored and   Jesper Juhl   commited 2008-04-21 22:24:53 +00:00
b299c22c8c
ACPI: Make sysfs interface in ACPI power optional.
Reference: http://bugzilla.kernel.org/show_bug.cgi?id=9494

Signed-off-by: Alexey Starikovskiy <astarikovskiy@suse.de>
Signed-off-by: Len Brown <len.brown@intel.com>

Alexey Starikovskiy   authored and   Len Brown   commited 2008-01-01 14:27:24 -05:00
97749cd9ad
ACPI: Split out control for /proc/acpi entries from battery, ac, and sbs.
Introduce new ACPI_PROCFS_POWER (default Yes) config option and move
procfs code in battery, ac, and sbs drivers under it.
This is done to allow ACPI_PROCFS to be default No.

Signed-off-by: Alexey Starikovskiy <astarikovskiy@suse.de>
Signed-off-by: Len Brown <len.brown@intel.com>

Alexey Starikovskiy   authored and   Len Brown   commited 2007-11-19 11:21:50 -05:00
fdcedbba2f
ACPI: AC: Update AC state on resume
Check if AC state has changed across resume and notify userspace if so.

Fixes "[2.6.24-rc1 regression] AC adapter state does not change after resume"

Signed-off-by: Alexey Starikovskiy <astarikovskiy@suse.de>
Tested-by: Andrey Borzenkov <arvidjaar@mail.ru>
Cc: Len Brown <lenb@kernel.org>
Cc: "Rafael J. Wysocki" <rjw@sisk.pl>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>

Alexey Starikovskiy   authored and   Linus Torvalds   commited 2007-11-14 18:45:44 -08:00
5bfeca3138
make /proc/acpi/ac_adapter dependent on ACPI_PROCFS
Do not provide /proc/acpi/ac_adapter if ACPI_PROCFS is not defined.  This
eliminates duplicated power adapters in HAL and makes it consistent with
battery module

Signed-off-by: Andrey Borzenkov <arvidjaar@mail.ru>
Acked-by: Alexey Starikovskiy <astarikovskiy@suse.de>
Cc: Len Brown <lenb@kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>

Andrey Borzenkov   authored and   Linus Torvalds   commited 2007-11-14 18:45:44 -08:00
8a246ee43f
ACPI: AC: Add sysfs interface
Refer to Documentation/power_supply_class.txt for interface description.

Signed-off-by: Alexey Starikovskiy <astarikovskiy@suse.de>
Signed-off-by: Len Brown <len.brown@intel.com>

Alexey Starikovskiy   authored and   Len Brown   commited 2007-09-27 15:50:23 -04:00
d5b4a3d0ef
ACPI: Schedule /proc/acpi/event for removal
Schedule /proc/acpi/event for removal in 6 months.

Re-name acpi_bus_generate_event() to acpi_bus_generate_proc_event()
to make sure there is no confusion that it is for /proc/acpi/event only.

Add CONFIG_ACPI_PROC_EVENT to allow removal of /proc/acpi/event.
There is no functional change if CONFIG_ACPI_PROC_EVENT=y

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

Len Brown   commited 2007-08-23 15:20:26 -04:00
14e04fb34f
ACPI: don't duplicate input events on netlink
The previous events patch added a netlink event for every
user of the legacy /proc/acpi/event interface.

However, some users of /proc/acpi/event are really input events,
and they already report their events via the input layer.

Introduce a new interface, acpi_bus_generate_netlink_event(),
which is explicitly called by devices that want to repoprt
events via netlink.  This allows the input-like events
to opt-out of generating netlink events.  In summary:

events that are sent via netlink:
	ac/battery/sbs
	thermal
	processor
	thinkpad_acpi dock/bay

events that are sent via input layer:
	button
	video hotkey
	thinkpad_acpi hotkey
	asus_acpi/asus-laptop hotkey
	sonypi/sonylaptop

Signed-off-by: Zhang Rui <rui.zhang@intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>

Zhang Rui   authored and   Len Brown   commited 2007-08-23 14:27:23 -04:00
962ce8ca06
ACPI: autoload modules - Create __mod_acpi_device_table symbol for all ACPI drivers
modpost is going to use these to create e.g. acpi:ACPI0001
in modules.alias.

Signed-off-by: Thomas Renninger <trenn@suse.de>
Signed-off-by: Len Brown <len.brown@intel.com>

Thomas Renninger   authored and   Len Brown   commited 2007-07-23 13:56:42 -04:00
1ba90e3a87
ACPI: delete extra #defines in /drivers/acpi/ drivers
Cosmetic only.

Except in a single case, #define ACPI_*_DRIVER_NAME
were invoked 0 or 1 times.

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

Len Brown   commited 2007-02-12 23:50:52 -05:00
7cda93e008
ACPI: fix acpi_driver.name usage
It was erroneously used as a description rather than a name.

ie. turn this:

lenb@se7525gp2:/sys> ls bus/acpi/drivers
ACPI AC Adapter Driver  ACPI Embedded Controller Driver  ACPI Power Resource Driver
ACPI Battery Driver     ACPI Fan Driver                  ACPI Processor Driver
ACPI Button Driver      ACPI PCI Interrupt Link Driver   ACPI Thermal Zone Driver
ACPI container driver   ACPI PCI Root Bridge Driver      hpet

into this:

lenb@se7525gp2:~> ls /sys/bus/acpi/drivers
ac  battery  button  container  ec  fan  hpet  pci_link  pci_root  power  processor  thermal

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

Len Brown   commited 2007-02-12 23:33:40 -05:00
c2b6705b75
ACPI: clean up ACPI_MODULE_NAME() use
cosmetic only

Make "module name" actually match the file name.
Invoke with ';' as leaving it off confuses Lindent and gcc doesn't care.
Fix indentation where Lindent did get confused.

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

Len Brown   commited 2007-02-12 22:42:12 -05:00
f52fd66d2e
ACPI: replace kmalloc+memset with kzalloc
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Len Brown <len.brown@intel.com>

Burman Yan   authored and   Len Brown   commited 2006-12-20 16:54:54 -05:00
36bcbec7ce
ACPI: Remove unnecessary from/to-void* and to-void casts in drivers/acpi
Signed-off-by: Jan Engelhardt <jengelh@gmx.de>
Signed-off-by: Len Brown <len.brown@intel.com>

Jan Engelhardt   authored and   Len Brown   commited 2006-10-14 01:51:07 -04:00
50dd096973
ACPI: fix boot with acpi=off
Fix acpi_ac/battery boot with acpi=off

Signed-off-by: Pavel Machek <pavel@suse.cz>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Len Brown <len.brown@intel.com>

Pavel Machek   authored and   Len Brown   commited 2006-08-15 23:16:43 -04:00
4d8316d5ea
ACPI: add 'const' to several ACPI file_operations
Signed-off-by: Arjan van de Ven <arjan@linux.intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>

Arjan van de Ven   authored and   Len Brown   commited 2006-07-10 00:04:29 -04:00
d75080328a
Pull smart-battery into release branch
Len Brown   commited 2006-07-01 17:21:39 -04:00
309b0f125a
ACPI: add support for Smart Battery
Most batteries today are ACPI "Control Method" batteries,
but some models ship with the older "Smart Battery"
that requires this code.

Rich Townsend and Bruno Ducrot were the original authors.
Vladimir Lebedev updated to run on latest kernel.

http://bugzilla.kernel.org/show_bug.cgi?id=3734

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

Rich Townsend   authored and   Len Brown   commited 2006-07-01 16:36:14 -04:00
3f86b83243
ACPI: handle AC notify event on broken BIOS
http://bugzilla.kernel.org/show_bug.cgi?id=3241

updated by Vladimir Lebedev

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

Christian Lupien   authored and   Len Brown   commited 2006-07-01 12:09:27 -04:00
03d782524e
ACPI: ac: Remove unneeded acpi_handle from driver.
Signed-off-by: Patrick Mochel <mochel@linux.intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>

Patrick Mochel   authored and   Len Brown   commited 2006-06-30 02:48:37 -04:00
1b5b8b81bd
ACPI: ac: Use acpi_device's handle instead of driver's
Signed-off-by: Patrick Mochel <mochel@linux.intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>

Patrick Mochel   authored and   Len Brown   commited 2006-06-30 02:37:05 -04:00
a6ba5ebef9
ACPI: ac: Add struct acpi_device to struct acpi_ac.
Signed-off-by: Patrick Mochel <mochel@linux.intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>

Patrick Mochel   authored and   Len Brown   commited 2006-06-30 02:18:05 -04:00
af96179a82
ACPI: delete tracing macros from drivers/acpi/*.c
Signed-off-by: Len Brown <len.brown@intel.com>

Patrick Mochel   authored and   Len Brown   commited 2006-06-27 00:41:40 -04:00
d550d98d33
ACPI: Enable ACPI error messages w/o CONFIG_ACPI_DEBUG
Signed-off-by: Thomas Renninger <trenn@suse.de>
Signed-off-by: Len Brown <len.brown@intel.com>

Thomas Renninger   authored and   Len Brown   commited 2006-06-26 23:58:43 -04:00
a6fc67202e
[ACPI] Lindent all ACPI files
Signed-off-by: Len Brown <len.brown@intel.com>

Len Brown   commited 2005-08-05 00:45:14 -04:00
4be44fcd3b
Linux-2.6.12-rc2
Initial git repository build. I'm not bothering with the full history,
even though we have it. We can create a separate "historical" git
archive of that later if we want to, and in the meantime it's about
3.2GB when imported into git - space that would just make the early
git days unnecessarily complicated, when we don't have a lot of good
infrastructure for it.

Let it rip!

Linus Torvalds   commited 2005-04-16 15:20:36 -07:00
1da177e4c3