openwrt/staging/blogic.git
16 years agoMerge branch 'pnp' into release
Len Brown [Wed, 30 Apr 2008 17:59:05 +0000 (13:59 -0400)]
Merge branch 'pnp' into release

16 years agoMerge branches 'release', 'acpica', 'bugzilla-10224', 'bugzilla-9772', 'bugzilla...
Len Brown [Wed, 30 Apr 2008 17:58:00 +0000 (13:58 -0400)]
Merge branches 'release', 'acpica', 'bugzilla-10224', 'bugzilla-9772', 'bugzilla-9916', 'ec', 'eeepc', 'idle', 'misc', 'pm-legacy', 'sysfs-links-2.6.26', 'thermal', 'thinkpad' and 'video' into release

16 years agoACPI: Fix acpi_processor_idle and idle= boot parameters interaction
Venkatesh Pallipadi [Wed, 30 Apr 2008 17:57:15 +0000 (13:57 -0400)]
ACPI: Fix acpi_processor_idle and idle= boot parameters interaction

acpi_processor_idle and "idle=" boot parameter interaction is broken.
The problem is that, at boot time acpi driver is checking for "idle=" boot
option and not registering the acpi idle handler. But, when there is a CST
changed callback (typically when switching AC <-> battery or suspend-resume)
there are no checks for boot_option_idle_override and acpi idle handler tries
to get installed with nasty side effects.

With CPU_IDLE configured this issue causes results in a nasty oops on CST
change callback and without CPU_IDLE there is no oops, but boot option
of "idle=" gets ignored and acpi idle handler gets installed.

Change the behavior to not do anything in acpi idle handler when there is a
"idle=" boot option.

Note that the problem is only there when "idle=" boot option is used.

Signed-off-by: Venkatesh Pallipadi <venkatesh.pallipadi@intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>
16 years agoacpi: fix section mismatch warning in pnpacpi
Sam Ravnborg [Tue, 29 Apr 2008 20:52:01 +0000 (22:52 +0200)]
acpi: fix section mismatch warning in pnpacpi

Fix following section mismatch warning:
WARNING: vmlinux.o(.text+0x153d69): Section mismatch in reference from the function is_exclusive_device() to the variable .init.data:excluded_id_list

is_exclusive_device is only used from __init context so document
this with the __init annotation and get rid of the warning.

Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
Signed-off-by: Len Brown <len.brown@intel.com>
16 years agointel_menlo: fix build warning
Len Brown [Tue, 29 Apr 2008 16:24:24 +0000 (12:24 -0400)]
intel_menlo: fix build warning

drivers/misc/intel_menlow.c:191: warning: label ‘unregister’ defined but not used

Signed-off-by: Len Brown <len.brown@intel.com>
16 years agoACPI: Cleanup: Remove unneeded, multiple local dummy variables
Thomas Renninger [Wed, 16 Apr 2008 18:52:02 +0000 (20:52 +0200)]
ACPI: Cleanup: Remove unneeded, multiple local dummy variables

Signed-off-by: Thomas Renninger <trenn@suse.de>
Signed-off-by: Len Brown <len.brown@intel.com>
16 years agoACPI: video - fix permissions on some proc entries
Dmitry Torokhov [Mon, 5 Nov 2007 16:43:36 +0000 (11:43 -0500)]
ACPI: video - fix permissions on some proc entries

POST and DOS are supposed to be writable but permissions
did not allow it.

Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
Acked-by: Zhang Rui <rui.zhang@intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>
16 years agoACPI: video - properly handle errors when registering proc elements
Dmitry Torokhov [Mon, 5 Nov 2007 16:43:34 +0000 (11:43 -0500)]
ACPI: video - properly handle errors when registering proc elements

Have acpi_video_device_add_fs() and acpi_video_bus_add_fs()
properly unwind proc creation after error.

Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
Acked-by: Zhang Rui <rui.zhang@intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>
16 years agoACPI: video - do not store invalid entries in attached_array list
Dmitry Torokhov [Mon, 5 Nov 2007 16:43:33 +0000 (11:43 -0500)]
ACPI: video - do not store invalid entries in attached_array list

this is a cleanup, not a change to function.

Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
Acked-by: Zhang Rui <rui.zhang@intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>
16 years agoACPI: re-name acpi_pm_ops to acpi_suspend_ops
Len Brown [Wed, 23 Apr 2008 22:02:52 +0000 (18:02 -0400)]
ACPI: re-name acpi_pm_ops to acpi_suspend_ops

... as they are platform_suspend_ops after all.

cosmetic re-name only, no functional change.

Signed-off-by: Len Brown <len.brown@intel.com>
16 years agoACER_WMI/ASUS_LAPTOP: fix build bug
Ingo Molnar [Tue, 29 Apr 2008 08:21:20 +0000 (10:21 +0200)]
ACER_WMI/ASUS_LAPTOP: fix build bug

randconfig testing in x86.git found the following upstream build bug:

 drivers/built-in.o: In function `acer_led_exit':
 acer-wmi.c:(.text+0xdc76e): undefined reference to `led_classdev_unregister'
 drivers/built-in.o: In function `acer_platform_probe':
 acer-wmi.c:(.devinit.text+0x63e6): undefined reference to `led_classdev_register'

which was due to acer-wmi.o only depending on CONFIG_LEDS_CLASS, while
also using a symbol offered by CONFIG_NEW_LEDS. Also fix a similar bug
in CONFIG_ASUS_LAPTOP.

Signed-off-by: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Len Brown <len.brown@intel.com>
16 years agothinkpad_acpi: fix possible NULL pointer dereference if kstrdup failed
Cyrill Gorcunov [Fri, 18 Apr 2008 20:27:29 +0000 (13:27 -0700)]
thinkpad_acpi: fix possible NULL pointer dereference if kstrdup failed

Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
Acked-by: Henrique de Moraes Holschuh <hmh@hmh.eng.br>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Len Brown <len.brown@intel.com>
16 years agoACPI: check a return value correctly in acpi_power_get_context()
Li Zefan [Fri, 18 Apr 2008 20:27:29 +0000 (13:27 -0700)]
ACPI: check a return value correctly in acpi_power_get_context()

We should check *resource != NULL rather than resource != NULL, which will be
always true.

Signed-off-by: Li Zefan <lizf@cn.fujitsu.com>
Acked-by: Zhao Yakui <yakui.zhao@intel.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Len Brown <len.brown@intel.com>
16 years ago#if 0 acpi/bay.c:eject_removable_drive()
Adrian Bunk [Sun, 30 Mar 2008 23:05:40 +0000 (02:05 +0300)]
#if 0 acpi/bay.c:eject_removable_drive()

This patch #if 0's the unused eject_removable_drive().

Signed-off-by: Adrian Bunk <bunk@kernel.org>
Signed-off-by: Len Brown <len.brown@intel.com>
16 years agoeeepc-laptop: add hwmon fan control
Corentin Chary [Thu, 13 Mar 2008 11:57:18 +0000 (12:57 +0100)]
eeepc-laptop: add hwmon fan control

Adds an hwmon interface to control the fan.

Signed-off-by: Corentin Chary <corentincj@iksaif.net>
Signed-off-by: Len Brown <len.brown@intel.com>
16 years agoeeepc-laptop: add backlight
Corentin Chary [Thu, 13 Mar 2008 11:56:37 +0000 (12:56 +0100)]
eeepc-laptop: add backlight

Add backlight class support to the eeepc-laptop driver.

Signed-off-by: Corentin Chary <corentincj@iksaif.net>
Signed-off-by: Len Brown <len.brown@intel.com>
16 years agoeeepc-laptop: add base driver
Eric Cooper [Thu, 13 Mar 2008 11:55:46 +0000 (12:55 +0100)]
eeepc-laptop: add base driver

This patch is based on Eric Cooper's work to clean the original asus_acpi
given by Asus.  It's a platform driver (/sys/devices/platform/eeepc/)
wich support:
     - hotkeys - wlan on/off - camera on/off - cardr on/off

Signed-off-by: Corentin Chary <corentincj@iksaif.net>
Signed-off-by: Len Brown <len.brown@intel.com>
16 years agoACPI: thinkpad-acpi: bump up version to 0.20
Henrique de Moraes Holschuh [Sat, 26 Apr 2008 04:02:30 +0000 (01:02 -0300)]
ACPI: thinkpad-acpi: bump up version to 0.20

Full LED sysfs support, and the rest of the assorted minor fixes and
enhancements are a good reason to checkpoint a new version...

Signed-off-by: Henrique de Moraes Holschuh <hmh@hmh.eng.br>
Signed-off-by: Len Brown <len.brown@intel.com>
16 years agoACPI: thinkpad-acpi: fix selects in Kconfig
Henrique de Moraes Holschuh [Sat, 26 Apr 2008 04:02:29 +0000 (01:02 -0300)]
ACPI: thinkpad-acpi: fix selects in Kconfig

Add missing select for BACKLIGHT_LCD_SUPPORT, as select doesn't select the
dependencies of a symbol for us.

Also, "select INPUT" in Kconfig.  We are not an Input device, nor are we
anywhere close to the input subsystem in the Kconfig tree, so using
"depends on INPUT" is not user-friendly at all.

Signed-off-by: Henrique de Moraes Holschuh <hmh@hmh.eng.br>
Signed-off-by: Len Brown <len.brown@intel.com>
16 years agoACPI: thinkpad-acpi: use a private workqueue
Henrique de Moraes Holschuh [Sat, 26 Apr 2008 04:02:28 +0000 (01:02 -0300)]
ACPI: thinkpad-acpi: use a private workqueue

Switch all task workers to a private thinkpad-acpi workqueue.

This way, we don't risk causing trouble for other tasks scheduled to the
default work queue, as our workers end up needing to access the ACPI EC,
run ACPI AML code, trigger SMI traps... and none of those are exactly known
to be fast, simple operations.

Signed-off-by: Henrique de Moraes Holschuh <hmh@hmh.eng.br>
Signed-off-by: Len Brown <len.brown@intel.com>
16 years agoACPI: thinkpad-acpi: fluff really minor fix
Henrique de Moraes Holschuh [Sat, 26 Apr 2008 04:02:27 +0000 (01:02 -0300)]
ACPI: thinkpad-acpi: fluff really minor fix

Fix a minor (nano?) thing that bothered me at exactly at the wrong time.

Signed-off-by: Henrique de Moraes Holschuh <hmh@hmh.eng.br>
Signed-off-by: Len Brown <len.brown@intel.com>
16 years agoACPI: thinkpad-acpi: use uppercase for "LED" on user documentation
Henrique de Moraes Holschuh [Sat, 26 Apr 2008 04:02:26 +0000 (01:02 -0300)]
ACPI: thinkpad-acpi: use uppercase for "LED" on user documentation

Change all occourences of the "led" word to full uppercase in user
documentation.

Signed-off-by: Henrique de Moraes Holschuh <hmh@hmh.eng.br>
Acked-by: Randy Dunlap <randy.dunlap@oracle.com>
Signed-off-by: Len Brown <len.brown@intel.com>
16 years agoACPI: thinkpad-acpi: add sysfs led class support to thinkpad leds (v3.2)
Henrique de Moraes Holschuh [Sat, 26 Apr 2008 04:02:25 +0000 (01:02 -0300)]
ACPI: thinkpad-acpi: add sysfs led class support to thinkpad leds (v3.2)

Add a sysfs led class interface to the led subdriver.

Signed-off-by: Henrique de Moraes Holschuh <hmh@hmh.eng.br>
Cc: Richard Purdie <rpurdie@rpsys.net>
Signed-off-by: Len Brown <len.brown@intel.com>
16 years agoACPI: thinkpad-acpi: add sysfs led class support for thinklight (v3.1)
Henrique de Moraes Holschuh [Sat, 26 Apr 2008 04:02:24 +0000 (01:02 -0300)]
ACPI: thinkpad-acpi: add sysfs led class support for thinklight (v3.1)

Add a sysfs led class interface to the thinklight (light subdriver).

Signed-off-by: Henrique de Moraes Holschuh <hmh@hmh.eng.br>
Cc: Richard Purdie <rpurdie@rpsys.net>
Signed-off-by: Len Brown <len.brown@intel.com>
16 years agoACPI: thinkpad-acpi: prepare light and LED for sysfs support
Henrique de Moraes Holschuh [Sat, 26 Apr 2008 04:02:23 +0000 (01:02 -0300)]
ACPI: thinkpad-acpi: prepare light and LED for sysfs support

Do some preparatory work to add sysfs support to the thinklight and
thinkpad leds driver.

Signed-off-by: Henrique de Moraes Holschuh <hmh@hmh.eng.br>
Signed-off-by: Len Brown <len.brown@intel.com>
16 years agoACPI: thinkpad-acpi: claim tpacpi as an official short handle (v1.1)
Henrique de Moraes Holschuh [Sat, 26 Apr 2008 04:02:22 +0000 (01:02 -0300)]
ACPI: thinkpad-acpi: claim tpacpi as an official short handle (v1.1)

Unfortunately, a lot of stuff in the kernel has size limitations, so
"thinkpad-acpi" ends up eating up too much real estate.  We were using
"tpacpi" in symbols already, but this shorthand was not visible to
userland.

Document that the driver will use tpacpi as a short hand where necessary,
and use it to name the kernel thread for NVRAM polling (now named
"ktpacpi_nvramd").

Also, register a module alias with the shorthand.  One can refer to the
module using the shorthand name.

Signed-off-by: Henrique de Moraes Holschuh <hmh@hmh.eng.br>
Signed-off-by: Len Brown <len.brown@intel.com>
16 years agoACPI: thinkpad-acpi: fix brightness dimming control bug
Henrique de Moraes Holschuh [Sat, 26 Apr 2008 04:02:21 +0000 (01:02 -0300)]
ACPI: thinkpad-acpi: fix brightness dimming control bug

ibm-acpi and thinkpad-acpi did not know about bit 5 of the EC backlight
level control register (EC 0x31), so it was always forced to zero on
any writes.

This would disable the BIOS option to *not* use a dimmer backlight level
scale while on battery, and who knows what else (there are two other
control bits of unknown function).

Bit 5 controls the "reduce backlight levels when on battery" optional
functionality (active low).  Bits 6 and 7 are better left alone as well,
instead of being forced to zero.

Signed-off-by: Henrique de Moraes Holschuh <hmh@hmh.eng.br>
Signed-off-by: Len Brown <len.brown@intel.com>
16 years agoACPI: thinkpad-acpi: rate-limit CMOS/EC unsynced error messages
Henrique de Moraes Holschuh [Sat, 26 Apr 2008 04:02:20 +0000 (01:02 -0300)]
ACPI: thinkpad-acpi: rate-limit CMOS/EC unsynced error messages

If userspace applications mess with the CMOS NVRAM, or something causes
both the ACPI firmware and thinkpad-acpi to try to change the brightness at
the same time, it is possible to have the CMOS and EC registers for the
current brightness go out of sync.

Should that happen, thinkpad-acpi could be really obnoxious when using a
brightness_mode of 3 (both EC and CMOS).  Instead of complaining a massive
number of times, make sure to complain only once until EC and CMOS are back
in sync.

Signed-off-by: Henrique de Moraes Holschuh <hmh@hmh.eng.br>
Cc: Joerg Platte <lists@naasa.net>
Signed-off-by: Len Brown <len.brown@intel.com>
16 years agoACPI: thinkpad-acpi: enhance box identification output (v2)
Henrique de Moraes Holschuh [Sat, 26 Apr 2008 04:02:19 +0000 (01:02 -0300)]
ACPI: thinkpad-acpi: enhance box identification output (v2)

During initialization, thinkpad-acpi outputs some messages to make sure
releavant box identification information is easily available in-line with
the rest of the driver messages.

Enhance those messages to output the alfanumeric model number as well.

Signed-off-by: Henrique de Moraes Holschuh <hmh@hmh.eng.br>
Signed-off-by: Len Brown <len.brown@intel.com>
16 years agoACPI: thinkpad-acpi: warn once about weird hotkey masks
Henrique de Moraes Holschuh [Sat, 26 Apr 2008 04:02:18 +0000 (01:02 -0300)]
ACPI: thinkpad-acpi: warn once about weird hotkey masks

thinkpad-acpi knows for a while now how to best program the hotkeys by
default, and always enable them by default.  Unfortunately, this
information has not filtered down everywhere it needs to, yet.  Notably,
old ibm-acpi documentation and most "thinkpad setup guides" will have wrong
information on this area.

Warn the local admin once whenever any of the following patterns are met:

1. Attempts to set hotkey mask to 0xffff (artifact from docs and config
   for the old ibm-acpi driver and behaviour).  This mask makes no
   real-world sense;

2. Attempts to set hotkey mask to 0xffffffff, which means the user is
   trying to just have "everything work" without even reading the
   documentation, or that we need to get a bug report, because there
   is a new thinkpad out there with new exciting hot keys :-)

3. Attempts to set hotkey mask to 0xffffff, which is almost never the
   correct way to set up volume and brightness event reporting (and with
   the current state-of-the-art, it is known to never be right way to do
   it).

The driver will perform any and all requested operations, though,
regardless of any warnings.  I hope these warnings can be removed one or
two years from now.

Signed-off-by: Henrique de Moraes Holschuh <hmh@hmh.eng.br>
Signed-off-by: Len Brown <len.brown@intel.com>
16 years agoACPI: thinkpad-acpi: BIOS backlight mode helper (v2.1)
Henrique de Moraes Holschuh [Sat, 26 Apr 2008 04:02:17 +0000 (01:02 -0300)]
ACPI: thinkpad-acpi: BIOS backlight mode helper (v2.1)

Lenovo ThinkPads with generic ACPI backlight level control can be easily
set to react to keyboard brightness key presses in a more predictable way
than what they do when in "DOS / bootloader" mode after Linux brings
up the ACPI interface.

The switch to the ACPI backlight mode in the firmware is designed to be
safe to use only as an one way trapdoor.  One is not to force the firmware
to switch back to "DOS/bootloader" mode except by rebooting.  The mode
switch itself is performed by calling any of the ACPI _BCL methods at least
once.

When in ACPI mode, the backlight firmware just issues (standard) events for
the brightness up/down hot key presses along with the non-standard HKEY
events which thinkpad-acpi traps, and doesn't touch the hardware.

thinkpad-acpi will:

1. Place the ThinkPad firmware in ACPI backlight control mode
   if one is available
2. Suppress HKEY backlight change notifications by default
   to avoid double-reporting when ACPI video is loaded when
   the ThinkPad is in ACPI backlight control mode
3. Urge the user to load the ACPI video driver

The user is free to use either the ACPI video driver to get the brightness
key events, or to override the thinkpad-acpi default hotkey mask to get
them from thinkpad-acpi as well (this will result in duplicate events if
ACPI video is loaded, so let's hope distros won't screw this up).

Provided userspace is sane, all should work (and *keep* working), which is
more that can be said about the non-ACPI mode of the new Lenovo ThinkPad
BIOSes when coupled to current userspace and X.org drivers.

Full guidelines for backlight hot key reporting and use of the
thinkpad-acpi backlight interface have been added to the documentation.

Signed-off-by: Henrique de Moraes Holschuh <hmh@hmh.eng.br>
Cc: Matthew Garrett <mjg59@srcf.ucam.org>
Cc: Thomas Renninger <trenn@suse.de>
Signed-off-by: Len Brown <len.brown@intel.com>
16 years agoACPICA: always disable GPE when requested
Damián Viano [Tue, 29 Apr 2008 07:32:25 +0000 (03:32 -0400)]
ACPICA: always disable GPE when requested

acpi_ev_disable_gpe() has an optimization where it doesn't disable
a GPE that it "doesn't have to".  Unfortunately, it can get tricked
by AML that scribbles on register state behind its back.  So when asked
to disable a GPE, simply do it -- a redundant register write
in the common case is a fair price to pay to be bomb-proof
for the rare cases.

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

Signed-off-by: Damián Viano <des@debian.org>
Acked-by: Zhang Rui <rui.zhang@intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>
16 years agoPNPBIOS: remove include/linux/pnpbios.h
Bjorn Helgaas [Mon, 28 Apr 2008 22:34:42 +0000 (16:34 -0600)]
PNPBIOS: remove include/linux/pnpbios.h

The contents of include/linux/pnpbios.h are used only inside the PNPBIOS
backend, so this file doesn't need to be visible outside PNP.

This patch moves the contents into an existing PNPBIOS-specific file,
drivers/pnp/pnpbios/pnpbios.h.

Signed-off-by: Bjorn Helgaas <bjorn.helgaas@hp.com>
Acked-By: Rene Herman <rene.herman@gmail.com>
Signed-off-by: Len Brown <len.brown@intel.com>
16 years agoISAPNP: remove unused pnp_dev->regs field
Bjorn Helgaas [Mon, 28 Apr 2008 22:34:41 +0000 (16:34 -0600)]
ISAPNP: remove unused pnp_dev->regs field

The "regs" field in struct pnp_dev is set but never read, so remove it.

Signed-off-by: Bjorn Helgaas <bjorn.helgaas@hp.com>
Acked-By: Rene Herman <rene.herman@gmail.com>
Signed-off-by: Len Brown <len.brown@intel.com>
16 years agoPNP: make interfaces private to the PNP core
Bjorn Helgaas [Mon, 28 Apr 2008 22:34:40 +0000 (16:34 -0600)]
PNP: make interfaces private to the PNP core

The interfaces for registering protocols, devices, cards,
and resource options should only be used inside the PNP core.

Signed-off-by: Bjorn Helgaas <bjorn.helgaas@hp.com>
Acked-By: Rene Herman <rene.herman@gmail.com>
Signed-off-by: Len Brown <len.brown@intel.com>
16 years agoPNPACPI: move _CRS/_PRS warnings closer to the action
Bjorn Helgaas [Mon, 28 Apr 2008 22:34:39 +0000 (16:34 -0600)]
PNPACPI: move _CRS/_PRS warnings closer to the action

Move warnings about _CRS and _PRS problems to the place where we
actually make the ACPI calls.  Then we don't have to pass around
acpi_status values any more than necessary.

Signed-off-by: Bjorn Helgaas <bjorn.helgaas@hp.com>
Acked-By: Rene Herman <rene.herman@gmail.com>
Signed-off-by: Len Brown <len.brown@intel.com>
16 years agoISAPNP: fold isapnp_read_resources() back into isapnp_get_resources()
Bjorn Helgaas [Mon, 28 Apr 2008 22:34:38 +0000 (16:34 -0600)]
ISAPNP: fold isapnp_read_resources() back into isapnp_get_resources()

isapnp_get_resources() does very little besides call
isapnp_read_resources(), so just fold them back together.

Based on a patch by Rene Herman <rene.herman@gmail.com>

Signed-off-by: Bjorn Helgaas <bjorn.helgaas@hp.com>
Signed-off-by: Len Brown <len.brown@intel.com>
16 years agoPNP: make generic pnp_add_mem_resource()
Bjorn Helgaas [Mon, 28 Apr 2008 22:34:37 +0000 (16:34 -0600)]
PNP: make generic pnp_add_mem_resource()

Add a pnp_add_mem_resource() that can be used by all the PNP
backends.  This consolidates a little more pnp_resource_table
knowledge into one place.

Signed-off-by: Bjorn Helgaas <bjorn.helgaas@hp.com>
Signed-off-by: Len Brown <len.brown@intel.com>
16 years agoPNP: make generic pnp_add_io_resource()
Bjorn Helgaas [Mon, 28 Apr 2008 22:34:36 +0000 (16:34 -0600)]
PNP: make generic pnp_add_io_resource()

Add a pnp_add_io_resource() that can be used by all the PNP
backends.  This consolidates a little more pnp_resource_table
knowledge into one place.

Signed-off-by: Bjorn Helgaas <bjorn.helgaas@hp.com>
Signed-off-by: Len Brown <len.brown@intel.com>
16 years agoPNP: make generic pnp_add_dma_resource()
Bjorn Helgaas [Mon, 28 Apr 2008 22:34:35 +0000 (16:34 -0600)]
PNP: make generic pnp_add_dma_resource()

Add a pnp_add_dma_resource() that can be used by all the PNP
backends.  This consolidates a little more pnp_resource_table
knowledge into one place.

Signed-off-by: Bjorn Helgaas <bjorn.helgaas@hp.com>
Signed-off-by: Len Brown <len.brown@intel.com>
16 years agoPNP: make generic pnp_add_irq_resource()
Bjorn Helgaas [Mon, 28 Apr 2008 22:34:34 +0000 (16:34 -0600)]
PNP: make generic pnp_add_irq_resource()

Add a pnp_add_irq_resource() that can be used by all the PNP
backends.  This consolidates a little more pnp_resource_table
knowledge into one place.

Signed-off-by: Bjorn Helgaas <bjorn.helgaas@hp.com>
Signed-off-by: Len Brown <len.brown@intel.com>
16 years agoPNP: add pnp_new_resource() to find a new unset pnp_resource
Bjorn Helgaas [Mon, 28 Apr 2008 22:34:33 +0000 (16:34 -0600)]
PNP: add pnp_new_resource() to find a new unset pnp_resource

This encapsulates the code to locate a new pnp_resource of the
desired type.  Currently this uses the pnp_resource_table, but
it will soon change to find a resource in a linked list.

Signed-off-by: Bjorn Helgaas <bjorn.helgaas@hp.com>
Signed-off-by: Len Brown <len.brown@intel.com>
16 years agoPNP: add pnp_resource index for ISAPNP
Bjorn Helgaas [Mon, 28 Apr 2008 22:34:32 +0000 (16:34 -0600)]
PNP: add pnp_resource index for ISAPNP

Save the ISAPNP config register index in the struct pnp_resource.

We need this because it is important to write ISAPNP configuration
back to the same registers we read it from.  For example, if we
read valid regions from memory descriptors 0, 1, and 3, we'd
better write them back to the same registers, without compressing
them to descriptors 0, 1, and 2.

This was previously guaranteed by using the index into the
pnp_resource_table array as the ISAPNP config register index.
However, I am removing those fixed-size arrays, so we need to
save the ISAPNP register index elsewhere.

Signed-off-by: Bjorn Helgaas <bjorn.helgaas@hp.com>
Signed-off-by: Len Brown <len.brown@intel.com>
16 years agoPNP: add pnp_get_pnp_resource()
Bjorn Helgaas [Mon, 28 Apr 2008 22:34:31 +0000 (16:34 -0600)]
PNP: add pnp_get_pnp_resource()

In some places, we need to get the struct pnp_resource, not just
the struct resource, because ISAPNP needs to store the register
index in the pnp_resource.

I don't like pnp_get_pnp_resource() and hope that it is temporary,
but we need it for a little while.

Signed-off-by: Bjorn Helgaas <bjorn.helgaas@hp.com>
Signed-off-by: Len Brown <len.brown@intel.com>
16 years agoPNP: add struct pnp_resource
Bjorn Helgaas [Mon, 28 Apr 2008 22:34:30 +0000 (16:34 -0600)]
PNP: add struct pnp_resource

This patch adds a "struct pnp_resource".  This currently
contains only a struct resource, but we will soon need
additional PNP-specific information.

Signed-off-by: Bjorn Helgaas <bjorn.helgaas@hp.com>
Signed-off-by: Len Brown <len.brown@intel.com>
16 years agoPNP: remove pnp_resource_table references from resource decoders
Bjorn Helgaas [Mon, 28 Apr 2008 22:34:29 +0000 (16:34 -0600)]
PNP: remove pnp_resource_table references from resource decoders

This removes a few more references to the pnp_resource_table.
No functional change.

Signed-off-by: Bjorn Helgaas <bjorn.helgaas@hp.com>
Signed-off-by: Len Brown <len.brown@intel.com>
16 years agoPNP: make pnp_resource_table private to PNP core
Bjorn Helgaas [Mon, 28 Apr 2008 22:34:28 +0000 (16:34 -0600)]
PNP: make pnp_resource_table private to PNP core

There are no remaining references to the PNP_MAX_* constants or
the pnp_resource_table structure outside of the PNP core.  Make
them private to the PNP core.

Signed-off-by: Bjorn Helgaas <bjorn.helgaas@hp.com>
Signed-off-by: Len Brown <len.brown@intel.com>
16 years agortc: dont reference pnp_resource_table directly
Bjorn Helgaas [Mon, 28 Apr 2008 22:34:27 +0000 (16:34 -0600)]
rtc: dont reference pnp_resource_table directly

pnp_resource_table is going away soon, so use the more
generic public interfaces instead.

Signed-off-by: Bjorn Helgaas <bjorn.helgaas@hp.com>
Acked-By: Rene Herman <rene.herman@gmail.com>
Signed-off-by: Len Brown <len.brown@intel.com>
16 years agoPNP: remove PNP_MAX_* uses
Bjorn Helgaas [Mon, 28 Apr 2008 22:34:26 +0000 (16:34 -0600)]
PNP: remove PNP_MAX_* uses

Remove some PNP_MAX_* uses.  The pnp_resource_table isn't
dynamic yet, but with pnp_get_resource(), we can start moving
away from the table size constants.

Signed-off-by: Bjorn Helgaas <bjorn.helgaas@hp.com>
Signed-off-by: Len Brown <len.brown@intel.com>
16 years agoPNP: convert assign, interface to use pnp_get_resource(), not pnp_resource_table
Bjorn Helgaas [Mon, 28 Apr 2008 22:34:25 +0000 (16:34 -0600)]
PNP: convert assign, interface to use pnp_get_resource(), not pnp_resource_table

This removes more direct references to pnp_resource_table from the
pnp_assign_resources() path and the /sys user interface path.

Signed-off-by: Bjorn Helgaas <bjorn.helgaas@hp.com>
Signed-off-by: Len Brown <len.brown@intel.com>
16 years agoPNP: convert encoders to use pnp_get_resource(), not pnp_resource_table
Bjorn Helgaas [Mon, 28 Apr 2008 22:34:24 +0000 (16:34 -0600)]
PNP: convert encoders to use pnp_get_resource(), not pnp_resource_table

This removes more direct references to pnp_resource_table.  This
path is used when telling a device what resources it should use.

This doesn't convert ISAPNP because ISA needs to know the config
register index in addition to the resource itself.

Signed-off-by: Bjorn Helgaas <bjorn.helgaas@hp.com>
Acked-By: Rene Herman <rene.herman@gmail.com>
Signed-off-by: Len Brown <len.brown@intel.com>
16 years agoPNP: convert resource checks to use pnp_get_resource(), not pnp_resource_table
Bjorn Helgaas [Mon, 28 Apr 2008 22:34:23 +0000 (16:34 -0600)]
PNP: convert resource checks to use pnp_get_resource(), not pnp_resource_table

This removes more direct references to pnp_resource_table.

Signed-off-by: Bjorn Helgaas <bjorn.helgaas@hp.com>
Acked-By: Rene Herman <rene.herman@gmail.com>
Signed-off-by: Len Brown <len.brown@intel.com>
16 years agoPNP: pass resources, not indexes, to pnp_check_port(), et al
Bjorn Helgaas [Mon, 28 Apr 2008 22:34:22 +0000 (16:34 -0600)]
PNP: pass resources, not indexes, to pnp_check_port(), et al

The caller already has the struct resource pointer, so no need for
pnp_check_port(), pnp_check_mem(), etc., to look it up again.

Signed-off-by: Bjorn Helgaas <bjorn.helgaas@hp.com>
Acked-By: Rene Herman <rene.herman@gmail.com>
Signed-off-by: Len Brown <len.brown@intel.com>
16 years agoPNP: check for conflicts with all resources, not just earlier ones
Bjorn Helgaas [Mon, 28 Apr 2008 22:34:21 +0000 (16:34 -0600)]
PNP: check for conflicts with all resources, not just earlier ones

This patch removes a use of "idx" in pnp_check_port() and similar
functions, in preparation for replacing idx with a pointer to the
resource itself.

I split this out because it changes the behavior slightly: we used
to check for conflicts only with earlier resources, e.g., we checked
resource 2 against resources 0 and 1 but not against 3, 4, etc.  Now
we will check against all resources except 2.

Since resources are assigned in ascending order, the old behavior
was probably safe, but I don't like to depend on that ordering.

Signed-off-by: Bjorn Helgaas <bjorn.helgaas@hp.com>
Acked-By: Rene Herman <rene.herman@gmail.com>
Signed-off-by: Len Brown <len.brown@intel.com>
16 years agoPNP: reduce redundancy in pnp_set_current_resources()
Bjorn Helgaas [Mon, 28 Apr 2008 22:34:20 +0000 (16:34 -0600)]
PNP: reduce redundancy in pnp_set_current_resources()

Use a temporary "res" pointer to replace repeated lookups in
the pnp resource tables.

Signed-off-by: Bjorn Helgaas <bjorn.helgaas@hp.com>
Acked-By: Rene Herman <rene.herman@gmail.com>
Signed-off-by: Len Brown <len.brown@intel.com>
16 years agoPNP: reduce redundancy in pnp_check_port() and others
Bjorn Helgaas [Mon, 28 Apr 2008 22:34:19 +0000 (16:34 -0600)]
PNP: reduce redundancy in pnp_check_port() and others

Use a temporary "res" pointer to replace repeated lookups in
the pnp resource tables.

Signed-off-by: Bjorn Helgaas <bjorn.helgaas@hp.com>
Acked-By: Rene Herman <rene.herman@gmail.com>
Signed-off-by: Len Brown <len.brown@intel.com>
16 years agoPNP: reduce redundancy in pnp_assign_port() and others
Bjorn Helgaas [Mon, 28 Apr 2008 22:34:18 +0000 (16:34 -0600)]
PNP: reduce redundancy in pnp_assign_port() and others

Use a temporary "res" pointer to replace repeated lookups in
the pnp resource tables.

Signed-off-by: Bjorn Helgaas <bjorn.helgaas@hp.com>
Acked-By: Rene Herman <rene.herman@gmail.com>
Signed-off-by: Len Brown <len.brown@intel.com>
16 years agoPNP: use conventional "i" for loop indices
Bjorn Helgaas [Mon, 28 Apr 2008 22:34:17 +0000 (16:34 -0600)]
PNP: use conventional "i" for loop indices

Cosmetic only: just use "i" instead of "tmp".

Signed-off-by: Bjorn Helgaas <bjorn.helgaas@hp.com>
Acked-By: Rene Herman <rene.herman@gmail.com>
Signed-off-by: Len Brown <len.brown@intel.com>
16 years agoPNP: convert resource accessors to use pnp_get_resource(), not pnp_resource_table
Bjorn Helgaas [Mon, 28 Apr 2008 22:34:16 +0000 (16:34 -0600)]
PNP: convert resource accessors to use pnp_get_resource(), not pnp_resource_table

This removes more direct references to pnp_resource_table.

Signed-off-by: Bjorn Helgaas <bjorn.helgaas@hp.com>
Signed-off-by: Len Brown <len.brown@intel.com>
16 years agoPNP: remove pnp_mem_flags() as an lvalue
Bjorn Helgaas [Mon, 28 Apr 2008 22:34:15 +0000 (16:34 -0600)]
PNP: remove pnp_mem_flags() as an lvalue

A future change will change pnp_mem_flags() from a "#define that
simplifies to an lvalue" to "an inline function that returns the
flags value."

Signed-off-by: Bjorn Helgaas <bjorn.helgaas@hp.com>
Acked-By: Rene Herman <rene.herman@gmail.com>
Signed-off-by: Len Brown <len.brown@intel.com>
16 years agoPNP: add pnp_get_resource() interface
Bjorn Helgaas [Mon, 28 Apr 2008 22:34:14 +0000 (16:34 -0600)]
PNP: add pnp_get_resource() interface

This adds a pnp_get_resource() that works the same way as
platform_get_resource().  This will enable us to consolidate
many pnp_resource_table references in one place, which will
make it easier to make the table dynamic.

Signed-off-by: Bjorn Helgaas <bjorn.helgaas@hp.com>
Acked-By: Rene Herman <rene.herman@gmail.com>
Signed-off-by: Len Brown <len.brown@intel.com>
16 years agoPNP: factor pnp_init_resource_table() and pnp_clean_resource_table()
Bjorn Helgaas [Mon, 28 Apr 2008 22:34:13 +0000 (16:34 -0600)]
PNP: factor pnp_init_resource_table() and pnp_clean_resource_table()

Move the common part of pnp_init_resource_table() and
pnp_clean_resource_table() into a new pnp_init_resource().
This reduces a little code duplication and will be
useful later to initialize an individual resource.

Signed-off-by: Bjorn Helgaas <bjorn.helgaas@hp.com>
Signed-off-by: Len Brown <len.brown@intel.com>
16 years agoPNP: use dev_printk when possible
Bjorn Helgaas [Mon, 28 Apr 2008 22:34:12 +0000 (16:34 -0600)]
PNP: use dev_printk when possible

Use dev_printk() when possible for more informative error messages.

Signed-off-by: Bjorn Helgaas <bjorn.helgaas@hp.com>
Acked-By: Rene Herman <rene.herman@gmail.com>
Signed-off-by: Len Brown <len.brown@intel.com>
16 years agoPNP: remove unused interfaces using pnp_resource_table
Bjorn Helgaas [Mon, 28 Apr 2008 22:34:11 +0000 (16:34 -0600)]
PNP: remove unused interfaces using pnp_resource_table

Rene Herman <rene.herman@gmail.com> recently removed the only in-tree
driver uses of:

    pnp_init_resource_table()
    pnp_manual_config_dev()
    pnp_resource_change()

in this change:

    http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commitdiff;h=109c53f840e551d6e99ecfd8b0131a968332c89f

These are no longer used in the PNP core either, so we can just remove
them completely.

It's possible that there are out-of-tree drivers that use these
interfaces.  They should be changed to either (1) use PNP quirks
to work around broken hardware or firmware, or (2) use the sysfs
interfaces to control resource usage from userspace.

Signed-off-by: Bjorn Helgaas <bjorn.helgaas@hp.com>
Acked-By: Rene Herman <rene.herman@gmail.com>
Signed-off-by: Len Brown <len.brown@intel.com>
16 years agoPNP: remove pnp_resource_table from internal pnp_clean_resource_table interface
Bjorn Helgaas [Mon, 28 Apr 2008 22:34:10 +0000 (16:34 -0600)]
PNP: remove pnp_resource_table from internal pnp_clean_resource_table interface

This changes pnp_clean_resource_table() to take a pnp_dev pointer
rather than a pnp_resource_table pointer.  This reduces the visibility
of pnp_resource_table and removes an opportunity for error in the
caller.

Signed-off-by: Bjorn Helgaas <bjorn.helgaas@hp.com>
Acked-By: Rene Herman <rene.herman@gmail.com>
Signed-off-by: Len Brown <len.brown@intel.com>
16 years agoPNP: add pnp_init_resources(struct pnp_dev *) interface
Bjorn Helgaas [Mon, 28 Apr 2008 22:34:09 +0000 (16:34 -0600)]
PNP: add pnp_init_resources(struct pnp_dev *) interface

Add pnp_init_resources(struct pnp_dev *) to replace
pnp_init_resource_table(), which takes a pointer to the
pnp_resource_table itself.  Passing only the pnp_dev * reduces
the possibility for error in the caller and removes the
pnp_resource_table implementation detail from the interface.

Even though pnp_init_resource_table() is exported, I did not
export pnp_init_resources() because it is used only by the PNP
core.

Signed-off-by: Bjorn Helgaas <bjorn.helgaas@hp.com>
Acked-By: Rene Herman <rene.herman@gmail.com>
Signed-off-by: Len Brown <len.brown@intel.com>
16 years agoPNP: add debug when assigning PNP resources
Bjorn Helgaas [Mon, 28 Apr 2008 22:34:08 +0000 (16:34 -0600)]
PNP: add debug when assigning PNP resources

This patch adds code to dump PNP resources before and after
assigning resources and before writing them to the device.

This is enabled by CONFIG_PNP_DEBUG=y.

Signed-off-by: Bjorn Helgaas <bjorn.helgaas@hp.com>
Signed-off-by: Len Brown <len.brown@intel.com>
16 years agoPNP: add debug output to encoders
Bjorn Helgaas [Mon, 28 Apr 2008 22:34:07 +0000 (16:34 -0600)]
PNP: add debug output to encoders

Add debug output to encoders (enabled by CONFIG_PNP_DEBUG).  This
uses dev_printk, so I had to add pnp_dev arguments at the same time.

Signed-off-by: Bjorn Helgaas <bjorn.helgaas@hp.com>
Acked-By: Rene Herman <rene.herman@gmail.com>
Signed-off-by: Len Brown <len.brown@intel.com>
16 years agoPNP: remove more pnp_resource_table arguments
Bjorn Helgaas [Mon, 28 Apr 2008 22:34:06 +0000 (16:34 -0600)]
PNP: remove more pnp_resource_table arguments

Stop passing around struct pnp_resource_table pointers.  In most cases,
the caller doesn't need to know how the resources are stored inside
the struct pnp_dev.

Signed-off-by: Bjorn Helgaas <bjorn.helgaas@hp.com>
Acked-By: Rene Herman <rene.herman@gmail.com>
Signed-off-by: Len Brown <len.brown@intel.com>
16 years agoPNP: remove pnp_resource_table from internal get/set interfaces
Bjorn Helgaas [Mon, 28 Apr 2008 22:34:05 +0000 (16:34 -0600)]
PNP: remove pnp_resource_table from internal get/set interfaces

When we call protocol->get() and protocol->set() methods, we currently
supply pointers to both the pnp_dev and the pnp_resource_table even
though the pnp_resource_table should always be the one associated with
the pnp_dev.

This removes the pnp_resource_table arguments to make it clear that
these methods only operate on the specified pnp_dev.

Signed-off-by: Bjorn Helgaas <bjorn.helgaas@hp.com>
Acked-By: Rene Herman <rene.herman@gmail.com>
Signed-off-by: Len Brown <len.brown@intel.com>
16 years agoPNP: add debug output to option registration
Bjorn Helgaas [Mon, 28 Apr 2008 22:34:04 +0000 (16:34 -0600)]
PNP: add debug output to option registration

Add debug output to resource option registration functions (enabled
by CONFIG_PNP_DEBUG).  This uses dev_printk, so I had to add pnp_dev
arguments at the same time.

Signed-off-by: Bjorn Helgaas <bjorn.helgaas@hp.com>
Acked-By: Rene Herman <rene.herman@gmail.com>
Signed-off-by: Len Brown <len.brown@intel.com>
16 years agoPNPACPI: pass pnp_dev instead of acpi_handle
Bjorn Helgaas [Mon, 28 Apr 2008 22:34:03 +0000 (16:34 -0600)]
PNPACPI: pass pnp_dev instead of acpi_handle

Pass the pnp_dev pointer when possible instead of the acpi_handle.
This allows better error messages and reduces the chance of error
in the caller.

Signed-off-by: Bjorn Helgaas <bjorn.helgaas@hp.com>
Acked-By: Rene Herman <rene.herman@gmail.com>
Signed-off-by: Len Brown <len.brown@intel.com>
16 years agoPNPACPI: extend irq_flags() to set IORESOURCE_IRQ_SHAREABLE when appropriate
Bjorn Helgaas [Mon, 28 Apr 2008 22:34:02 +0000 (16:34 -0600)]
PNPACPI: extend irq_flags() to set IORESOURCE_IRQ_SHAREABLE when appropriate

This simplifies IRQ resource parsing slightly by computing all the
IORESOURCE_IRQ_* flags at the same time.

This also keeps track of shareability information when parsing options
from _PRS.  Previously we ignored shareability in _PRS.

Signed-off-by: Bjorn Helgaas <bjorn.helgaas@hp.com>
Acked-By: Rene Herman <rene.herman@gmail.com>
Signed-off-by: Len Brown <len.brown@intel.com>
16 years agoPNPACPI: hoist dma_flags() out of pnpacpi_parse_allocated_dmaresource()
Bjorn Helgaas [Mon, 28 Apr 2008 22:34:01 +0000 (16:34 -0600)]
PNPACPI: hoist dma_flags() out of pnpacpi_parse_allocated_dmaresource()

Hoist dma_flags() out of pnpacpi_parse_allocated_dmaresource() into its
caller.  This makes pnpacpi_parse_allocated_dmaresource() more similar
to pnpbios_parse_allocated_dmaresource().

Signed-off-by: Bjorn Helgaas <bjorn.helgaas@hp.com>
Acked-By: Rene Herman <rene.herman@gmail.com>
Signed-off-by: Len Brown <len.brown@intel.com>
16 years agoPNPACPI: use temporaries to reduce repetition
Bjorn Helgaas [Mon, 28 Apr 2008 22:34:00 +0000 (16:34 -0600)]
PNPACPI: use temporaries to reduce repetition

No functional change, just fewer words and fewer chances for
transcription errors.

Signed-off-by: Bjorn Helgaas <bjorn.helgaas@hp.com>
Acked-By: Rene Herman <rene.herman@gmail.com>
Signed-off-by: Len Brown <len.brown@intel.com>
16 years agoPNPACPI: pnpacpi_encode_ext_irq() wrongly set "irq" instead of "extended_irq"
Bjorn Helgaas [Mon, 28 Apr 2008 22:33:59 +0000 (16:33 -0600)]
PNPACPI: pnpacpi_encode_ext_irq() wrongly set "irq" instead of "extended_irq"

pnpacpi_encode_ext_irq() should set resource->data.extended_irq, not
resource->data.irq.

This has been wrong since at least 2.6.12.  I haven't seen any bug
reports, but it's clearly incorrect.

Signed-off-by: Bjorn Helgaas <bjorn.helgaas@hp.com>
Signed-off-by: Len Brown <len.brown@intel.com>
16 years agoPNP: add pnp_alloc_card()
Bjorn Helgaas [Mon, 28 Apr 2008 22:33:58 +0000 (16:33 -0600)]
PNP: add pnp_alloc_card()

Add pnp_alloc_card() to allocate a struct pnp_card and fill in the
protocol, instance number, and initial PNP ID.  Now it is always
valid to use dev_printk() on any pnp_card pointer.

Signed-off-by: Bjorn Helgaas <bjorn.helgaas@hp.com>
Acked-By: Rene Herman <rene.herman@gmail.com>
Signed-off-by: Len Brown <len.brown@intel.com>
16 years agoISAPNP: pull pnp_add_card_id() out of isapnp_parse_card_id()
Bjorn Helgaas [Mon, 28 Apr 2008 22:33:57 +0000 (16:33 -0600)]
ISAPNP: pull pnp_add_card_id() out of isapnp_parse_card_id()

Split the pnp_add_card_id() part from the PNPID conversion part so we
can move the initial add_id() into the pnp_card allocation.

This makes the PNPID conversion generic so we can use the same
one for both devices and cards.

Signed-off-by: Bjorn Helgaas <bjorn.helgaas@hp.com>
Acked-By: Rene Herman <rene.herman@gmail.com>
Signed-off-by: Len Brown <len.brown@intel.com>
16 years agoPNP: change pnp_add_card_id() to allocate its own pnp_id structures
Bjorn Helgaas [Mon, 28 Apr 2008 22:33:56 +0000 (16:33 -0600)]
PNP: change pnp_add_card_id() to allocate its own pnp_id structures

This moves some of the pnp_id knowledge out of the backends and into
the PNP core.

Signed-off-by: Bjorn Helgaas <bjorn.helgaas@hp.com>
Acked-By: Rene Herman <rene.herman@gmail.com>
Signed-off-by: Len Brown <len.brown@intel.com>
16 years agoPNP: make pnp_add_card_id() internal to PNP core
Bjorn Helgaas [Mon, 28 Apr 2008 22:33:55 +0000 (16:33 -0600)]
PNP: make pnp_add_card_id() internal to PNP core

pnp_add_card_id() doesn't need to be exposed outside the PNP core, so
move the declaration to an internal header file.

Signed-off-by: Bjorn Helgaas <bjorn.helgaas@hp.com>
Acked-By: Rene Herman <rene.herman@gmail.com>
Signed-off-by: Len Brown <len.brown@intel.com>
16 years agoPNP: add pnp_alloc_dev()
Bjorn Helgaas [Mon, 28 Apr 2008 22:33:54 +0000 (16:33 -0600)]
PNP: add pnp_alloc_dev()

Add pnp_alloc_dev() to allocate a struct pnp_dev and fill in the
protocol, instance number, and initial PNP ID.  Now it is always
valid to use dev_printk() on any pnp_dev pointer.

Signed-off-by: Bjorn Helgaas <bjorn.helgaas@hp.com>
Acked-By: Rene Herman <rene.herman@gmail.com>
Signed-off-by: Len Brown <len.brown@intel.com>
16 years agoPNP: add pnp_eisa_id_to_string()
Bjorn Helgaas [Mon, 28 Apr 2008 22:33:53 +0000 (16:33 -0600)]
PNP: add pnp_eisa_id_to_string()

Converting the EISA ID to a string is messy and error-prone, and
we might as well use the same code for ISAPNP and PNPBIOS.

PNPACPI uses the conversion done by the ACPI core with
acpi_ex_eisa_id_to_string().

Signed-off-by: Bjorn Helgaas <bjorn.helgaas@hp.com>
Acked-By: Rene Herman <rene.herman@gmail.com>
Signed-off-by: Len Brown <len.brown@intel.com>
16 years agoPNP: change pnp_add_id() to allocate its own pnp_id structures
Bjorn Helgaas [Mon, 28 Apr 2008 22:33:52 +0000 (16:33 -0600)]
PNP: change pnp_add_id() to allocate its own pnp_id structures

This moves some of the pnp_id knowledge out of the backends and into
the PNP core.

Signed-off-by: Bjorn Helgaas <bjorn.helgaas@hp.com>
Acked-By: Rene Herman <rene.herman@gmail.com>
Signed-off-by: Len Brown <len.brown@intel.com>
16 years agoPNP: make pnp_add_id() internal to PNP core
Bjorn Helgaas [Mon, 28 Apr 2008 22:33:51 +0000 (16:33 -0600)]
PNP: make pnp_add_id() internal to PNP core

pnp_add_id() doesn't need to be exposed outside the PNP core, so
move the declaration to an internal header file.

Signed-off-by: Bjorn Helgaas <bjorn.helgaas@hp.com>
Acked-By: Rene Herman <rene.herman@gmail.com>
Signed-off-by: Len Brown <len.brown@intel.com>
16 years agoPNPACPI: continue after _CRS and _PRS errors
Bjorn Helgaas [Mon, 28 Apr 2008 22:33:50 +0000 (16:33 -0600)]
PNPACPI: continue after _CRS and _PRS errors

Keep going and register the device even if we have trouble parsing
_CRS or _PRS.  A parsing problem might mean we ignore some resources
the device is using, or we might not be able to change its resources.
But we should still take note of anything we *could* parse correctly.

Also remove reference to dev_id because I plan to remove it soon.

Signed-off-by: Bjorn Helgaas <bjorn.helgaas@hp.com>
Signed-off-by: Len Brown <len.brown@intel.com>
16 years agoISAPNP: move config register addresses out of isapnp.h
Bjorn Helgaas [Mon, 28 Apr 2008 22:33:49 +0000 (16:33 -0600)]
ISAPNP: move config register addresses out of isapnp.h

These are used only in drivers/pnp/isapnp/core.c, so no need to
expose them to the world.

Signed-off-by: Bjorn Helgaas <bjorn.helgaas@hp.com>
Acked-By: Rene Herman <rene.herman@gmail.com>
Signed-off-by: Len Brown <len.brown@intel.com>
16 years agoPNP: turn on -DDEBUG when CONFIG_PNP_DEBUG is set
Bjorn Helgaas [Mon, 28 Apr 2008 22:33:48 +0000 (16:33 -0600)]
PNP: turn on -DDEBUG when CONFIG_PNP_DEBUG is set

Turn on -DDEBUG in CFLAGS when CONFIG_PNP_DEBUG=y.  This makes
dev_dbg() do what you expect.

Signed-off-by: Bjorn Helgaas <bjorn.helgaas@hp.com>
Acked-by: Rene Herman <rene.herman@gmail.com>
Signed-off-by: Len Brown <len.brown@intel.com>
16 years agothermal: re-name thermal.c to thermal_sys.c
Len Brown [Tue, 29 Apr 2008 07:12:17 +0000 (03:12 -0400)]
thermal: re-name thermal.c to thermal_sys.c

thermal_sys was already the name of the resulting module,
and it is built from  this one source file.

Signed-off-by: Len Brown <len.brown@intel.com>
16 years agoACPI: update thermal temperature
Zhang, Rui [Thu, 10 Apr 2008 08:20:23 +0000 (16:20 +0800)]
ACPI: update thermal temperature

Fix the problem that thermal_get_temp returns the cached value,
which causes the temperature in generic thermal never updates.

Signed-off-by: Zhang Rui <rui.zhang@intel.com>
Acked-by: Jean Delvare <khali@linux-fr.org>
Signed-off-by: Len Brown <len.brown@intel.com>
16 years agoACPI: elide a non-zero test on a result that is never 0
Julia Lawall [Fri, 11 Apr 2008 02:09:24 +0000 (10:09 +0800)]
ACPI: elide a non-zero test on a result that is never 0

thermal_cooling_device_register used to return NULL if THERMAL is "n".
As the ACPI fan, processor and video drivers SELECT the generic
thermal in PATCH 01, this is not a problem any more.

Signed-off-by: Julia Lawall <julia@diku.dk>
Signed-off-by: Zhang Rui <rui.zhang@intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>
16 years agothermal: update the documentation
Zhang Rui [Tue, 22 Apr 2008 00:50:09 +0000 (08:50 +0800)]
thermal: update the documentation

Update the documentation for the thermal driver hwmon sys I/F.

Change the ACPI thermal zone type to be consistent with hwmon.

Signed-off-by: Zhang Rui <rui.zhang@intel.com>
Acked-by: Jean Delvare <khali@linux-fr.org>
Signed-off-by: Len Brown <len.brown@intel.com>
16 years agothermal: add hwmon sysfs I/F
Zhang Rui [Mon, 21 Apr 2008 08:07:52 +0000 (16:07 +0800)]
thermal: add hwmon sysfs I/F

Add hwmon sys I/F for generic thermal driver.

Note: we have one hwmon class device for EACH TYPE of the thermal zone device.

Signed-off-by: Zhang Rui <rui.zhang@intel.com>
Acked-by: Jean Delvare <khali@linux-fr.org>
Signed-off-by: Len Brown <len.brown@intel.com>
16 years agothermal: add new get_crit_temp callback
Zhang, Rui [Thu, 10 Apr 2008 08:13:10 +0000 (16:13 +0800)]
thermal: add new get_crit_temp callback

Add a new callback so that the generic thermal can get
the critical trip point info of a thermal zone,
which is needed for building the tempX_crit hwmon sysfs attribute.

Signed-off-by: Zhang Rui <rui.zhang@intel.com>
Acked-by: Jean Delvare <khali@linux-fr.org>
Signed-off-by: Len Brown <len.brown@intel.com>
16 years agothermal: add the support for building the generic thermal as a module
Zhang Rui [Mon, 21 Apr 2008 08:07:13 +0000 (16:07 +0800)]
thermal: add the support for building the generic thermal as a module

Build the generic thermal driver as module "thermal_sys".

Make ACPI thermal, video, processor and fan SELECT the generic
thermal driver, as these drivers rely on it to build the sysfs I/F.

Signed-off-by: Zhang Rui <rui.zhang@intel.com>
Acked-by: Jean Delvare <khali@linux-fr.org>
Signed-off-by: Len Brown <len.brown@intel.com>
16 years agoflush kacpi_notify_wq before removing notify handler
Zhang Rui [Tue, 29 Apr 2008 06:34:42 +0000 (02:34 -0400)]
flush kacpi_notify_wq before removing notify handler

Flush kacpi_notify_wq before notify handler is removed,
this can fix a bug which the deferred notify handler is executed
after the notify_handler has already been removed.
http://bugzilla.kernel.org/show_bug.cgi?id=9772

Signed-off-by: Zhang Rui <rui.zhang@intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>
16 years agodrivers: fix integer as NULL pointer warnings
Harvey Harrison [Mon, 28 Apr 2008 23:50:04 +0000 (16:50 -0700)]
drivers: fix integer as NULL pointer warnings

Signed-off-by: Harvey Harrison <harvey.harrison@gmail.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
16 years agomedia: fix integer as NULL pointer warnings
Harvey Harrison [Mon, 28 Apr 2008 23:50:03 +0000 (16:50 -0700)]
media: fix integer as NULL pointer warnings

drivers/media/video/v4l2-common.c:719:16: warning: Using plain integer as NULL pointer
drivers/media/video/au0828/au0828-dvb.c:122:19: warning: Using plain integer as NULL pointer
drivers/media/video/ivtv/ivtv-yuv.c:1101:22: warning: Using plain integer as NULL pointer
drivers/media/video/ivtv/ivtv-yuv.c:1102:23: warning: Using plain integer as NULL pointer
drivers/media/video/pvrusb2/pvrusb2-audio.c:78:39: warning: Using plain integer as NULL pointer
drivers/media/video/pvrusb2/pvrusb2-video-v4l.c:84:39: warning: Using plain integer as NULL pointer
drivers/media/video/pvrusb2/pvrusb2-v4l2.c:1264:9: warning: Using plain integer as NULL pointer
drivers/media/video/pvrusb2/pvrusb2-context.c:197:28: warning: Using plain integer as NULL pointer
drivers/media/video/pvrusb2/pvrusb2-cx2584x-v4l.c:126:39: warning: Using plain integer as NULL pointer
drivers/media/video/pvrusb2/pvrusb2-dvb.c:133:32: warning: Using plain integer as NULL pointer
drivers/media/video/pvrusb2/pvrusb2-dvb.c:145:31: warning: Using plain integer as NULL pointer
drivers/media/video/pvrusb2/pvrusb2-dvb.c:177:55: warning: Using plain integer as NULL pointer
drivers/media/video/videobuf-core.c:100:9: warning: Using plain integer as NULL pointer

Signed-off-by: Harvey Harrison <harvey.harrison@gmail.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
16 years agoscsi: fix integer as NULL pointer warnings
Harvey Harrison [Mon, 28 Apr 2008 23:50:03 +0000 (16:50 -0700)]
scsi: fix integer as NULL pointer warnings

drivers/scsi/aic7xxx/aic7770_osm.c:53:58: warning: Using plain integer as NULL pointer
drivers/scsi/aic7xxx/aic7xxx_osm_pci.c:355:47: warning: Using plain integer as NULL pointer
drivers/scsi/aic7xxx/aic7xxx_osm_pci.c:372:55: warning: Using plain integer as NULL pointer
drivers/scsi/aha152x.c:997:28: warning: Using plain integer as NULL pointer
drivers/scsi/aha152x.c:1003:28: warning: Using plain integer as NULL pointer
drivers/scsi/aha152x.c:1165:46: warning: Using plain integer as NULL pointer
drivers/scsi/fdomain.c:1446:40: warning: Using plain integer as NULL pointer
drivers/scsi/sym53c8xx_2/sym_hipd.c:1650:51: warning: Using plain integer as NULL pointer
drivers/scsi/sym53c8xx_2/sym_hipd.c:3171:42: warning: Using plain integer as NULL pointer
drivers/scsi/sym53c8xx_2/sym_hipd.c:5732:52: warning: Using plain integer as NULL pointer
drivers/scsi/ncr53c8xx.c:8189:31: warning: Using plain integer as NULL pointer
drivers/scsi/ncr53c8xx.c:8225:34: warning: Using plain integer as NULL pointer
drivers/scsi/dpt_i2o.c:156:32: warning: Using plain integer as NULL pointer
drivers/scsi/ultrastor.c:954:42: warning: Using plain integer as NULL pointer
drivers/scsi/ultrastor.c:1104:18: warning: Using plain integer as NULL pointer

Signed-off-by: Harvey Harrison <harvey.harrison@gmail.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
16 years agoMerge git://git.kernel.org/pub/scm/linux/kernel/git/bart/ide-2.6
Linus Torvalds [Tue, 29 Apr 2008 00:30:26 +0000 (17:30 -0700)]
Merge git://git./linux/kernel/git/bart/ide-2.6

* git://git.kernel.org/pub/scm/linux/kernel/git/bart/ide-2.6: (35 commits)
  siimage: coding style cleanup (take 2)
  ide-cd: clean up cdrom_analyze_sense_data()
  ide-cd: fix test unsigned var < 0
  ide: add TSSTcorp CDDVDW SH-S202H to ivb_list[]
  piix: add Asus Eee 701 controller to short cable list
  ARM: always select HAVE_IDE
  remove the broken ETRAX_IDE driver
  ide: remove ->dma_prdtable field from ide_hwif_t
  ide: remove ->dma_vendor{1,3} fields from ide_hwif_t
  scc_pata: add ->dma_host_set and ->dma_start methods
  ide: skip "VLB sync" if host uses MMIO
  ide: add ide_pad_transfer() helper
  ide: remove ->INW and ->OUTW methods
  ide: use IDE I/O helpers directly in ide_tf_{load,read}()
  ns87415: add ->tf_read method
  scc_pata: add ->tf_{load,read} methods
  ide-h8300: add ->tf_{load,read} methods
  ide-cris: add ->tf_{load,read} methods
  ide: add ->tf_load and ->tf_read methods
  ide: move ide_tf_{load,read} to ide-iops.c
  ...

16 years agoMerge git://git.kernel.org/pub/scm/linux/kernel/git/sam/kbuild
Linus Torvalds [Tue, 29 Apr 2008 00:29:43 +0000 (17:29 -0700)]
Merge git://git./linux/kernel/git/sam/kbuild

* git://git.kernel.org/pub/scm/linux/kernel/git/sam/kbuild:
  kconfig: add named choice group
  kconfig: fix choice dependency check
  kconifg: 'select' considered less evil
  dontdiff: ignore timeconst.h
  dontdiff: add modules.order
  kbuild: fix unportability in gen_initramfs_list.sh
  kbuild: fix help output to show correct arch
  kbuild: show defconfig subdirs in make help
  kconfig: reversed borderlines in inputbox