01 Oct, 2016

1 commit

  • This fixes commit d76eebfa175e ("include/linux/property.h: fix build
    issues with gcc-4.4.4").

    With that commit we get the following compile error when using the
    PROPERTY_ENTRY_INTEGER_ARRAY macro.

    include/linux/property.h:201:39: error: `u32_data' undeclared (first
    use in this function)
    PROPERTY_ENTRY_INTEGER_ARRAY(_name_, u32, _val_)
    ^
    include/linux/property.h:193:17: note: in definition of macro
    `PROPERTY_ENTRY_INTEGER_ARRAY'
    { .pointer = { _type_##_data = _val_ } }, \
    ^

    This needs a '.' to reference the union member. It seems this was just
    overlooked here since it is done correctly in similar constructs in
    other parts of the original commit.

    This fix is in preparation of upcoming commits that will use this macro.

    Fixes: commit d76eebfa175e ("include/linux/property.h: fix build issues with gcc-4.4.4")
    Link: http://lkml.kernel.org/r/2de3b929290d88a723ed829a3e3cbd02044714df.1475114627.git.johnyoun@synopsys.com
    Signed-off-by: John Youn
    Cc: "Rafael J. Wysocki"
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    John Youn
     

26 Jun, 2016

1 commit

  • For device nodes in both DT and ACPI, it possible to have named
    child nodes which contain properties (an existing example being
    gpio-leds). This adds a function to find a named child node for
    a device which can be used by drivers for property retrieval.

    For DT data node name matching, of_node_cmp() and similar functions
    are made available outside of CONFIG_OF block so the new function
    can reference these for DT and non-DT builds.

    For ACPI data node name matching, a helper function is also added
    which returns false if CONFIG_ACPI is not set, otherwise it
    performs a string comparison on the data node name. This avoids
    using the acpi_data_node struct for non CONFIG_ACPI builds,
    which would otherwise cause a build failure.

    Signed-off-by: Adam Thomson
    Acked-by: Sathyanarayana Nujella
    Acked-by: Rob Herring
    Acked-by: Rafael J. Wysocki
    Signed-off-by: Mark Brown

    Adam Thomson
     

09 Apr, 2016

1 commit

  • Since device_add_property_set() now always takes a copy of
    the property_set, and also since the fwnode type is always
    hard coded to be FWNODE_PDATA, there is no need for the
    drivers to deliver the entire struct property_set. The
    function can just create the instance of it on its own and
    bind the properties from the drivers to it on the spot.

    This renames device_add_property_set() to
    device_add_properties(). The function now takes struct
    property_entry as its parameter instead of struct
    property_set.

    Reviewed-by: Andy Shevchenko
    Reviewed-by: Mika Westerberg
    Acked-by: Thierry Reding
    Acked-by: Lee Jones
    Signed-off-by: Heikki Krogerus
    Signed-off-by: Rafael J. Wysocki

    Heikki Krogerus
     

01 Jan, 2016

2 commits


07 Dec, 2015

5 commits


07 Nov, 2015

3 commits

  • These DMA APIs are replaced with the newer versions, which return
    the enum dev_dma_attr. So, we can safely remove them.

    Signed-off-by: Suravee Suthikulpanit
    Acked-by: Bjorn Helgaas
    Reviewed-by: Hanjun Guo
    Signed-off-by: Rafael J. Wysocki

    Suthikulpanit, Suravee
     
  • The function device_dma_is_coherent() does not sufficiently
    communicate device DMA attributes. Instead, this patch introduces
    device_get_dma_attr(), which returns enum dev_dma_attr.
    It replaces the acpi_check_dma(), which will be removed in
    subsequent patch.

    This also provides a convenient function, device_dma_supported(),
    to check DMA support of the specified device.

    Signed-off-by: Suravee Suthikulpanit
    Acked-by: Bjorn Helgaas
    Reviewed-by: Hanjun Guo
    Signed-off-by: Rafael J. Wysocki

    Suthikulpanit, Suravee
     
  • A device could have one of the following DMA attributes:
    * DMA not supported
    * DMA non-coherent
    * DMA coherent

    So, this patch introduces enum dev_dma_attribute. This will be used by
    new APIs introduced in later patches.

    Signed-off-by: Suravee Suthikulpanit
    Acked-by: Bjorn Helgaas
    Reviewed-by: Hanjun Guo
    Signed-off-by: Rafael J. Wysocki

    Suthikulpanit, Suravee
     

25 Sep, 2015

1 commit

  • Sometimes it is useful to be able to extract an index of certain string
    value from an array of strings. A typical use case is to give a name to a
    DMA channel, PWM, clock and so on.

    Provide an implementation using unified device property accessors that
    follows of_property_match_string() but works for all supported fwnodes.

    Signed-off-by: Mika Westerberg
    Signed-off-by: Rafael J. Wysocki

    Mika Westerberg
     

14 Aug, 2015

1 commit

  • OF has some helper functions for parsing MAC and PHY settings.
    In cases where the platform is providing this information rather
    than the device itself, there needs to be similar functions for ACPI.

    These functions are slightly modified versions of the ones in
    of_net which can use information provided via DT or ACPI.

    Signed-off-by: Jeremy Linton
    Signed-off-by: David S. Miller

    Jeremy Linton
     

15 Jun, 2015

1 commit

  • Currently, device drivers, which support both OF and ACPI,
    need to call two separate APIs, of_dma_is_coherent() and
    acpi_dma_is_coherent()) to determine device coherency attribute.

    This patch simplifies this process by introducing a new device
    property API, device_dma_is_coherent(), which calls the appropriate
    interface based on the booting architecture.

    Signed-off-by: Suravee Suthikulpanit
    Signed-off-by: Rafael J. Wysocki

    Suthikulpanit, Suravee
     

04 Apr, 2015

1 commit

  • Introduce data structures and code allowing "built-in" properties
    to be associated with devices in such a way that they will be used
    by the device_property_* API if no proper firmware node (neither DT
    nor ACPI) is present for the given device.

    Each property is to be represented by a property_entry structure.
    An array of property_entry structures (terminated with a null
    entry) can be pointed to by the properties field of struct
    property_set that can be added as a firmware node to a struct
    device using device_add_property_set(). That will cause the
    device_property_* API to use that property_set as the source
    of properties if the given device does not have a DT node or
    an ACPI companion device object associated with it.

    Signed-off-by: Rafael J. Wysocki
    Tested-by: Heikki Krogerus
    Acked-by: Greg Kroah-Hartman

    Rafael J. Wysocki
     

17 Mar, 2015

1 commit

  • Now that we have struct fwnode_handle, we can use that to point to
    ACPI companions from struct device objects instead of pointing to
    struct acpi_device directly.

    There are two benefits from that. First, the somewhat ugly and
    hackish struct acpi_dev_node can be dropped and, second, the same
    struct fwnode_handle pointer can be used in the future to point
    to other (non-ACPI) firmware device node types.

    Signed-off-by: Rafael J. Wysocki
    Acked-by: Greg Kroah-Hartman
    Acked-by: Grant Likely

    Rafael J. Wysocki
     

05 Nov, 2014

2 commits

  • 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: Grant Likely
    Acked-by: Greg Kroah-Hartman
    Acked-by: Grant Likely
    Signed-off-by: Rafael J. Wysocki

    Rafael J. Wysocki
     
  • Add a uniform interface by which device drivers can request device
    properties from the platform firmware by providing a property name
    and the corresponding data type. The purpose of it is to help to
    write portable code that won't depend on any particular platform
    firmware interface.

    The following general helper functions are added:

    device_property_present()
    device_property_read_u8()
    device_property_read_u16()
    device_property_read_u32()
    device_property_read_u64()
    device_property_read_string()
    device_property_read_u8_array()
    device_property_read_u16_array()
    device_property_read_u32_array()
    device_property_read_u64_array()
    device_property_read_string_array()

    The first one allows the caller to check if the given property is
    present. The next 5 of them allow single-valued properties of
    various types to be retrieved in a uniform way. The remaining 5 are
    for reading properties with multiple values (arrays of either numbers
    or strings).

    The interface covers both ACPI and Device Trees.

    This change set includes material from Mika Westerberg and Aaron Lu.

    Signed-off-by: Aaron Lu
    Signed-off-by: Mika Westerberg
    Acked-by: Greg Kroah-Hartman
    Acked-by: Grant Likely
    Signed-off-by: Rafael J. Wysocki

    Rafael J. Wysocki