aboutsummaryrefslogtreecommitdiff
path: root/drivers/pnp/driver.c
AgeCommit message (Collapse)Author
2011-01-11PNP / ACPI: Use DEVICE_ACPI_HANDLE() for device ACPI handle accessRafael J. Wysocki
The PNP ACPI driver squirrels the ACPI handles of PNP devices' ACPI companions, but this isn't correct, because those handles should be accessed using the DEVICE_ACPI_HANDLE() macro operating on struct device objects. Using DEVICE_ACPI_HANDLE() in the PNP ACPI driver instead of the driver's own copies of the ACPI handles allows us to avoid a problem with docking stations where a machine docked before suspend to RAM and undocked while suspended crashes during the subsequent resume (in that case the ACPI companion of the PNP device in question doesn't exist any more while the device is being resumed). It also allows us to avoid the problem where suspend to RAM fails when the machine was undocked while suspended before (again, the ACPI companion of the PNP device is not present any more while it is being suspended). This change doesn't fix all of the the PNP ACPI driver's problems with PNP devices in docking stations (generally speaking, the driver has no idea that devices can come and go and doesn't even attempt to handle such events), but at least it makes suspend work for the users of docking stations who don't use the PNP devices located in there. References: https://bugzilla.kernel.org/show_bug.cgi?id=15100 Reported-and-tested-by: Toralf Förster <toralf.foerster@gmx.de> Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl> Acked-by: Bjorn Helgaas <bjorn.helgaas@hp.com> Signed-off-by: Len Brown <len.brown@intel.com>
2010-10-01ACPI/PNP: A HID value of an object never changes -> make it constThomas Renninger
Signed-off-by: Thomas Renninger <trenn@suse.de> Signed-off-by: Len Brown <len.brown@intel.com>
2009-09-22pnp: add a shutdown method to pnp driversDavid Härdeman
The shutdown method is used by the winbond cir driver to setup the hardware for wake-from-S5. Signed-off-by: Bjorn Helgaas <bjorn.helgaas@hp.com> Signed-off-by: David Härdeman <david@hardeman.nu> Cc: Dmitry Torokhov <dtor@mail.ru> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2008-10-23Merge branch 'linus' into testLen Brown
Conflicts: MAINTAINERS arch/x86/kernel/acpi/boot.c arch/x86/kernel/acpi/sleep.c drivers/acpi/Kconfig drivers/pnp/Makefile drivers/pnp/quirks.c Signed-off-by: Len Brown <len.brown@intel.com>
2008-10-16PNP: create device attributes via default device attributesDrew Moseley
This creates the attributes before the uevent is sent. Signed-off-by: Drew Moseley <dmoseley@mvista.com> Acked-by: Kay Sievers <kay.sievers@vrfy.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2008-10-10PNP: convert the last few pnp_info() uses to printk()Bjorn Helgaas
There are only a few remaining uses of pnp_info(), so I just converted them to printk and removed the pnp_err(), pnp_info(), pnp_warn(), and pnp_dbg() wrappers. I also removed a couple debug messages that don't seem useful any more ("driver registered", "driver unregistered", "driver attached"). Signed-off-by: Bjorn Helgaas <bjorn.helgaas@hp.com> Signed-off-by: Andi Kleen <ak@linux.intel.com> Signed-off-by: Len Brown <len.brown@intel.com>
2008-04-29PNP: change pnp_add_id() to allocate its own pnp_id structuresBjorn Helgaas
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>
2008-04-28PNP: skip dev->protocol NULL checksBjorn Helgaas
Every PNP device should have a valid protocol pointer. If it doesn't, something's wrong and we should oops so we can find and fix the problem. Signed-off-by: Bjorn Helgaas <bjorn.helgaas@hp.com> Cc: Adam Belay <ambx1@neo.rr.com> Cc: Adrian Bunk <bunk@kernel.org> Cc: Rene Herman <rene.herman@keyaccess.nl> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2008-02-06PNP: do not test PNP_DRIVER_RES_DO_NOT_CHANGE on suspend/resumeRene Herman
The PNP_DRIVER_RES_DO_NOT_CHANGE flag is meant to signify that the PNP core should not change resources for the device -- not that it shouldn't disable/enable the device on suspend/resume. ALSA ISAPnP drivers set PNP_DRIVER_RES_DO_NOT_CHANAGE (0x0001) through setting PNP_DRIVER_RES_DISABLE (0x0003). The latter including the former may in itself be considered rather unexpected but doesn't change that suspend/resume wouldn't seem to have any business testing the flag. As reported by Ondrej Zary for snd-cs4236, ALSA driven ISAPnP cards don't survive swsusp hibernation with the resume skipping setting the resources due to testing the flag -- the same test in the suspend path isn't enough to keep hibernation from disabling the card it seems. These tests were added (in 2005) by Piere Ossman in commit 68094e3251a664ee1389fcf179497237cbf78331, "alsa: Improved PnP suspend support" who doesn't remember why. This deletes them. Signed-off-by: Rene Herman <rene.herman@gmail.com> Tested-by: Ondrej Zary <linux@rainbow-software.org> Cc: Bjorn Helgaas <bjorn.helgaas@hp.com> Cc: Pierre Ossman <drzeus@drzeus.cx> Cc: Adam Belay <ambx1@neo.rr.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2007-10-17PNP: use dev_info(), dev_err(), etc in coreBjorn Helgaas
If we have the struct pnp_dev available, we can use dev_info(), dev_err(), etc., to give a little more information and consistency. [akpm@linux-foundation.org: fix warning] Signed-off-by: Bjorn Helgaas <bjorn.helgaas@hp.com> Cc: Adam Belay <ambx1@neo.rr.com> Cc: Len Brown <lenb@kernel.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2007-08-24PNP: remove null pointer checksBjorn Helgaas
Remove some null pointer checks. Null pointers in these areas indicate programming errors, and I think it's better to oops immediately rather than return an error that is easily ignored. Signed-off-by: Bjorn Helgaas <bjorn.helgaas@hp.com> Acked-by: Adam Belay <abelay@novell.com> Signed-off-by: Len Brown <len.brown@intel.com>
2007-08-24PNP: fix up after LindentBjorn Helgaas
More manual fixups after Lindent. No functional change. Signed-off-by: Bjorn Helgaas <bjorn.helgaas@hp.com> Acked-by: Adam Belay <abelay@novell.com> Signed-off-by: Len Brown <len.brown@intel.com>
2007-07-26PNP: fix up after LindentBjorn Helgaas
These are manual fixups after running Lindent. No functional change. Signed-off-by: Bjorn Helgaas <bjorn.helgaas@hp.com> Cc: Len Brown <lenb@kernel.org> Cc: Adam Belay <ambx1@neo.rr.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2007-07-26PNP: Lindent all source filesBjorn Helgaas
Run Lindent on all PNP source files. Produced by: $ quilt new pnp-lindent $ find drivers/pnp -name \*.[ch] | xargs quilt add $ quilt add include/linux/{pnp.h,pnpbios.h} $ scripts/Lindent drivers/pnp/*.c drivers/pnp/*/*.c include/linux/pnp*.h $ quilt refresh --sort Signed-off-by: Bjorn Helgaas <bjorn.helgaas@hp.com> Cc: Len Brown <lenb@kernel.org> Cc: Adam Belay <ambx1@neo.rr.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2007-07-22ACPI, PNP: hook ACPI D-state to PNP suspend/resumeShaohua Li
applied after Rafel's 'PM: Update global suspend and hibernation operations framework' patch set Signed-off-by: Shaohua Li <shaohua.li@intel.com> Signed-off-by: Len Brown <len.brown@intel.com>
2006-06-30Remove obsolete #include <linux/config.h>Jörn Engel
Signed-off-by: Jörn Engel <joern@wohnheim.fh-wedel.de> Signed-off-by: Adrian Bunk <bunk@stusta.de>
2006-03-27[PATCH] pnp: PNP: adjust pnp_register_driver signatureBjorn Helgaas
Remove the assumption that pnp_register_driver() returns the number of devices claimed. Returning the count is unreliable because devices may be hot-plugged in the future. This changes the convention to "zero for success, or a negative error value," which matches pci_register_driver(), acpi_bus_register_driver(), and platform_driver_register(). Signed-off-by: Bjorn Helgaas <bjorn.helgaas@hp.com> Cc: Adam Belay <ambx1@neo.rr.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2006-01-13[PATCH] Add pnp_bus_type probe and remove methodsRussell King
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2006-01-03[ALSA] [PATCH] alsa: Improved PnP suspend supportPierre Ossman
Also use the PnP functions to start/stop the devices during the suspend so that drivers will not have to duplicate this code. Cc: Adam Belay <ambx1@neo.rr.com> Cc: Jaroslav Kysela <perex@suse.cz> Cc: Takashi Iwai <tiwai@suse.de> Signed-off-by: Pierre Ossman <drzeus@drzeus.cx> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2006-01-03[ALSA] PATCH] Add PM support to PnP driversTakashi Iwai
Add suspend/resume callback to pnp_driver and pnp_card_driver. Signed-off-by: Takashi Iwai <tiwai@suse.de>
2005-11-07[PATCH] drivers/pnp/: cleanupsAdrian Bunk
This patch contains the following possible cleanups: - make needlessly global code static - #if 0 the following unused global function: - core.c: pnp_remove_device - #if 0 the following unneeded EXPORT_SYMBOL's: - card.c: pnp_add_card - card.c: pnp_remove_card - card.c: pnp_add_card_device - card.c: pnp_remove_card_device - card.c: pnp_add_card_id - core.c: pnp_register_protocol - core.c: pnp_unregister_protocol - core.c: pnp_add_device - core.c: pnp_remove_device - pnpacpi/core.c: pnpacpi_protocol - driver.c: pnp_add_id - isapnp/core.c: isapnp_read_byte - manager.c: pnp_auto_config_dev - resource.c: pnp_register_dependent_option - resource.c: pnp_register_independent_option - resource.c: pnp_register_irq_resource - resource.c: pnp_register_dma_resource - resource.c: pnp_register_port_resource - resource.c: pnp_register_mem_resource Note that this patch #if 0's exactly one functions and removes no functions. Most it does is the #if 0 of EXPORT_SYMBOL's, so if any modular code will use any of them, re-adding will be trivial. Modular ISAPnP might be interesting in some cases, but this is more legacy code. If someone would work on it to sort all the issues out (starting with the point that most users of __ISAPNP__ will have to be fixed) re-enabling the required EXPORT_SYMBOL's won't be hard for him. Signed-off-by: Adrian Bunk <bunk@stusta.de> Cc: Adam Belay <ambx1@neo.rr.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2005-09-07[PATCH] PNP: make pnp_dbg conditional directly on CONFIG_PNP_DEBUGBjorn Helgaas
Seems pointless to require .c files to test CONFIG_PNP_DEBUG and conditionally define DEBUG before including <linux/pnp.h>. Just test CONFIG_PNP_DEBUG directly in pnp.h. Signed-off-by: Bjorn Helgaas <bjorn.helgaas@hp.com> Cc: Adam Belay <ambx1@neo.rr.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2005-06-20[PATCH] Use driver_for_each_device() in drivers/pnp/driver.c instead of ↵mochel@digitalimplant.org
manually walking list. Signed-off-by: Patrick Mochel <mochel@digitalimplant.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> diff -Nru a/drivers/pnp/driver.c b/drivers/pnp/driver.c
2005-04-16Linux-2.6.12-rc2v2.6.12-rc2Linus Torvalds
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!