1. 15 3月, 2014 1 次提交
    • M
      gpio / ACPI: Add support for ACPI GPIO operation regions · 473ed7be
      Mika Westerberg 提交于
      GPIO operation regions is a new feature introduced in ACPI 5.0
      specification. This feature adds a way for platform ASL code to call back
      to OS GPIO driver and toggle GPIO pins.
      
      An example ASL code from Lenovo Miix 2 tablet with only relevant part
      listed:
      
       Device (\_SB.GPO0)
       {
           Name (AVBL, Zero)
           Method (_REG, 2, NotSerialized)
           {
               If (LEqual (Arg0, 0x08))
               {
                   // Marks the region available
                   Store (Arg1, AVBL)
               }
           }
      
           OperationRegion (GPOP, GeneralPurposeIo, Zero, 0x0C)
           Field (GPOP, ByteAcc, NoLock, Preserve)
           {
               Connection (
                   GpioIo (Exclusive, PullDefault, 0, 0, IoRestrictionOutputOnly,
                           "\\_SB.GPO0", 0x00, ResourceConsumer,,)
                   {
                       0x003B
                   }
               ),
               SHD3,   1,
           }
       }
      
       Device (SHUB)
       {
           Method (_PS0, 0, Serialized)
           {
               If (LEqual (\_SB.GPO0.AVBL, One))
               {
                   Store (One, \_SB.GPO0.SHD3)
                   Sleep (0x32)
               }
           }
           Method (_PS3, 0, Serialized)
           {
               If (LEqual (\_SB.GPO0.AVBL, One))
               {
                   Store (Zero, \_SB.GPO0.SHD3)
               }
           }
       }
      
      How this works is that whenever _PS0 or _PS3 method is run (typically when
      SHUB device is transitioned to D0 or D3 respectively), ASL code checks if
      the GPIO operation region is available (\_SB.GPO0.AVBL). If it is we go and
      store either 0 or 1 to \_SB.GPO0.SHD3.
      
      Now, when ACPICA notices ACPI GPIO operation region access (the store
      above) it will call acpi_gpio_adr_space_handler() that then toggles the
      GPIO accordingly using standard gpiolib interfaces.
      
      Implement the support by registering GPIO operation region handlers for all
      GPIO devices that have an ACPI handle. First time the GPIO is used by the
      ASL code we make sure that the GPIO stays requested until the GPIO chip
      driver itself is unloaded. If we find out that the GPIO is already
      requested we just toggle it according to the value got from ASL code.
      Signed-off-by: NMika Westerberg <mika.westerberg@linux.intel.com>
      Signed-off-by: NLinus Walleij <linus.walleij@linaro.org>
      473ed7be
  2. 13 3月, 2014 3 次提交
  3. 13 2月, 2014 1 次提交
  4. 08 1月, 2014 2 次提交
  5. 13 12月, 2013 1 次提交
  6. 20 10月, 2013 2 次提交
  7. 11 10月, 2013 1 次提交
  8. 24 9月, 2013 1 次提交
  9. 17 9月, 2013 1 次提交
  10. 12 4月, 2013 1 次提交
  11. 11 4月, 2013 1 次提交
    • R
      gpio / ACPI: Handle ACPI events in accordance with the spec · 7fc7acb9
      Rafael J. Wysocki 提交于
      Commit 0d1c28a4 (gpiolib-acpi: Add ACPI5 event model support to gpio.)
      that added support for ACPI events signalled through GPIO interrupts
      covered only GPIO pins whose numbers are less than or equal to 255.
      However, there may be GPIO pins with numbers greater than 255 and
      the ACPI spec (ACPI 5.0, Section 5.6.5.1) requires the _EVT method
      to be used for handling events corresponding to those pins.
      
      Moreover, according to the spec, _EVT is the default mechanism
      for handling all ACPI events signalled through GPIO interrupts,
      so if the _Exx/_Lxx method is not present for the given pin,
      _EVT should be used instead.  If present, though, _Exx/_Lxx take
      precedence over _EVT which shouldn't be executed in that case
      (ACPI 5.0, Section 5.6.5.3).
      
      Modify acpi_gpiochip_request_interrupts() to follow the spec as
      described above and add acpi_gpiochip_free_interrupts() needed
      to free interrupts associated with _EVT.
      Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
      Acked-by: NMika Westerberg <mika.westerberg@linux.intel.com>
      Signed-off-by: NLinus Walleij <linus.walleij@linaro.org>
      7fc7acb9
  12. 05 2月, 2013 1 次提交
  13. 29 1月, 2013 1 次提交
  14. 30 11月, 2012 1 次提交