1. 20 1月, 2013 1 次提交
    • M
      ACPI: add support for CSRT table · 13176bbf
      Mika Westerberg 提交于
      Core System Resources Table (CSRT) is a proprietary ACPI table that
      contains resources for certain devices that are not found in the DSDT
      table. Typically a shared DMA controller might be found here.
      
      This patch adds support for this table. We go through all entries in the
      table and make platform devices of them. The resources from the table are
      passed with the platform device.
      
      There is one special resource in the table and it is the DMA request line
      base and number of request lines. This information might be needed by the
      DMA controller driver as it needs to map the ACPI DMA request line number
      to the actual request line understood by the hardware. This range is passed
      as IORESOURCE_DMA resource.
      Signed-off-by: NAndy Shevchenko <andriy.shevchenko@linux.intel.com>
      Signed-off-by: NMika Westerberg <mika.westerberg@linux.intel.com>
      Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
      13176bbf
  2. 15 1月, 2013 5 次提交
  3. 12 1月, 2013 1 次提交
  4. 08 1月, 2013 1 次提交
    • R
      ACPI / scan: Treat power resources in a special way · f95988de
      Rafael J. Wysocki 提交于
      Commit 805d410f (ACPI: Separate adding ACPI device objects from
      probing ACPI drivers) introduced an ACPI power resources management
      regression, because it didn't ensure that the power resources
      driver bind to the struct acpi_device objects corresponding
      to power resources as soon as they were created.  As a result,
      ACPI power management routines may attempt to access power resource
      objects before they are ready to use.
      
      To fix this problem, tell the acpi_add_single_object() in
      acpi_bus_check_add() to probe the driver for objects of type
      ACPI_BUS_TYPE_POWER.  This fix has been verified to work on
      HP nx6325 where the problem was first observed.
      Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
      Acked-by: NToshi Kani <toshi.kani@hp.com>
      f95988de
  5. 05 1月, 2013 1 次提交
  6. 03 1月, 2013 12 次提交
    • R
      ACPI: Drop ACPI device .bind() and .unbind() callbacks · 3eec5f7a
      Rafael J. Wysocki 提交于
      Drop the .bind() and .unbind() that have no more users from
      struct acpi_device_ops and remove all of the code referring to
      them from drivers/acpi/scan.c.
      Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
      Acked-by: NYinghai Lu <yinghai@kernel.org>
      Acked-by: NToshi Kani <toshi.kani@hp.com>
      3eec5f7a
    • R
      ACPI: Make acpi_bus_scan() and acpi_bus_add() take only one argument · 0cd6ac52
      Rafael J. Wysocki 提交于
      The callers of acpi_bus_add() usually assume that if it has
      succeeded, then a struct acpi_device object has been attached to
      the handle passed as the first argument.  Unfortunately, however,
      this assumption is wrong, because acpi_bus_scan(), and acpi_bus_add()
      too as a result, may return a pointer to a different struct
      acpi_device object on success (it may be an object corresponding to
      one of the descendant ACPI nodes in the namespace scope below that
      handle).
      
      For this reason, the callers of acpi_bus_add() who care about
      whether or not a struct acpi_device object has been created for
      its first argument need to check that using acpi_bus_get_device()
      anyway, so the second argument of acpi_bus_add() is not really
      useful for them.  The same observation applies to acpi_bus_scan()
      executed directly from acpi_scan_init().
      
      Therefore modify the relevant callers of acpi_bus_add() to check the
      existence of the struct acpi_device in question with the help of
      acpi_bus_get_device() and drop the no longer necessary second
      argument of acpi_bus_add().  Accordingly, modify acpi_scan_init() to
      use acpi_bus_get_device() to get acpi_root and drop the no longer
      needed second argument of acpi_bus_scan().
      Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
      Acked-by: NYinghai Lu <yinghai@kernel.org>
      Acked-by: NToshi Kani <toshi.kani@hp.com>
      0cd6ac52
    • R
      ACPI: Replace ACPI device add_type field with a match_driver flag · 209d3b17
      Rafael J. Wysocki 提交于
      After the removal of the second argument of acpi_bus_scan() there is
      no difference between the ACPI_BUS_ADD_MATCH and ACPI_BUS_ADD_START
      add types, so the add_type field in struct acpi_device may be
      replaced with a single flag.  Do that calling the flag match_driver.
      Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
      Acked-by: NYinghai Lu <yinghai@kernel.org>
      Acked-by: NToshi Kani <toshi.kani@hp.com>
      209d3b17
    • R
      ACPI: Drop the second argument of acpi_bus_scan() · e3863094
      Rafael J. Wysocki 提交于
      After the removal of acpi_start_single_object() and acpi_bus_start()
      the second argument of acpi_bus_scan() is not necessary any more,
      so drop it and update acpi_bus_check_add() accordingly.
      Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
      Acked-by: NYinghai Lu <yinghai@kernel.org>
      Acked-by: NToshi Kani <toshi.kani@hp.com>
      e3863094
    • R
      ACPI: Remove the arguments of acpi_bus_add() that are not used · 636458de
      Rafael J. Wysocki 提交于
      Notice that acpi_bus_add() uses only 2 of its 4 arguments and
      redefine its header to match the body.  Update all of its callers as
      necessary and observe that this leads to quite a number of removed
      lines of code (Linus will like that).
      
      Add a kerneldoc comment documenting acpi_bus_add() and wonder how
      its callers make wrong assumptions about the second argument (make
      note to self to take care of that later).
      Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
      Acked-by: NYinghai Lu <yinghai@kernel.org>
      Acked-by: NToshi Kani <toshi.kani@hp.com>
      636458de
    • R
      ACPI: Remove acpi_start_single_object() and acpi_bus_start() · 02f57c67
      Rafael J. Wysocki 提交于
      The ACPI PCI root bridge driver was the only ACPI driver implementing
      the .start() callback, which isn't used by any ACPI drivers any more
      now.
      
      For this reason, acpi_start_single_object() has no purpose any more,
      so remove it and all references to it.  Also remove
      acpi_bus_start_device(), whose only purpose was to call
      acpi_start_single_object().
      
      Moreover, since after the removal of acpi_bus_start_device() the
      only purpose of acpi_bus_start() remains to call
      acpi_update_all_gpes(), move that into acpi_bus_add() and drop
      acpi_bus_start() too, remove its header from acpi_bus.h and
      update all of its former users accordingly.
      
      This change was previously proposed in a different from by
      Yinghai Lu.
      Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
      Acked-by: NYinghai Lu <yinghai@kernel.org>
      Acked-by: NToshi Kani <toshi.kani@hp.com>
      02f57c67
    • R
      ACPI: Change the ordering of acpi_bus_check_add() · 4002bf38
      Rafael J. Wysocki 提交于
      If acpi_bus_check_add() is called for a handle already having an
      existing struct acpi_device object attached, it is not necessary to
      check the type and status of the device correspondig to it, so
      change the ordering of acpi_bus_check_add() to avoid that.
      Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
      Acked-by: NYinghai Lu <yinghai@kernel.org>
      Acked-by: NToshi Kani <toshi.kani@hp.com>
      4002bf38
    • R
      ACPI: Replace struct acpi_bus_ops with enum type · a2d06a1a
      Rafael J. Wysocki 提交于
      Notice that one member of struct acpi_bus_ops, acpi_op_add, is not
      used anywhere any more and the relationship between its remaining
      members, acpi_op_match and acpi_op_start, is such that it doesn't
      make sense to set the latter without setting the former at the same
      time.  Therefore, replace struct acpi_bus_ops with new a enum type,
      enum acpi_bus_add_type, with three values, ACPI_BUS_ADD_BASIC,
      ACPI_BUS_ADD_MATCH, ACPI_BUS_ADD_START, corresponding to
      both acpi_op_match and acpi_op_start unset, acpi_op_match set and
      acpi_op_start unset, and both acpi_op_match and acpi_op_start set,
      respectively.
      Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
      Acked-by: NYinghai Lu <yinghai@kernel.org>
      Acked-by: NToshi Kani <toshi.kani@hp.com>
      a2d06a1a
    • R
      ACPI: Reduce the usage of struct acpi_bus_ops · ca7b3c4f
      Rafael J. Wysocki 提交于
      Objects of type struct acpi_bus_ops are currently used to pass
      information between different parts of the ACPI namespace scanning
      code, sometimes in quite convoluted ways.  It turns out that that
      is not necessary in some cases, so simplify the code by reducing
      the utilization of struct acpi_bus_ops objects where clearly
      possible.
      Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
      Acked-by: NYinghai Lu <yinghai@kernel.org>
      Acked-by: NToshi Kani <toshi.kani@hp.com>
      ca7b3c4f
    • R
      ACPI: Make acpi_bus_add() and acpi_bus_start() visibly different · 0fc300b0
      Rafael J. Wysocki 提交于
      The current ACPI namespace scanning code suggests that acpi_bus_add()
      and acpi_bus_start() share some code.  In fact, however, they are
      completely different code paths (except for the initial checks), so
      refactor the code to make that distinction visibly clear.
      Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
      Acked-by: NYinghai Lu <yinghai@kernel.org>
      Acked-by: NToshi Kani <toshi.kani@hp.com>
      0fc300b0
    • R
      ACPI: Change the ordering of PCI root bridge driver registrarion · 92ef2a25
      Rafael J. Wysocki 提交于
      Instead of running acpi_pci_root_init() from a separate subsys
      initcall, call it directly from acpi_scan_init() before scanning the
      ACPI namespace for the first time, so that the PCI root bridge
      driver's .add() routine, acpi_pci_root_start(), is always run
      before binding ACPI drivers or attaching "companion" device objects
      to struct acpi_device objects below the root bridge's device node in
      the ACPI namespace.
      
      The first, simpler reason for doing this is that it makes the
      situation during boot more similar to the situation during hotplug,
      in which the ACPI PCI root bridge driver is always present.
      
      The second reason is that acpi_pci_root_init() causes struct pci_dev
      objects to be created for all PCI devices below the bridge and
      these objects may be necessary for whatever is done with the other
      ACPI device nodes in that namespace scope.  For example, devices
      created by acpi_create_platform_device() sometimes may need to be
      added to the device hierarchy as children of PCI bridges.  For this
      purpose, however, the struct pci_dev objects representing those
      bridges need to exist before the platform devices in question are
      registered.
      Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
      Acked-by: NYinghai Lu <yinghai@kernel.org>
      Acked-by: NToshi Kani <toshi.kani@hp.com>
      92ef2a25
    • R
      ACPI: Separate adding ACPI device objects from probing ACPI drivers · 805d410f
      Rafael J. Wysocki 提交于
      Split the ACPI namespace scanning for devices into two passes, such
      that struct acpi_device objects are registerd in the first pass
      without probing ACPI drivers and the drivers are probed against them
      directly in the second pass.
      
      There are two main reasons for doing that.
      
      First, the ACPI PCI root bridge driver's .add() routine,
      acpi_pci_root_add(), causes struct pci_dev objects to be created for
      all PCI devices under the given root bridge.  Usually, there are
      corresponding ACPI device nodes in the ACPI namespace for some of
      those devices and therefore there should be "companion" struct
      acpi_device objects to attach those struct pci_dev objects to.  These
      struct acpi_device objects should exist when the corresponding
      struct pci_dev objects are created, but that is only guaranteed
      during boot and not during hotplug.  This leads to a number of
      functional differences between the boot and the hotplug cases which
      are not strictly necessary and make the code more complicated.
      
      For example, this forces the ACPI PCI root bridge driver to defer the
      registration of the just created struct pci_dev objects and to use a
      special .start() callback routine, acpi_pci_root_start(), to make
      sure that all of the "companion" struct acpi_device objects will be
      present at PCI devices registration time during hotplug.
      
      If those differences can be eliminated, we will be able to
      consolidate the boot and hotplug code paths for the enumeration and
      registration of PCI devices and to reduce the complexity of that
      code quite a bit.
      
      The second reason is that, in general, it should be possible to
      resolve conflicts of resources assigned by the BIOS to different
      devices represented by ACPI namespace nodes before any drivers bind
      to them and before they are attached to "companion" objects
      representing physical devices (such as struct pci_dev).  However, for
      this purpose we first need to enumerate all ACPI device nodes in the
      given namespace scope.
      Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
      Acked-by: NYinghai Lu <yinghai@kernel.org>
      Acked-by: NToshi Kani <toshi.kani@hp.com>
      805d410f
  7. 08 12月, 2012 1 次提交
  8. 05 12月, 2012 1 次提交
  9. 24 11月, 2012 1 次提交
  10. 22 11月, 2012 1 次提交
    • A
      ACPI / PM: Introduce os_accessible flag for power_state · 1399dfcd
      Aaron Lu 提交于
      Currently we have valid flag to represent if this ACPI device power
      state is valid. A device power state is valid does not necessarily
      mean we, as OSPM, has a mean to put the device into that power state,
      e.g. D3 cold is always a valid power state for any ACPI device, but if
      there is no _PS3 or _PRx for this device, we can't really put that
      device into D3 cold power state. The same is true for D0 power state.
      
      So here comes the os_accessible flag, which is only set if the device
      has provided us the required means to put it into that power state,
      e.g. if we have _PS3 or _PRx, we can put the device into D3 cold state
      and thus, D3 cold power state's os_accessible flag will be set in this
      case.
      
      And a new wrapper inline function is added to be used to check if
      firmware has provided us a way to power off the device during runtime.
      Signed-off-by: NAaron Lu <aaron.lu@intel.com>
      Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
      1399dfcd
  11. 21 11月, 2012 1 次提交
  12. 16 11月, 2012 1 次提交
  13. 15 11月, 2012 8 次提交
  14. 07 10月, 2012 1 次提交
    • L
      ACPI: Add new sysfs interface to export device description · d1efe3c3
      Lance Ortiz 提交于
      Add support to export the device description obtained from the ACPI _STR
      method, if one exists for a device, to user-space via a sysfs interface.
      This new interface provides a standard and platform neutral way for users
      to obtain the description text stored in the ACPI _STR method.  If no
      _STR method exists for the device, no sysfs 'description' file will be
      created.  The 'description' file will be located in the /sys/devices/
      directory using the device's path.
      
      /sys/device/<bus>/<bridge path>/<device path>.../firmware_node/description
      
      Example:
      
      /sys/devices/pci0000:00/0000:00.07.0/0000:0e:00.0/firmware_node/description
      
      It can also be located using the ACPI device path, for example:
      
      /sys/devices/LNXSYSTM:00/device:00/ACPI0004:00/PNP0A08:00/device:13/device:15/description
      /sys/devices/LNXSYSTM:00/device:00/ACPI0004:00/ACPI0004:01/ACPI0007:02/description
      
      Execute the 'cat' command on the 'description' file to obtain the
      description string for that device.
      
      This patch also includes documentation describing how the new sysfs
      interface works
      
      Changes from v1-v2 based on comments by Len Brown and Fengguang Wu
      * Removed output "No Description" and leaving a NULL attribute if the
      _STR method failed to evaluate.
      
      * In acpi_device_remove_files() removed the redundent check of
      dev->pnp.str_obj before calling free.  This check triggered a message
      from smatch.
      Signed-off-by: NLance Ortiz <lance.ortiz@hp.com>
      Signed-off-by: NLen Brown <len.brown@intel.com>
      d1efe3c3
  15. 22 9月, 2012 1 次提交
    • L
      ACPI: Allow ACPI binding with USB-3.0 hub · 1033f904
      Lan Tianyu 提交于
      A USB port's position and connectability can't be identified on some boards
      via USB hub registers. ACPI _UPC and _PLD can help to resolve this issue
      and so it is necessary to bind USB with ACPI. This patch is to allow ACPI
      binding with USB-3.0 hub.
      
      Current ACPI only can bind one struct-device to one ACPI device node.
      This can not work with USB-3.0 hub, because the USB-3.0 hub has two logical
      devices. Each works for USB-2.0 and USB-3.0 devices. In the Linux USB subsystem,
      those two logical hubs are treated as two seperate devices that have two struct
      devices. But in the ACPI DSDT, these two logical hubs share one ACPI device
      node. So there is a requirement to bind multi struct-devices to one ACPI
      device node. This patch is to resolve such problem.
      
      Following is the ACPI device nodes' description under xhci hcd.
      
      Device (XHC)
                  Device (RHUB)
                      Device (HSP1)
                      Device (HSP2)
                      Device (HSP3)
                      Device (HSP4)
                      Device (SSP1)
                      Device (SSP2)
                      Device (SSP3)
                      Device (SSP4)
      
      Topology in the Linux
      
      	device XHC
      	   USB-2.0 logical hub    USB-3.0 logical hub
      		HSP1			SSP1
      		HSP2			SSP2
      		HSP3			SSP3
      		HSP4			SSP4
      
      This patch also modifies the output of /proc/acpi/wakeup. One ACPI node
      can be associated with multiple devices:
      
      XHC		S4	*enabled	pci:0000:00:14.0
      RHUB	S0	disabled	usb:usb1
      			disabled	usb:usb2
      Signed-off-by: NLan Tianyu <tianyu.lan@intel.com>
      Acked-by: NSarah Sharp <sarah.a.sharp@linux.intel.com>
      Signed-off-by: NLen Brown <len.brown@intel.com>
      1033f904
  16. 01 7月, 2012 3 次提交
    • R
      ACPI / PM: Drop PM callbacks from the ACPI bus type · d91ee328
      Rafael J. Wysocki 提交于
      Since the ACPI bus type's PM callbacks only execute the driver ones
      without doing anything else, they can be dropped, because the driver
      callbacks will be executed by the PM core directly if bus type
      (or other subsystem) callbacks are not present.
      Signed-off-by: NRafael J. Wysocki <rjw@sisk.pl>
      d91ee328
    • R
      ACPI / PM: Do not execute legacy driver PM callbacks · 13db8552
      Rafael J. Wysocki 提交于
      Since all ACPI drivers in the tree should have been switched
      to power management handling based on struct dev_pm_ops,
      modify the ACPI bus type driver so that is doesn't execute
      legacy driver power management callbacks from the functions
      pointed to by the members of the acpi_bus_pm structure.
      Signed-off-by: NRafael J. Wysocki <rjw@sisk.pl>
      13db8552
    • R
      ACPI / PM: Make acpi_bus_type use driver struct dev_pm_ops callbacks · 67699c5f
      Rafael J. Wysocki 提交于
      Modify acpi_bus_type so that it executes PM callbacks provided
      by drivers through their struct dev_pm_ops objects, if present,
      while still allowing the legacy ACPI PM callbacks to take precedence.
      This will make it possible to convert ACPI drivers one by one to
      handling PM through struct dev_pm_ops instead of the legacy way.
      
      The code added by this change is temporary and will be removed
      when all of the drivers in question have been switched over to
      the PM handling based on struct dev_pm_ops.
      Signed-off-by: NRafael J. Wysocki <rjw@sisk.pl>
      67699c5f