1. 22 10月, 2010 3 次提交
    • D
      of/mips: Cleanup some include directives/files. · 4c60071c
      David Daney 提交于
      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: NDavid Daney <ddaney@caviumnetworks.com>
      Acked-by: NRalf Baechle <ralf@linux-mips.org>
      Signed-off-by: NGrant Likely <grant.likely@secretlab.ca>
      4c60071c
    • G
      of/flattree: Eliminate need to provide early_init_dt_scan_chosen_arch · 32c97689
      Grant Likely 提交于
      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: NGrant Likely <grant.likely@secretlab.ca>
      Tested-by: NDavid Daney <ddaney@caviumnetworks.com>
      32c97689
    • G
      of/device: Rework to use common platform_device_alloc() for allocating devices · 7096d042
      Grant Likely 提交于
      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: NGrant 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
  2. 13 10月, 2010 5 次提交
  3. 11 10月, 2010 1 次提交
  4. 09 10月, 2010 1 次提交
  5. 06 8月, 2010 1 次提交
  6. 01 8月, 2010 1 次提交
    • G
      of/platform: Register of_platform_drivers with an "of:" prefix · 7fb8f881
      Grant Likely 提交于
      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
  7. 30 7月, 2010 2 次提交
  8. 25 7月, 2010 3 次提交
  9. 24 7月, 2010 5 次提交
  10. 19 7月, 2010 2 次提交
  11. 15 7月, 2010 2 次提交
  12. 06 7月, 2010 14 次提交
    • A
      proc: unify PROC_DEVICETREE config · ef2a4524
      Andres Salomon 提交于
      Microblaze and PPC both use PROC_DEVICETREE, and OLPC will as well.. put
      the Kconfig option into fs/ rather than in arch/*/Kconfig.
      Signed-off-by: NAndres Salomon <dilinger@queued.net>
      [grant.likely@secretlab.ca: changed depends to PROC_FS && !SPARC]
      [grant.likely@secretlab.ca: moved to drivers/of/Kconfig]
      Signed-off-by: NGrant Likely <grant.likely@secretlab.ca>
      ef2a4524
    • G
      of: Put all CONFIG_OF dependencies into a Kconfig menu block · 5ab5fc7e
      Grant Likely 提交于
      All of the options in drivers/of/Kconfig depend on CONFIG_OF.  Putting
      all of them inside a menu block simplifies the dependency statements.
      It also creates a logical group for adding user selectable OF options.
      
      This patch also changes (PPC_OF || MICROBLAZE) statements to (!SPARC)
      so that those options are available to other architectures (and in
      fact the !SPARC conditions should probably be re-evalutated since the
      code is more generic now)
      
      This patch also moves the definition of CONFIG_DTC from arch/* to
      drivers/of/Kconfig
      Signed-off-by: NGrant Likely <grant.likely@secretlab.ca>
      5ab5fc7e
    • S
    • G
      of: Fix missing include · 50ef5284
      Grant Likely 提交于
      Fix a build failure on ARM
      Signed-off-by: NGrant Likely <grant.likely@secretlab.ca>
      50ef5284
    • 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
      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
    • 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
    • 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