1. 02 Mar, 2011 1 commit
    • Andres Salomon's avatar
      of/promtree: allow DT device matching by fixing 'name' brokenness (v5) · a74ea43d
      Andres Salomon authored
      Commit e2f2a93b
      
      , "of/promtree: add package-to-path support to pdt"
      changed dp->name from using the 'name' property to using
      package-to-path.  This fixed /proc/device-tree creation by eliminating
      conflicts between names (the 'name' property provides names like
      'battery', whereas package-to-path provides names like
      '/foo/bar/battery@0', which we stripped to 'battery@0').  However, it
      also breaks of_device_id table matching.
      
      The fix that we _really_ wanted was to keep dp->name based upon
      the name property ('battery'), but based dp->full_name upon
      package-to-path ('battery@0').  This patch does just that.
      
      This changes all users (except SPARC) of promtree to use the full
      result from package-to-path for full_name, rather than stripping the
      directory out.  In practice, the strings end up being exactly the
      same; this change saves time, code, and memory.
      
      SPARC continues to use the existing build_path_component() code.
      
      v2: combine two patches and revert of_pdt_node_name to original version
      v3: use dp->phandle instead of passing around node
      v4: warn/bail out for non-sparc archs if pkg2path is not set
      v5: split of_pdt_build_full_name into sparc & non-sparc versions
      v6: Pass NULL to pkg2path before buf gets assigned.
          Drop check for pkg2path hook on each and every node.
      v7: Don't BUG() when unable to get the full_path; create a
          known-unique name instead.
      Signed-off-by: default avatarAndres Salomon <dilinger@queued.net>
      Signed-off-by: default avatarGrant Likely <grant.likely@secretlab.ca>
      a74ea43d
  2. 16 Jan, 2011 1 commit
  3. 03 Jan, 2011 1 commit
    • Grant Likely's avatar
      of/device: Don't register disabled devices · cd1e6504
      Grant Likely authored
      
      Device nodes with the property status="disabled" are not usable and so
      don't register them when parsing the device tree for devices.
      Signed-off-by: default avatarGrant Likely <grant.likely@secretlab.ca>
      Cc: Hollis Blanchard <hollis_blanchard@mentor.com>
      Cc: Deepak Saxena <deepak_saxena@mentor.com>
      Cc: Scott Wood <scottwood@freescale.com>,
      Cc: David Gibson <david@gibson.dropbear.id.au>
      Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
      cd1e6504
  4. 01 Jan, 2011 1 commit
  5. 30 Dec, 2010 2 commits
  6. 29 Dec, 2010 3 commits
  7. 24 Dec, 2010 2 commits
    • David Daney's avatar
      of/i2c: Fix request module by alias · 02086264
      David Daney authored
      
      If we are registering an i2c device that has a device tree node like
      this real-world example:
      
            rtc@68 {
              compatible = "dallas,ds1337";
              reg = <0x68>;
            };
      
      of_i2c_register_devices() will try to load a module called ds1337.ko.
      There is no such module, so it will fail.  If we look in modules.alias
      we will find entries like these:
      
      .
      .
      .
      alias i2c:ds1339 rtc_ds1307
      alias i2c:ds1338 rtc_ds1307
      alias i2c:ds1337 rtc_ds1307
      alias i2c:ds1307 rtc_ds1307
      alias i2c:ds1374 rtc_ds1374
      .
      .
      .
      
      The module we want is really called rtc_ds1307.ko.  If we request a
      module called "i2c:ds1337", the userspace module loader will do the
      right thing (unless it is busybox) and load rtc_ds1307.ko.  So we add
      the I2C_MODULE_PREFIX to the request_module() string.
      Signed-off-by: default avatarDavid Daney <ddaney@caviumnetworks.com>
      Signed-off-by: default avatarGrant Likely <grant.likely@secretlab.ca>
      02086264
    • David Daney's avatar
      of/mdio: Fix some endianness problems. · 19458860
      David Daney authored
      
      In of_mdiobus_register(), the __be32 *addr variable is dereferenced.
      This will not work on little-endian targets.  Also since it is
      unsigned, checking for less than zero is redundant.
      
      Fix these two issues.
      Signed-off-by: default avatarDavid Daney <ddaney@caviumnetworks.com>
      [grant.likely@secretlab.ca: removed goto]
      Signed-off-by: default avatarGrant Likely <grant.likely@secretlab.ca>
      19458860
  8. 23 Dec, 2010 1 commit
  9. 09 Dec, 2010 1 commit
  10. 01 Nov, 2010 1 commit
  11. 21 Oct, 2010 3 commits
    • David Daney's avatar
      of/mips: Cleanup some include directives/files. · 4c60071c
      David Daney authored
      
      The __init directives should go on the definitions of things, not the
      declaration, also __init is meaningless for inline functions, so
      remove it from prom.h.  This allows us to get rid of a useless
      #include, but most of the rest of them are useless too, so kill them
      as well.
      
      If of_i2c.c needs irq definitions, it should include linux/irq.h
      directly, not assume indirect inclusion via asm/prom.h.
      Signed-off-by: default avatarDavid Daney <ddaney@caviumnetworks.com>
      Acked-by: default avatarRalf Baechle <ralf@linux-mips.org>
      Signed-off-by: default avatarGrant Likely <grant.likely@secretlab.ca>
      4c60071c
    • Grant Likely's avatar
      of/flattree: Eliminate need to provide early_init_dt_scan_chosen_arch · 32c97689
      Grant Likely authored
      
      This patch refactors the early init parsing of the chosen node so that
      architectures aren't forced to provide an empty implementation of
      early_init_dt_scan_chosen_arch.  Instead, if an architecture wants to
      do something different, it can either use a wrapper function around
      early_init_dt_scan_chosen(), or it can replace it altogether.
      
      This patch was written in preparation to adding device tree support to
      both x86 ad MIPS.
      Signed-off-by: default avatarGrant Likely <grant.likely@secretlab.ca>
      Tested-by: default avatarDavid Daney <ddaney@caviumnetworks.com>
      32c97689
    • Grant Likely's avatar
      of/device: Rework to use common platform_device_alloc() for allocating devices · 7096d042
      Grant Likely authored
      
      The current code allocates and manages platform_devices created from
      the device tree manually.  It also uses an unsafe shortcut for
      allocating the platform_device and the resource table at the same
      time. (which I added in the last rework; sorry).
      
      This patch refactors the code to use platform_device_alloc() for
      allocating new devices.  This reduces the amount of custom code
      implemented by of_platform, eliminates the unsafe alloc trick, and has
      the side benefit of letting the platform_bus code manage freeing the
      device data and resources when the device is freed.
      Signed-off-by: default avatarGrant Likely <grant.likely@secretlab.ca>
      Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
      Cc: Greg Kroah-Hartman <gregkh@suse.de>
      Cc: "David S. Miller" <davem@davemloft.net>
      Cc: Michal Simek <monstr@monstr.eu>
      7096d042
  12. 13 Oct, 2010 5 commits
  13. 11 Oct, 2010 1 commit
  14. 09 Oct, 2010 1 commit
  15. 06 Aug, 2010 1 commit
  16. 01 Aug, 2010 1 commit
    • Grant Likely's avatar
      of/platform: Register of_platform_drivers with an "of:" prefix · 7fb8f881
      Grant Likely authored
      Currently there are some drivers in tree which register both a
      platform_driver and an of_platform_driver with the same name.  This is
      a temporary situation until all the relevant of_platform_drivers are
      converted to be normal platform_drivers.  Until then, this patch gives
      all the of_platform_drivers an "of:" prefix to protect against bogus
      matches and namespace conflicts.
      7fb8f881
  17. 30 Jul, 2010 2 commits
  18. 24 Jul, 2010 8 commits
  19. 19 Jul, 2010 2 commits
  20. 15 Jul, 2010 2 commits