]> Git Repo - linux.git/commitdiff
Merge tag 'devicetree-for-linus' of git://git.secretlab.ca/git/linux
authorLinus Torvalds <[email protected]>
Thu, 4 Jul 2013 22:51:45 +0000 (15:51 -0700)
committerLinus Torvalds <[email protected]>
Thu, 4 Jul 2013 22:51:45 +0000 (15:51 -0700)
Pull device tree updates from Grant Likely:
 "This branch contains the following changes:
   - Removal of CONFIG_OF_DEVICE, it is always enabled by CONFIG_OF
   - Remove #ifdef from linux/of_platform.h to increase compiler syntax
     coverage
   - Bug fix for address decoding on Bimini and js2x powerpc platforms.
   - miscellaneous binding changes

  One note on the above.  The binding changes going in from all kinds of
  different trees has gotten rather out of hand.  I picked up some
  during this cycle, but even going though my tree isn't a great fit.

  Ian Campbell has prototyped splitting the bindings and .dtb files into
  a separate repository.  The plan is to migrate to using that sometime
  in the next few kernel releases which should get rid of a lot of the
  churn on binding docs and .dts files"

* tag 'devicetree-for-linus' of git://git.secretlab.ca/git/linux:
  of: Fix address decoding on Bimini and js2x machines
  of: remove CONFIG_OF_DEVICE
  usb: chipidea: depend on CONFIG_OF instead of CONFIG_OF_DEVICE
  of: remove of_platform_driver
  ibmebus: convert of_platform_driver to platform_driver
  driver core: move to_platform_driver to platform_device.h
  mfd: DT bindings for the palmas family MFD
  ARM: dts: omap3-devkit8000: fix NAND memory binding
  of/base: fix typos
  of: remove #ifdef from linux/of_platform.h

1  2 
arch/arm/boot/dts/omap3-devkit8000.dts
drivers/base/platform.c
drivers/of/address.c
drivers/of/base.c
drivers/usb/chipidea/Makefile
include/linux/platform_device.h

index af32eff9f4b78c00ada0a776fd5f7519e7122c9a,e5b35f526b7422954fcbc5313414d7d4947a3cd7..7ef282795dd4194fb05df05def1a8b918d94a434
@@@ -7,7 -7,7 +7,7 @@@
   */
  /dts-v1/;
  
 -/include/ "omap34xx.dtsi"
 +#include "omap34xx.dtsi"
  / {
        model = "TimLL OMAP3 Devkit8000";
        compatible = "timll,omap3-devkit8000", "ti,omap3";
  
                heartbeat {
                        label = "devkit8000::led1";
 -                      gpios = <&gpio6 26 0>;  /* 186 -> LED1 */
 +                      gpios = <&gpio6 26 GPIO_ACTIVE_HIGH>;   /* 186 -> LED1 */
                        default-state = "on";
                        linux,default-trigger = "heartbeat";
                };
  
                mmc {
                        label = "devkit8000::led2";
 -                      gpios = <&gpio6 3 0>;   /* 163 -> LED2 */
 +                      gpios = <&gpio6 3 GPIO_ACTIVE_HIGH>;    /* 163 -> LED2 */
                        default-state = "on";
                        linux,default-trigger = "none";
                };
  
                usr {
                        label = "devkit8000::led3";
 -                      gpios = <&gpio6 4 0>;   /* 164 -> LED3 */
 +                      gpios = <&gpio6 4 GPIO_ACTIVE_HIGH>;    /* 164 -> LED3 */
                        default-state = "on";
                        linux,default-trigger = "usr";
                  };
@@@ -80,8 -80,7 +80,8 @@@
        status = "disabled";
  };
  
 -/include/ "twl4030.dtsi"
 +#include "twl4030.dtsi"
 +#include "twl4030_omap3.dtsi"
  
  &mmc1 {
        vmmc-supply = <&vmmc1>;
                reg = <0 0 0>; /* CS0, offset 0 */
                nand-bus-width = <16>;
  
-               gpmc,sync-clk = <0>;
-               gpmc,cs-on = <0>;
-               gpmc,cs-rd-off = <44>;
-               gpmc,cs-wr-off = <44>;
-               gpmc,adv-on = <6>;
-               gpmc,adv-rd-off = <34>;
-               gpmc,adv-wr-off = <44>;
-               gpmc,we-off = <40>;
-               gpmc,oe-off = <54>;
-               gpmc,access = <64>;
-               gpmc,rd-cycle = <82>;
-               gpmc,wr-cycle = <82>;
-               gpmc,wr-access = <40>;
-               gpmc,wr-data-mux-bus = <0>;
+               gpmc,device-nand;
+               gpmc,sync-clki-ps = <0>;
+               gpmc,cs-on-ns = <0>;
+               gpmc,cs-rd-off-ns = <44>;
+               gpmc,cs-wr-off-ns = <44>;
+               gpmc,adv-on-ns = <6>;
+               gpmc,adv-rd-off-ns = <34>;
+               gpmc,adv-wr-off-ns = <44>;
+               gpmc,we-off-ns = <40>;
+               gpmc,oe-off-ns = <54>;
+               gpmc,access-ns = <64>;
+               gpmc,rd-cycle-ns = <82>;
+               gpmc,wr-cycle-ns = <82>;
+               gpmc,wr-access-ns = <40>;
+               gpmc,wr-data-mux-bus-ns = <0>;
  
                #address-cells = <1>;
                #size-cells = <1>;
diff --combined drivers/base/platform.c
index 6eaa7ab9e4bc6199c4fe9ce49b30a85068c78fe7,1bcb2a792e95cfddbc4c7126935bc6aed786fa2c..15789875128e87668a5693712adc5ecbaf45b77c
@@@ -29,9 -29,6 +29,6 @@@
  /* For automatically allocated device IDs */
  static DEFINE_IDA(platform_devid_ida);
  
- #define to_platform_driver(drv)       (container_of((drv), struct platform_driver, \
-                                driver))
  struct device platform_bus = {
        .init_name      = "platform",
  };
@@@ -523,13 -520,11 +520,13 @@@ static void platform_drv_shutdown(struc
  }
  
  /**
 - * platform_driver_register - register a driver for platform-level devices
 + * __platform_driver_register - register a driver for platform-level devices
   * @drv: platform driver structure
   */
 -int platform_driver_register(struct platform_driver *drv)
 +int __platform_driver_register(struct platform_driver *drv,
 +                              struct module *owner)
  {
 +      drv->driver.owner = owner;
        drv->driver.bus = &platform_bus_type;
        if (drv->probe)
                drv->driver.probe = platform_drv_probe;
  
        return driver_register(&drv->driver);
  }
 -EXPORT_SYMBOL_GPL(platform_driver_register);
 +EXPORT_SYMBOL_GPL(__platform_driver_register);
  
  /**
   * platform_driver_unregister - unregister a driver for platform-level devices
@@@ -890,6 -885,7 +887,6 @@@ int platform_pm_restore(struct device *
  static const struct dev_pm_ops platform_dev_pm_ops = {
        .runtime_suspend = pm_generic_runtime_suspend,
        .runtime_resume = pm_generic_runtime_resume,
 -      .runtime_idle = pm_generic_runtime_idle,
        USE_PLATFORM_PM_SLEEP_OPS
  };
  
diff --combined drivers/of/address.c
index fdd0636a987d1fe9165c0d4917d86efc8cce40c3,7c8221d363292df921cd5341facfa48bfd06d1e3..b55c2189076064c1d9a8015079370046ad8ae615
@@@ -106,8 -106,12 +106,12 @@@ static unsigned int of_bus_default_get_
  
  static int of_bus_pci_match(struct device_node *np)
  {
-       /* "vci" is for the /chaos bridge on 1st-gen PCI powermacs */
-       return !strcmp(np->type, "pci") || !strcmp(np->type, "vci");
+       /*
+        * "vci" is for the /chaos bridge on 1st-gen PCI powermacs
+        * "ht" is hypertransport
+        */
+       return !strcmp(np->type, "pci") || !strcmp(np->type, "vci") ||
+               !strcmp(np->type, "ht");
  }
  
  static void of_bus_pci_count_cells(struct device_node *np,
@@@ -227,73 -231,6 +231,73 @@@ int of_pci_address_to_resource(struct d
        return __of_address_to_resource(dev, addrp, size, flags, NULL, r);
  }
  EXPORT_SYMBOL_GPL(of_pci_address_to_resource);
 +
 +int of_pci_range_parser_init(struct of_pci_range_parser *parser,
 +                              struct device_node *node)
 +{
 +      const int na = 3, ns = 2;
 +      int rlen;
 +
 +      parser->node = node;
 +      parser->pna = of_n_addr_cells(node);
 +      parser->np = parser->pna + na + ns;
 +
 +      parser->range = of_get_property(node, "ranges", &rlen);
 +      if (parser->range == NULL)
 +              return -ENOENT;
 +
 +      parser->end = parser->range + rlen / sizeof(__be32);
 +
 +      return 0;
 +}
 +EXPORT_SYMBOL_GPL(of_pci_range_parser_init);
 +
 +struct of_pci_range *of_pci_range_parser_one(struct of_pci_range_parser *parser,
 +                                              struct of_pci_range *range)
 +{
 +      const int na = 3, ns = 2;
 +
 +      if (!range)
 +              return NULL;
 +
 +      if (!parser->range || parser->range + parser->np > parser->end)
 +              return NULL;
 +
 +      range->pci_space = parser->range[0];
 +      range->flags = of_bus_pci_get_flags(parser->range);
 +      range->pci_addr = of_read_number(parser->range + 1, ns);
 +      range->cpu_addr = of_translate_address(parser->node,
 +                              parser->range + na);
 +      range->size = of_read_number(parser->range + parser->pna + na, ns);
 +
 +      parser->range += parser->np;
 +
 +      /* Now consume following elements while they are contiguous */
 +      while (parser->range + parser->np <= parser->end) {
 +              u32 flags, pci_space;
 +              u64 pci_addr, cpu_addr, size;
 +
 +              pci_space = be32_to_cpup(parser->range);
 +              flags = of_bus_pci_get_flags(parser->range);
 +              pci_addr = of_read_number(parser->range + 1, ns);
 +              cpu_addr = of_translate_address(parser->node,
 +                              parser->range + na);
 +              size = of_read_number(parser->range + parser->pna + na, ns);
 +
 +              if (flags != range->flags)
 +                      break;
 +              if (pci_addr != range->pci_addr + range->size ||
 +                  cpu_addr != range->cpu_addr + range->size)
 +                      break;
 +
 +              range->size += size;
 +              parser->range += parser->np;
 +      }
 +
 +      return range;
 +}
 +EXPORT_SYMBOL_GPL(of_pci_range_parser_one);
 +
  #endif /* CONFIG_PCI */
  
  /*
diff --combined drivers/of/base.c
index a6f584a7f4a13f2842663c98d807e9b38b2cf89f,c1cfc4553a5df6074e250d19e059766cecd91dc2..5c5427918eb2f54b6a22d766aa7e697ca21c7666
@@@ -192,15 -192,14 +192,15 @@@ EXPORT_SYMBOL(of_find_property)
  struct device_node *of_find_all_nodes(struct device_node *prev)
  {
        struct device_node *np;
 +      unsigned long flags;
  
 -      raw_spin_lock(&devtree_lock);
 +      raw_spin_lock_irqsave(&devtree_lock, flags);
        np = prev ? prev->allnext : of_allnodes;
        for (; np != NULL; np = np->allnext)
                if (of_node_get(np))
                        break;
        of_node_put(prev);
 -      raw_spin_unlock(&devtree_lock);
 +      raw_spin_unlock_irqrestore(&devtree_lock, flags);
        return np;
  }
  EXPORT_SYMBOL(of_find_all_nodes);
@@@ -422,9 -421,8 +422,9 @@@ struct device_node *of_get_next_availab
        struct device_node *prev)
  {
        struct device_node *next;
 +      unsigned long flags;
  
 -      raw_spin_lock(&devtree_lock);
 +      raw_spin_lock_irqsave(&devtree_lock, flags);
        next = prev ? prev->sibling : node->child;
        for (; next; next = next->sibling) {
                if (!__of_device_is_available(next))
                        break;
        }
        of_node_put(prev);
 -      raw_spin_unlock(&devtree_lock);
 +      raw_spin_unlock_irqrestore(&devtree_lock, flags);
        return next;
  }
  EXPORT_SYMBOL(of_get_next_available_child);
@@@ -737,14 -735,13 +737,14 @@@ EXPORT_SYMBOL_GPL(of_modalias_node)
  struct device_node *of_find_node_by_phandle(phandle handle)
  {
        struct device_node *np;
 +      unsigned long flags;
  
 -      raw_spin_lock(&devtree_lock);
 +      raw_spin_lock_irqsave(&devtree_lock, flags);
        for (np = of_allnodes; np; np = np->allnext)
                if (np->phandle == handle)
                        break;
        of_node_get(np);
 -      raw_spin_unlock(&devtree_lock);
 +      raw_spin_unlock_irqrestore(&devtree_lock, flags);
        return np;
  }
  EXPORT_SYMBOL(of_find_node_by_phandle);
@@@ -812,7 -809,7 +812,7 @@@ EXPORT_SYMBOL_GPL(of_property_read_u32_
   *
   * @np:               device node from which the property value is to be read.
   * @propname: name of the property to be searched.
-  * @out_value       pointer to return value, modified only if return value is 0.
+  * @out_values:       pointer to return value, modified only if return value is 0.
   * @sz:               number of array elements to read
   *
   * Search for a property in a device node and read 8-bit value(s) from
   * dts entry of array should be like:
   *    property = /bits/ 8 <0x50 0x60 0x70>;
   *
-  * The out_value is modified only if a valid u8 value can be decoded.
+  * The out_values is modified only if a valid u8 value can be decoded.
   */
  int of_property_read_u8_array(const struct device_node *np,
                        const char *propname, u8 *out_values, size_t sz)
@@@ -845,7 -842,7 +845,7 @@@ EXPORT_SYMBOL_GPL(of_property_read_u8_a
   *
   * @np:               device node from which the property value is to be read.
   * @propname: name of the property to be searched.
-  * @out_value       pointer to return value, modified only if return value is 0.
+  * @out_values:       pointer to return value, modified only if return value is 0.
   * @sz:               number of array elements to read
   *
   * Search for a property in a device node and read 16-bit value(s) from
   * dts entry of array should be like:
   *    property = /bits/ 16 <0x5000 0x6000 0x7000>;
   *
-  * The out_value is modified only if a valid u16 value can be decoded.
+  * The out_values is modified only if a valid u16 value can be decoded.
   */
  int of_property_read_u16_array(const struct device_node *np,
                        const char *propname, u16 *out_values, size_t sz)
@@@ -879,7 -876,7 +879,7 @@@ EXPORT_SYMBOL_GPL(of_property_read_u16_
   *
   * @np:               device node from which the property value is to be read.
   * @propname: name of the property to be searched.
-  * @out_value       pointer to return value, modified only if return value is 0.
+  * @out_values:       pointer to return value, modified only if return value is 0.
   * @sz:               number of array elements to read
   *
   * Search for a property in a device node and read 32-bit value(s) from
   * -ENODATA if property does not have a value, and -EOVERFLOW if the
   * property data isn't large enough.
   *
-  * The out_value is modified only if a valid u32 value can be decoded.
+  * The out_values is modified only if a valid u32 value can be decoded.
   */
  int of_property_read_u32_array(const struct device_node *np,
                               const char *propname, u32 *out_values,
index 3bbbcba03815de28a5cb78e03aabba1044d9932d,4113febdb4329d3ed803ab5194dfef63b8e93aba..6cf5f68dedd8d2c08e00e2ba7d9cf99cc65fafb0
@@@ -9,13 -9,13 +9,13 @@@ ci_hdrc-$(CONFIG_USB_CHIPIDEA_DEBUG)  +
  
  # Glue/Bridge layers go here
  
 -obj-$(CONFIG_USB_CHIPIDEA)    += ci13xxx_msm.o
 +obj-$(CONFIG_USB_CHIPIDEA)    += ci_hdrc_msm.o
  
  # PCI doesn't provide stubs, need to check
  ifneq ($(CONFIG_PCI),)
 -      obj-$(CONFIG_USB_CHIPIDEA)      += ci13xxx_pci.o
 +      obj-$(CONFIG_USB_CHIPIDEA)      += ci_hdrc_pci.o
  endif
  
- ifneq ($(CONFIG_OF_DEVICE),)
+ ifneq ($(CONFIG_OF),)
 -      obj-$(CONFIG_USB_CHIPIDEA)      += ci13xxx_imx.o usbmisc_imx.o
 +      obj-$(CONFIG_USB_CHIPIDEA)      += ci_hdrc_imx.o usbmisc_imx.o
  endif
index cd46ee58b9dcdd82a394202311146840131e8319,3413897474e17bf09358489c3e483a8e58e19a50..ce8e4ffd78c773a1923c18cc53403726e79f71bf
@@@ -180,13 -180,10 +180,16 @@@ struct platform_driver 
        const struct platform_device_id *id_table;
  };
  
 -extern int platform_driver_register(struct platform_driver *);
+ #define to_platform_driver(drv)       (container_of((drv), struct platform_driver, \
+                                driver))
 +/*
 + * use a macro to avoid include chaining to get THIS_MODULE
 + */
 +#define platform_driver_register(drv) \
 +      __platform_driver_register(drv, THIS_MODULE)
 +extern int __platform_driver_register(struct platform_driver *,
 +                                      struct module *);
  extern void platform_driver_unregister(struct platform_driver *);
  
  /* non-hotpluggable platform devices may use this so that probe() and
This page took 0.094433 seconds and 4 git commands to generate.