15 May, 2008

1 commit

  • Update function of_find_property() to return NULL if the device_node
    passed to it is also NULL. Otherwise, passing NULL will cause a null
    pointer dereference.

    Without this, the legacy_serial driver will crash if there's no
    'chosen' node in the device tree.

    Signed-off-by: Timur Tabi
    Signed-off-by: Paul Mackerras

    Timur Tabi
     

24 Apr, 2008

1 commit


20 Apr, 2008

1 commit

  • Fix build breakage introduced in commit "[POWERPC] i2c: OF helpers for
    the i2c API". If i2c-core is compiled as a module, the helper needs
    to be compiled as a module, as well. Rename i2c.c to of_i2c.c to
    avoid name space conflict.

    [paulus@samba.org: Changed dependency from OF to PPC_OF to avoid
    sparc{32,64} allmodconfig breakage.]

    Signed-off-by: Jochen Friedrich
    Signed-off-by: Paul Mackerras

    Jochen Friedrich
     

17 Apr, 2008

2 commits

  • This implements various helpers to support OF bindings for the i2c
    API.

    Signed-off-by: Jochen Friedrich
    Acked-by: David S. Miller
    Acked-by: Stephen Rothwell
    Signed-off-by: Paul Mackerras

    Jochen Friedrich
     
  • This implements various helpers to support OF bindings for the GPIO
    LIB API.

    Previously this was PowerPC specific, but it seems this code isn't
    arch-dependent anyhow, so let's place it into of/.

    SPARC will not see this addition yet, real hardware seem to not use
    GPIOs at all. But this might change:

    http://www.leox.org/docs/faq_MLleon.html

    "16-bit I/O port" sounds promising. :-)

    Signed-off-by: Anton Vorontsov
    Acked-by: Grant Likely
    Signed-off-by: Paul Mackerras

    Anton Vorontsov
     

07 Apr, 2008

1 commit

  • IEEE 1275 defined a standard "status" property to indicate the operational
    status of a device. The property has four possible values: okay, disabled,
    fail, fail-xxx. The absence of this property means the operational status
    of the device is unknown or okay.

    This adds a function called of_device_is_available that checks the state
    of the status property of a device. If the property is absent or set to
    either "okay" or "ok", it returns 1. Otherwise it returns 0.

    Signed-off-by: Josh Boyer
    Signed-off-by: Paul Mackerras

    Josh Boyer
     

06 Feb, 2008

2 commits

  • Although of_platform_device's can have a shutdown routine, at the moment
    the bus code doesn't actually call it. So add the required glue to
    hook the shutdown routine.

    Signed-off-by: Michael Ellerman
    Acked-by: Benjamin Herrenschmidt
    Signed-off-by: Paul Mackerras

    Michael Ellerman
     
  • Iterating through a device node's parents is simple enough, but dealing
    with the refcounts properly is a little ugly, and replicating that logic
    is asking for someone to get it wrong or forget it all together, eg:

    while (dn != NULL) {
    /* loop body */
    tmp = of_get_parent(dn);
    of_node_put(dn);
    dn = tmp;
    }

    So add of_get_next_parent(), inspired by of_get_next_child(). The
    contract is that it returns the parent and drops the reference on the
    current node, this makes the loop look like:

    while (dn != NULL) {
    /* loop body */
    dn = of_get_next_parent(dn);
    }

    Signed-off-by: Michael Ellerman
    Acked-by: David S. Miller
    Signed-off-by: Paul Mackerras

    Michael Ellerman
     

17 Jan, 2008

1 commit

  • Similar to of_find_compatible_node(), of_find_matching_node() and
    for_each_matching_node() allow you to iterate over the device tree
    looking for specific nodes, except that they take of_device_id
    tables instead of strings.

    This also moves of_match_node() from driver/of/device.c to
    driver/of/base.c to colocate it with the of_find_matching_node which
    depends on it.

    Signed-off-by: Grant Likely
    Signed-off-by: Paul Mackerras

    Grant Likely
     

18 Oct, 2007

1 commit


20 Jul, 2007

9 commits

  • and populate it with the common parts from PowerPC and Sparc[64].

    Signed-off-by: Stephen Rothwell
    Acked-by: Paul Mackerras
    Acked-by: David S. Miller

    Stephen Rothwell
     
  • This just moves the common stuff from the arch of_device.h files to
    linux/of_device.h.

    Signed-off-by: Stephen Rothwell
    Acked-by: Paul Mackerras
    Acked-by: David S. Miller

    Stephen Rothwell
     
  • This moves all the common parts for the Sparc, Sparc64 and PowerPC
    of_device.c files into drivers/of/device.c.

    Apart from the simple move, Sparc gains of_match_node() and a call to
    of_node_put in of_release_dev(). PowerPC gains better recovery if
    device_create_file() fails in of_device_register().

    Signed-off-by: Stephen Rothwell
    Acked-by: Paul Mackerras
    Acked-by: David S. Miller

    Stephen Rothwell
     
  • This consolidates the routines of_find_node_by_path, of_find_node_by_name,
    of_find_node_by_type and of_find_compatible_device. Again, the comparison
    of strings are done differently by Sparc and PowerPC and also these add
    read_locks around the iterations.

    Signed-off-by: Stephen Rothwell
    Acked-by: Paul Mackerras
    Acked-by: David S. Miller

    Stephen Rothwell
     
  • This adds a read_lock around the child/next accesses on Sparc.

    Signed-off-by: Stephen Rothwell
    Acked-by: Paul Mackerras
    Acked-by: David S. Miller

    Stephen Rothwell
     
  • This requires creating dummy of_node_{get,put} routines for sparc and
    sparc64. It also adds a read_lock around the parent accesses.

    Signed-off-by: Stephen Rothwell
    Acked-by: Paul Mackerras
    Acked-by: David S. Miller

    Stephen Rothwell
     
  • The only change here is that a readlock is taken while the property list
    is being traversed on Sparc where it was not taken previously.

    Also, Sparc uses strcasecmp to compare property names while PowerPC
    uses strcmp.

    Signed-off-by: Stephen Rothwell
    Acked-by: Paul Mackerras
    Acked-by: David S. Miller

    Stephen Rothwell
     
  • The only difference here is that Sparc uses strncmp to match compatibility
    names while PowerPC uses strncasecmp.

    Signed-off-by: Stephen Rothwell
    Acked-by: Paul Mackerras
    Acked-by: David S. Miller

    Stephen Rothwell
     
  • This creates drivers/of/base.c (depending on CONFIG_OF) and puts
    the first trivially common bits from the prom.c files into it.

    Signed-off-by: Stephen Rothwell
    Acked-by: Paul Mackerras
    Acked-by: David S. Miller

    Stephen Rothwell