1. 06 7月, 2010 26 次提交
    • G
      of: refactor of_modalias_node() and remove explicit match table. · 2ffe8c5f
      Grant Likely 提交于
      This patch tightens up the behaviour of of_modalias_node() to be more
      predicatable and to eliminate the explicit of_modalias_tablep[] that
      is currently used to override the first entry in the compatible list
      of a device.  The override table was needed originally because spi
      and i2c drivers had no way to do of-style matching.  Now that all
      devices can have an of_node pointer, and all drivers can have an
      of_match_table, the explicit override table is no longer needed
      because each driver can specify its own OF-style match data.
      
      The mpc8349emitx-mcu driver is modified to explicitly specify the
      correct device to bind against.
      Signed-off-by: NGrant Likely <grant.likely@secretlab.ca>
      2ffe8c5f
    • G
      i2c: Add OF-style registration and binding · 959e85f7
      Grant Likely 提交于
      This patch adds OF hooks to the i2c core so that devices can automatically
      be registered based on device tree data.
      Signed-off-by: NGrant Likely <grant.likely@secretlab.ca>
      959e85f7
    • G
      of/i2c: Generalize OF support · 9fd04992
      Grant Likely 提交于
      This patch cleans up the i2c OF support code to make it selectable by
      all architectures and allow for automatic registration of i2c devices.
      Signed-off-by: NGrant Likely <grant.likely@secretlab.ca>
      9fd04992
    • R
      niu: always include of_device.h · 4f0ddcb0
      Randy Dunlap 提交于
      The niu driver uses struct of_device when built on any arch, not
      only SPARC64, so always #include <linux/of_device.h>.
      
      drivers/net/niu.c:9700: warning: 'struct of_device' declared inside parameter list
      drivers/net/niu.c:9700: warning: its scope is only this definition or declaration, which is probably not what you want
      drivers/net/niu.c:9716: warning: assignment from incompatible pointer type
      Signed-off-by: NRandy Dunlap <randy.dunlap@oracle.com>
      Acked-by: NDave S. Miller <davem@davemloft.net>
      Signed-off-by: NGrant Likely <grant.likely@secretlab.ca>
      4f0ddcb0
    • G
      of/device: Move struct of_device define outside of CONFIG_OF_DEVICE test · f9f5a466
      Grant Likely 提交于
      Some code uses of_device even when CONFIG_OF_DEVICE is not set.  This
      patch makes of_device valid all the time by moving it outside of the
      ifdef CONFIG_OF_DEVICE test.
      Reported-by: NRandy Dunlap <randy.dunlap@oracle.com>
      Signed-off-by: NGrant Likely <grant.likely@secretlab.ca>
      Acked-by: NRandy Dunlap <randy.dunlap@oracle.com>
      f9f5a466
    • G
      of/device: Add OF style matching helper function · 8cec0e7b
      Grant Likely 提交于
      Add of_driver_match_device() helper function.  This function can be used
      by bus types to determine if a driver works with a device when using OF
      style matching.  If CONFIG_OF is unselected, then it is a nop.
      Signed-off-by: NGrant Likely <grant.likely@secretlab.ca>
      CC: Greg Kroah-Hartman <gregkh@suse.de>
      CC: Michal Simek <monstr@monstr.eu>
      CC: Grant Likely <grant.likely@secretlab.ca>
      CC: Benjamin Herrenschmidt <benh@kernel.crashing.org>
      CC: Stephen Rothwell <sfr@canb.auug.org.au>
      CC: linux-kernel@vger.kernel.org
      CC: microblaze-uclinux@itee.uq.edu.au
      CC: linuxppc-dev@ozlabs.org
      CC: devicetree-discuss@lists.ozlabs.org
      8cec0e7b
    • G
      of/gpio: fix of_gpio includes · 2e13cba8
      Grant Likely 提交于
      drivers/of/gpio.c is missing includes for of_irq and struct device which
      cause build failures on ARM.  This patch adds the correct include files
      and removes the unneeded kernel.h include
      Signed-off-by: NGrant Likely <grant.likely@secretlab.ca>
      2e13cba8
    • A
      of/gpio: add default of_xlate function if device has a node pointer · 391c970c
      Anton Vorontsov 提交于
      Implement generic OF gpio hooks and thus make device-enabled GPIO chips
      (i.e.  the ones that have gpio_chip->dev specified) automatically attach
      to the OpenFirmware subsystem.  Which means that now we can handle I2C and
      SPI GPIO chips almost* transparently.
      
      * "Almost" because some chips still require platform data, and for these
        chips OF-glue is still needed, though with this change the glue will
        be much smaller.
      Signed-off-by: NAnton Vorontsov <avorontsov@ru.mvista.com>
      Signed-off-by: NGrant Likely <grant.likely@secretlab.ca>
      Cc: David Brownell <dbrownell@users.sourceforge.net>
      Cc: Bill Gatliff <bgat@billgatliff.com>
      Cc: Dmitry Eremin-Solenikov <dbaryshkov@gmail.com>
      Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
      Cc: Jean Delvare <khali@linux-fr.org>
      Cc: Andrew Morton <akpm@linux-foundation.org>
      CC: linux-kernel@vger.kernel.org
      CC: devicetree-discuss@lists.ozlabs.org
      391c970c
    • G
      of/gpio: stop using device_node data pointer to find gpio_chip · 594fa265
      Grant Likely 提交于
      Currently the kernel uses the struct device_node.data pointer to resolve
      a struct gpio_chip pointer from a device tree node.  However, the .data
      member doesn't provide any type checking and there aren't any rules
      enforced on what it should be used for.  There's no guarantee that the
      data stored in it actually points to an gpio_chip pointer.
      
      Instead of relying on the .data pointer, this patch modifies the code
      to add a lookup function which scans through the registered gpio_chips
      and returns the gpio_chip that has a pointer to the specified
      device_node.
      Signed-off-by: NGrant Likely <grant.likely@secretlab.ca>
      CC: Andrew Morton <akpm@linux-foundation.org>
      CC: Anton Vorontsov <avorontsov@ru.mvista.com>
      CC: Grant Likely <grant.likely@secretlab.ca>
      CC: David Brownell <dbrownell@users.sourceforge.net>
      CC: Bill Gatliff <bgat@billgatliff.com>
      CC: Dmitry Eremin-Solenikov <dbaryshkov@gmail.com>
      CC: Benjamin Herrenschmidt <benh@kernel.crashing.org>
      CC: Jean Delvare <khali@linux-fr.org>
      CC: linux-kernel@vger.kernel.org
      CC: devicetree-discuss@lists.ozlabs.org
      594fa265
    • A
      of/gpio: Kill of_gpio_chip and add members directly to gpio_chip · a19e3da5
      Anton Vorontsov 提交于
      The OF gpio infrastructure is great for describing GPIO connections within
      the device tree.  However, using a GPIO binding still requires changes to
      the gpio controller just to add an of_gpio structure.  In most cases, the
      gpio controller doesn't actually need any special support and the simple
      OF gpio mapping function is more than sufficient.  Additional, the current
      scheme of using of_gpio_chip requires a convoluted scheme to maintain
      1:1 mappings between of_gpio_chip and gpio_chip instances.
      
      If the struct of_gpio_chip data members were moved into struct gpio_chip,
      then it would simplify the processing of OF gpio bindings, and it would
      make it trivial to use device tree OF connections on existing gpiolib
      controller drivers.
      
      This patch eliminates the of_gpio_chip structure and moves the relevant
      fields into struct gpio_chip (conditional on CONFIG_OF_GPIO).  This move
      simplifies the existing code and prepares for adding automatic device tree
      support to existing drivers.
      Signed-off-by: NGrant Likely <grant.likely@secretlab.ca>
      Cc: Andrew Morton <akpm@linux-foundation.org>
      Cc: Anton Vorontsov <avorontsov@ru.mvista.com>
      Cc: Grant Likely <grant.likely@secretlab.ca>
      Cc: David Brownell <dbrownell@users.sourceforge.net>
      Cc: Bill Gatliff <bgat@billgatliff.com>
      Cc: Dmitry Eremin-Solenikov <dbaryshkov@gmail.com>
      Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
      Cc: Jean Delvare <khali@linux-fr.org>
      a19e3da5
    • A
      gpiolib: cosmetic improvements for error handling in gpiochip_add() · cedb1881
      Anton Vorontsov 提交于
      Hopefully it makes the code look nicer and makes it easier to extend
      this function.
      Signed-off-by: NAnton Vorontsov <avorontsov@ru.mvista.com>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NGrant Likely <grant.likely@secretlab.ca>
      CC: devicetree-discuss@lists.ozlabs.org
      CC: linux-kernel@vger.kernel.org
      cedb1881
    • G
      of/device: populate platform_device (of_device) resource table on allocation · ac80a51e
      Grant Likely 提交于
      When allocating a platform_device to represent an OF node, also allocate
      space for the resource table and populate it with IRQ and reg property
      information.  This change is in preparation for merging the
      of_platform_bus_type with the platform_bus_type so that existing
      platform_driver code can retrieve base addresses and IRQs data.
      
      Background: a previous commit removed struct of_device and made it a
      #define alias for platform_device.
      Signed-off-by: NGrant Likely <grant.likely@secretlab.ca>
      CC: Michal Simek <monstr@monstr.eu>
      CC: Grant Likely <grant.likely@secretlab.ca>
      CC: Benjamin Herrenschmidt <benh@kernel.crashing.org>
      CC: Stephen Rothwell <sfr@canb.auug.org.au>
      CC: microblaze-uclinux@itee.uq.edu.au
      CC: linuxppc-dev@ozlabs.org
      CC: devicetree-discuss@lists.ozlabs.org
      ac80a51e
    • G
      of: Merge of_device_alloc() and of_device_make_bus_id() · 94c09319
      Grant Likely 提交于
      This patch merges the common routines of_device_alloc() and
      of_device_make_bus_id() from powerpc and microblaze.
      Signed-off-by: NGrant Likely <grant.likely@secretlab.ca>
      CC: Michal Simek <monstr@monstr.eu>
      CC: Grant Likely <grant.likely@secretlab.ca>
      CC: Benjamin Herrenschmidt <benh@kernel.crashing.org>
      CC: Stephen Rothwell <sfr@canb.auug.org.au>
      CC: microblaze-uclinux@itee.uq.edu.au
      CC: linuxppc-dev@ozlabs.org
      CC: devicetree-discuss@lists.ozlabs.org
      94c09319
    • G
      of/device: Merge of_platform_bus_probe() · 5fd200f3
      Grant Likely 提交于
      Merge common code between PowerPC and microblaze.  This patch merges
      the code that scans the tree and registers devices.  The functions
      merged are of_platform_bus_probe(), of_platform_bus_create(), and
      of_platform_device_create().
      
      This patch also move the of_default_bus_ids[] table out of a Microblaze
      header file and makes it non-static.  The device ids table isn't merged
      because powerpc and microblaze use different default data.
      Signed-off-by: NGrant Likely <grant.likely@secretlab.ca>
      CC: Michal Simek <monstr@monstr.eu>
      CC: Grant Likely <grant.likely@secretlab.ca>
      CC: Benjamin Herrenschmidt <benh@kernel.crashing.org>
      CC: Stephen Rothwell <sfr@canb.auug.org.au>
      CC: microblaze-uclinux@itee.uq.edu.au
      CC: linuxppc-dev@ozlabs.org
      5fd200f3
    • G
      of: Modify of_device_get_modalias to be passed struct device · 34a1c1e8
      Grant Likely 提交于
      Now that the of_node pointer is part of struct device,
      of_device_get_modalias could be used on any struct device
      that has the device node pointer set.  This patch changes
      of_device_get_modalias to accept a struct device instead
      of a struct of_device.
      Signed-off-by: NGrant Likely <grant.likely@secretlab.ca>
      CC: Michal Simek <monstr@monstr.eu>
      CC: Benjamin Herrenschmidt <benh@kernel.crashing.org>
      CC: Wolfram Sang <w.sang@pengutronix.de>
      CC: Stephen Rothwell <sfr@canb.auug.org.au>
      CC: microblaze-uclinux@itee.uq.edu.au
      CC: linuxppc-dev@ozlabs.org
      34a1c1e8
    • G
      of/device: merge of_device_uevent · dd27dcda
      Grant Likely 提交于
      Merge common code between powerpc and microblaze
      Signed-off-by: NGrant Likely <grant.likely@secretlab.ca>
      CC: Michal Simek <monstr@monstr.eu>
      CC: Wolfram Sang <w.sang@pengutronix.de>
      CC: Stephen Rothwell <sfr@canb.auug.org.au>
      CC: Benjamin Herrenschmidt <benh@kernel.crashing.org>
      CC: microblaze-uclinux@itee.uq.edu.au
      CC: linuxppc-dev@ozlabs.org
      dd27dcda
    • G
      of: Use full node name in resource structures · d3571c3a
      Grant Likely 提交于
      Resource names appear in human readable output, so when extracting IRQ
      and address resources from a device tree node, use the full node name
      to give proper context in places like /proc/iomem.
      Signed-off-by: NGrant Likely <grant.likely@secretlab.ca>
      CC: Michal Simek <monstr@monstr.eu>
      CC: Stephen Rothwell <sfr@canb.auug.org.au>
      CC: Benjamin Herrenschmidt <benh@kernel.crashing.org>
      CC: microblaze-uclinux@itee.uq.edu.au
      CC: linuxppc-dev@ozlabs.org
      d3571c3a
    • G
      of/address: restrict 'no-ranges' kludge to powerpc · 3930f294
      Grant Likely 提交于
      Certain Apple machines don't use the ranges property correctly, but the
      workaround should not be applied on other architectures.  This patch
      disables the workaround for non-powerpc architectures.
      Signed-off-by: NGrant Likely <grant.likely@secretlab.ca>
      Acked-by: NBenjamin Herrenschmidt <benh@kernel.crashing.org>
      CC: Stephen Rothwell <sfr@canb.auug.org.au>
      3930f294
    • G
      of/address: little-endian fixes · 154063a9
      Grant Likely 提交于
      Fix some endian issues in the OF address translation code.
      Signed-off-by: NGrant Likely <grant.likely@secretlab.ca>
      Acked-by: NBenjamin Herrenschmidt <benh@kernel.crashing.org>
      CC: Michal Simek <monstr@monstr.eu>
      CC: Stephen Rothwell <sfr@canb.auug.org.au>
      154063a9
    • G
      of/address: Merge all of the bus translation code · dbbdee94
      Grant Likely 提交于
      Microblaze and PowerPC share a large chunk of code for translating
      OF device tree data into usable addresses.  Differences between the two
      consist of cosmetic differences, and the addition of dma-ranges support
      code to powerpc but not microblaze.  This patch moves the powerpc
      version into common code and applies many of the cosmetic (non-functional)
      changes from the microblaze version.
      Signed-off-by: NGrant Likely <grant.likely@secretlab.ca>
      Acked-by: NBenjamin Herrenschmidt <benh@kernel.crashing.org>
      CC: Michal Simek <monstr@monstr.eu>
      CC: Wolfram Sang <w.sang@pengutronix.de>
      CC: Stephen Rothwell <sfr@canb.auug.org.au>
      dbbdee94
    • G
      of/address: merge of_address_to_resource() · 1f5bef30
      Grant Likely 提交于
      Merge common code between PowerPC and Microblaze.  This patch also
      moves the prototype of pci_address_to_pio() out of pci-bridge.h and
      into prom.h because the only user of pci_address_to_pio() is
      of_address_to_resource().
      Signed-off-by: NGrant Likely <grant.likely@secretlab.ca>
      Acked-by: NBenjamin Herrenschmidt <benh@kernel.crashing.org>
      CC: Michal Simek <monstr@monstr.eu>
      CC: Stephen Rothwell <sfr@canb.auug.org.au>
      1f5bef30
    • G
      of/address: merge of_iomap() · 6b884a8d
      Grant Likely 提交于
      Merge common code between Microblaze and PowerPC.  This patch creates
      new of_address.h and address.c files to containing address translation
      and mapping routines.  First routine to be moved it of_iomap()
      Signed-off-by: NGrant Likely <grant.likely@secretlab.ca>
      Acked-by: NBenjamin Herrenschmidt <benh@kernel.crashing.org>
      CC: Michal Simek <monstr@monstr.eu>
      CC: Stephen Rothwell <sfr@canb.auug.org.au>
      6b884a8d
    • R
      of/irq: little endian fixes · a7c194b0
      Rob Herring 提交于
      Fix some endian issues in the irq mapping OF code.
      Signed-off-by: NRob Herring <r.herring@freescale.com>
      Signed-off-by: NGrant Likely <grant.likely@secretlab.ca>
      CC: Michal Simek <monstr@monstr.eu>
      CC: Wolfram Sang <w.sang@pengutronix.de>
      CC: Stephen Rothwell <sfr@canb.auug.org.au>
      CC: Benjamin Herrenschmidt <benh@kernel.crashing.org>
      a7c194b0
    • G
      of/irq: merge irq mapping code · 7dc2e113
      Grant Likely 提交于
      Merge common irq mapping code between PowerPC and Microblaze.
      
      This patch merges of_irq_find_parent(), of_irq_map_raw() and
      of_irq_map_one().  The functions are dependent on one another, so all
      three are merged in a single patch.  Other than cosmetic difference
      (ie. DBG() vs. pr_debug()), the implementations are identical.
      
      of_irq_to_resource() is also merged, but in this case the
      implementations are different.  This patch drops the microblaze version
      and uses the powerpc implementation unchanged.  The microblaze version
      essentially open-coded irq_of_parse_and_map() which it does not need
      to do.  Therefore the powerpc version is safe to adopt.
      Signed-off-by: NGrant Likely <grant.likely@secretlab.ca>
      CC: Michal Simek <monstr@monstr.eu>
      CC: Benjamin Herrenschmidt <benh@kernel.crashing.org>
      CC: Stephen Rothwell <sfr@canb.auug.org.au>
      7dc2e113
    • G
      of/powerpc: Move Powermac irq quirk code into powermac pic driver code · b83da291
      Grant Likely 提交于
      The code that figures out what is wrong with the powermac irq device
      tree data belongs with the rest of the powermac irq code.  This patch
      moves it out of prom_parse.c and into powermac/pic.c so that it is only
      compiled in when actually needed.
      Signed-off-by: NGrant Likely <grant.likely@secretlab.ca>
      Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
      Cc: Stephen Rothwell <sfr@canb.auug.org.au>
      b83da291
    • G
      of/microblaze: strip out of_irq_workarounds code · b6295c8b
      Grant Likely 提交于
      Microblaze doesn't have any legacy workaround in the device tree irq
      mapping data.  All of the of_irq_workarounds stuff can be dropped
      Signed-off-by: NGrant Likely <grant.likely@secretlab.ca>
      Cc: Michal Simek <monstr@monstr.eu>
      Cc: Stephen Rothwell <sfr@canb.auug.org.au>
      b6295c8b
  2. 29 6月, 2010 3 次提交
    • G
      of/irq: Move irq_of_parse_and_map() to common code · e3873444
      Grant Likely 提交于
      Merge common code between PowerPC and Microblaze.  SPARC implements
      irq_of_parse_and_map(), but the implementation is different, so it
      does not use this code.
      Signed-off-by: NGrant Likely <grant.likely@secretlab.ca>
      Acked-by: NBenjamin Herrenschmidt <benh@kernel.crashing.org>
      Cc: Michal Simek <monstr@monstr.eu>
      Cc: "David S. Miller" <davem@davemloft.net>
      Cc: Stephen Rothwell <sfr@canb.auug.org.au>
      Cc: Jeremy Kerr <jeremy.kerr@canonical.com>
      e3873444
    • G
      of: kill struct of_device · b505ff5e
      Grant Likely 提交于
      Now that the device tree node pointer has been moved out of struct
      of_device and into the common struct device, there isn't anything
      unique about of_device anymore.  In fact, there isn't much need
      for a separate of_bus when all busses have access to OF style
      probing.
      
      arch/powerpc and arch/microblaze are moving away from using the of_bus
      and using the regular platform bus instead for mmio devices.  This
      patch makes of_device the same as platform_device as a stepping stone
      in migrating of_platform_drivers over to the platform bus.
      Signed-off-by: NGrant Likely <grant.likely@secretlab.ca>
      Acked-by: NDavid S. Miller <davem@davemloft.net>
      Cc: Michal Simek <monstr@monstr.eu>
      Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
      Cc: Stephen Rothwell <sfr@canb.auug.org.au>
      b505ff5e
    • G
      sparc/of: Move of_device fields into struct pdev_archdata · 1636f8ac
      Grant Likely 提交于
      This patch moves SPARC architecture specific data members out of
      struct of_device and into the pdev_archdata structure.  The reason
      for this change is to unify the struct of_device definition amongst
      all the architectures.  It also remvoes the .sysdata, .slot, .portid
      and .clock_freq properties because they aren't actually used by
      anything.
      
      A subsequent patch will replace struct of_device entirely with struct
      platform_device and the of_platform support code will share common
      routines with the platform bus (but the bus instances themselves can
      remain separate).
      
      This patch also adds 'struct resources *resource' and num_resources
      to match the fields defined in struct platform_device.  After this
      change, 'struct platform_device' can be used as a drop-in replacement
      for 'struct of_platform'.
      
      This change is in preparation for merging the of_platform_bus_type
      with the platform_bus_type.
      Signed-off-by: NGrant Likely <grant.likely@secretlab.ca>
      Acked-by: NDavid S. Miller <davem@davemloft.net>
      Cc: Stephen Rothwell <sfr@canb.auug.org.au>
      1636f8ac
  3. 16 6月, 2010 3 次提交
  4. 15 6月, 2010 2 次提交
  5. 14 6月, 2010 1 次提交
  6. 12 6月, 2010 5 次提交