]> git.karo-electronics.de Git - linux-beck.git/commitdiff
Merge tag 'devicetree-for-linus' of git://git.secretlab.ca/git/linux-2.6
authorLinus Torvalds <torvalds@linux-foundation.org>
Sat, 7 Jan 2012 20:18:52 +0000 (12:18 -0800)
committerLinus Torvalds <torvalds@linux-foundation.org>
Sat, 7 Jan 2012 20:18:52 +0000 (12:18 -0800)
devicetree/next changes queued for v3.3 merge window

* tag 'devicetree-for-linus-20120104' of git://git.secretlab.ca/git/linux-2.6:
  ARM: prom.h: Fix build error by removing unneeded header file
  irq: check domain hwirq range for DT translate
  dt: add empty of_get_node/of_put_node functions
  of/pdt: fix section mismatch warning
  i2c-designware: add OF binding support
  dt/i2c: Enumerate some of the known trivial i2c devices
  dt: reform for_each_property to for_each_property_of_node
  ARM/of: allow *machine_desc.dt_compat to be const
  of/base: Take NULL string into account for property with multiple strings
  OF/device-tree: Add some entries to vendor-prefixes.txt

Fix up trivial add-add conflicts in include/linux/of.h

12 files changed:
Documentation/devicetree/bindings/i2c/i2c-designware.txt [new file with mode: 0644]
Documentation/devicetree/bindings/i2c/trivial-devices.txt [new file with mode: 0644]
Documentation/devicetree/bindings/vendor-prefixes.txt
arch/arm/include/asm/mach/arch.h
arch/arm/include/asm/prom.h
drivers/i2c/busses/i2c-designware-platdrv.c
drivers/of/base.c
drivers/of/fdt.c
drivers/of/pdt.c
include/linux/of.h
include/linux/of_fdt.h
kernel/irq/irqdomain.c

diff --git a/Documentation/devicetree/bindings/i2c/i2c-designware.txt b/Documentation/devicetree/bindings/i2c/i2c-designware.txt
new file mode 100644 (file)
index 0000000..e42a2ee
--- /dev/null
@@ -0,0 +1,22 @@
+* Synopsys DesignWare I2C
+
+Required properties :
+
+ - compatible : should be "snps,designware-i2c"
+ - reg : Offset and length of the register set for the device
+ - interrupts : <IRQ> where IRQ is the interrupt number.
+
+Recommended properties :
+
+ - clock-frequency : desired I2C bus clock frequency in Hz.
+
+Example :
+
+       i2c@f0000 {
+               #address-cells = <1>;
+               #size-cells = <0>;
+               compatible = "snps,designware-i2c";
+               reg = <0xf0000 0x1000>;
+               interrupts = <11>;
+               clock-frequency = <400000>;
+       };
diff --git a/Documentation/devicetree/bindings/i2c/trivial-devices.txt b/Documentation/devicetree/bindings/i2c/trivial-devices.txt
new file mode 100644 (file)
index 0000000..1a85f98
--- /dev/null
@@ -0,0 +1,58 @@
+This is a list of trivial i2c devices that have simple device tree
+bindings, consisting only of a compatible field, an address and
+possibly an interrupt line.
+
+If a device needs more specific bindings, such as properties to
+describe some aspect of it, there needs to be a specific binding
+document for it just like any other devices.
+
+
+Compatible             Vendor / Chip
+==========             =============
+ad,ad7414              SMBus/I2C Digital Temperature Sensor in 6-Pin SOT with SMBus Alert and Over Temperature Pin
+ad,adm9240             ADM9240:  Complete System Hardware Monitor for uProcessor-Based Systems
+adi,adt7461            +/-1C TDM Extended Temp Range I.C
+adt7461                        +/-1C TDM Extended Temp Range I.C
+at,24c08               i2c serial eeprom  (24cxx)
+atmel,24c02            i2c serial eeprom  (24cxx)
+catalyst,24c32         i2c serial eeprom
+dallas,ds1307          64 x 8, Serial, I2C Real-Time Clock
+dallas,ds1338          I2C RTC with 56-Byte NV RAM
+dallas,ds1339          I2C Serial Real-Time Clock
+dallas,ds1340          I2C RTC with Trickle Charger
+dallas,ds1374          I2C, 32-Bit Binary Counter Watchdog RTC with Trickle Charger and Reset Input/Output
+dallas,ds1631          High-Precision Digital Thermometer
+dallas,ds1682          Total-Elapsed-Time Recorder with Alarm
+dallas,ds1775          Tiny Digital Thermometer and Thermostat
+dallas,ds3232          Extremely Accurate I²C RTC with Integrated Crystal and SRAM
+dallas,ds4510          CPU Supervisor with Nonvolatile Memory and Programmable I/O
+dallas,ds75            Digital Thermometer and Thermostat
+dialog,da9053          DA9053: flexible system level PMIC with multicore support
+epson,rx8025           High-Stability. I2C-Bus INTERFACE REAL TIME CLOCK MODULE
+epson,rx8581           I2C-BUS INTERFACE REAL TIME CLOCK MODULE
+fsl,mag3110            MAG3110: Xtrinsic High Accuracy, 3D Magnetometer
+fsl,mc13892            MC13892: Power Management Integrated Circuit (PMIC) for i.MX35/51
+fsl,mma8450            MMA8450Q: Xtrinsic Low-power, 3-axis Xtrinsic Accelerometer
+fsl,mpr121             MPR121: Proximity Capacitive Touch Sensor Controller
+fsl,sgtl5000           SGTL5000: Ultra Low-Power Audio Codec
+maxim,ds1050           5 Bit Programmable, Pulse-Width Modulator
+maxim,max1237          Low-Power, 4-/12-Channel, 2-Wire Serial, 12-Bit ADCs
+maxim,max6625          9-Bit/12-Bit Temperature Sensors with I²C-Compatible Serial Interface
+mc,rv3029c2            Real Time Clock Module with I2C-Bus
+national,lm75          I2C TEMP SENSOR
+national,lm80          Serial Interface ACPI-Compatible Microprocessor System Hardware Monitor
+national,lm92          ±0.33°C Accurate, 12-Bit + Sign Temperature Sensor and Thermal Window Comparator with Two-Wire Interface
+nxp,pca9556            Octal SMBus and I2C registered interface
+nxp,pca9557            8-bit I2C-bus and SMBus I/O port with reset
+nxp,pcf8563            Real-time clock/calendar
+ovti,ov5642            OV5642: Color CMOS QSXGA (5-megapixel) Image Sensor with OmniBSI and Embedded TrueFocus
+pericom,pt7c4338       Real-time Clock Module
+plx,pex8648            48-Lane, 12-Port PCI Express Gen 2 (5.0 GT/s) Switch
+ramtron,24c64          i2c serial eeprom  (24cxx)
+ricoh,rs5c372a         I2C bus SERIAL INTERFACE REAL-TIME CLOCK IC
+samsung,24ad0xd1       S524AD0XF1 (128K/256K-bit Serial EEPROM for Low Power)
+st-micro,24c256                i2c serial eeprom  (24cxx)
+stm,m41t00             Serial Access TIMEKEEPER
+stm,m41t62             Serial real-time clock (RTC) with alarm
+stm,m41t80             M41T80 - SERIAL ACCESS RTC WITH ALARMS
+ti,tsc2003             I2C Touch-Screen Controller
index 874921e97802d1d8c0e7cc2b694cca4bc3f18bf4..18626965159e06447b369a7f931075f8570c32c7 100644 (file)
@@ -8,7 +8,9 @@ amcc    Applied Micro Circuits Corporation (APM, formally AMCC)
 apm    Applied Micro Circuits Corporation (APM)
 arm    ARM Ltd.
 atmel  Atmel Corporation
+cavium Cavium, Inc.
 chrp   Common Hardware Reference Platform
+cortina        Cortina Systems, Inc.
 dallas Maxim Integrated Products (formerly Dallas Semiconductor)
 denx   Denx Software Engineering
 epson  Seiko Epson Corp.
@@ -36,6 +38,7 @@ schindler     Schindler
 sil    Silicon Image
 simtek
 sirf   SiRF Technology, Inc.
+st     STMicroelectronics
 stericsson     ST-Ericsson
 ti     Texas Instruments
 xlnx   Xilinx
index bcb0c883e21ed06aa18c9f48354314c877523a8b..d7692cafde7fdd3d0b4e297620fbf2dd45d611d6 100644 (file)
@@ -19,7 +19,7 @@ struct machine_desc {
        unsigned int            nr;             /* architecture number  */
        const char              *name;          /* architecture name    */
        unsigned long           atag_offset;    /* tagged list (relative) */
-       const char              **dt_compat;    /* array of device tree
+       const char *const       *dt_compat;     /* array of device tree
                                                 * 'compatible' strings */
 
        unsigned int            nr_irqs;        /* number of IRQs */
index 6f65ca86a5ec03347ea3305874437120680f77e1..ee0363307918b1d889897553f0283e0848307b15 100644 (file)
@@ -13,7 +13,6 @@
 
 #ifdef CONFIG_OF
 
-#include <asm/setup.h>
 #include <asm/irq.h>
 
 extern struct machine_desc *setup_machine_fdt(unsigned int dt_phys);
index 2d3657ab1258534d307c8ab00b0dfd1718c5ce72..5244c4724df7a558e0e84459c7f5c89dacb29ef2 100644 (file)
@@ -34,6 +34,7 @@
 #include <linux/sched.h>
 #include <linux/err.h>
 #include <linux/interrupt.h>
+#include <linux/of_i2c.h>
 #include <linux/platform_device.h>
 #include <linux/io.h>
 #include <linux/slab.h>
@@ -137,6 +138,7 @@ static int __devinit dw_i2c_probe(struct platform_device *pdev)
                        sizeof(adap->name));
        adap->algo = &i2c_dw_algo;
        adap->dev.parent = &pdev->dev;
+       adap->dev.of_node = pdev->dev.of_node;
 
        adap->nr = pdev->id;
        r = i2c_add_numbered_adapter(adap);
@@ -144,6 +146,7 @@ static int __devinit dw_i2c_probe(struct platform_device *pdev)
                dev_err(&pdev->dev, "failure adding adapter\n");
                goto err_free_irq;
        }
+       of_i2c_register_devices(adap);
 
        return 0;
 
@@ -187,6 +190,14 @@ static int __devexit dw_i2c_remove(struct platform_device *pdev)
        return 0;
 }
 
+#ifdef CONFIG_OF
+static const struct of_device_id dw_i2c_of_match[] = {
+       { .compatible = "snps,designware-i2c", },
+       {},
+};
+MODULE_DEVICE_TABLE(of, dw_i2c_of_match);
+#endif
+
 /* work with hotplug and coldplug */
 MODULE_ALIAS("platform:i2c_designware");
 
@@ -195,6 +206,7 @@ static struct platform_driver dw_i2c_driver = {
        .driver         = {
                .name   = "i2c_designware",
                .owner  = THIS_MODULE,
+               .of_match_table = of_match_ptr(dw_i2c_of_match),
        },
 };
 
index c6db9ab9046e59c59e373c7a4e4f5b45e83001da..133908a6fd8db5270f3845ce387b3724d3845b7d 100644 (file)
@@ -752,7 +752,7 @@ int of_property_read_string_index(struct device_node *np, const char *propname,
 
        for (i = 0; total < prop->length; total += l, p += l) {
                l = strlen(p) + 1;
-               if ((*p != 0) && (i++ == index)) {
+               if (i++ == index) {
                        *output = p;
                        return 0;
                }
@@ -790,11 +790,9 @@ int of_property_count_strings(struct device_node *np, const char *propname)
 
        p = prop->value;
 
-       for (i = 0; total < prop->length; total += l, p += l) {
+       for (i = 0; total < prop->length; total += l, p += l, i++)
                l = strlen(p) + 1;
-               if (*p != 0)
-                       i++;
-       }
+
        return i;
 }
 EXPORT_SYMBOL_GPL(of_property_count_strings);
@@ -1163,7 +1161,7 @@ void of_alias_scan(void * (*dt_alloc)(u64 size, u64 align))
        if (!of_aliases)
                return;
 
-       for_each_property(pp, of_aliases->properties) {
+       for_each_property_of_node(of_aliases, pp) {
                const char *start = pp->name;
                const char *end = start + strlen(start);
                struct device_node *np;
index fd85fa298e0f053eb666fc0c6060e3779731545f..91a375fb6ae622181231fce19b1a5907e94c9f40 100644 (file)
@@ -18,6 +18,7 @@
 #include <linux/errno.h>
 #include <linux/slab.h>
 
+#include <asm/setup.h>  /* for COMMAND_LINE_SIZE */
 #ifdef CONFIG_PPC
 #include <asm/machdep.h>
 #endif /* CONFIG_PPC */
@@ -107,7 +108,7 @@ int of_fdt_is_compatible(struct boot_param_header *blob,
  * of_fdt_match - Return true if node matches a list of compatible values
  */
 int of_fdt_match(struct boot_param_header *blob, unsigned long node,
-                 const char **compat)
+                 const char *const *compat)
 {
        unsigned int tmp, score = 0;
 
@@ -541,7 +542,7 @@ int __init of_flat_dt_is_compatible(unsigned long node, const char *compat)
 /**
  * of_flat_dt_match - Return true if node matches a list of compatible values
  */
-int __init of_flat_dt_match(unsigned long node, const char **compat)
+int __init of_flat_dt_match(unsigned long node, const char *const *compat)
 {
        return of_fdt_match(initial_boot_params, node, compat);
 }
index bc5b3990f6ed114f50103c8a8b060dfc69cc6aed..07cc1d678e4d3da7d810c330c8bb4053411bd885 100644 (file)
@@ -229,7 +229,7 @@ static struct device_node * __init of_pdt_build_tree(struct device_node *parent,
        return ret;
 }
 
-static void *kernel_tree_alloc(u64 size, u64 align)
+static void * __init kernel_tree_alloc(u64 size, u64 align)
 {
        return prom_early_alloc(size);
 }
index ea44fd72af5fb02e02550e2163e4e7860eacf301..a75a831e2057f96e3519d100f988a584e18ac669 100644 (file)
@@ -72,6 +72,20 @@ struct of_phandle_args {
        uint32_t args[MAX_PHANDLE_ARGS];
 };
 
+#if defined(CONFIG_SPARC) || !defined(CONFIG_OF)
+/* Dummy ref counting routines - to be implemented later */
+static inline struct device_node *of_node_get(struct device_node *node)
+{
+       return node;
+}
+static inline void of_node_put(struct device_node *node)
+{
+}
+#else
+extern struct device_node *of_node_get(struct device_node *node);
+extern void of_node_put(struct device_node *node);
+#endif
+
 #ifdef CONFIG_OF
 
 /* Pointer for first entry in chain of all nodes. */
@@ -102,21 +116,6 @@ static inline void of_node_set_flag(struct device_node *n, unsigned long flag)
 
 extern struct device_node *of_find_all_nodes(struct device_node *prev);
 
-#if defined(CONFIG_SPARC)
-/* Dummy ref counting routines - to be implemented later */
-static inline struct device_node *of_node_get(struct device_node *node)
-{
-       return node;
-}
-static inline void of_node_put(struct device_node *node)
-{
-}
-
-#else
-extern struct device_node *of_node_get(struct device_node *node);
-extern void of_node_put(struct device_node *node);
-#endif
-
 /*
  * OF address retrieval & translation
  */
@@ -226,8 +225,8 @@ extern int of_device_is_available(const struct device_node *device);
 extern const void *of_get_property(const struct device_node *node,
                                const char *name,
                                int *lenp);
-#define for_each_property(pp, properties) \
-       for (pp = properties; pp != NULL; pp = pp->next)
+#define for_each_property_of_node(dn, pp) \
+       for (pp = dn->properties; pp != NULL; pp = pp->next)
 
 extern int of_n_addr_cells(struct device_node *np);
 extern int of_n_size_cells(struct device_node *np);
index c84d900fbbb3d93a194cf5c3dbb7ad06388bd631..ed136ad698ce622e4d150d7fda337a99c78d5a4e 100644 (file)
@@ -71,7 +71,7 @@ extern int of_fdt_is_compatible(struct boot_param_header *blob,
                                unsigned long node,
                                const char *compat);
 extern int of_fdt_match(struct boot_param_header *blob, unsigned long node,
-                       const char **compat);
+                       const char *const *compat);
 extern void of_fdt_unflatten_tree(unsigned long *blob,
                               struct device_node **mynodes);
 
@@ -88,7 +88,7 @@ extern int of_scan_flat_dt(int (*it)(unsigned long node, const char *uname,
 extern void *of_get_flat_dt_prop(unsigned long node, const char *name,
                                 unsigned long *size);
 extern int of_flat_dt_is_compatible(unsigned long node, const char *name);
-extern int of_flat_dt_match(unsigned long node, const char **matches);
+extern int of_flat_dt_match(unsigned long node, const char *const *matches);
 extern unsigned long of_get_flat_dt_root(void);
 
 extern int early_init_dt_scan_chosen(unsigned long node, const char *uname,
index 7ca523b249ef55fbfa551555b268236763bac80b..1f9e26526b69961ad73d3ddc1d0b788b6ca291d7 100644 (file)
@@ -135,6 +135,9 @@ int irq_domain_simple_dt_translate(struct irq_domain *d,
                return -EINVAL;
        if (intsize < 1)
                return -EINVAL;
+       if (d->nr_irq && ((intspec[0] < d->hwirq_base) ||
+           (intspec[0] >= d->hwirq_base + d->nr_irq)))
+               return -EINVAL;
 
        *out_hwirq = intspec[0];
        *out_type = IRQ_TYPE_NONE;