1. 03 6月, 2019 2 次提交
  2. 18 4月, 2019 1 次提交
    • S
      device property: Add fwnode_graph_get_endpoint_by_id() · 0fcc2bdc
      Sakari Ailus 提交于
      fwnode_graph_get_endpoint_by_id() is intended for obtaining local
      endpoints by a given local port.
      
      fwnode_graph_get_endpoint_by_id() is slightly different from its OF
      counterpart, of_graph_get_endpoint_by_regs(): instead of using -1 as
      a value to indicate that a port or an endpoint number does not matter,
      it uses flags to look for equal or greater endpoint. The port number
      is always fixed. It also returns only remote endpoints that belong
      to an available device, a behaviour that can be turned off with a flag.
      Signed-off-by: NSakari Ailus <sakari.ailus@linux.intel.com>
      [ rjw: Changelog ]
      Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
      0fcc2bdc
  3. 29 1月, 2019 1 次提交
  4. 27 11月, 2018 1 次提交
    • H
      drivers: base: Introducing software nodes to the firmware node framework · 59abd836
      Heikki Krogerus 提交于
      Software node is a new struct fwnode_handle type that can be
      used to describe devices in kernel (software). It is meant
      to complement fwnodes representing real firmware nodes when
      they are incomplete (for example missing device properties)
      and to supply the primary fwnode when the firmware lacks
      hardware description for a device completely.
      
      The software node type is really meant to replace the
      currently used "property_set" struct fwnode_handle type. The
      handling of struct property_set is glued to the generic
      device property handling code, and it is not possible to
      create a struct property_set independently from the device
      that it is bind to. struct property_set is only created when
      device properties are added to already initialized struct
      device, and control of it is only possible from the generic
      property handling code.
      
      Software nodes are instead designed to be created
      independently from the device entries (struct device). It
      makes them much more flexible, as then the device meant to
      be bind to the node can be created at a later time, and from
      another location. It is also possible to bind multiple
      devices to a single software node if needed.
      
      The software node implementation also includes support for
      node hierarchy, which was the main motivation for this
      commit. The node hierarchy was something that was requested
      for the struct property_set, but it did not seem reasonable
      to try to extend the property_set support for that purpose.
      struct property_set was really meant only for device
      property handling like the name suggests.
      
      Support for struct property_set is not yet removed in this
      commit, but it will be in the following one.
      Signed-off-by: NHeikki Krogerus <heikki.krogerus@linux.intel.com>
      Acked-by: NLinus Walleij <linus.walleij@linaro.org>
      Reviewed-by: NAndy Shevchenko <andriy.shevchenko@linux.intel.com>
      Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
      59abd836
  5. 17 5月, 2018 1 次提交
    • A
      device property: Get rid of union aliasing · 63dcc709
      Andy Shevchenko 提交于
      Commit 318a1971 (device property: refactor built-in properties
      support) went way too far and brought a union aliasing. Partially
      revert it here to get rid of union aliasing.
      
      Note, all Apple properties are considered as u8 arrays. To get a value
      of any of them the caller must use device_property_read_u8_array().
      
      What's union aliasing?
      ~~~~~~~~~~~~~~~~~~~~~~
      
      The C99 standard in section 6.2.5 paragraph 20 defines union type as
      "an overlapping nonempty set of member objects". It also states in
      section 6.7.2.1 paragraph 14 that "the value of at most one of the
      members can be stored in a union object at any time'.
      
      Union aliasing is a type punning mechanism using union members to store
      as one type and read back as another.
      
      Why it's not good?
      ~~~~~~~~~~~~~~~~~~
      
      Section 6.2.6.1 paragraph 6 says that a union object may not be a trap
      representation, although its member objects may be.
      
      Meanwhile annex J.1 says that "the value of a union member other than
      the last one stored into" is unspecified [removed in C11].
      
      In TC3, a footnote is added which specifies that accessing a member of a
      union other than the last one stored causes "the object representation"
      to be re-interpreted in the new type and specifically refers to this as
      "type punning". This conflicts to some degree with Annex J.1.
      
      While it's working in Linux with GCC, the use of union members to do
      type punning is not clear area in the C standard and might lead to
      unspecified behaviour.
      
      More information is available in this [1] blog post.
      
      [1]: https://davmac.wordpress.com/2010/02/26/c99-revisited/Signed-off-by: NAndy Shevchenko <andriy.shevchenko@linux.intel.com>
      Acked-by: NArd Biesheuvel <ard.biesheuvel@linaro.org>
      Reviewed-by: NMika Westerberg <mika.westerberg@linux.intel.com>
      Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
      63dcc709
  6. 12 2月, 2018 1 次提交
  7. 25 1月, 2018 1 次提交
  8. 22 1月, 2018 4 次提交
    • M
      device property: Allow iterating over available child fwnodes · 3395de96
      Marcin Wojtas 提交于
      Implement a new helper function fwnode_get_next_available_child_node(),
      which enables obtaining next enabled child fwnode, which
      works on a similar basis to OF's of_get_next_available_child().
      
      This commit also introduces a macro, thanks to which it is
      possible to iterate over the available fwnodes, using the
      new function described above.
      Signed-off-by: NMarcin Wojtas <mw@semihalf.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      3395de96
    • M
      device property: Introduce fwnode_irq_get() · 7c6c57f2
      Marcin Wojtas 提交于
      Until now there were two very similar functions allowing
      to get Linux IRQ number from ACPI handle (acpi_irq_get())
      and OF node (of_irq_get()). The first one appeared to be used
      only as a subroutine of platform_irq_get(), which (in the generic
      code) limited IRQ obtaining from _CRS method only to nodes
      associated to kernel's struct platform_device.
      
      This patch introduces a new helper routine - fwnode_irq_get(),
      which allows to get the IRQ number directly from the fwnode
      to be used as common for OF/ACPI worlds. It is usable not
      only for the parents fwnodes, but also for the child nodes
      comprising their own _CRS methods with interrupts description.
      
      In order to be able o satisfy compilation with !CONFIG_ACPI
      and also simplify the new code, introduce a helper macro
      (ACPI_HANDLE_FWNODE), with which it is possible to reach
      an ACPI handle directly from its fwnode.
      Signed-off-by: NMarcin Wojtas <mw@semihalf.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      7c6c57f2
    • M
      device property: Introduce fwnode_get_phy_mode() · b28f263b
      Marcin Wojtas 提交于
      Until now there were two almost identical functions for
      obtaining network PHY mode - of_get_phy_mode() and,
      more generic, device_get_phy_mode(). However it is not uncommon,
      that the network interface is represented as a child
      of the actual controller, hence it is not associated
      directly to any struct device, required by the latter
      routine.
      
      This commit allows for getting the PHY mode for
      children nodes in the ACPI world by introducing a new function -
      fwnode_get_phy_mode(). This commit also changes
      device_get_phy_mode() routine to be its wrapper, in order
      to prevent unnecessary duplication.
      Signed-off-by: NMarcin Wojtas <mw@semihalf.com>
      Acked-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      b28f263b
    • M
      device property: Introduce fwnode_get_mac_address() · babe2dbb
      Marcin Wojtas 提交于
      Until now there were two almost identical functions for
      obtaining MAC address - of_get_mac_address() and, more generic,
      device_get_mac_address(). However it is not uncommon,
      that the network interface is represented as a child
      of the actual controller, hence it is not associated
      directly to any struct device, required by the latter
      routine.
      
      This commit allows for getting the MAC address for
      children nodes in the ACPI world by introducing a new function -
      fwnode_get_mac_address(). This commit also changes
      device_get_mac_address() routine to be its wrapper, in order
      to prevent unnecessary duplication.
      Signed-off-by: NMarcin Wojtas <mw@semihalf.com>
      Acked-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      babe2dbb
  9. 13 12月, 2017 1 次提交
  10. 09 11月, 2017 2 次提交
  11. 22 7月, 2017 2 次提交
  12. 22 6月, 2017 3 次提交
  13. 29 3月, 2017 8 次提交
  14. 07 2月, 2017 3 次提交
  15. 01 10月, 2016 1 次提交
  16. 26 6月, 2016 1 次提交
  17. 09 4月, 2016 1 次提交
  18. 01 1月, 2016 2 次提交
  19. 07 12月, 2015 4 次提交