aboutsummaryrefslogtreecommitdiff
path: root/drivers/platform
AgeCommit message (Collapse)Author
2009-12-09eeepc-laptop: move platform driver registration out of eeepc_hotk_add()Alan Jenkins
Strictly speaking we should register the platform driver exactly once, whether there are zero, one, or multiple matching acpi devices. Signed-off-by: Alan Jenkins <alan-jenkins@tuffmail.co.uk> Signed-off-by: Len Brown <len.brown@intel.com>
2009-12-09eeepc-laptop: refactor notificationsAlan Jenkins
Separate out input_notify(), in a similar way to how notify_brn() is already separated. This will allow all the functions which refer to the input device to be grouped together. This includes a small behaviour change - we now synthesize brightness up/down key events even if the brightness is already at the maximum/minimum value. This is consistent with the new uevent interface. Signed-off-by: Alan Jenkins <alan-jenkins@tuffmail.co.uk> Signed-off-by: Len Brown <len.brown@intel.com>
2009-12-09eeepc-laptop: simplify how the hwmon device reads values from the ECAlan Jenkins
The hwmon device uses ec_write() to write values to the EC. So for consistency it should use ec_read() to read values. The extra layers of indirection used did not add any value. This may mean we no longer take the ACPI global lock for such reads (if the EC operation region requires the lock and the EC does not). But there is no point locking each one-byte read individually, when write operations do not use the lock at all. Signed-off-by: Alan Jenkins <alan-jenkins@tuffmail.co.uk> Signed-off-by: Len Brown <len.brown@intel.com>
2009-12-09eeepc-laptop: simplify acpi initializationAlan Jenkins
We don't need to store init_flags after using them. And we don't use the result of INIT, so we don't need to allocate a buffer for it. Signed-off-by: Alan Jenkins <alan-jenkins@tuffmail.co.uk> Signed-off-by: Len Brown <len.brown@intel.com>
2009-12-09eeepc-laptop: no need to check argument of set_brightness()Alan Jenkins
We already tell the backlight class our maximum brightness value; it will validate the user requested values for us. Signed-off-by: Alan Jenkins <alan-jenkins@tuffmail.co.uk> Signed-off-by: Len Brown <len.brown@intel.com>
2009-12-09eeepc-laptop: remove redundant NULL checksAlan Jenkins
eeepc_hotk_notify() cannot be called with ehotk == NULL or bd == NULL. We check both variables for allocation failure and would bail out before the notifier is registered. Signed-off-by: Alan Jenkins <alan-jenkins@tuffmail.co.uk> Signed-off-by: Len Brown <len.brown@intel.com>
2009-12-09eeepc-laptop: fix set_acpi() to return non-zero on failureAlan Jenkins
If the control method does not exist, return -ENODEV for consistency with get_acpi() Signed-off-by: Alan Jenkins <alan-jenkins@tuffmail.co.uk> Signed-off-by: Len Brown <len.brown@intel.com>
2009-12-09eeepc-laptop: fix potential leak (led_init() failure)Alan Jenkins
If we bail out because we can't create the led class device, we need to ensure the led workqueue is cleaned up. Signed-off-by: Alan Jenkins <alan-jenkins@tuffmail.co.uk> Signed-off-by: Len Brown <len.brown@intel.com>
2009-12-09eeepc-laptop: fix led initialization orderAlan Jenkins
Create the workqueue thread used by tpd_led_set() *before* we register the led device. (And vice versa for unregistration). Signed-off-by: Alan Jenkins <alan-jenkins@tuffmail.co.uk> Signed-off-by: Len Brown <len.brown@intel.com>
2009-12-09eeepc-laptop: fix value of pwm1_enable to match documentationAlan Jenkins
Documentation/hwmon/sysfs-interface tells us that automatic fan speed control should be represented by a value of 2 or above for pwm1_enable. Fix eeepc_get_fan_ctrl() to return 2 for automatic fan control. Setting "1" for manual control is already consistent with the documentation, so this remains unchanged. Let's preserve the ABI for this specific driver, so that writing "0" will still invoke automatic control. (The documentation says setting "0" should leave the fan at full speed all the time. This mode is not directly supported by our hardware. Full speed is rather noisy on my 701 and the automatic control has never used it. If you really want this e.g. to prolong the life of an EeePC used as a server, you can always use manual mode. hwmon has always been fairly machine-specific, and you're in a tiny minority (or elite :-). I'm sure you're smart enough to notice that the fan doesn't turn on to full speed when you try this mode, either by ear or checking fan_input1. We could even claim to be honouring the spirit of the documentation. "0" really means "safe mode". EeePCs default to automatic mode, ie that is what Asus will actually test. Since we do not provide any way to tamper with the temperature threshold, automatic mode _is_ the safe option). Signed-off-by: Alan Jenkins <alan-jenkins@tuffmail.co.uk> Signed-off-by: Len Brown <len.brown@intel.com>
2009-12-09eeepc-laptop: set acpi_driver.ownerAlan Jenkins
The owner field provides the link between drivers and modules in sysfs, but no ACPI driver was setting it. After setting the owner field, we can see which module provides which driver and vice versa by looking at /sys/bus/acpi/driver/*/module and /sys/module/*/drivers/acpi:*. Signed-off-by: Alan Jenkins <alan-jenkins@tuffmail.co.uk> Signed-off-by: Len Brown <len.brown@intel.com>
2009-12-09eeepc-laptop: Remove uneccesary acpi_disabled checkAlan Jenkins
acpi_bus_register_driver() already checks acpi_disabled, so acpi bus drivers don't need to. Signed-off-by: Alan Jenkins <alan-jenkins@tuffmail.co.uk> Signed-off-by: Len Brown <len.brown@intel.com>
2009-12-09eeepc-laptop: Remove redundant NULL checksAlan Jenkins
The acpi device callbacks add, start, remove, suspend and resume can never be called with a NULL acpi_device. Each callsite in acpi/scan.c has to dereference the device in order to get the ops structure, e.g. struct acpi_device *acpi_dev = to_acpi_device(dev); struct acpi_driver *acpi_drv = acpi_dev->driver; if (acpi_drv && acpi_drv->ops.suspend) return acpi_drv->ops.suspend(acpi_dev, state); Remove all checks for acpi_dev == NULL within these callbacks. Also remove the checks for acpi_driver_data(acpi_dev) == NULL. None of these checks could fail unless the driver does something strange (which none of them do), the acpi core did something terribly wrong, or we have a memory corruption issue. If this does happen then it's best to dereference the pointer and crash noisily. Signed-off-by: Alan Jenkins <alan-jenkins@tuffmail.co.uk> Signed-off-by: Len Brown <len.brown@intel.com>
2009-12-09eeepc-laptop: add touchpad ledCorentin Chary
This led can be found on Eeepc 1005 series. Signed-off-by: Corentin Chary <corentincj@iksaif.net> Signed-off-by: Len Brown <len.brown@intel.com>
2009-12-09asus-laptop: set acpi_driver.ownerAlan Jenkins
The owner field provides the link between drivers and modules in sysfs, but no ACPI driver was setting it. After setting the owner field, we can see which module provides which driver and vice versa by looking at /sys/bus/acpi/driver/*/module and /sys/module/*/drivers/acpi:*. Signed-off-by: Alan Jenkins <alan-jenkins@tuffmail.co.uk> Signed-off-by: Len Brown <len.brown@intel.com>
2009-12-09asus-acpi: set acpi_driver.ownerAlan Jenkins
The owner field provides the link between drivers and modules in sysfs, but no ACPI driver was setting it. After setting the owner field, we can see which module provides which driver and vice versa by looking at /sys/bus/acpi/driver/*/module and /sys/module/*/drivers/acpi:*. Signed-off-by: Alan Jenkins <alan-jenkins@tuffmail.co.uk> Signed-off-by: Len Brown <len.brown@intel.com>
2009-12-09asus-acpi: Remove uneccesary acpi_disabled checksAlan Jenkins
acpi_bus_register_driver() already checks acpi_disabled, so acpi bus drivers don't need to. Signed-off-by: Alan Jenkins <alan-jenkins@tuffmail.co.uk> Signed-off-by: Len Brown <len.brown@intel.com>
2009-12-09asus-laptop: Remove uneccesary acpi_disabled checkAlan Jenkins
acpi_bus_register_driver() already checks acpi_disabled, so acpi bus drivers don't need to. Signed-off-by: Alan Jenkins <alan-jenkins@tuffmail.co.uk> Signed-off-by: Len Brown <len.brown@intel.com>
2009-12-09asus-acpi: Remove redundant NULL checksAlan Jenkins
The acpi device callbacks add, start, remove, suspend and resume can never be called with a NULL acpi_device. Each callsite in acpi/scan.c has to dereference the device in order to get the ops structure, e.g. struct acpi_device *acpi_dev = to_acpi_device(dev); struct acpi_driver *acpi_drv = acpi_dev->driver; if (acpi_drv && acpi_drv->ops.suspend) return acpi_drv->ops.suspend(acpi_dev, state); Remove all checks for acpi_dev == NULL within these callbacks. Also remove the checks for acpi_driver_data(acpi_dev) == NULL. None of these checks could fail unless the driver does something strange (which none of them do), the acpi core did something terribly wrong, or we have a memory corruption issue. If this does happen then it's best to dereference the pointer and crash noisily. Signed-off-by: Alan Jenkins <alan-jenkins@tuffmail.co.uk> Signed-off-by: Len Brown <len.brown@intel.com>
2009-12-09asus-laptop: Remove redundant NULL checksAlan Jenkins
The acpi device callbacks add, start, remove, suspend and resume can never be called with a NULL acpi_device. Each callsite in acpi/scan.c has to dereference the device in order to get the ops structure, e.g. struct acpi_device *acpi_dev = to_acpi_device(dev); struct acpi_driver *acpi_drv = acpi_dev->driver; if (acpi_drv && acpi_drv->ops.suspend) return acpi_drv->ops.suspend(acpi_dev, state); Remove all checks for acpi_dev == NULL within these callbacks. Also remove the checks for acpi_driver_data(acpi_dev) == NULL. None of these checks could fail unless the driver does something strange (which none of them do), the acpi core did something terribly wrong, or we have a memory corruption issue. If this does happen then it's best to dereference the pointer and crash noisily. Signed-off-by: Alan Jenkins <alan-jenkins@tuffmail.co.uk> Signed-off-by: Len Brown <len.brown@intel.com>
2009-12-09eeepc-laptop: disp attribute should be write-onlyAlan Jenkins
Currently, reading from the disp attribute fails with "No such device", which is misleading. According to CMSG table on acpi4asus project site, no models have a getter method corresponding to SDSP. Change the file permission to disallow reads. If some joker changes the permission to permit reads, then return -EIO to be consistent with sysfs' behaviour when no show() method is provided. Signed-off-by: Alan Jenkins <alan-jenkins@tuffmail.co.uk> Signed-off-by: Corentin Chary <corentincj@iksaif.net> Signed-off-by: Len Brown <len.brown@intel.com>
2009-12-09thinkpad-acpi: use input_set_capabilityHenrique de Moraes Holschuh
Use input_set_capability() instead of set_bit. Signed-off-by: Henrique de Moraes Holschuh <hmh@hmh.eng.br> Cc: Dmitry Torokhov <dtor@mail.ru> Signed-off-by: Len Brown <len.brown@intel.com>
2009-12-09thinkpad-acpi: log temperatures on termal alarm (v2)Henrique de Moraes Holschuh
Log temperatures on any of the EC thermal alarms. It could be useful to help tracking down what is happening... Signed-off-by: Henrique de Moraes Holschuh <hmh@hmh.eng.br> Acked-by: Pavel Machek <pavel@ucw.cz> Signed-off-by: Len Brown <len.brown@intel.com>
2009-12-09thinkpad-acpi: expose module parametersHenrique de Moraes Holschuh
Export the normal (non-command) module paramenters as mode 0444, so that they will show up in sysfs. These parameters must not be changed at runtime as a rule, with very few exceptions. Reported-by: Ferenc Wagner <wferi@niif.hu> Signed-off-by: Henrique de Moraes Holschuh <hmh@hmh.eng.br> Signed-off-by: Len Brown <len.brown@intel.com>
2009-12-09thinkpad-acpi: adopt input deviceHenrique de Moraes Holschuh
Properly init the parent field of the input device. Thanks to Alan Jenkins, who noted this problem in a different driver. Reported-by: Alan Jenkins <alan-jenkins@tuffmail.co.uk> Signed-off-by: Henrique de Moraes Holschuh <hmh@hmh.eng.br> Signed-off-by: Len Brown <len.brown@intel.com>
2009-12-09thinkpad-acpi: silence bogus complain during rmmodHenrique de Moraes Holschuh
Fix this bogus warning during module shutdown, when backlight event reporting is enabled: "thinkpad_acpi: required events 0x00018000 not enabled!" Signed-off-by: Henrique de Moraes Holschuh <hmh@hmh.eng.br> Signed-off-by: Len Brown <len.brown@intel.com>
2009-12-09thinkpad-acpi: issue backlight class eventsHenrique de Moraes Holschuh
Take advantage of the new events capabilities of the backlight class to notify userspace of backlight changes. This depends on "backlight: Allow drivers to update the core, and generate events on changes", by Matthew Garrett. Signed-off-by: Henrique de Moraes Holschuh <hmh@hmh.eng.br> Cc: Matthew Garrett <mjg@redhat.com> Cc: Richard Purdie <rpurdie@linux.intel.com> Signed-off-by: Len Brown <len.brown@intel.com>
2009-12-09thinkpad-acpi: fix some version quirksHenrique de Moraes Holschuh
Update some of the BIOS/EC version quirks. Signed-off-by: Henrique de Moraes Holschuh <hmh@hmh.eng.br> Signed-off-by: Len Brown <len.brown@intel.com>
2009-12-09thinkpad-acpi: preserve rfkill state across suspend/resumeHenrique de Moraes Holschuh
Since the rfkill rework in 2.6.31, the driver is always resuming with the radios disabled. Change thinkpad-acpi to ask the firmware to resume with the radios in the last state. This fixes the Bluetooth and WWAN rfkill switches. Note that it means we respect the firmware's oddities. Should the user toggle the hardware rfkill switch on and off, it might cause the radios to resume enabled. UWB is an unknown quantity since it has nowhere the same level of firmware support (no control over state storage in NVRAM, for example), and might need further fixing. Testers welcome. This change fixes a regression from 2.6.30. Reported-by: Jerone Young <jerone.young@canonical.com> Reported-by: Ian Molton <ian.molton@collabora.co.uk> Signed-off-by: Henrique de Moraes Holschuh <hmh@hmh.eng.br> Tested-by: Ian Molton <ian.molton@collabora.co.uk> Cc: stable@kernel.org Signed-off-by: Len Brown <len.brown@intel.com>
2009-12-09thinkpad-acpi: fix default brightness_mode for R50e/R51Henrique de Moraes Holschuh
According to a report, the R50e wants EC-based brightness control, even if it uses an Intel GPU. The current driver default was reported to not work at all. This bug can be worked around by the "brightness_mode=3" module parameter. Change the default of the R50e and R51 2xxx models (which use the same EC firmware, 1V) to TPACPI_BRGHT_Q_EC, but keep TPACPI_BRGHT_Q_ASK set for now, as I'd like to get more reports. This fixes a regression caused by commit 59fe4fe34d7afdf63208124f313be9056feaa2f4, "thinkpad-acpi: fix incorrect use of TPACPI_BRGHT_MODE_ECNVRAM" Kernel 2.6.31 also needs this fix. Reported-by: Ferenc Wagner <wferi@niif.hu> Tested-by: Ferenc Wagner <wferi@niif.hu> Signed-off-by: Henrique de Moraes Holschuh <hmh@hmh.eng.br> Cc: stable@kernel.org Signed-off-by: Len Brown <len.brown@intel.com>
2009-12-07Merge branch 'for-next' into for-linusJiri Kosina
Conflicts: kernel/irq/chip.c
2009-12-04tree-wide: fix assorted typos all over the placeAndré Goddard Rosa
That is "success", "unknown", "through", "performance", "[re|un]mapping" , "access", "default", "reasonable", "[con]currently", "temperature" , "channel", "[un]used", "application", "example","hierarchy", "therefore" , "[over|under]flow", "contiguous", "threshold", "enough" and others. Signed-off-by: André Goddard Rosa <andre.goddard@gmail.com> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2009-11-25Merge branch 'misc-2.6.32' into releaseLen Brown
2009-11-25acerhdf: return temperature in milidegree instead of degreePeter Feuerer
Return temperature in milidegree instead of degree, as sysfs-api requires the temperature in milidegree. Signed-off-by: Peter Feuerer <peter@piie.net> Tested-by: Borislav Petkov <petkovbb@gmail.com> Cc: Andreas Mohr <andi@lisas.de> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Len Brown <len.brown@intel.com>
2009-11-25thinkpad-acpi: fix detection of old ThinkPadsHenrique de Moraes Holschuh
There is a problem in the quirk tables used by tpacpi_is_fw_known() and tpacpi_check_outdated_fw(), which causes outdated BIOSes that are lacking the EC firmware ID DMI field to never match. This breaks module loading on, e.g. a T23 with outdated BIOS, and the module will refuse to load unless the "force_load=1" parameter is given. Fix the quirk tables so that they can also match the outdated BIOSes, which in turn will both fix the module loading, and also warn the user that he is using outdated firmware and should upgrade. This fixes a serious regression, introduced by commit e675abafcc0df38125e6e94a9ba91c92fe774f52, "thinkpad-acpi: be more strict when detecting a ThinkPad". http://bugzilla.kernel.org/show_bug.cgi?id=14597 Reported-by: Paul Kimoto <kimoto@lightlink.com> Signed-off-by: Henrique de Moraes Holschuh <hmh@hmh.eng.br> Tested-by: Paul Kimoto <kimoto@lightlink.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Len Brown <len.brown@intel.com>
2009-11-25thinkpad-acpi: fix sign of ERESTARTSYS returnRoel Kluin
The returned error should be negative Signed-off-by: Roel Kluin <roel.kluin@gmail.com> Acked-by: Henrique de Moraes Holschuh <hmh@hmh.eng.br> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Cc: <stable@kernel.org> Signed-off-by: Len Brown <len.brown@intel.com>
2009-11-24ACPICA: Add post-order callback to acpi_walk_namespaceLin Ming
The existing interface only has a pre-order callback. This change adds an additional parameter for a post-order callback which will be more useful for bus scans. ACPICA BZ 779. Also update the external calls to acpi_walk_namespace. http://www.acpica.org/bugzilla/show_bug.cgi?id=779 Signed-off-by: Lin Ming <ming.m.lin@intel.com> Signed-off-by: Bob Moore <robert.moore@intel.com> Signed-off-by: Len Brown <len.brown@intel.com>
2009-11-09Kconfig: Remove useless and sometimes wrong commentsMichael Roth
Additionally, some excessive newlines removed. Signed-off-by: Michael Roth <mroth@nessie.de> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2009-11-05wmi: Add support for module autoloadingMatthew Garrett
WMI provides interface-specific GUIDs that are exported from modules as modalises, but the core currently generates no events to trigger module loading. This patch adds support for registering devices for each WMI GUID and generating the appropriate uevent. Based heavily on a patch by Carlos Corbacho (<carlos@strangeworlds.co.uk>). Signed-off-by: Matthew Garrett <mjg@redhat.com> Tested-by: Carlos Corbacho <carlos@strangeworlds.co.uk> Acked-by: Carlos Corbacho <carlos@strangeworlds.co.uk> Signed-off-by: Len Brown <len.brown@intel.com>
2009-11-03eeepc-laptop: don't enable camera at startup if it's already on.Luca Niccoli
Switching the camera takes 500ms, checking if it's on is almost free... The BIOS remembers the setting through reboots, so there's good chance the camera is already enabled. Signed-off-by: Luca Niccoli <lultimouomo@gmail.com> Cc: Corentin Chary <corentincj@iksaif.net> Cc: Alan Jenkins <alan-jenkins@tuffmail.co.uk> Cc: Matthew Garrett <mjg@redhat.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Corentin Chary <corentincj@iksaif.net> Signed-off-by: Len Brown <len.brown@intel.com>
2009-11-03Revert "eeepc-laptop: Prevent a panic when disabling RT2860 wireless when ↵Corentin Chary
associated" rt2860sta is fine with the patch as is, but iwl3945 isn't (eeepc_rfkill_set() needs to call eeepc_rfkill_hotplug(true) – which means that we're back to causing the rt2860sta panic This reverts commit b56ab33d68638e6aafdbfc694025e8354a628f49. Signed-off-by: Corentin Chary <corentincj@iksaif.net> Signed-off-by: Darren Salt <linux@youmustbejoking.demon.co.uk> Signed-off-by: Len Brown <len.brown@intel.com>
2009-10-15Merge branch 'misc' into releaseLen Brown
2009-10-13eeepc-laptop: Prevent a panic when disabling RT2860 wireless when associatedDarren Salt
This works around what I think is actually a bug in rt2860sta which is triggered when the hardware "disappears" from beneath the driver, i.e. when wireless is toggled off via ACPI. It does so by ensuring that the rfkill soft-block flag is set before the hardware is disabled. I do not know whether this patch is required if rt2800pci is in use instead of rt2860sta; at the time of submission of this patch, I've not been able to test this. (Ref. http://bugzilla.kernel.org/show_bug.cgi?id=13390) Signed-off-by: Darren Salt <linux@youmustbejoking.demon.co.uk> Signed-off-by: Len Brown <len.brown@intel.com>
2009-10-13eeepc-laptop: Properly annote eeepc_enable_camera().Rakib Mullick
Currently the annotation for function eeepc_enable_camera() is __init, and refers to a function eeepc_hotk_add() which is non-init. Use __devinit for both functions which is more appropriate and fixes a section mismatch warning. We were warned by the following warning: LD drivers/platform/x86/built-in.o WARNING: drivers/platform/x86/built-in.o(.text+0x12e1): Section mismatch in reference from the function eeepc_hotk_add() to the function .init.text:eeepc_enable_camera() The function eeepc_hotk_add() references the function __init eeepc_enable_camera(). This is often because eeepc_hotk_add lacks a __init annotation or the annotation of eeepc_enable_camera is wrong. Signed-off-by: Rakib Mullick <rakib.mullick@gmail.com> Signed-off-by: Corentin Chary <corentincj@iksaif.net> Signed-off-by: Len Brown <len.brown@intel.com>
2009-10-09fujitsu-laptop: address missed led-class ifdef fixupJonathan Woithe
A follow-up 2.6.32-rc1's 1e384cb0f9a940f2a431d1708f963987e61d71e3 "fujitsu-laptop: support led-class as module" It's a trivial fix for one of the CONFIG_LEDS_CLASS ifdefs which was somehow missed in the original patch. Signed-off-by: Jonathan Woithe <jwoithe@physics.adelaide.edu.au> Signed-off-by: Len Brown <len.brown@intel.com>
2009-10-02Merge branches 'sony-laptop', 'bugzilla-14247' and 'bugzilla-14271' into releaseLen Brown
2009-09-30Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-2.6Linus Torvalds
* git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-2.6: (33 commits) sony-laptop: re-read the rfkill state when resuming from suspend sony-laptop: check for rfkill hard block at load time wext: add back wireless/ dir in sysfs for cfg80211 interfaces wext: Add bound checks for copy_from_user mac80211: improve/fix mlme messages cfg80211: always get BSS iwlwifi: fix 3945 ucode info retrieval after failure iwlwifi: fix memory leak in command queue handling iwlwifi: fix debugfs buffer handling cfg80211: don't set privacy w/o key cfg80211: wext: don't display BSSID unless associated net: Add explicit bound checks in net/socket.c bridge: Fix double-free in br_add_if. isdn: fix netjet/isdnhdlc build errors atm: dereference of he_dev->rbps_virt in he_init_group() ax25: Add missing dev_put in ax25_setsockopt Revert "sit: stateless autoconf for isatap" net: fix double skb free in dcbnl net: fix nlmsg len size for skb when error bit is set. net: fix vlan_get_size to include vlan_flags size ...
2009-09-28sony-laptop: re-read the rfkill state when resuming from suspendAlan Jenkins
Without this, the hard-blocked state will be reported incorrectly if the hardware switch is changed while the laptop is suspended. Signed-off-by: Alan Jenkins <alan-jenkins@tuffmail.co.uk> Tested-by: Norbert Preining <preining@logic.at> Acked-by: Mattia Dongili <malattia@linux.it> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2009-09-28sony-laptop: check for rfkill hard block at load timeAlan Jenkins
"I recently (on a flight) I found out that when I boot with the hard-switch activated, so turning off all wireless activity on my laptop, the state is not correctly announced in /dev/rfkill (reading it with rfkill command, or my own gnome applet)... After turning off and on again the hard-switch the events were right." We can fix this by querying the firmware at load time and calling rfkill_set_hw_state(). Signed-off-by: Alan Jenkins <alan-jenkins@tuffmail.co.uk> Tested-by: Norbert Preining <preining@logic.at> Acked-by: Johannes Berg <johannes@sipsolutions.net> Acked-by: Mattia Dongili <malattia@linux.it> CC: stable@kernel.org Signed-off-by: John W. Linville <linville@tuxdriver.com>
2009-09-27sony-laptop: Don't unregister the SPIC driver if it wasn't registeredAlan Jenkins
This fixes a warning when the module is unloaded on machines without SPIC. ------------[ cut here ]------------ WARNING: at drivers/base/driver.c:261 driver_unregister+0x6e/0x80() Hardware name: OEM Unexpected driver unregister! Modules linked in: sony_laptop(-) rfkill af_packet i915 drm i2c_algo_bit cfbcopyarea i2c_core cfbimgblt cfbfillrect binfmt_misc ipv6 kvm_intel kvm acpi_cpufreq cpufreq_userspace cpufreq_powersave cpufreq_stats acpi_pad ac video output battery pci_slot sbs sbshc container iptable_filter ip_tables x_tables ext2 fuse snd_hda_codec_realtek snd_hda_intel snd_hda_codec snd_hwdep snd_pcm_oss snd_mixer_oss snd_pcm snd_seq_dummy snd_seq_oss snd_seq_midi_event snd_seq snd_timer snd_seq_device snd fan sg serio_raw sr_mod cdrom soundcore button thermal processor thermal_sys floppy snd_page_alloc pcspkr intel_agp evdev [last unloaded: asus_atk0110] Pid: 8136, comm: modprobe Not tainted 2.6.31-rc8debug #50 Call Trace: [<ffffffff8121ec7e>] ? driver_unregister+0x6e/0x80 [<ffffffff81047577>] warn_slowpath_common+0x87/0xb0 [<ffffffff81047624>] warn_slowpath_fmt+0x64/0x70 [<ffffffff8119a360>] ? kobject_release+0x0/0x1f0 [<ffffffff8119a267>] ? kobject_put+0x27/0x60 [<ffffffff8121d346>] ? bus_put+0x16/0x20 [<ffffffff8121d406>] ? bus_remove_driver+0xb6/0xf0 [<ffffffff8121ec7e>] driver_unregister+0x6e/0x80 [<ffffffff811cab50>] acpi_bus_unregister_driver+0x10/0x12 [<ffffffffa035e86c>] sony_laptop_exit+0x2c/0x2e [sony_laptop] [<ffffffff8107ddc6>] sys_delete_module+0x176/0x230 [<ffffffff8107186d>] ? trace_hardirqs_on_caller+0x14d/0x1a0 [<ffffffff81350a04>] ? trace_hardirqs_on_thunk+0x3a/0x3f [<ffffffff8100bdab>] system_call_fastpath+0x16/0x1b ---[ end trace f638b6a59b19703e ]--- Signed-off-by: Alan Jenkins <alan-jenkins@tuffmail.co.uk> Signed-off-by: Mattia Dongili <malattia@linux.it> Signed-off-by: Len Brown <len.brown@intel.com>