1. 10 12月, 2009 6 次提交
    • A
      eeepc-laptop: fix value of pwm1_enable to match documentation · 48718688
      Alan 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: NAlan Jenkins <alan-jenkins@tuffmail.co.uk>
      Signed-off-by: NLen Brown <len.brown@intel.com>
      48718688
    • A
      eeepc-laptop: set acpi_driver.owner · eacec303
      Alan 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: NAlan Jenkins <alan-jenkins@tuffmail.co.uk>
      Signed-off-by: NLen Brown <len.brown@intel.com>
      eacec303
    • A
      eeepc-laptop: Remove uneccesary acpi_disabled check · 2adb8bd3
      Alan Jenkins 提交于
      acpi_bus_register_driver() already checks acpi_disabled, so acpi bus
      drivers don't need to.
      Signed-off-by: NAlan Jenkins <alan-jenkins@tuffmail.co.uk>
      Signed-off-by: NLen Brown <len.brown@intel.com>
      2adb8bd3
    • A
      eeepc-laptop: Remove redundant NULL checks · fbe3d894
      Alan 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: NAlan Jenkins <alan-jenkins@tuffmail.co.uk>
      Signed-off-by: NLen Brown <len.brown@intel.com>
      fbe3d894
    • C
      eeepc-laptop: add touchpad led · 3c0eb510
      Corentin Chary 提交于
      This led can be found on Eeepc 1005 series.
      Signed-off-by: NCorentin Chary <corentincj@iksaif.net>
      Signed-off-by: NLen Brown <len.brown@intel.com>
      3c0eb510
    • A
      eeepc-laptop: disp attribute should be write-only · 6dff29b6
      Alan 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: NAlan Jenkins <alan-jenkins@tuffmail.co.uk>
      Signed-off-by: NCorentin Chary <corentincj@iksaif.net>
      Signed-off-by: NLen Brown <len.brown@intel.com>
      6dff29b6
  2. 03 11月, 2009 2 次提交
  3. 13 10月, 2009 2 次提交
  4. 22 9月, 2009 1 次提交
  5. 30 8月, 2009 2 次提交
  6. 29 8月, 2009 11 次提交
  7. 03 8月, 2009 1 次提交
    • A
      eeepc-laptop: fix hot-unplug on resume · 7334546a
      Alan Jenkins 提交于
      OOPS on resume when the wireless adaptor is disabled during suspend was
      introduced by "eeepc-laptop: read rfkill soft-blocked state on resume".
      
      Unable to handle kernel NULL pointer dereference
      
      Process s2disk
      Tainted: G W
      IP: klist_put
      
      Call trace:
      ? klist_del
      ? device_del
      ? device_unregister
      ? pci_stop_dev
      ? pci_stop_bus
      ? pci_remove_device
      ? eeepc_rfkill_hotplug [eeepc_laptop]
      ? eeepc_hotk_resume [eeepc_laptop]
      ? acpi_device_resume
      ? device_resume
      ? hibernation_snapshot
      
      It appears the PCI device is removed twice.  The eeepc_rfkill_hotplug()
      call from the resume handler is racing against the call from the ACPI
      notifier callback.  The ACPI notification is triggered by the resume
      handler when it refreshes the value of CM_ASL_WLAN.
      
      The fix is to serialize hotplug calls using a workqueue.
      
      http://bugzilla.kernel.org/show_bug.cgi?id=13825Signed-off-by: NAlan Jenkins <alan-jenkins@tuffmail.co.uk>
      Acked-by: NCorentin Chary <corentin.chary@gmail.com>
      Signed-off-by: NLen Brown <len.brown@intel.com>
      7334546a
  8. 26 6月, 2009 7 次提交
  9. 24 6月, 2009 3 次提交
  10. 19 6月, 2009 2 次提交
    • A
      eeepc-laptop: read rfkill soft-blocked state on resume · 96e9cfeb
      Alan Jenkins 提交于
      This will respect state changes over hibernation, e.g. if the user
      disables the wireless in the BIOS setup screen.
      
      It reveals an issue where ACPI silently kills the wireless on
      suspend.  Normally, the BIOS restores the correct state from
      non-volatile storage on boot.  But when hibernation is aborted,
      the wireless would remain killed.  Fortunately we can work around
      this in the resume handler by simply writing back the same value we
      read from NVS.
      Signed-off-by: NAlan Jenkins <alan-jenkins@tuffmail.co.uk>
      Signed-off-by: NJohn W. Linville <linville@tuxdriver.com>
      96e9cfeb
    • A
      rfkill: don't restore software blocked state on persistent devices · 06d5caf4
      Alan Jenkins 提交于
      The setting of the "persistent" flag is also made more explicit using
      a new rfkill_init_sw_state() function, instead of special-casing
      rfkill_set_sw_state() when it is called before registration.
      
      Suspend is a bit of a corner case so we try to get away without adding
      another hack to rfkill-input - it's going to be removed soon.
      If the state does change over suspend, users will simply have to prod
      rfkill-input twice in order to toggle the state.
      
      Userspace policy agents will be able to implement a more consistent user
      experience.  For example, they can avoid the above problem if they
      toggle devices individually.  Then there would be no "global state"
      to get out of sync.
      
      Currently there are only two rfkill drivers with persistent soft-blocked
      state.  thinkpad-acpi already checks the software state on resume.
      eeepc-laptop will require modification.
      Signed-off-by: NAlan Jenkins <alan-jenkins@tuffmail.co.uk>
      CC: Marcel Holtmann <marcel@holtmann.org>
      Acked-by: NHenrique de Moraes Holschuh <hmh@hmh.eng.br>
      Signed-off-by: NJohn W. Linville <linville@tuxdriver.com>
      06d5caf4
  11. 18 6月, 2009 1 次提交
    • B
      ACPI: eeepc-laptop: use .notify method instead of installing handler directly · d9b9bd7b
      Bjorn Helgaas 提交于
      This patch adds a .notify() method.  The presence of .notify() causes
      Linux/ACPI to manage event handlers and notify handlers on our behalf,
      so we don't have to install and remove them ourselves.
      
      This driver relies on seeing system notify events, not device-specific
      ones (because it used ACPI_SYSTEM_NOTIFY).  We use the
      ACPI_DRIVER_ALL_NOTIFY_EVENTS driver flag to request all events, then
      just ignore any device events we get.
      Signed-off-by: NBjorn Helgaas <bjorn.helgaas@hp.com>
      CC: Corentin Chary <corentincj@iksaif.net>
      CC: acpi4asus-user@lists.sourceforge.net
      CC: Matthew Garrett <mjg@redhat.com>
      Signed-off-by: NLen Brown <len.brown@intel.com>
      d9b9bd7b
  12. 11 6月, 2009 1 次提交
    • A
      rfkill: remove set_global_sw_state · b3fa1329
      Alan Jenkins 提交于
      rfkill_set_global_sw_state() (previously rfkill_set_default()) will no
      longer be exported by the rewritten rfkill core.
      
      Instead, platform drivers which can provide persistent soft-rfkill state
      across power-down/reboot should indicate their initial state by calling
      rfkill_set_sw_state() before registration.  Otherwise, they will be
      initialized to a default value during registration by a set_block call.
      
      We remove existing calls to rfkill_set_sw_state() which happen before
      registration, since these had no effect in the old model.  If these
      drivers do have persistent state, the calls can be put back (subject
      to testing :-).  This affects hp-wmi and acer-wmi.
      
      Drivers with persistent state will affect the global state only if
      rfkill-input is enabled.  This is required, otherwise booting with
      wireless soft-blocked and pressing the wireless-toggle key once would
      have no apparent effect.  This special case will be removed in future
      along with rfkill-input, in favour of a more flexible userspace daemon
      (see Documentation/feature-removal-schedule.txt).
      
      Now rfkill_global_states[n].def is only used to preserve global states
      over EPO, it is renamed to ".sav".
      Signed-off-by: NAlan Jenkins <alan-jenkins@tuffmail.co.uk>
      Acked-by: NHenrique de Moraes Holschuh <hmh@hmh.eng.br>
      Signed-off-by: NJohn W. Linville <linville@tuxdriver.com>
      b3fa1329
  13. 04 6月, 2009 1 次提交
    • J
      rfkill: rewrite · 19d337df
      Johannes Berg 提交于
      This patch completely rewrites the rfkill core to address
      the following deficiencies:
      
       * all rfkill drivers need to implement polling where necessary
         rather than having one central implementation
      
       * updating the rfkill state cannot be done from arbitrary
         contexts, forcing drivers to use schedule_work and requiring
         lots of code
      
       * rfkill drivers need to keep track of soft/hard blocked
         internally -- the core should do this
      
       * the rfkill API has many unexpected quirks, for example being
         asymmetric wrt. alloc/free and register/unregister
      
       * rfkill can call back into a driver from within a function the
         driver called -- this is prone to deadlocks and generally
         should be avoided
      
       * rfkill-input pointlessly is a separate module
      
       * drivers need to #ifdef rfkill functions (unless they want to
         depend on or select RFKILL) -- rfkill should provide inlines
         that do nothing if it isn't compiled in
      
       * the rfkill structure is not opaque -- drivers need to initialise
         it correctly (lots of sanity checking code required) -- instead
         force drivers to pass the right variables to rfkill_alloc()
      
       * the documentation is hard to read because it always assumes the
         reader is completely clueless and contains way TOO MANY CAPS
      
       * the rfkill code needlessly uses a lot of locks and atomic
         operations in locked sections
      
       * fix LED trigger to actually change the LED when the radio state
         changes -- this wasn't done before
      Tested-by: NAlan Jenkins <alan-jenkins@tuffmail.co.uk>
      Signed-off-by: Henrique de Moraes Holschuh <hmh@hmh.eng.br> [thinkpad]
      Signed-off-by: NJohannes Berg <johannes@sipsolutions.net>
      Signed-off-by: NJohn W. Linville <linville@tuxdriver.com>
      19d337df