1. 24 9月, 2016 1 次提交
  2. 02 7月, 2016 1 次提交
    • J
      asus-wmi: Create quirk for airplane_mode LED · a977e59c
      João Paulo Rechi Vita 提交于
      Some Asus laptops that have an airplane-mode indicator LED, also have
      the WMI WLAN user bit set, and the following bits in their DSDT:
      
      Scope (_SB)
      {
        (...)
        Device (ATKD)
        {
          (...)
          Method (WMNB, 3, Serialized)
          {
            (...)
            If (LEqual (IIA0, 0x00010002))
            {
              OWGD (IIA1)
              Return (One)
            }
          }
        }
      }
      
      So when asus-wmi uses ASUS_WMI_DEVID_WLAN_LED (0x00010002) to store the
      wlan state, it drives the airplane-mode indicator LED (through the call
      to OWGD) in an inverted fashion: the LED is ON when airplane mode is OFF
      (since wlan is ON), and vice-versa.
      
      This commit creates a quirk to not register a RFKill switch at all for
      these laptops, to allow the asus-wireless driver to drive the airplane
      mode LED correctly through the ASHS ACPI device. It also adds a match to
      that quirk for the Asus X555UB, which is affected by this problem.
      Signed-off-by: NJoão Paulo Rechi Vita <jprvita@endlessm.com>
      Reviewed-by: NCorentin Chary <corentin.chary@gmail.com>
      Signed-off-by: NDarren Hart <dvhart@linux.intel.com>
      a977e59c
  3. 28 5月, 2016 1 次提交
  4. 20 1月, 2016 1 次提交
  5. 11 11月, 2015 1 次提交
    • D
      asus-wmi: fix error handling in store_sys_wmi() · b8298340
      Dan Carpenter 提交于
      The asus_wmi_get_devstate_simple() returns 0-1 on success.  In theory
      according to static checkers, it can return either -EIO or -ENODEV on
      failure.  Currently the error handling code only handles -ENODEV and
      -EIO is treated as success.  Let's make it handle the -EIO error as
      well.
      
      It's possible that it can't actually return -EIO and this patch is not
      needed but in that case this patch is harmless and silences a static
      checker warning so it's still worth it.
      Signed-off-by: NDan Carpenter <dan.carpenter@oracle.com>
      Signed-off-by: NDarren Hart <dvhart@linux.intel.com>
      b8298340
  6. 10 10月, 2015 1 次提交
  7. 03 10月, 2015 1 次提交
  8. 19 6月, 2015 2 次提交
    • H
      asus-wmi: Port to new backlight interface selection API · 62c4aa1a
      Hans de Goede 提交于
      Port the backlight selection logic to the new backlight interface
      selection API.
      
      This commit also removes various obsolete pr_xxx messages related to
      backlight interface selection. These are obsolete because they assume
      there is only a vendor or acpi backlight driver and no other choice.
      Also they are not necessary, if the user wants to know which backlight
      interfaces are registered a simple "ls /sys/class/backlight" suffices.
      Signed-off-by: NHans de Goede <hdegoede@redhat.com>
      Acked-by: NDarren Hart <dvhart@linux.intel.com>
      Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
      62c4aa1a
    • H
      asus-wmi: Use acpi_video_unregister_backlight instead of acpi_video_unregister · 4c27febf
      Hans de Goede 提交于
      acpi_video_unregister() not only unregisters the acpi-video backlight
      interface but also unregisters the acpi video bus event listener, causing
      e.g. brightness hotkey presses to no longer generate keypress events.
      
      The unregistering of the acpi video bus event listener usually is
      undesirable, which by itself is a good reason to switch to
      acpi_video_unregister_backlight().
      
      Another problem with using acpi_video_unregister() rather then using
      acpi_video_unregister_backlight() is that on systems with an intel video
      opregion (most systems) and a wmi_backlight_power quirk, whether or not
      the acpi video bus event listener actually gets unregistered depends on
      module load ordering:
      
      Scenario a:
      1) acpi/video.ko gets loaded (*), does not do acpi_video_register as there
         is an intel opregion.
      2) intel.ko gets loaded, calls acpi_video_register() which registers both
         the listener and the acpi backlight interface
      3) asus-wmi.ko gets loaded, calls acpi_video_unregister() causing both
         the listener and the acpi backlight interface to unregister
      
      Scenario b:
      1) acpi/video.ko gets loaded (*), does not do acpi_video_register as there
         is an intel opregion.
      2) asus-wmi.ko gets loaded, calls acpi_video_dmi_promote_vendor(),
         calls acpi_video_unregister(), which is a nop since acpi_video_register
         has not yet been called
      2) intel.ko gets loaded, calls acpi_video_register() which registers
         the listener, but does not register the acpi backlight interface due to
         the call to the preciding call to acpi_video_dmi_promote_vendor()
      
      *) acpi/video.ko always loads first as both other modules depend on it.
      
      So we end up with or without an acpi video bus event listener depending
      on module load ordering, not good.
      
      Switching to using acpi_video_unregister_backlight() means that independ
      of ordering we will always have an acpi video bus event listener fixing
      this.
      
      Note that this commit means that systems without an intel video opregion,
      and systems which were hitting scenario a wrt module load ordering, are
      now getting an acpi video bus event listener while before they were not!
      
      On some systems this may cause the brightness hotkeys to start generating
      keypresses while before they were not (good), while on other systems this
      may cause the brightness hotkeys to generate multiple keypress events for
      a single press (not so good). Since on most systems the acpi video bus is
      the canonical source for brightness events I believe that the latter case
      will needs to be handled on a case by case basis by filtering out the
      duplicate keypresses at the other source for them.
      
      Cc: Corentin Chary <corentin.chary@gmail.com>
      Signed-off-by: NHans de Goede <hdegoede@redhat.com>
      Acked-by: NDarren Hart <dvhart@linux.intel.com>
      Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
      4c27febf
  9. 08 6月, 2015 1 次提交
    • H
      asus-wmi: Use acpi_video_unregister_backlight instead of acpi_video_unregister · 5f770658
      Hans de Goede 提交于
      acpi_video_unregister() not only unregisters the acpi-video backlight
      interface but also unregisters the acpi video bus event listener, causing
      e.g. brightness hotkey presses to no longer generate keypress events.
      
      The unregistering of the acpi video bus event listener usually is
      undesirable, which by itself is a good reason to switch to
      acpi_video_unregister_backlight().
      
      Another problem with using acpi_video_unregister() rather then using
      acpi_video_unregister_backlight() is that on systems with an intel video
      opregion (most systems) and a wmi_backlight_power quirk, whether or not
      the acpi video bus event listener actually gets unregistered depends on
      module load ordering:
      
      Scenario a:
      1) acpi/video.ko gets loaded (*), does not do acpi_video_register as there
         is an intel opregion.
      2) intel.ko gets loaded, calls acpi_video_register() which registers both
         the listener and the acpi backlight interface
      3) asus-wmi.ko gets loaded, calls acpi_video_unregister() causing both
         the listener and the acpi backlight interface to unregister
      
      Scenario b:
      1) acpi/video.ko gets loaded (*), does not do acpi_video_register as there
         is an intel opregion.
      2) asus-wmi.ko gets loaded, calls acpi_video_dmi_promote_vendor(),
         calls acpi_video_unregister(), which is a nop since acpi_video_register
         has not yet been called
      2) intel.ko gets loaded, calls acpi_video_register() which registers
         the listener, but does not register the acpi backlight interface due to
         the call to the preciding call to acpi_video_dmi_promote_vendor()
      
      *) acpi/video.ko always loads first as both other modules depend on it.
      
      So we end up with or without an acpi video bus event listener depending
      on module load ordering, not good.
      
      Switching to using acpi_video_unregister_backlight() means that independ
      of ordering we will always have an acpi video bus event listener fixing
      this.
      
      Note that this commit means that systems without an intel video opregion,
      and systems which were hitting scenario a wrt module load ordering, are
      now getting an acpi video bus event listener while before they were not!
      
      On some systems this may cause the brightness hotkeys to start generating
      keypresses while before they were not (good), while on other systems this
      may cause the brightness hotkeys to generate multiple keypress events for
      a single press (not so good). Since on most systems the acpi video bus is
      the canonical source for brightness events I believe that the latter case
      will needs to be handled on a case by case basis by filtering out the
      duplicate keypresses at the other source for them.
      
      Cc: acpi4asus-user@lists.sourceforge.net
      Signed-off-by: NHans de Goede <hdegoede@redhat.com>
      Acked-by: Corentin Chary <corentin.chary@gmail.com)
      Signed-off-by: NDarren Hart <dvhart@linux.intel.com>
      5f770658
  10. 14 5月, 2015 1 次提交
    • K
      asus-wmi: add fan control · 53e755c2
      Kast Bernd 提交于
      This patch is partially based on Felipe Contrera's earlier patch, that
      was discussed here: https://lkml.org/lkml/2013/10/8/800
      Some problems of that patch are solved, now:
      
      1) The main obstacle for the earlier patch seemed to be the use of
      virt_to_phys, which is accepted, now
      
      2) random memory corruption occurred on my notebook, thus DMA-able memory
      is allocated now, which solves this problem
      
      3) hwmon interface is used instead of the thermal interface, as a
      hwmon device is already set up by this driver and seemed more
      appropriate than the thermal interface
      
      4) Calling the ACPI-functions was modularized thus it's possible to call
      some multifunctions easily, now (by using
      asus_wmi_evaluate_method_agfn).
      
      Unfortunately the WMI doesn't support controlling both fans on
      a dual-fan notebook because of an restriction in the acpi-method
      "SFNS", that is callable through the wmi. If "SFNV" would be called
      directly even dual fan configurations could be controlled, but not by using
      wmi.
      
      Speed readings only work on auto-mode, thus "-1" will be reported in
      manual mode.
      Additionally the speed readings are reported as hundreds of RPM thus
      they are not too precise.
      
      This patch is tested only on one notebook (N551JK) but a similar module,
      that contained some code to try to control the second fan also, was
      reported to work on an UX32VD, at least for the first fan.
      
      As Felipe already mentioned the low-level functions are described here:
      http://forum.notebookreview.com/threads/fan-control-on-asus-prime-ux31-ux31a-ux32a-ux32vd.705656/Signed-off-by: NKast Bernd <kastbernd@gmx.de>
      Acked-by: NCorentin Chary <corentin.chary@gmail.com>
      Cc: Corentin Chary <corentin.chary@gmail.com>
      Cc: Darren Hart <dvhart@infradead.org>
      Cc: Matthew Garrett <mjg59@srcf.ucam.org>
      Cc: Rafael J. Wysocki <rjw@rjwysocki.net>
      Signed-off-by: NDarren Hart <dvhart@linux.intel.com>
      53e755c2
  11. 04 12月, 2014 1 次提交
  12. 16 8月, 2014 3 次提交
  13. 11 6月, 2014 1 次提交
  14. 30 5月, 2014 1 次提交
  15. 21 1月, 2014 1 次提交
  16. 15 1月, 2014 1 次提交
  17. 07 12月, 2013 1 次提交
    • L
      ACPI: Clean up inclusions of ACPI header files · 8b48463f
      Lv Zheng 提交于
      Replace direct inclusions of <acpi/acpi.h>, <acpi/acpi_bus.h> and
      <acpi/acpi_drivers.h>, which are incorrect, with <linux/acpi.h>
      inclusions and remove some inclusions of those files that aren't
      necessary.
      
      First of all, <acpi/acpi.h>, <acpi/acpi_bus.h> and <acpi/acpi_drivers.h>
      should not be included directly from any files that are built for
      CONFIG_ACPI unset, because that generally leads to build warnings about
      undefined symbols in !CONFIG_ACPI builds.  For CONFIG_ACPI set,
      <linux/acpi.h> includes those files and for CONFIG_ACPI unset it
      provides stub ACPI symbols to be used in that case.
      
      Second, there are ordering dependencies between those files that always
      have to be met.  Namely, it is required that <acpi/acpi_bus.h> be included
      prior to <acpi/acpi_drivers.h> so that the acpi_pci_root declarations the
      latter depends on are always there.  And <acpi/acpi.h> which provides
      basic ACPICA type declarations should always be included prior to any other
      ACPI headers in CONFIG_ACPI builds.  That also is taken care of including
      <linux/acpi.h> as appropriate.
      Signed-off-by: NLv Zheng <lv.zheng@intel.com>
      Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
      Cc: Matthew Garrett <mjg59@srcf.ucam.org>
      Cc: Tony Luck <tony.luck@intel.com>
      Cc: "H. Peter Anvin" <hpa@zytor.com>
      Acked-by: Bjorn Helgaas <bhelgaas@google.com> (drivers/pci stuff)
      Acked-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com> (Xen stuff)
      Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
      8b48463f
  18. 11 7月, 2013 2 次提交
  19. 27 2月, 2013 2 次提交
  20. 25 2月, 2013 2 次提交
    • A
      asus-wmi: add display toggle quirk · a2a96f0c
      AceLan Kao 提交于
      For machines with AMD graphic chips, it will send out WMI event and ACPI
      interrupt at the same time while hitting the hotkey. BIOS will notify the
      system the next display output mode throught WMI event code, so that
      windows' application can show an OSD to tell the user which mode will be
      taken effect. User can hit the display toggle key many times within 2
      seconds to choose the mode they want. After 2 seconds, WMI dirver should
      send a WMIMethod(SDSP) command to tell the BIOS which mode the user chose.
      And then BIOS will raise another ACPI interrupt to tell the system to
      really switch the display mode.
      
      In Linux desktop, we don't have this kind of OSD to let users to choose
      the mode they want, so we don't need to call WMIMethod(SDSP) to have
      another ACPI interrupt. To simplify the problem, we just have to ignore
      the WMI event, and let the first ACPI interrupt to send out the key event.
      
      For the need, here comes another quirk to add machines with this kind of
      behavior. When the WMI driver receives the display toggle WMI event, and
      found the machin is in the list, it will do nothing and let ACPI video
      driver to report the key event.
      Signed-off-by: NAceLan Kao <acelan.kao@canonical.com>
      Signed-off-by: NCorentin Chary <corentincj@iksaif.net>
      Signed-off-by: NMatthew Garrett <matthew.garrett@nebula.com>
      a2a96f0c
    • A
      asus-wmi: update wlan LED through rfkill led trigger · 6cae06e6
      AceLan Kao 提交于
      For those machines with wapf=4, BIOS won't update the wireless LED,
      since wapf=4 means user application will take in chage of the wifi and bt.
      So, we have to update wlan LED status explicitly.
      
      But I found there is another wireless LED bug in launchpad and which is
      not in the wapf=4 quirk.
      So, it might be better to set wireless LED status explicitly for all
      machines.
      
      BugLink: https://launchpad.net/bugs/901105Signed-off-by: NAceLan Kao <acelan.kao@canonical.com>
      Signed-off-by: NMatthew Garrett <mjg@redhat.com>
      6cae06e6
  21. 18 12月, 2012 1 次提交
  22. 14 9月, 2012 1 次提交
  23. 18 8月, 2012 1 次提交
    • A
      asus-wmi: record wlan status while controlled by userapp · a50bd128
      AceLan Kao 提交于
      If the user bit is set, that mean BIOS can't set and record the wlan
      status, it will report the value read from id ASUS_WMI_DEVID_WLAN_LED
      (0x00010012) while we query the wlan status by id ASUS_WMI_DEVID_WLAN
      (0x00010011) through WMI.
      So, we have to record wlan status in id ASUS_WMI_DEVID_WLAN_LED
      (0x00010012) while setting the wlan status through WMI.
      This is also the behavior that windows app will do.
      
      Quote from ASUS application engineer
      ===
      When you call WMIMethod(DSTS, 0x00010011) to get WLAN status, it may return
      
      (1) 0x00050001 (On)
      (2) 0x00050000 (Off)
      (3) 0x00030001 (On)
      (4) 0x00030000 (Off)
      (5) 0x00000002 (Unknown)
      
      (1), (2) means that the model has hardware GPIO for WLAN, you can call
      WMIMethod(DEVS, 0x00010011, 1 or 0) to turn WLAN on/off.
      (3), (4) means that the model doesn’t have hardware GPIO, you need to use
      API or driver library to turn WLAN on/off, and call
      WMIMethod(DEVS, 0x00010012, 1 or 0) to set WLAN LED status.
      After you set WLAN LED status, you can see the WLAN status is changed with
      WMIMethod(DSTS, 0x00010011). Because the status is recorded lastly
      (ex: Windows), you can use it for synchronization.
      (5) means that the model doesn’t have WLAN device.
      
      WLAN is the ONLY special case with upper rule.
      
      For other device, like Bluetooth, you just need use
      WMIMethod(DSTS, 0x00010013) to get, and WMIMethod(DEVS, 0x00010013, 1 or 0)
      to set.
      ===
      Signed-off-by: NAceLan Kao <acelan.kao@canonical.com>
      Signed-off-by: NMatthew Garrett <mjg@redhat.com>
      a50bd128
  24. 28 7月, 2012 3 次提交
  25. 27 3月, 2012 5 次提交
  26. 28 2月, 2012 1 次提交
  27. 04 1月, 2012 1 次提交
  28. 24 10月, 2011 1 次提交