aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Documentation/devicetree/bindings/i2c/i2c-designware.txt22
-rw-r--r--Documentation/devicetree/bindings/i2c/trivial-devices.txt58
-rw-r--r--Documentation/devicetree/bindings/vendor-prefixes.txt3
-rw-r--r--arch/arm/include/asm/mach/arch.h2
-rw-r--r--arch/arm/include/asm/prom.h1
-rw-r--r--drivers/i2c/busses/i2c-designware-platdrv.c12
-rw-r--r--drivers/of/base.c10
-rw-r--r--drivers/of/fdt.c5
-rw-r--r--drivers/of/pdt.c2
-rw-r--r--include/linux/of.h33
-rw-r--r--include/linux/of_fdt.h4
-rw-r--r--kernel/irq/irqdomain.c3
12 files changed, 125 insertions, 30 deletions
diff --git a/Documentation/devicetree/bindings/i2c/i2c-designware.txt b/Documentation/devicetree/bindings/i2c/i2c-designware.txt
new file mode 100644
index 000000000000..e42a2ee233e6
--- /dev/null
+++ b/Documentation/devicetree/bindings/i2c/i2c-designware.txt
@@ -0,0 +1,22 @@
1* Synopsys DesignWare I2C
2
3Required properties :
4
5 - compatible : should be "snps,designware-i2c"
6 - reg : Offset and length of the register set for the device
7 - interrupts : <IRQ> where IRQ is the interrupt number.
8
9Recommended properties :
10
11 - clock-frequency : desired I2C bus clock frequency in Hz.
12
13Example :
14
15 i2c@f0000 {
16 #address-cells = <1>;
17 #size-cells = <0>;
18 compatible = "snps,designware-i2c";
19 reg = <0xf0000 0x1000>;
20 interrupts = <11>;
21 clock-frequency = <400000>;
22 };
diff --git a/Documentation/devicetree/bindings/i2c/trivial-devices.txt b/Documentation/devicetree/bindings/i2c/trivial-devices.txt
new file mode 100644
index 000000000000..1a85f986961b
--- /dev/null
+++ b/Documentation/devicetree/bindings/i2c/trivial-devices.txt
@@ -0,0 +1,58 @@
1This is a list of trivial i2c devices that have simple device tree
2bindings, consisting only of a compatible field, an address and
3possibly an interrupt line.
4
5If a device needs more specific bindings, such as properties to
6describe some aspect of it, there needs to be a specific binding
7document for it just like any other devices.
8
9
10Compatible Vendor / Chip
11========== =============
12ad,ad7414 SMBus/I2C Digital Temperature Sensor in 6-Pin SOT with SMBus Alert and Over Temperature Pin
13ad,adm9240 ADM9240: Complete System Hardware Monitor for uProcessor-Based Systems
14adi,adt7461 +/-1C TDM Extended Temp Range I.C
15adt7461 +/-1C TDM Extended Temp Range I.C
16at,24c08 i2c serial eeprom (24cxx)
17atmel,24c02 i2c serial eeprom (24cxx)
18catalyst,24c32 i2c serial eeprom
19dallas,ds1307 64 x 8, Serial, I2C Real-Time Clock
20dallas,ds1338 I2C RTC with 56-Byte NV RAM
21dallas,ds1339 I2C Serial Real-Time Clock
22dallas,ds1340 I2C RTC with Trickle Charger
23dallas,ds1374 I2C, 32-Bit Binary Counter Watchdog RTC with Trickle Charger and Reset Input/Output
24dallas,ds1631 High-Precision Digital Thermometer
25dallas,ds1682 Total-Elapsed-Time Recorder with Alarm
26dallas,ds1775 Tiny Digital Thermometer and Thermostat
27dallas,ds3232 Extremely Accurate I²C RTC with Integrated Crystal and SRAM
28dallas,ds4510 CPU Supervisor with Nonvolatile Memory and Programmable I/O
29dallas,ds75 Digital Thermometer and Thermostat
30dialog,da9053 DA9053: flexible system level PMIC with multicore support
31epson,rx8025 High-Stability. I2C-Bus INTERFACE REAL TIME CLOCK MODULE
32epson,rx8581 I2C-BUS INTERFACE REAL TIME CLOCK MODULE
33fsl,mag3110 MAG3110: Xtrinsic High Accuracy, 3D Magnetometer
34fsl,mc13892 MC13892: Power Management Integrated Circuit (PMIC) for i.MX35/51
35fsl,mma8450 MMA8450Q: Xtrinsic Low-power, 3-axis Xtrinsic Accelerometer
36fsl,mpr121 MPR121: Proximity Capacitive Touch Sensor Controller
37fsl,sgtl5000 SGTL5000: Ultra Low-Power Audio Codec
38maxim,ds1050 5 Bit Programmable, Pulse-Width Modulator
39maxim,max1237 Low-Power, 4-/12-Channel, 2-Wire Serial, 12-Bit ADCs
40maxim,max6625 9-Bit/12-Bit Temperature Sensors with I²C-Compatible Serial Interface
41mc,rv3029c2 Real Time Clock Module with I2C-Bus
42national,lm75 I2C TEMP SENSOR
43national,lm80 Serial Interface ACPI-Compatible Microprocessor System Hardware Monitor
44national,lm92 ±0.33°C Accurate, 12-Bit + Sign Temperature Sensor and Thermal Window Comparator with Two-Wire Interface
45nxp,pca9556 Octal SMBus and I2C registered interface
46nxp,pca9557 8-bit I2C-bus and SMBus I/O port with reset
47nxp,pcf8563 Real-time clock/calendar
48ovti,ov5642 OV5642: Color CMOS QSXGA (5-megapixel) Image Sensor with OmniBSI and Embedded TrueFocus
49pericom,pt7c4338 Real-time Clock Module
50plx,pex8648 48-Lane, 12-Port PCI Express Gen 2 (5.0 GT/s) Switch
51ramtron,24c64 i2c serial eeprom (24cxx)
52ricoh,rs5c372a I2C bus SERIAL INTERFACE REAL-TIME CLOCK IC
53samsung,24ad0xd1 S524AD0XF1 (128K/256K-bit Serial EEPROM for Low Power)
54st-micro,24c256 i2c serial eeprom (24cxx)
55stm,m41t00 Serial Access TIMEKEEPER
56stm,m41t62 Serial real-time clock (RTC) with alarm
57stm,m41t80 M41T80 - SERIAL ACCESS RTC WITH ALARMS
58ti,tsc2003 I2C Touch-Screen Controller
diff --git a/Documentation/devicetree/bindings/vendor-prefixes.txt b/Documentation/devicetree/bindings/vendor-prefixes.txt
index 874921e97802..18626965159e 100644
--- a/Documentation/devicetree/bindings/vendor-prefixes.txt
+++ b/Documentation/devicetree/bindings/vendor-prefixes.txt
@@ -8,7 +8,9 @@ amcc Applied Micro Circuits Corporation (APM, formally AMCC)
8apm Applied Micro Circuits Corporation (APM) 8apm Applied Micro Circuits Corporation (APM)
9arm ARM Ltd. 9arm ARM Ltd.
10atmel Atmel Corporation 10atmel Atmel Corporation
11cavium Cavium, Inc.
11chrp Common Hardware Reference Platform 12chrp Common Hardware Reference Platform
13cortina Cortina Systems, Inc.
12dallas Maxim Integrated Products (formerly Dallas Semiconductor) 14dallas Maxim Integrated Products (formerly Dallas Semiconductor)
13denx Denx Software Engineering 15denx Denx Software Engineering
14epson Seiko Epson Corp. 16epson Seiko Epson Corp.
@@ -36,6 +38,7 @@ schindler Schindler
36sil Silicon Image 38sil Silicon Image
37simtek 39simtek
38sirf SiRF Technology, Inc. 40sirf SiRF Technology, Inc.
41st STMicroelectronics
39stericsson ST-Ericsson 42stericsson ST-Ericsson
40ti Texas Instruments 43ti Texas Instruments
41xlnx Xilinx 44xlnx Xilinx
diff --git a/arch/arm/include/asm/mach/arch.h b/arch/arm/include/asm/mach/arch.h
index bcb0c883e21e..d7692cafde7f 100644
--- a/arch/arm/include/asm/mach/arch.h
+++ b/arch/arm/include/asm/mach/arch.h
@@ -19,7 +19,7 @@ struct machine_desc {
19 unsigned int nr; /* architecture number */ 19 unsigned int nr; /* architecture number */
20 const char *name; /* architecture name */ 20 const char *name; /* architecture name */
21 unsigned long atag_offset; /* tagged list (relative) */ 21 unsigned long atag_offset; /* tagged list (relative) */
22 const char **dt_compat; /* array of device tree 22 const char *const *dt_compat; /* array of device tree
23 * 'compatible' strings */ 23 * 'compatible' strings */
24 24
25 unsigned int nr_irqs; /* number of IRQs */ 25 unsigned int nr_irqs; /* number of IRQs */
diff --git a/arch/arm/include/asm/prom.h b/arch/arm/include/asm/prom.h
index 6f65ca86a5ec..ee0363307918 100644
--- a/arch/arm/include/asm/prom.h
+++ b/arch/arm/include/asm/prom.h
@@ -13,7 +13,6 @@
13 13
14#ifdef CONFIG_OF 14#ifdef CONFIG_OF
15 15
16#include <asm/setup.h>
17#include <asm/irq.h> 16#include <asm/irq.h>
18 17
19extern struct machine_desc *setup_machine_fdt(unsigned int dt_phys); 18extern struct machine_desc *setup_machine_fdt(unsigned int dt_phys);
diff --git a/drivers/i2c/busses/i2c-designware-platdrv.c b/drivers/i2c/busses/i2c-designware-platdrv.c
index 2d3657ab1258..5244c4724df7 100644
--- a/drivers/i2c/busses/i2c-designware-platdrv.c
+++ b/drivers/i2c/busses/i2c-designware-platdrv.c
@@ -34,6 +34,7 @@
34#include <linux/sched.h> 34#include <linux/sched.h>
35#include <linux/err.h> 35#include <linux/err.h>
36#include <linux/interrupt.h> 36#include <linux/interrupt.h>
37#include <linux/of_i2c.h>
37#include <linux/platform_device.h> 38#include <linux/platform_device.h>
38#include <linux/io.h> 39#include <linux/io.h>
39#include <linux/slab.h> 40#include <linux/slab.h>
@@ -137,6 +138,7 @@ static int __devinit dw_i2c_probe(struct platform_device *pdev)
137 sizeof(adap->name)); 138 sizeof(adap->name));
138 adap->algo = &i2c_dw_algo; 139 adap->algo = &i2c_dw_algo;
139 adap->dev.parent = &pdev->dev; 140 adap->dev.parent = &pdev->dev;
141 adap->dev.of_node = pdev->dev.of_node;
140 142
141 adap->nr = pdev->id; 143 adap->nr = pdev->id;
142 r = i2c_add_numbered_adapter(adap); 144 r = i2c_add_numbered_adapter(adap);
@@ -144,6 +146,7 @@ static int __devinit dw_i2c_probe(struct platform_device *pdev)
144 dev_err(&pdev->dev, "failure adding adapter\n"); 146 dev_err(&pdev->dev, "failure adding adapter\n");
145 goto err_free_irq; 147 goto err_free_irq;
146 } 148 }
149 of_i2c_register_devices(adap);
147 150
148 return 0; 151 return 0;
149 152
@@ -187,6 +190,14 @@ static int __devexit dw_i2c_remove(struct platform_device *pdev)
187 return 0; 190 return 0;
188} 191}
189 192
193#ifdef CONFIG_OF
194static const struct of_device_id dw_i2c_of_match[] = {
195 { .compatible = "snps,designware-i2c", },
196 {},
197};
198MODULE_DEVICE_TABLE(of, dw_i2c_of_match);
199#endif
200
190/* work with hotplug and coldplug */ 201/* work with hotplug and coldplug */
191MODULE_ALIAS("platform:i2c_designware"); 202MODULE_ALIAS("platform:i2c_designware");
192 203
@@ -195,6 +206,7 @@ static struct platform_driver dw_i2c_driver = {
195 .driver = { 206 .driver = {
196 .name = "i2c_designware", 207 .name = "i2c_designware",
197 .owner = THIS_MODULE, 208 .owner = THIS_MODULE,
209 .of_match_table = of_match_ptr(dw_i2c_of_match),
198 }, 210 },
199}; 211};
200 212
diff --git a/drivers/of/base.c b/drivers/of/base.c
index c6db9ab9046e..133908a6fd8d 100644
--- a/drivers/of/base.c
+++ b/drivers/of/base.c
@@ -752,7 +752,7 @@ int of_property_read_string_index(struct device_node *np, const char *propname,
752 752
753 for (i = 0; total < prop->length; total += l, p += l) { 753 for (i = 0; total < prop->length; total += l, p += l) {
754 l = strlen(p) + 1; 754 l = strlen(p) + 1;
755 if ((*p != 0) && (i++ == index)) { 755 if (i++ == index) {
756 *output = p; 756 *output = p;
757 return 0; 757 return 0;
758 } 758 }
@@ -790,11 +790,9 @@ int of_property_count_strings(struct device_node *np, const char *propname)
790 790
791 p = prop->value; 791 p = prop->value;
792 792
793 for (i = 0; total < prop->length; total += l, p += l) { 793 for (i = 0; total < prop->length; total += l, p += l, i++)
794 l = strlen(p) + 1; 794 l = strlen(p) + 1;
795 if (*p != 0) 795
796 i++;
797 }
798 return i; 796 return i;
799} 797}
800EXPORT_SYMBOL_GPL(of_property_count_strings); 798EXPORT_SYMBOL_GPL(of_property_count_strings);
@@ -1163,7 +1161,7 @@ void of_alias_scan(void * (*dt_alloc)(u64 size, u64 align))
1163 if (!of_aliases) 1161 if (!of_aliases)
1164 return; 1162 return;
1165 1163
1166 for_each_property(pp, of_aliases->properties) { 1164 for_each_property_of_node(of_aliases, pp) {
1167 const char *start = pp->name; 1165 const char *start = pp->name;
1168 const char *end = start + strlen(start); 1166 const char *end = start + strlen(start);
1169 struct device_node *np; 1167 struct device_node *np;
diff --git a/drivers/of/fdt.c b/drivers/of/fdt.c
index fd85fa298e0f..91a375fb6ae6 100644
--- a/drivers/of/fdt.c
+++ b/drivers/of/fdt.c
@@ -18,6 +18,7 @@
18#include <linux/errno.h> 18#include <linux/errno.h>
19#include <linux/slab.h> 19#include <linux/slab.h>
20 20
21#include <asm/setup.h> /* for COMMAND_LINE_SIZE */
21#ifdef CONFIG_PPC 22#ifdef CONFIG_PPC
22#include <asm/machdep.h> 23#include <asm/machdep.h>
23#endif /* CONFIG_PPC */ 24#endif /* CONFIG_PPC */
@@ -107,7 +108,7 @@ int of_fdt_is_compatible(struct boot_param_header *blob,
107 * of_fdt_match - Return true if node matches a list of compatible values 108 * of_fdt_match - Return true if node matches a list of compatible values
108 */ 109 */
109int of_fdt_match(struct boot_param_header *blob, unsigned long node, 110int of_fdt_match(struct boot_param_header *blob, unsigned long node,
110 const char **compat) 111 const char *const *compat)
111{ 112{
112 unsigned int tmp, score = 0; 113 unsigned int tmp, score = 0;
113 114
@@ -541,7 +542,7 @@ int __init of_flat_dt_is_compatible(unsigned long node, const char *compat)
541/** 542/**
542 * of_flat_dt_match - Return true if node matches a list of compatible values 543 * of_flat_dt_match - Return true if node matches a list of compatible values
543 */ 544 */
544int __init of_flat_dt_match(unsigned long node, const char **compat) 545int __init of_flat_dt_match(unsigned long node, const char *const *compat)
545{ 546{
546 return of_fdt_match(initial_boot_params, node, compat); 547 return of_fdt_match(initial_boot_params, node, compat);
547} 548}
diff --git a/drivers/of/pdt.c b/drivers/of/pdt.c
index bc5b3990f6ed..07cc1d678e4d 100644
--- a/drivers/of/pdt.c
+++ b/drivers/of/pdt.c
@@ -229,7 +229,7 @@ static struct device_node * __init of_pdt_build_tree(struct device_node *parent,
229 return ret; 229 return ret;
230} 230}
231 231
232static void *kernel_tree_alloc(u64 size, u64 align) 232static void * __init kernel_tree_alloc(u64 size, u64 align)
233{ 233{
234 return prom_early_alloc(size); 234 return prom_early_alloc(size);
235} 235}
diff --git a/include/linux/of.h b/include/linux/of.h
index ea44fd72af5f..a75a831e2057 100644
--- a/include/linux/of.h
+++ b/include/linux/of.h
@@ -72,6 +72,20 @@ struct of_phandle_args {
72 uint32_t args[MAX_PHANDLE_ARGS]; 72 uint32_t args[MAX_PHANDLE_ARGS];
73}; 73};
74 74
75#if defined(CONFIG_SPARC) || !defined(CONFIG_OF)
76/* Dummy ref counting routines - to be implemented later */
77static inline struct device_node *of_node_get(struct device_node *node)
78{
79 return node;
80}
81static inline void of_node_put(struct device_node *node)
82{
83}
84#else
85extern struct device_node *of_node_get(struct device_node *node);
86extern void of_node_put(struct device_node *node);
87#endif
88
75#ifdef CONFIG_OF 89#ifdef CONFIG_OF
76 90
77/* Pointer for first entry in chain of all nodes. */ 91/* 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)
102 116
103extern struct device_node *of_find_all_nodes(struct device_node *prev); 117extern struct device_node *of_find_all_nodes(struct device_node *prev);
104 118
105#if defined(CONFIG_SPARC)
106/* Dummy ref counting routines - to be implemented later */
107static inline struct device_node *of_node_get(struct device_node *node)
108{
109 return node;
110}
111static inline void of_node_put(struct device_node *node)
112{
113}
114
115#else
116extern struct device_node *of_node_get(struct device_node *node);
117extern void of_node_put(struct device_node *node);
118#endif
119
120/* 119/*
121 * OF address retrieval & translation 120 * OF address retrieval & translation
122 */ 121 */
@@ -226,8 +225,8 @@ extern int of_device_is_available(const struct device_node *device);
226extern const void *of_get_property(const struct device_node *node, 225extern const void *of_get_property(const struct device_node *node,
227 const char *name, 226 const char *name,
228 int *lenp); 227 int *lenp);
229#define for_each_property(pp, properties) \ 228#define for_each_property_of_node(dn, pp) \
230 for (pp = properties; pp != NULL; pp = pp->next) 229 for (pp = dn->properties; pp != NULL; pp = pp->next)
231 230
232extern int of_n_addr_cells(struct device_node *np); 231extern int of_n_addr_cells(struct device_node *np);
233extern int of_n_size_cells(struct device_node *np); 232extern int of_n_size_cells(struct device_node *np);
diff --git a/include/linux/of_fdt.h b/include/linux/of_fdt.h
index c84d900fbbb3..ed136ad698ce 100644
--- a/include/linux/of_fdt.h
+++ b/include/linux/of_fdt.h
@@ -71,7 +71,7 @@ extern int of_fdt_is_compatible(struct boot_param_header *blob,
71 unsigned long node, 71 unsigned long node,
72 const char *compat); 72 const char *compat);
73extern int of_fdt_match(struct boot_param_header *blob, unsigned long node, 73extern int of_fdt_match(struct boot_param_header *blob, unsigned long node,
74 const char **compat); 74 const char *const *compat);
75extern void of_fdt_unflatten_tree(unsigned long *blob, 75extern void of_fdt_unflatten_tree(unsigned long *blob,
76 struct device_node **mynodes); 76 struct device_node **mynodes);
77 77
@@ -88,7 +88,7 @@ extern int of_scan_flat_dt(int (*it)(unsigned long node, const char *uname,
88extern void *of_get_flat_dt_prop(unsigned long node, const char *name, 88extern void *of_get_flat_dt_prop(unsigned long node, const char *name,
89 unsigned long *size); 89 unsigned long *size);
90extern int of_flat_dt_is_compatible(unsigned long node, const char *name); 90extern int of_flat_dt_is_compatible(unsigned long node, const char *name);
91extern int of_flat_dt_match(unsigned long node, const char **matches); 91extern int of_flat_dt_match(unsigned long node, const char *const *matches);
92extern unsigned long of_get_flat_dt_root(void); 92extern unsigned long of_get_flat_dt_root(void);
93 93
94extern int early_init_dt_scan_chosen(unsigned long node, const char *uname, 94extern int early_init_dt_scan_chosen(unsigned long node, const char *uname,
diff --git a/kernel/irq/irqdomain.c b/kernel/irq/irqdomain.c
index 7ca523b249ef..1f9e26526b69 100644
--- a/kernel/irq/irqdomain.c
+++ b/kernel/irq/irqdomain.c
@@ -135,6 +135,9 @@ int irq_domain_simple_dt_translate(struct irq_domain *d,
135 return -EINVAL; 135 return -EINVAL;
136 if (intsize < 1) 136 if (intsize < 1)
137 return -EINVAL; 137 return -EINVAL;
138 if (d->nr_irq && ((intspec[0] < d->hwirq_base) ||
139 (intspec[0] >= d->hwirq_base + d->nr_irq)))
140 return -EINVAL;
138 141
139 *out_hwirq = intspec[0]; 142 *out_hwirq = intspec[0];
140 *out_type = IRQ_TYPE_NONE; 143 *out_type = IRQ_TYPE_NONE;