We already tell the backlight class our maximum brightness value; it
will validate the user requested values for us.
Signed-off-by: Alan Jenkins <[email protected]>
Signed-off-by: Len Brown <[email protected]>
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 <[email protected]>
Signed-off-by: Len Brown <[email protected]>
If the control method does not exist, return -ENODEV for consistency
with get_acpi()
Signed-off-by: Alan Jenkins <[email protected]>
Signed-off-by: Len Brown <[email protected]>
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 <[email protected]>
Signed-off-by: Len Brown <[email protected]>
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 <[email protected]>
Signed-off-by: Len Brown <[email protected]>
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 <[email protected]>
Signed-off-by: Len Brown <[email protected]>
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 <[email protected]>
Signed-off-by: Len Brown <[email protected]>
acpi_bus_register_driver() already checks acpi_disabled, so acpi bus
drivers don't need to.
Signed-off-by: Alan Jenkins <[email protected]>
Signed-off-by: Len Brown <[email protected]>
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 <[email protected]>
Signed-off-by: Len Brown <[email protected]>
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 <[email protected]>
Signed-off-by: Len Brown <[email protected]>
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 <[email protected]>
Signed-off-by: Len Brown <[email protected]>
acpi_bus_register_driver() already checks acpi_disabled, so acpi bus
drivers don't need to.
Signed-off-by: Alan Jenkins <[email protected]>
Signed-off-by: Len Brown <[email protected]>
acpi_bus_register_driver() already checks acpi_disabled, so acpi bus
drivers don't need to.
Signed-off-by: Alan Jenkins <[email protected]>
Signed-off-by: Len Brown <[email protected]>
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 <[email protected]>
Signed-off-by: Len Brown <[email protected]>
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 <[email protected]>
Signed-off-by: Len Brown <[email protected]>
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 <[email protected]>
Signed-off-by: Corentin Chary <[email protected]>
Signed-off-by: Len Brown <[email protected]>
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 <[email protected]>
Acked-by: Pavel Machek <[email protected]>
Signed-off-by: Len Brown <[email protected]>
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 <[email protected]>
Signed-off-by: Henrique de Moraes Holschuh <[email protected]>
Signed-off-by: Len Brown <[email protected]>
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 <[email protected]>
Signed-off-by: Henrique de Moraes Holschuh <[email protected]>
Signed-off-by: Len Brown <[email protected]>
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 <[email protected]>
Signed-off-by: Len Brown <[email protected]>
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 <[email protected]>
Cc: Matthew Garrett <[email protected]>
Cc: Richard Purdie <[email protected]>
Signed-off-by: Len Brown <[email protected]>
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 <[email protected]>
Reported-by: Ian Molton <[email protected]>
Signed-off-by: Henrique de Moraes Holschuh <[email protected]>
Tested-by: Ian Molton <[email protected]>
Cc: [email protected]
Signed-off-by: Len Brown <[email protected]>
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
59fe4fe34d,
"thinkpad-acpi: fix incorrect use of TPACPI_BRGHT_MODE_ECNVRAM"
Kernel 2.6.31 also needs this fix.
Reported-by: Ferenc Wagner <[email protected]>
Tested-by: Ferenc Wagner <[email protected]>
Signed-off-by: Henrique de Moraes Holschuh <[email protected]>
Cc: [email protected]
Signed-off-by: Len Brown <[email protected]>
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
e675abafcc, "thinkpad-acpi: be more strict
when detecting a ThinkPad".
http://bugzilla.kernel.org/show_bug.cgi?id=14597
Reported-by: Paul Kimoto <[email protected]>
Signed-off-by: Henrique de Moraes Holschuh <[email protected]>
Tested-by: Paul Kimoto <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Len Brown <[email protected]>
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 <[email protected]>
Signed-off-by: Bob Moore <[email protected]>
Signed-off-by: Len Brown <[email protected]>
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 (<[email protected]>).
Signed-off-by: Matthew Garrett <[email protected]>
Tested-by: Carlos Corbacho <[email protected]>
Acked-by: Carlos Corbacho <[email protected]>
Signed-off-by: Len Brown <[email protected]>
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 <[email protected]>
Cc: Corentin Chary <[email protected]>
Cc: Alan Jenkins <[email protected]>
Cc: Matthew Garrett <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Corentin Chary <[email protected]>
Signed-off-by: Len Brown <[email protected]>
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 b56ab33d68.
Signed-off-by: Corentin Chary <[email protected]>
Signed-off-by: Darren Salt <[email protected]>
Signed-off-by: Len Brown <[email protected]>
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 <[email protected]>
Signed-off-by: Len Brown <[email protected]>
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 <[email protected]>
Signed-off-by: Corentin Chary <[email protected]>
Signed-off-by: Len Brown <[email protected]>
A follow-up 2.6.32-rc1's
1e384cb0f9
"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 <[email protected]>
Signed-off-by: Len Brown <[email protected]>
* 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
...
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 <[email protected]>
Tested-by: Norbert Preining <[email protected]>
Acked-by: Mattia Dongili <[email protected]>
Signed-off-by: John W. Linville <[email protected]>
"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 <[email protected]>
Tested-by: Norbert Preining <[email protected]>
Acked-by: Johannes Berg <[email protected]>
Acked-by: Mattia Dongili <[email protected]>
CC: [email protected]
Signed-off-by: John W. Linville <[email protected]>
This is unnecessary as OSPM is supposed to call the method already when
the device is discovered.
Signed-off-by: Mattia Dongili <[email protected]>
Signed-off-by: Len Brown <[email protected]>
The SPIC irq is not really shareable, the IO port cannot be cleared and
always returns some data so there is no real way to understand if the irq
is for us or not. Moreover the _PRS acpi method says the irq is not
shareable.
In addition to this, in some cases, an additional write to the IO port has
to be performed in order to properly decode the event received from the
device. This generates another interrupt which may overlap with the
previous one. In the future this is going to be important for properly
decoding events.
Signed-off-by: Mattia Dongili <[email protected]>
Signed-off-by: Len Brown <[email protected]>
Having separate drivers for SPIC showed to be useless, only type3 has a
slightly different behaviour than the others and there seem to be no real
conflict between them.
Signed-off-by: Mattia Dongili <[email protected]>
Signed-off-by: Len Brown <[email protected]>
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 <[email protected]>
Reported-by: Audrius Kazukauskas <[email protected]>
Signed-off-by: Henrique de Moraes Holschuh <[email protected]>
Signed-off-by: Len Brown <[email protected]>