summaryrefslogtreecommitdiffstats
path: root/drivers
Commit message (Collapse)AuthorAgeFilesLines
* tty: Fix regressions caused by commit b50989dcDave Young2009-09-272-13/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The following commit made console open fails while booting: commit b50989dc444599c8b21edc23536fc305f4e9b7d5 Author: Alan Cox <alan@linux.intel.com> Date: Sat Sep 19 13:13:22 2009 -0700 tty: make the kref destructor occur asynchronously Due to tty release routines run in a workqueue now, error like the following will be reported while booting: INIT open /dev/console Input/output error It also causes hibernation regression to appear as reported at http://bugzilla.kernel.org/show_bug.cgi?id=14229 The reason is that now there's latency issue with closing, but when we open a "closing not finished" tty, -EIO will be returned. Fix it as per the following Alan's suggestion: Fun but it's actually not a bug and the fix is wrong in itself as the port may be closing but not yet being destructed, in which case it seems to do the wrong thing. Opening a tty that is closing (and could be closing for long periods) is supposed to return -EIO. I suspect a better way to deal with this and keep the old console timing is to split tty->shutdown into two functions. tty->shutdown() - called synchronously just before we dump the tty onto the waitqueue for destruction tty->cleanup() - called when the destructor runs. We would then do the shutdown part which can occur in IRQ context fine, before queueing the rest of the release (from tty->magic = 0 ... the end) to occur asynchronously The USB update in -next would then need a call like if (tty->cleanup) tty->cleanup(tty); at the top of the async function and the USB shutdown to be split between shutdown and cleanup as the USB resource cleanup and final tidy cannot occur synchronously as it needs to sleep. In other words the logic becomes final kref put make object unfindable async clean it up Signed-off-by: Dave Young <hidave.darkstar@gmail.com> [ rjw: Rebased on top of 2.6.31-git, reworked the changelog. ] Signed-off-by: "Rafael J. Wysocki" <rjw@sisk.pl> [ Changed serial naming to match new rules, dropped tty_shutdown as per comments from Alan Stern - Linus ] Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
* ACPI: kill "unused variable ‘i’" warningLinus Torvalds2009-09-271-1/+0
| | | | | | | | | | | | | | Commit 3d5b6fb47a8e68fa311ca2c3447e7f8a7c3a9cf3 ("ACPI: Kill overly verbose "power state" log messages") removed the actual use of this variable, but didn't remove the variable itself, resulting in build warnings like drivers/acpi/processor_idle.c: In function ‘acpi_processor_power_init’: drivers/acpi/processor_idle.c:1169: warning: unused variable ‘i’ Just get rid of the now unused variable. Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
* const: mark struct vm_struct_operationsAlexey Dobriyan2009-09-2731-34/+34
| | | | | | | | | | | * mark struct vm_area_struct::vm_ops as const * mark vm_ops in AGP code But leave TTM code alone, something is fishy there with global vm_ops being used. Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
* ACPI: Kill overly verbose "power state" log messagesRoland Dreier2009-09-271-7/+0
| | | | | | | | | | | | | | | | I was recently lucky enough to get a 64-CPU system, so my kernel log ends up with 64 lines like: ACPI: CPU0 (power states: C1[C1] C2[C3]) This is pretty useless clutter because this info is already available after boot from both /sys/devices/system/cpu/cpu*/cpuidle/state?/ as well as /proc/acpi/processor/CPU*/power. So just delete the code that prints the C-states in processor_idle.c. Signed-off-by: Roland Dreier <rolandd@cisco.com> Signed-off-by: Len Brown <len.brown@intel.com>
* ACPI: Clarify resource conflict messageJean Delvare2009-09-271-1/+7
| | | | | | | | | | | | | | | | | | | | | | | | The message "ACPI: Device needs an ACPI driver" is misleading. The device _may_ need an ACPI driver, if the BIOS implemented a custom API for the device in question (which, AFAIK, can't be checked.) If not, then either a generic ACPI driver may be used (for example "thermal"), or nothing can be done (other than a white list). I propose to reword the message to: ACPI: If an ACPI driver is available for this device, you should use it instead of the native driver which I think is more correct. Comments and suggestions welcome. I also added a message warning about possible problems and system instability when users pass acpi_enforce_resources=lax, as suggested by Len. Signed-off-by: Jean Delvare <jdelvare@suse.de> Cc: Thomas Renninger <trenn@suse.de> Cc: Alan Jenkins <sourcejedi.lkml@googlemail.com> Signed-off-by: Len Brown <len.brown@intel.com>
* thinkpad-acpi: fix CONFIG_THINKPAD_ACPI_HOTKEY_POLL build problemHenrique de Moraes Holschuh2009-09-271-0/+2
| | | | | | | | | | | | | | | Fix this problem when CONFIG_THINKPAD_ACPI_HOTKEY_POLL is undefined: CHECK drivers/platform/x86/thinkpad_acpi.c drivers/platform/x86/thinkpad_acpi.c:1968:21: error: not an lvalue CC [M] drivers/platform/x86/thinkpad_acpi.o drivers/platform/x86/thinkpad_acpi.c: In function 'tpacpi_hotkey_driver_mask_set': drivers/platform/x86/thinkpad_acpi.c:1968: error: lvalue required as left operand of assignment Reported-by: Noah Dain <noahdain@gmail.com> Reported-by: Audrius Kazukauskas <audrius@neutrino.lt> Signed-off-by: Henrique de Moraes Holschuh <hmh@hmh.eng.br> Signed-off-by: Len Brown <len.brown@intel.com>
* Merge branch 'for-linus' of git://git.o-hand.com/linux-rpurdie-ledsLinus Torvalds2009-09-2610-31/+380
|\ | | | | | | | | | | | | | | | | | | | | * 'for-linus' of git://git.o-hand.com/linux-rpurdie-leds: leds: move leds-clevo-mail's probe function to .devinit.text leds: Fix indentation in LEDS_LP3944 Kconfig entry leds: Fix LED names leds: Fix leds-pca9532 whitespace issues leds: fix coding style in worker thread code for ledtrig-gpio. leds: gpio-leds: fix typographics fault leds: Add WM831x status LED driver
| * leds: move leds-clevo-mail's probe function to .devinit.textUwe Kleine-König2009-09-071-1/+1
| | | | | | | | | | | | | | | | | | | | | | A pointer to clevo_mail_led_probe is passed to the core via platform_driver_register and so the function must not disappear when the .init sections are discarded. Otherwise (if also having HOTPLUG=y) unbinding and binding a device to the driver via sysfs will result in an oops as does a device being registered late. Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
| * leds: Fix indentation in LEDS_LP3944 Kconfig entryAntonio Ospite2009-09-071-3/+3
| | | | | | | | | | Signed-off-by: Antonio Ospite <ospite@studenti.unina.it> Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
| * leds: Fix LED names Olaf Hering2009-09-073-4/+4
| | | | | | | | | | | | | | | | | | This is needed to get kde-powersave to work properly on some g4 powerbooks. From: Olaf Hering <olh@suse.de> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
| * leds: Fix leds-pca9532 whitespace issuesRichard Purdie2009-09-071-6/+6
| | | | | | | | Signed-off-by: Richard Purdie <rpurdie@linux.intel.com
| * leds: fix coding style in worker thread code for ledtrig-gpio.Thadeu Lima de Souza Cascardo2009-09-071-16/+16
| | | | | | | | | | | | | | | | [akpm@linux-foundation.org: coding-style fixes] Signed-off-by: Thadeu Lima de Souza Cascardo <cascardo@holoscopio.com> Signed-off-by: Samuel R. C. Vale <srcvale@holoscopio.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
| * leds: gpio-leds: fix typographics faultMichal Simek2009-09-071-1/+1
| | | | | | | | | | | | | | [akpm@linux-foundation.org: coding-style fixes] Signed-off-by: Michal Simek <monstr@monstr.eu> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
| * leds: Add WM831x status LED driverMark Brown2009-09-073-0/+349
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The WM831x devices feature two software controlled status LEDs with hardware assisted blinking. The device can also autonomously control the LEDs based on a selection of sources. This can be configured at boot time using either platform data or the chip OTP. A sysfs file in the style of that for triggers allowing the control source to be configured at run time. Triggers can't be used here since they can't depend on the implementation details of a specific LED type. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
* | Merge branch 'for-linus' of git://git.o-hand.com/linux-rpurdie-backlightLinus Torvalds2009-09-2611-2/+1168
|\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 'for-linus' of git://git.o-hand.com/linux-rpurdie-backlight: backlight: new driver for ADP5520/ADP5501 MFD PMICs backlight: extend event support to also support poll() backlight/eeepc-laptop: Update the backlight state when we change brightness backlight/acpi: Update the backlight state when we change brightness backlight: Allow drivers to update the core, and generate events on changes backlight: switch to da903x driver to dev_pm_ops backlight: Add support for the Avionic Design Xanthos backlight device. backlight: spi driver for LMS283GF05 LCD backlight: move hp680-bl's probe function to .devinit.text backlight: Add support for new Apple machines. backlight: mbp_nvidia_bl: add support for MacBookAir 1,1 backlight: Add WM831x backlight driver Trivial conflicts due to '#ifdef CONFIG_PM' differences in drivers/video/backlight/da903x_bl.c
| * | backlight: new driver for ADP5520/ADP5501 MFD PMICsMichael Hennerich2009-09-263-0/+390
| | | | | | | | | | | | | | | | | | | | | Signed-off-by: Michael Hennerich <michael.hennerich@analog.com> Signed-off-by: Bryan Wu <cooloney@kernel.org> Signed-off-by: Mike Frysinger <vapier@gentoo.org> Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
| * | backlight: extend event support to also support poll()Henrique de Moraes Holschuh2009-09-261-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Extend the backlight event support to also allow the use of poll()/select() on actual_brightness. We already have the entire event hookup anyway, adding a single function call in one line to get functionality like that is a really good deal. Signed-off-by: Henrique de Moraes Holschuh <hmh@hmh.eng.br> Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
| * | backlight/eeepc-laptop: Update the backlight state when we change brightnessMatthew Garrett2009-09-211-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | Trigger a status update when the user hits a brightness key, allowing userspace to present appropriate UI. Signed-off-by: Matthew Garrett <mjg@redhat.com> Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
| * | backlight/acpi: Update the backlight state when we change brightnessMatthew Garrett2009-09-211-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | Trigger a status update when we change the brightness in the driver, thus allowing userspace to present appropriate UI. Signed-off-by: Matthew Garrett <mjg@redhat.com> Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
| * | backlight: Allow drivers to update the core, and generate events on changesMatthew Garrett2009-09-211-0/+41
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Certain hardware will send us events when the backlight brightness changes. Add a function to update the value in the core, and additionally send a uevent so that userspace can pop up appropriate UI. The uevents are flagged depending on whether the update originated in the kernel or from userspace, making it easier to only display UI at the appropriate time. Signed-off-by: Matthew Garrett <mjg@redhat.com> Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
| * | backlight: switch to da903x driver to dev_pm_opsMike Rapoport2009-09-211-10/+10
| | | | | | | | | | | | | | | Signed-off-by: Mike Rapoport <mike@compulab.co.il> Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
| * | backlight: Add support for the Avionic Design Xanthos backlight device.Thierry Reding2009-09-073-1/+187
| | | | | | | | | | | | | | | | | | | | | | | | This patch adds support for the backlight device found on Avionic Design Xanthos-based boards. Signed-off-by: Thierry Reding <thierry.reding@avionic-design.de> Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
| * | backlight: spi driver for LMS283GF05 LCDMarek Vasut2009-09-073-0/+250
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | ADd support for the SPI part of LMS283GF05 LCD. The LCD uses SPI for initialization and powerdown sequences. No further defails are specified in the datasheet about the initialization/powerdown sequence, just the magic numbers that have to be sent over SPI bus. This LCD can be found in the Aeronix Zipit Z2 handheld. Signed-off-by: Marek Vasut <marek.vasut@gmail.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
| * | backlight: move hp680-bl's probe function to .devinit.textUwe Kleine-König2009-09-071-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | A pointer to hp680bl_probe is passed to the core via platform_driver_register and so the function must not disappear when the .init sections are discarded. Otherwise (if also having HOTPLUG=y) unbinding and binding a device to the driver via sysfs will result in an oops as does a device being registered late. Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Acked-by: Kristoffer Ericson <Kristoffer.Ericson@gmail.com> Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
| * | backlight: Add support for new Apple machines.Mario Schwalbe2009-09-071-0/+27
| | | | | | | | | | | | | | | | | | | | | | | | | | | This patch adds support for the new Apple models MacBook 5,1, MacBook Pro 5,1, MacBook Pro 5,2, MacBook Pro 5,5. It's just a device table update. Signed-off-by: Mario Schwalbe <schwalbe@inf.tu-dresden.de> Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
| * | backlight: mbp_nvidia_bl: add support for MacBookAir 1,1Henrik Rydberg2009-09-071-0/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add LCD backlight support for the Intel GMA965 found in the MacBookAir 1,1. Signed-off-by: Henrik Rydberg <rydberg@euromail.se> Acked-by: Matthew Garrett <mjg@redhat.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
| * | backlight: Add WM831x backlight driverMark Brown2009-09-073-0/+258
| |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The WM831x series of PMICs provide DC-DC boost convertors and current sinks which can be used together to drive LEDs for use as backlights. Expose this functionality via the backlight API. Since when used in this configuration the current sink and boost convertor are very tightly coupled with a multi-stage startup for the current sink which overlaps with the boost convertor startup this driver bypasses the regulator API. Machine inititialisation is responsible for ensuring that the regulators are not accessed via both APIs. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
* | headers: kref.h reduxAlexey Dobriyan2009-09-266-6/+0
| | | | | | | | | | | | | | | | | | * remove asm/atomic.h inclusion from kref.h -- not needed, linux/types.h is enough for atomic_t * remove linux/kref.h inclusion from files which do not need it. Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
* | Merge branch 'release' of ↵Linus Torvalds2009-09-266-682/+731
|\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | git://git.kernel.org/pub/scm/linux/kernel/git/lenb/linux-acpi-2.6 * 'release' of git://git.kernel.org/pub/scm/linux/kernel/git/lenb/linux-acpi-2.6: (32 commits) ACPI: i2c-scmi: don't use acpi_device_uid() ACPI: simplify building device HID/CID list ACPI: remove acpi_device_uid() and related stuff ACPI: remove acpi_device.flags.hardware_id ACPI: remove acpi_device.flags.compatible_ids ACPI: maintain a single list of _HID and _CID IDs ACPI: make sure every acpi_device has an ID ACPI: use acpi_device_hid() when possible ACPI: fix synthetic HID for \_SB_ ACPI: handle re-enumeration, when acpi_devices might already exist ACPI: factor out device type and status checking ACPI: add acpi_bus_get_status_handle() ACPI: use acpi_walk_namespace() to enumerate devices ACPI: identify device tree root by null parent pointer, not ACPI_BUS_TYPE ACPI: enumerate namespace before adding functional fixed hardware devices ACPI: convert acpi_bus_scan() to operate on an acpi_handle ACPI: add acpi_bus_get_parent() and remove "parent" arguments ACPI: remove unnecessary argument checking ACPI: remove redundant "type" arguments ACPI: remove acpi_device_set_context() "type" argument ...
| * | ACPI: i2c-scmi: don't use acpi_device_uid()Bjorn Helgaas2009-09-261-3/+2
| | | | | | | | | | | | | | | | | | | | | | | | We recently removed the acpi_device_uid() interface because nobody used it. I don't think it's essential here either. Signed-off-by: Bjorn Helgaas <bjorn.helgaas@hp.com> Signed-off-by: Len Brown <len.brown@intel.com>
| * | Merge branch 'thinkpad-2.6.32-part2' into releaseLen Brown2009-09-261-206/+426
| |\ \
| | * | thinkpad-acpi: name event constantsHenrique de Moraes Holschuh2009-09-201-23/+69
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Reduce the number of magic numbers in the driver... note that they were all explained and documented already. Signed-off-by: Henrique de Moraes Holschuh <hmh@hmh.eng.br> Signed-off-by: Len Brown <len.brown@intel.com>
| | * | thinkpad-acpi: add internal hotkey event APIHenrique de Moraes Holschuh2009-09-201-0/+48
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add an internal API to the driver, to allow subdrivers to request and receive HKEY 0x1000 events. This API will be used by the backlight (brightness up/down) and upcoming ALSA mixer (volume up/down/mute) subdrivers. Signed-off-by: Henrique de Moraes Holschuh <hmh@hmh.eng.br> Signed-off-by: Len Brown <len.brown@intel.com>
| | * | thinkpad-acpi: hotkey event driver updateHenrique de Moraes Holschuh2009-09-201-176/+302
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Update the HKEY event driver to: 1. Handle better the second-gen firmware, which has no HKEY mask support but does report FN+F3, FN+F4 and FN+F12 without the need for NVRAM polling. a) always make the mask-related attributes available in sysfs; b) use DMI quirks to detect the second-gen firmware; c) properly report that FN+F3, FN+F4 and FN+F12 are enabled, and available even on mask-less second-gen firmware; 2. Decouple the issuing of hotkey events towards userspace from their reception from the firmware. ALSA mixer and brightness event reporting support will need this feature. 3. Clean up the mess in the hotkey driver a great deal. It is still very convoluted, and wants a full refactoring into a proper event API interface, but that is not going to happen today. 4. Fully reset firmware interface on resume (restore hotkey mask and status). 5. Stop losing polled events for no good reason when changing the mask and poll frequencies. We will still lose them when the hotkey_source_mask is changed, as well as any that happened between driver suspend and driver resume. The hotkey subdriver now has the notion of user-space-visible hotkey event mask, as well as of the set of "hotkey" events the driver needs (because brightness/volume change reports are not just keypress reports in most ThinkPad models). With this rewrite, the ABI level is bumped to 0x020500 should userspace need to know it is dealing with the updated hotkey subdriver. Signed-off-by: Henrique de Moraes Holschuh <hmh@hmh.eng.br> Signed-off-by: Len Brown <len.brown@intel.com>
| | * | thinkpad-acpi: drop HKEY event 0x5010Henrique de Moraes Holschuh2009-09-201-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | HKEY event 0x5010 is useless to us: old ThinkPads don't issue it. Newer ThinkPads won't issue it anymore. And all ThinkPads issue 0x1010 and 0x1011 events. Just silently drop it instead of sending it to userspace. Signed-off-by: Henrique de Moraes Holschuh <hmh@hmh.eng.br> Signed-off-by: Len Brown <len.brown@intel.com>
| | * | thinkpad-acpi: remove uneeded tp_features.hotkey tests in hotkey_exitHenrique de Moraes Holschuh2009-09-201-10/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | hotkey_exit() is only called if hotkey_init() finished sucessfully, or by direct calls inside hotkey_init(). The tp_features.hotkey test is always true, and just adds to the confusion, remove it. Also, avoid calling hotkey_mask_set() when it won't do anything useful. Signed-off-by: Henrique de Moraes Holschuh <hmh@hmh.eng.br> Signed-off-by: Len Brown <len.brown@intel.com>
| | * | thinkpad-acpi: don't leave ERR_PTR() pointers aroundHenrique de Moraes Holschuh2009-09-201-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | backlight_device_register returns ERR_PTR() in case of problems, and the current code would leave that ERR_PTR in ibm_backlight_device. The current code paths won't touch it in that situation, but that could change. Make sure to set ibm_backlight_device to NULL in the error path. Signed-off-by: Henrique de Moraes Holschuh <hmh@hmh.eng.br> Signed-off-by: Len Brown <len.brown@intel.com>
| * | | ACPI: simplify building device HID/CID listBjorn Helgaas2009-09-251-33/+23
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Minor code cleanup, no functional change. Instead of remembering what HIDs & CIDs to add later, just add them immediately. Signed-off-by: Bjorn Helgaas <bjorn.helgaas@hp.com> Signed-off-by: Len Brown <len.brown@intel.com>
| * | | ACPI: remove acpi_device_uid() and related stuffBjorn Helgaas2009-09-251-18/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Nobody uses acpi_device_uid(), so this patch removes it. Signed-off-by: Bjorn Helgaas <bjorn.helgaas@hp.com> Signed-off-by: Len Brown <len.brown@intel.com>
| * | | ACPI: remove acpi_device.flags.hardware_idBjorn Helgaas2009-09-252-26/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Every acpi_device has at least one ID (if there's no _HID or _CID, we give it a synthetic or default ID). So there's no longer a need to check whether an ID exists; we can just use it. Signed-off-by: Bjorn Helgaas <bjorn.helgaas@hp.com> Signed-off-by: Len Brown <len.brown@intel.com>
| * | | ACPI: remove acpi_device.flags.compatible_idsBjorn Helgaas2009-09-251-11/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We now keep a single list of IDs that includes both the _HID and any _CIDs. We no longer need to keep track of whether the device has a _CID. Signed-off-by: Bjorn Helgaas <bjorn.helgaas@hp.com> Signed-off-by: Len Brown <len.brown@intel.com>
| * | | ACPI: maintain a single list of _HID and _CID IDsBjorn Helgaas2009-09-252-129/+53
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | There's no need to treat _HID and _CID differently. Keeping them in a single list makes code that uses the IDs a little simpler because it can just traverse the list rather than checking "do we have a HID?", "do we have any CIDs?" Signed-off-by: Bjorn Helgaas <bjorn.helgaas@hp.com> Reviewed-by: Alex Chiang <achiang@hp.com> Signed-off-by: Len Brown <len.brown@intel.com>
| * | | ACPI: make sure every acpi_device has an IDBjorn Helgaas2009-09-251-0/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This makes sure every acpi_device has at least one ID. If we build an acpi_device for a namespace node with no _HID or _CID, we sometimes synthesize an ID like "LNXCPU" or "LNXVIDEO". If we don't even have that, give it a default "device" ID. Note that this means things like: /sys/devices/LNXSYSTM:00/LNXSYBUS:00/HWP0001:00/HWP0002:04/device:00 (a PCI slot SxFy device) will have "hid" and "modprobe" entries, where they didn't before. These aren't very useful (a HID of "device" doesn't tell you what *kind* of device it is, so it doesn't help find a driver), but I don't think they're harmful. Signed-off-by: Bjorn Helgaas <bjorn.helgaas@hp.com> Signed-off-by: Len Brown <len.brown@intel.com>
| * | | ACPI: use acpi_device_hid() when possibleBjorn Helgaas2009-09-252-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Use acpi_device_hid() rather than accessing acpi_device.pnp.hardware_id directly. Signed-off-by: Bjorn Helgaas <bjorn.helgaas@hp.com> Signed-off-by: Len Brown <len.brown@intel.com>
| * | | ACPI: fix synthetic HID for \_SB_Bjorn Helgaas2009-09-251-12/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This makes \_SB_ show up as /sys/devices/LNXSYSTM:00/LNXSYBUS:00 rather than "device:00". This has been broken for a loooong time (at least since 2.6.13) because device->parent is an acpi_device pointer, not a handle. Signed-off-by: Bjorn Helgaas <bjorn.helgaas@hp.com> Signed-off-by: Len Brown <len.brown@intel.com>
| * | | ACPI: handle re-enumeration, when acpi_devices might already existBjorn Helgaas2009-09-251-8/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | acpi_bus_scan() traverses the namespace to enumerate devices and uses acpi_add_single_object() to create acpi_devices. When the platform notifies us of a hot-plug event, we need to traverse part of the namespace again to figure out what appeared or disappeared. (We don't yet call acpi_bus_scan() during hot-plug, but I plan to do that in the future.) This patch makes acpi_add_single_object() notice when we already have an acpi_device, so we don't need to make a new one. Signed-off-by: Bjorn Helgaas <bjorn.helgaas@hp.com> Signed-off-by: Len Brown <len.brown@intel.com>
| * | | ACPI: factor out device type and status checkingBjorn Helgaas2009-09-251-77/+52
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch adds acpi_bus_type_and_status(), which determines the type of the object and whether we want to build an acpi_device for it. If it is acpi_device-worthy, it returns the type and the device's current status. Signed-off-by: Bjorn Helgaas <bjorn.helgaas@hp.com> Signed-off-by: Len Brown <len.brown@intel.com>
| * | | ACPI: add acpi_bus_get_status_handle()Bjorn Helgaas2009-09-251-27/+22
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add acpi_bus_get_status_handle() so we can get the status of a namespace object before building a struct acpi_device. This removes a use of "device->flags.dynamic_status", a cached indicator of whether _STA exists. It seems simpler and more reliable to just evaluate _STA and catch AE_NOT_FOUND errors. Signed-off-by: Bjorn Helgaas <bjorn.helgaas@hp.com> Signed-off-by: Len Brown <len.brown@intel.com>
| * | | ACPI: use acpi_walk_namespace() to enumerate devicesBjorn Helgaas2009-09-251-122/+74
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | acpi_bus_scan() currently walks the namespace manually. This patch changes it to use acpi_walk_namespace() instead. Besides removing some complicated code, this means we take advantage of the namespace locking done by acpi_walk_namespace(). The locking isn't so important at boot-time, but I hope to eventually use this same path to handle hot-addition of devices, when it will be important. Note that acpi_walk_namespace() does not actually visit the starting node first, so we need to do that by hand first. Signed-off-by: Bjorn Helgaas <bjorn.helgaas@hp.com> Signed-off-by: Len Brown <len.brown@intel.com>
| * | | ACPI: identify device tree root by null parent pointer, not ACPI_BUS_TYPEBjorn Helgaas2009-09-251-7/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We can identify the root of the ACPI device tree by the fact that it has no parent. This is simpler than passing around ACPI_BUS_TYPE_SYSTEM and will help remove special treatment of the device tree root. Currently, we add the root by hand with ACPI_BUS_TYPE_SYSTEM. If we traverse the tree treating the root as just another device and use acpi_get_type(), the root shows up as ACPI_TYPE_DEVICE. Signed-off-by: Bjorn Helgaas <bjorn.helgaas@hp.com> Signed-off-by: Len Brown <len.brown@intel.com>
OpenPOWER on IntegriCloud