1. 22 7月, 2017 1 次提交
  2. 28 6月, 2017 3 次提交
    • R
      PCI / PM: Drop pme_interrupt flag from struct pci_dev · 8370c2dc
      Rafael J. Wysocki 提交于
      The pme_interrupt flag in struct pci_dev is set when PMEs generated
      by the device are going to be signaled via root port PME interrupts.
      
      Ironically enough, that information is only used by the code setting
      up device wakeup through ACPI which returns as soon as it sees the
      pme_interrupt flag set while setting up "remote runtime wakeup".
      That is questionable, however, because in theory there may be PCIe
      devices using out-of-band PME signaling under root ports handled
      by the native PME code or devices requiring wakeup power setup to be
      carried out by AML.  For such devices, ACPI wakeup should be invoked
      regardless of whether or not native PME signaling is used in general.
      
      For this reason, drop the pme_interrupt flag and rework the code
      using it which then allows the ACPI-based device wakeup handling
      in PCI to be consolidated to use one code path for both "runtime
      remote wakeup" and system wakeup (from sleep states).
      Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
      Reviewed-by: NMika Westerberg <mika.westerberg@linux.intel.com>
      Acked-by: NBjorn Helgaas <bhelgaas@google.com>
      8370c2dc
    • R
      ACPI / PM: Consolidate device wakeup settings code · 4d183d04
      Rafael J. Wysocki 提交于
      Currently, there are two separate ways of handling device wakeup
      settings in the ACPI core, depending on whether this is runtime
      wakeup or system wakeup (from sleep states).  However, after the
      previous commit eliminating the run_wake ACPI device wakeup flag,
      there is no difference between the two any more at the ACPI level,
      so they can be combined.
      
      For this reason, introduce acpi_pm_set_device_wakeup() to replace both
      acpi_pm_device_run_wake() and acpi_pm_device_sleep_wake() and make it
      check the ACPI device object's wakeup.valid flag to determine whether
      or not the device can be set up to generate wakeup signals.
      
      Also notice that zpodd_enable/disable_run_wake() only call
      device_set_run_wake() because acpi_pm_device_run_wake() called
      device_run_wake(), which is not done by acpi_pm_set_device_wakeup(),
      so drop the now redundant device_set_run_wake() calls from there.
      Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
      Reviewed-by: NMika Westerberg <mika.westerberg@linux.intel.com>
      Acked-by: NBjorn Helgaas <bhelgaas@google.com>
      4d183d04
    • R
      ACPI / PM: Drop run_wake from struct acpi_device_wakeup_flags · a1a66393
      Rafael J. Wysocki 提交于
      The run_wake flag in struct acpi_device_wakeup_flags stores the
      information on whether or not the device can generate wakeup
      signals at run time, but in ACPI that really is equivalent to
      being able to generate wakeup signals at all.
      
      In fact, run_wake will always be set after successful executeion of
      acpi_setup_gpe_for_wake(), but if that fails, the device will not be
      able to use a wakeup GPE at all, so it won't be able to wake up the
      systems from sleep states too.  Hence, run_wake actually means that
      the device is capable of triggering wakeup and so it is equivalent
      to the valid flag.
      
      For this reason, drop run_wake from struct acpi_device_wakeup_flags
      and make sure that the valid flag is only set if
      acpi_setup_gpe_for_wake() has been successful.
      Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
      Reviewed-by: NMika Westerberg <mika.westerberg@linux.intel.com>
      Acked-by: NBjorn Helgaas <bhelgaas@google.com>
      a1a66393
  3. 22 6月, 2017 1 次提交
    • J
      ACPI / scan: Fix enumeration for special SPI and I2C devices · e4330d8b
      Jarkko Nikula 提交于
      Commit f406270b ("ACPI / scan: Set the visited flag for all
      enumerated devices") caused that two group of special SPI or I2C
      devices do not enumerate. SPI and I2C devices are expected to be
      enumerated by the SPI and I2C subsystems but change caused that
      acpi_bus_attach() marks those devices with acpi_device_set_enumerated().
      
      First group of devices are matched using Device Tree compatible property
      with special _HID "PRP0001". Those devices have matched scan handler,
      acpi_scan_attach_handler() retuns 1 and acpi_bus_attach() marks them
      with acpi_device_set_enumerated().
      
      Second group of devices without valid _HID such as "LNXVIDEO" have
      device->pnp.type.platform_id set to zero and change again marks them
      with acpi_device_set_enumerated().
      
      Fix this by flagging the SPI and I2C devices during struct acpi_device
      object initialization time and let the code in acpi_bus_attach() to go
      through the device_attach() and acpi_default_enumeration() path for all
      SPI and I2C devices.
      
      Fixes: f406270b (ACPI / scan: Set the visited flag for all enumerated devices)
      Signed-off-by: NJarkko Nikula <jarkko.nikula@linux.intel.com>
      Acked-by: NMika Westerberg <mika.westerberg@linux.intel.com>
      Cc: 4.11+ <stable@vger.kernel.org> # 4.11+
      Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
      e4330d8b
  4. 15 6月, 2017 2 次提交
    • R
      ACPI / PM: Ignore spurious SCI wakeups from suspend-to-idle · 33e4f80e
      Rafael J. Wysocki 提交于
      The ACPI SCI (System Control Interrupt) is set up as a wakeup IRQ
      during suspend-to-idle transitions and, consequently, any events
      signaled through it wake up the system from that state.  However,
      on some systems some of the events signaled via the ACPI SCI while
      suspended to idle should not cause the system to wake up.  In fact,
      quite often they should just be discarded.
      
      Arguably, systems should not resume entirely on such events, but in
      order to decide which events really should cause the system to resume
      and which are spurious, it is necessary to resume up to the point
      when ACPI SCIs are actually handled and processed, which is after
      executing dpm_resume_noirq() in the system resume path.
      
      For this reasons, add a loop around freeze_enter() in which the
      platforms can process events signaled via multiplexed IRQ lines
      like the ACPI SCI and add suspend-to-idle hooks that can be
      used for this purpose to struct platform_freeze_ops.
      
      In the ACPI case, the ->wake hook is used for checking if the SCI
      has triggered while suspended and deferring the interrupt-induced
      system wakeup until the events signaled through it are actually
      processed sufficiently to decide whether or not the system should
      resume.  In turn, the ->sync hook allows all of the relevant event
      queues to be flushed so as to prevent events from being missed due
      to race conditions.
      
      In addition to that, some ACPI code processing wakeup events needs
      to be modified to use the "hard" version of wakeup triggers, so that
      it will cause a system resume to happen on device-induced wakeup
      events even if the "soft" mechanism to prevent the system from
      suspending is not enabled.  However, to preserve the existing
      behavior with respect to suspend-to-RAM, this only is done in
      the suspend-to-idle case and only if an SCI has occurred while
      suspended.
      Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
      33e4f80e
    • R
      ACPI / PM: Run wakeup notify handlers synchronously · 64fd1c70
      Rafael J. Wysocki 提交于
      The work functions provided by the users of acpi_add_pm_notifier()
      should be run synchronously before re-enabling the wakeup GPE in
      case they are used to clear the status and/or disable the wakeup
      signaling at the source.  Otherwise, which is the case currently in
      the PCI bus type code, the same wakeup event may be signaled for
      multiple times while the execution of the work function in response
      to it has already been queued up.
      
      Fortunately, acpi_add_pm_notifier() is only used by PCI and by
      ACPI device PM code internally, so the change is relatively
      straightforward to make.
      Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
      Acked-by: NBjorn Helgaas <bhelgaas@google.com>
      64fd1c70
  5. 07 6月, 2017 1 次提交
  6. 27 4月, 2017 1 次提交
    • H
      ACPI / bus: Introduce a list of ids for "always present" devices · b7ecf663
      Hans de Goede 提交于
      Several Bay / Cherry Trail devices (all of which ship with Windows 10) hide
      the LPSS PWM controller in ACPI, typically the _STA method looks like this:
      
          Method (_STA, 0, NotSerialized)  // _STA: Status
          {
              If (OSID == One)
              {
                  Return (Zero)
              }
      
              Return (0x0F)
          }
      
      Where OSID is some dark magic seen in all Cherry Trail ACPI tables making
      the machine behave differently depending on which OS it *thinks* it is
      booting, this gets set in a number of ways which we cannot control, on
      some newer machines it simple hardcoded to "One" aka win10.
      
      This causes the PWM controller to get hidden, which means Linux cannot
      control the backlight level on cht based tablets / laptops.
      
      Since loading the driver for this does no harm (the only in kernel user
      of it is the i915 driver, which will only uses it when it needs it), this
      commit makes acpi_bus_get_status() always set status to ACPI_STA_DEFAULT
      for the LPSS PWM device, fixing the lack of backlight control.
      Signed-off-by: NHans de Goede <hdegoede@redhat.com>
      [ rjw: Rename the new file to utils.c ]
      Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
      b7ecf663
  7. 20 4月, 2017 2 次提交
    • S
      drivers: acpi: Handle IOMMU lookup failure with deferred probing or error · 5a1bb638
      Sricharan R 提交于
      This is an equivalent to the DT's handling of the iommu master's probe
      with deferred probing when the corrsponding iommu is not probed yet.
      The lack of a registered IOMMU can be caused by the lack of a driver for
      the IOMMU, the IOMMU device probe not having been performed yet, having
      been deferred, or having failed.
      
      The first case occurs when the firmware describes the bus master and
      IOMMU topology correctly but no device driver exists for the IOMMU yet
      or the device driver has not been compiled in. Return NULL, the caller
      will configure the device without an IOMMU.
      
      The second and third cases are handled by deferring the probe of the bus
      master device which will eventually get reprobed after the IOMMU.
      
      The last case is currently handled by deferring the probe of the bus
      master device as well. A mechanism to either configure the bus master
      device without an IOMMU or to fail the bus master device probe depending
      on whether the IOMMU is optional or mandatory would be a good
      enhancement.
      Tested-by: NHanjun Guo <hanjun.guo@linaro.org>
      Reviewed-by: NRobin Murphy <robin.murphy@arm.com>
      [Lorenzo: Added fixes for dma_coherent_mask overflow, acpi_dma_configure
                called multiple times for same device]
      Signed-off-by: NLorenzo Pieralisi <lorenzo.pieralisi@arm.com>
      Signed-off-by: NSricharan R <sricharan@codeaurora.org>
      Signed-off-by: NJoerg Roedel <jroedel@suse.de>
      5a1bb638
    • H
      ACPI / utils: Add new acpi_dev_present helper · 8661423e
      Hans de Goede 提交于
      acpi_dev_found just iterates over all ACPI-ids and sees if one matches.
      This means that it will return true for devices which are in the DSDT
      but disabled (their _STA method returns 0).
      
      For some drivers it is useful to be able to check if a certain HID
      is not only present in the namespace, but also actually present as in
      acpi_device_is_present() will return true for the device. For example
      because if a certain device is present then the driver will want to use
      an extcon or IIO ADC channel provided by that device.
      
      This commit adds a new acpi_dev_present helper which drivers can use
      to this end.
      
      Like acpi_dev_found, acpi_dev_present take a HID as argument, but
      it also has 2 extra optional arguments to only check for an ACPI
      device with a specific UID and/or HRV value. This makes it more
      generic and allows it to replace custom code doing similar checks
      in several places.
      
      Arguably acpi_dev_present is what acpi_dev_found should have been, but
      there are too many users to just change acpi_dev_found without the risk
      of breaking something.
      Signed-off-by: NHans de Goede <hdegoede@redhat.com>
      Reviewed-by: NLukas Wunner <lukas@wunner.de>
      Reviewed-by: NMika Westerberg <mika.westerberg@linux.intel.com>
      Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
      8661423e
  8. 29 3月, 2017 1 次提交
    • M
      ACPI / property: Add possiblity to retrieve parent firmware node · dfa672fb
      Mika Westerberg 提交于
      Sometimes it is useful to be able to navigate firmware node hierarchy
      upwards toward parent nodes. ACPI device nodes are pretty much already
      supported because ACPICA provides acpi_get_parent(). ACPI data nodes,
      however, are all below the same parent ACPI device. Their hierarchy is
      created by "linking" each other using references in the value field.
      
      Add parent pointer to the parent data node while we create them so it is
      easy to navigate the hierarchy backwards. We use this parent pointer in a
      new function acpi_node_get_parent() that is able to extract parent of both
      ACPI firmware node types.
      Signed-off-by: NMika Westerberg <mika.westerberg@linux.intel.com>
      Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
      dfa672fb
  9. 07 2月, 2017 1 次提交
  10. 29 11月, 2016 1 次提交
    • L
      ACPI: Implement acpi_dma_configure · d760a1ba
      Lorenzo Pieralisi 提交于
      On DT based systems, the of_dma_configure() API implements DMA
      configuration for a given device. On ACPI systems an API equivalent to
      of_dma_configure() is missing which implies that it is currently not
      possible to set-up DMA operations for devices through the ACPI generic
      kernel layer.
      
      This patch fills the gap by introducing acpi_dma_configure/deconfigure()
      calls that for now are just wrappers around arch_setup_dma_ops() and
      arch_teardown_dma_ops() and also updates ACPI and PCI core code to use
      the newly introduced acpi_dma_configure/acpi_dma_deconfigure functions.
      
      Since acpi_dma_configure() is used to configure DMA operations, the
      function initializes the dma/coherent_dma masks to sane default values
      if the current masks are uninitialized (also to keep the default values
      consistent with DT systems) to make sure the device has a complete
      default DMA set-up.
      
      The DMA range size passed to arch_setup_dma_ops() is sized according
      to the device coherent_dma_mask (starting at address 0x0), mirroring the
      DT probing path behaviour when a dma-ranges property is not provided
      for the device being probed; this changes the current arch_setup_dma_ops()
      call parameters in the ACPI probing case, but since arch_setup_dma_ops()
      is a NOP on all architectures but ARM/ARM64 this patch does not change
      the current kernel behaviour on them.
      Signed-off-by: NLorenzo Pieralisi <lorenzo.pieralisi@arm.com>
      Acked-by: Bjorn Helgaas <bhelgaas@google.com> [pci]
      Acked-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
      Reviewed-by: NTomasz Nowicki <tn@semihalf.com>
      Tested-by: NHanjun Guo <hanjun.guo@linaro.org>
      Tested-by: NTomasz Nowicki <tn@semihalf.com>
      Cc: Bjorn Helgaas <bhelgaas@google.com>
      Cc: Robin Murphy <robin.murphy@arm.com>
      Cc: Tomasz Nowicki <tn@semihalf.com>
      Cc: Joerg Roedel <joro@8bytes.org>
      Cc: "Rafael J. Wysocki" <rjw@rjwysocki.net>
      Signed-off-by: NWill Deacon <will.deacon@arm.com>
      d760a1ba
  11. 26 6月, 2016 1 次提交
  12. 28 4月, 2016 1 次提交
  13. 12 4月, 2016 1 次提交
  14. 09 4月, 2016 1 次提交
    • L
      ACPI / utils: Rename acpi_dev_present() · c68ae33e
      Lukas Wunner 提交于
      acpi_dev_present() was originally named after pci_dev_present()
      to signify the similarity of the two functions.
      
      However Rafael J. Wysocki pointed out that the exported function
      acpi_dev_present() is easily confused with the non-exported
      acpi_device_is_present(). Additionally in ACPI parlance the term
      "present" usually refers to the "device is present" bit returned
      by the _STA control method, yet acpi_dev_present() merely checks
      presence in the namespace. It does not invoke _STA at all, let
      alone check the "device is present" bit.
      
      As suggested by Rafael, rename the function to acpi_dev_found()
      and adjust all existing call sites.
      Signed-off-by: NLukas Wunner <lukas@wunner.de>
      Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
      c68ae33e
  15. 10 12月, 2015 1 次提交
  16. 09 12月, 2015 1 次提交
  17. 07 11月, 2015 3 次提交
  18. 15 9月, 2015 5 次提交
    • R
      ACPI / scan: constify struct acpi_hardware_id::id · 844142c3
      Rasmus Villemoes 提交于
      This is preparation for using kstrdup_const to initialize that member.
      Signed-off-by: NRasmus Villemoes <linux@rasmusvillemoes.dk>
      Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
      844142c3
    • R
      ACPI / scan: constify first argument of struct acpi_scan_handler::match · 636c19d3
      Rasmus Villemoes 提交于
      One wouldn't expect a "match" function modify the string it searches
      for, and indeed the only instance of the struct
      acpi_scan_handler::match callback, acpi_pnp_match, can easily be
      changed. While there, update its helper matching_id().
      
      This is also preparation for constifying struct acpi_hardware_id::id.
      Signed-off-by: NRasmus Villemoes <linux@rasmusvillemoes.dk>
      Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
      636c19d3
    • R
      ACPI / property: Extend fwnode_property_* to data-only subnodes · 3a7a2ab8
      Rafael J. Wysocki 提交于
      Modify is_acpi_node() to return "true" for ACPI data-only subnodes as
      well as for ACPI device objects and change the name of to_acpi_node()
      to to_acpi_device_node() so it is clear that it covers ACPI device
      objects only.  Accordingly, introduce to_acpi_data_node() to cover
      data-only subnodes in an analogous way.
      
      With that, make the fwnode_property_* family of functions work with
      ACPI data-only subnodes introduced previously.
      Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
      Tested-by: NMika Westerberg <mika.westerberg@linux.intel.com>
      3a7a2ab8
    • R
      ACPI / property: Expose data-only subnodes via sysfs · 263b4c1a
      Rafael J. Wysocki 提交于
      Add infrastructure needed to expose data-only subnodes of ACPI
      device objects introduced previously via sysfs.
      
      Each data-only subnode is represented as a sysfs directory under
      the directory corresponding to its parent object (a device or a
      data-only subnode).  Each of them has a "path" attribute (containing
      the full ACPI namespace path to the object the subnode data come from)
      at this time.
      Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
      Tested-by: NMika Westerberg <mika.westerberg@linux.intel.com>
      263b4c1a
    • R
      ACPI / property: Add support for data-only subnodes · 445b0eb0
      Rafael J. Wysocki 提交于
      In some cases, the information expressed via device properties is
      hierarchical by nature.  For example, the properties of a composite
      device consisting of multiple semi-dependent components may need
      to be represented in the form of a tree of property data sets
      corresponding to specific components of the device.
      
      Unfortunately, using ACPI device objects for this purpose turns out
      to be problematic, mostly due to the assumption made by some operating
      systems (that platform firmware generally needs to work with) that
      each device object in the ACPI namespace represents a device requiring
      a separate driver.  That assumption leads to complications which
      reportedly are impractically difficult to overcome and a different
      approach is needed for the sake of interoperability.
      
      The approach implemented here is based on extending _DSD via pointers
      (links) to additional ACPI objects returning data packages formatted
      in accordance with the _DSD formatting rules defined by Section 6.2.5
      of ACPI 6.  Those additional objects are referred to as data-only
      subnodes of the device object containing the _DSD pointing to them.
      
      The links to them need to be located in a separate section of the
      _DSD data package following UUID dbb8e3e6-5886-4ba6-8795-1319f52a966b
      referred to as the Hierarchical Data Extension UUID as defined in [1].
      Each of them is represented by a package of two strings.  The first
      string in that package (the key) is regarded as the name of the
      data-only subnode pointed to by the link.  The second string in it
      (the target) is expected to hold the ACPI namespace path (possibly
      utilizing the usual ACPI namespace search rules) of an ACPI object
      evaluating to a data package extending the _DSD.
      
      The device properties initialization code follows those links,
      creates a struct acpi_data_node object for each of them to store
      the data returned by the ACPI object pointed to by it and processes
      those data recursively (which may lead to the creation of more
      struct acpi_data_node objects if the returned data package contains
      the Hierarchical Data Extension UUID section with more links in it).
      
      All of the struct acpi_data_node objects are present until the the
      ACPI device object containing the _DSD with links to them is deleted
      and they are deleted along with that object.
      
      [1]: http://www.uefi.org/sites/default/files/resources/_DSD-hierarchical-data-extension-UUID-v1.pdfSigned-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
      Tested-by: NMika Westerberg <mika.westerberg@linux.intel.com>
      445b0eb0
  19. 08 7月, 2015 1 次提交
  20. 25 6月, 2015 1 次提交
  21. 15 6月, 2015 1 次提交
  22. 16 5月, 2015 1 次提交
    • R
      ACPI / PM: Rework device power management to follow ACPI 6 · 20dacb71
      Rafael J. Wysocki 提交于
      The ACPI 6 specification has made some changes in the device power
      management area.  In particular:
      
       * The D3hot power state is now supposed to be always available
         (instead of D3cold) and D3cold is only regarded as valid if the
         _PR3 object is present for the given device.
      
       * The required ordering of transitions into power states deeper than
         D0 is now such that for a transition into state Dx the _PSx method
         is supposed to be executed first, if present, and the states of
         the power resources the device depends on are supposed to be
         changed after that.
      
       * It is now explicitly forbidden to transition devices from
         lower-power (deeper) into higher-power (shallower) power states
         other than D0.
      
      Those changes have been made so the specification reflects the
      Windows' device power management code that the vast majority of
      systems using ACPI is validated against.
      
      To avoid artificial differences in ACPI device power management
      between Windows and Linux, modify the ACPI device power management
      code to follow the new specification.  Add comments explaining the
      code flow in some unclear places.
      
      This only may affect some real corner cases in which the OS behavior
      expected by the firmware is different from the Windows one, but that's
      quite unlikely.  The transition ordering change affects transitions
      to D1 and D2 which are rarely used (if at all) and into D3hot and
      D3cold for devices actually having _PR3, but those are likely to
      be validated against Windows anyway.  The other changes may affect
      code calling acpi_device_get_power() or acpi_device_update_power()
      where ACPI_STATE_D3_HOT may be returned instead of ACPI_STATE_D3_COLD
      (that's why the ACPI fan driver needs to be updated too) and since
      transitions into ACPI_STATE_D3_HOT may remove power now, it is better
      to avoid this one in acpi_pm_device_sleep_state() if the "no power
      off" PM QoS flag is set.
      
      The only existing user of acpi_device_can_poweroff() really cares
      about the case when _PR3 is present, so the change in that function
      should not cause any problems to happen too.
      
      A plus is that PCI_D3hot can be mapped to ACPI_STATE_D3_HOT
      now and the compatibility with older systems should be covered
      automatically.
      
      In any case, if any real problems result from this, it still will
      be better to follow the Windows' behavior (which now is reflected
      by the specification too) in general and handle the cases when it
      doesn't work via quirks.
      Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
      20dacb71
  23. 05 5月, 2015 1 次提交
    • R
      ACPI / property: Refine consistency check for PRP0001 · 5c53b262
      Rafael J. Wysocki 提交于
      Refine the check for the presence of the "compatible" property
      if the PRP0001 device ID is present in the device's list of
      ACPI/PNP IDs to also print the message if _DSD is missing
      entirely or the format of it is incorrect.
      
      One special case to take into accout is that the "compatible"
      property need not be provided for devices having the PRP0001
      device ID in their lists of ACPI/PNP IDs if they are ancestors
      of PRP0001 devices with the "compatible" property present.
      This is to cover heriarchies of device objects where the kernel
      is only supposed to use a struct device representation for the
      topmost one and the others represent, for example, functional
      blocks of a composite device.
      
      While at it, reduce the log level of the message to "info"
      and reduce the log level of the "broken _DSD" message to
      "debug" (noise reduction).
      Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
      Reviewed-by: NMika Westerberg <mika.westerberg@linux.intel.com>
      5c53b262
  24. 18 3月, 2015 1 次提交
  25. 17 3月, 2015 1 次提交
  26. 13 12月, 2014 1 次提交
  27. 04 12月, 2014 1 次提交
  28. 24 11月, 2014 1 次提交
  29. 05 11月, 2014 2 次提交
    • R
      ACPI / GPIO: Driver GPIO mappings for ACPI GPIOs · f028d524
      Rafael J. Wysocki 提交于
      Provide a way for device drivers using GPIOs described by ACPI
      GpioIo resources in _CRS to tell the GPIO subsystem what names
      (connection IDs) to associate with specific GPIO pins defined
      in there.
      
      To do that, a driver needs to define a mapping table as a
      NULL-terminated array of struct acpi_gpio_mapping objects
      that each contain a name, a pointer to an array of line data
      (struct acpi_gpio_params) objects and the size of that array.
      
      Each struct acpi_gpio_params object consists of three fields,
      crs_entry_index, line_index, active_low, representing the index of
      the target GpioIo()/GpioInt() resource in _CRS starting from zero,
      the index of the target line in that resource starting from zero,
      and the active-low flag for that line, respectively.
      
      Next, the mapping table needs to be passed as the second
      argument to acpi_dev_add_driver_gpios() that will register it with
      the ACPI device object pointed to by its first argument.  That
      should be done in the driver's .probe() routine.
      
      On removal, the driver should unregister its GPIO mapping table
      by calling acpi_dev_remove_driver_gpios() on the ACPI device
      object where that table was previously registered.
      
      Included are fixes from Mika Westerberg.
      Acked-by: NAlexandre Courbot <acourbot@nvidia.com>
      Reviewed-by: NLinus Walleij <linus.walleij@linaro.org>
      Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
      f028d524
    • R
      Driver core: Unified interface for firmware node properties · 8a0662d9
      Rafael J. Wysocki 提交于
      Add new generic routines are provided for retrieving properties from
      device description objects in the platform firmware in case there are
      no struct device objects for them (either those objects have not been
      created yet or they do not exist at all).
      
      The following functions are provided:
      
      fwnode_property_present()
      fwnode_property_read_u8()
      fwnode_property_read_u16()
      fwnode_property_read_u32()
      fwnode_property_read_u64()
      fwnode_property_read_string()
      fwnode_property_read_u8_array()
      fwnode_property_read_u16_array()
      fwnode_property_read_u32_array()
      fwnode_property_read_u64_array()
      fwnode_property_read_string_array()
      
      in analogy with the corresponding functions for struct device added
      previously.  For all of them, the first argument is a pointer to struct
      fwnode_handle (new type) that allows a device description object
      (depending on what platform firmware interface is in use) to be
      obtained.
      
      Add a new macro device_for_each_child_node() for iterating over the
      children of the device description object associated with a given
      device and a new function device_get_child_node_count() returning the
      number of a given device's child nodes.
      
      The interface covers both ACPI and Device Trees.
      Suggested-by: NGrant Likely <grant.likely@linaro.org>
      Acked-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      Acked-by: NGrant Likely <grant.likely@linaro.org>
      Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
      8a0662d9