aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2013-09-10 16:53:52 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2013-09-10 16:53:52 -0400
commit31f7c3a688f75bceaf2fd009efc489659ad6aa61 (patch)
tree1721765e553c01559d1b784563d4840c5d3dd0b9
parentec5b103ecfde929004b691f29183255aeeadecd5 (diff)
parent2bc552df76d83cf1455ac8cf4c87615bfd15df74 (diff)
Merge tag 'devicetree-for-linus' of git://git.secretlab.ca/git/linux
Pull device tree core updates from Grant Likely: "Generally minor changes. A bunch of bug fixes, particularly for initialization and some refactoring. Most notable change if feeding the entire flattened tree into the random pool at boot. May not be significant, but shouldn't hurt either" Tim Bird questions whether the boot time cost of the random feeding may be noticeable. And "add_device_randomness()" is definitely not some speed deamon of a function. * tag 'devicetree-for-linus' of git://git.secretlab.ca/git/linux: of/platform: add error reporting to of_amba_device_create() irq/of: Fix comment typo for irq_of_parse_and_map of: Feed entire flattened device tree into the random pool of/fdt: Clean up casting in unflattening path of/fdt: Remove duplicate memory clearing on FDT unflattening gpio: implement gpio-ranges binding document fix of: call __of_parse_phandle_with_args from of_parse_phandle of: introduce of_parse_phandle_with_fixed_args of: move of_parse_phandle() of: move documentation of of_parse_phandle_with_args of: Fix missing memory initialization on FDT unflattening of: consolidate definition of early_init_dt_alloc_memory_arch() of: Make of_get_phy_mode() return int i.s.o. const int include: dt-binding: input: create a DT header defining key codes. of/platform: Staticize of_platform_device_create_pdata() of: Specify initrd location using 64-bit dt: Typo fix OF: make of_property_for_each_{u32|string}() use parameters if OF is not enabled
-rw-r--r--Documentation/devicetree/bindings/net/can/sja1000.txt2
-rw-r--r--arch/arc/kernel/devtree.c6
-rw-r--r--arch/arc/mm/init.c5
-rw-r--r--arch/arm/mm/init.c2
-rw-r--r--arch/arm64/kernel/setup.c5
-rw-r--r--arch/arm64/mm/init.c3
-rw-r--r--arch/c6x/kernel/devicetree.c8
-rw-r--r--arch/metag/mm/init.c5
-rw-r--r--arch/microblaze/kernel/prom.c8
-rw-r--r--arch/mips/kernel/prom.c3
-rw-r--r--arch/openrisc/kernel/prom.c8
-rw-r--r--arch/powerpc/kernel/prom.c8
-rw-r--r--arch/x86/kernel/devicetree.c3
-rw-r--r--arch/xtensa/kernel/setup.c3
-rw-r--r--drivers/gpio/gpiolib-of.c4
-rw-r--r--drivers/of/base.c200
-rw-r--r--drivers/of/fdt.c98
-rw-r--r--drivers/of/irq.c2
-rw-r--r--drivers/of/of_net.c2
-rw-r--r--drivers/of/platform.c21
-rw-r--r--include/dt-bindings/input/input.h525
-rw-r--r--include/linux/of.h49
-rw-r--r--include/linux/of_fdt.h3
-rw-r--r--include/linux/of_net.h4
24 files changed, 787 insertions, 190 deletions
diff --git a/Documentation/devicetree/bindings/net/can/sja1000.txt b/Documentation/devicetree/bindings/net/can/sja1000.txt
index c2dbcec0ee31..f2105a47ec87 100644
--- a/Documentation/devicetree/bindings/net/can/sja1000.txt
+++ b/Documentation/devicetree/bindings/net/can/sja1000.txt
@@ -37,7 +37,7 @@ Optional properties:
37 If not specified or if the specified value is 0, the CLKOUT pin 37 If not specified or if the specified value is 0, the CLKOUT pin
38 will be disabled. 38 will be disabled.
39 39
40- nxp,no-comparator-bypass : Allows to disable the CAN input comperator. 40- nxp,no-comparator-bypass : Allows to disable the CAN input comparator.
41 41
42For further information, please have a look to the SJA1000 data sheet. 42For further information, please have a look to the SJA1000 data sheet.
43 43
diff --git a/arch/arc/kernel/devtree.c b/arch/arc/kernel/devtree.c
index bdee3a812052..2340af0e1d6f 100644
--- a/arch/arc/kernel/devtree.c
+++ b/arch/arc/kernel/devtree.c
@@ -18,12 +18,6 @@
18#include <asm/clk.h> 18#include <asm/clk.h>
19#include <asm/mach_desc.h> 19#include <asm/mach_desc.h>
20 20
21/* called from unflatten_device_tree() to bootstrap devicetree itself */
22void * __init early_init_dt_alloc_memory_arch(u64 size, u64 align)
23{
24 return __va(memblock_alloc(size, align));
25}
26
27/** 21/**
28 * setup_machine_fdt - Machine setup when an dtb was passed to the kernel 22 * setup_machine_fdt - Machine setup when an dtb was passed to the kernel
29 * @dt: virtual address pointer to dt blob 23 * @dt: virtual address pointer to dt blob
diff --git a/arch/arc/mm/init.c b/arch/arc/mm/init.c
index a08ce7185423..81279ec73a6a 100644
--- a/arch/arc/mm/init.c
+++ b/arch/arc/mm/init.c
@@ -127,9 +127,8 @@ void __init free_initrd_mem(unsigned long start, unsigned long end)
127#endif 127#endif
128 128
129#ifdef CONFIG_OF_FLATTREE 129#ifdef CONFIG_OF_FLATTREE
130void __init early_init_dt_setup_initrd_arch(unsigned long start, 130void __init early_init_dt_setup_initrd_arch(u64 start, u64 end)
131 unsigned long end)
132{ 131{
133 pr_err("%s(%lx, %lx)\n", __func__, start, end); 132 pr_err("%s(%llx, %llx)\n", __func__, start, end);
134} 133}
135#endif /* CONFIG_OF_FLATTREE */ 134#endif /* CONFIG_OF_FLATTREE */
diff --git a/arch/arm/mm/init.c b/arch/arm/mm/init.c
index 93cbf566a972..febaee7ca57b 100644
--- a/arch/arm/mm/init.c
+++ b/arch/arm/mm/init.c
@@ -78,7 +78,7 @@ static int __init parse_tag_initrd2(const struct tag *tag)
78__tagtable(ATAG_INITRD2, parse_tag_initrd2); 78__tagtable(ATAG_INITRD2, parse_tag_initrd2);
79 79
80#ifdef CONFIG_OF_FLATTREE 80#ifdef CONFIG_OF_FLATTREE
81void __init early_init_dt_setup_initrd_arch(unsigned long start, unsigned long end) 81void __init early_init_dt_setup_initrd_arch(u64 start, u64 end)
82{ 82{
83 phys_initrd_start = start; 83 phys_initrd_start = start;
84 phys_initrd_size = end - start; 84 phys_initrd_size = end - start;
diff --git a/arch/arm64/kernel/setup.c b/arch/arm64/kernel/setup.c
index bca4c1c2052a..12ad8f3d0cfd 100644
--- a/arch/arm64/kernel/setup.c
+++ b/arch/arm64/kernel/setup.c
@@ -190,11 +190,6 @@ void __init early_init_dt_add_memory_arch(u64 base, u64 size)
190 memblock_add(base, size); 190 memblock_add(base, size);
191} 191}
192 192
193void * __init early_init_dt_alloc_memory_arch(u64 size, u64 align)
194{
195 return __va(memblock_alloc(size, align));
196}
197
198/* 193/*
199 * Limit the memory size that was specified via FDT. 194 * Limit the memory size that was specified via FDT.
200 */ 195 */
diff --git a/arch/arm64/mm/init.c b/arch/arm64/mm/init.c
index 67e8d7ce3fe7..de2de5db628d 100644
--- a/arch/arm64/mm/init.c
+++ b/arch/arm64/mm/init.c
@@ -44,8 +44,7 @@ static unsigned long phys_initrd_size __initdata = 0;
44 44
45phys_addr_t memstart_addr __read_mostly = 0; 45phys_addr_t memstart_addr __read_mostly = 0;
46 46
47void __init early_init_dt_setup_initrd_arch(unsigned long start, 47void __init early_init_dt_setup_initrd_arch(u64 start, u64 end)
48 unsigned long end)
49{ 48{
50 phys_initrd_start = start; 49 phys_initrd_start = start;
51 phys_initrd_size = end - start; 50 phys_initrd_size = end - start;
diff --git a/arch/c6x/kernel/devicetree.c b/arch/c6x/kernel/devicetree.c
index bdb56f09d0ac..9e15ab9199b2 100644
--- a/arch/c6x/kernel/devicetree.c
+++ b/arch/c6x/kernel/devicetree.c
@@ -33,8 +33,7 @@ void __init early_init_devtree(void *params)
33 33
34 34
35#ifdef CONFIG_BLK_DEV_INITRD 35#ifdef CONFIG_BLK_DEV_INITRD
36void __init early_init_dt_setup_initrd_arch(unsigned long start, 36void __init early_init_dt_setup_initrd_arch(u64 start, u64 end)
37 unsigned long end)
38{ 37{
39 initrd_start = (unsigned long)__va(start); 38 initrd_start = (unsigned long)__va(start);
40 initrd_end = (unsigned long)__va(end); 39 initrd_end = (unsigned long)__va(end);
@@ -46,8 +45,3 @@ void __init early_init_dt_add_memory_arch(u64 base, u64 size)
46{ 45{
47 c6x_add_memory(base, size); 46 c6x_add_memory(base, size);
48} 47}
49
50void * __init early_init_dt_alloc_memory_arch(u64 size, u64 align)
51{
52 return __va(memblock_alloc(size, align));
53}
diff --git a/arch/metag/mm/init.c b/arch/metag/mm/init.c
index 28813f164730..123919534b80 100644
--- a/arch/metag/mm/init.c
+++ b/arch/metag/mm/init.c
@@ -407,10 +407,9 @@ void free_initrd_mem(unsigned long start, unsigned long end)
407#endif 407#endif
408 408
409#ifdef CONFIG_OF_FLATTREE 409#ifdef CONFIG_OF_FLATTREE
410void __init early_init_dt_setup_initrd_arch(unsigned long start, 410void __init early_init_dt_setup_initrd_arch(u64 start, u64 end)
411 unsigned long end)
412{ 411{
413 pr_err("%s(%lx, %lx)\n", 412 pr_err("%s(%llx, %llx)\n",
414 __func__, start, end); 413 __func__, start, end);
415} 414}
416#endif /* CONFIG_OF_FLATTREE */ 415#endif /* CONFIG_OF_FLATTREE */
diff --git a/arch/microblaze/kernel/prom.c b/arch/microblaze/kernel/prom.c
index 0a2c68f9f9b0..0c4453f134cb 100644
--- a/arch/microblaze/kernel/prom.c
+++ b/arch/microblaze/kernel/prom.c
@@ -46,11 +46,6 @@ void __init early_init_dt_add_memory_arch(u64 base, u64 size)
46 memblock_add(base, size); 46 memblock_add(base, size);
47} 47}
48 48
49void * __init early_init_dt_alloc_memory_arch(u64 size, u64 align)
50{
51 return __va(memblock_alloc(size, align));
52}
53
54#ifdef CONFIG_EARLY_PRINTK 49#ifdef CONFIG_EARLY_PRINTK
55static char *stdout; 50static char *stdout;
56 51
@@ -136,8 +131,7 @@ void __init early_init_devtree(void *params)
136} 131}
137 132
138#ifdef CONFIG_BLK_DEV_INITRD 133#ifdef CONFIG_BLK_DEV_INITRD
139void __init early_init_dt_setup_initrd_arch(unsigned long start, 134void __init early_init_dt_setup_initrd_arch(u64 start, u64 end)
140 unsigned long end)
141{ 135{
142 initrd_start = (unsigned long)__va(start); 136 initrd_start = (unsigned long)__va(start);
143 initrd_end = (unsigned long)__va(end); 137 initrd_end = (unsigned long)__va(end);
diff --git a/arch/mips/kernel/prom.c b/arch/mips/kernel/prom.c
index 7e954042f252..0fa0b69cdd53 100644
--- a/arch/mips/kernel/prom.c
+++ b/arch/mips/kernel/prom.c
@@ -58,8 +58,7 @@ void * __init early_init_dt_alloc_memory_arch(u64 size, u64 align)
58} 58}
59 59
60#ifdef CONFIG_BLK_DEV_INITRD 60#ifdef CONFIG_BLK_DEV_INITRD
61void __init early_init_dt_setup_initrd_arch(unsigned long start, 61void __init early_init_dt_setup_initrd_arch(u64 start, u64 end)
62 unsigned long end)
63{ 62{
64 initrd_start = (unsigned long)__va(start); 63 initrd_start = (unsigned long)__va(start);
65 initrd_end = (unsigned long)__va(end); 64 initrd_end = (unsigned long)__va(end);
diff --git a/arch/openrisc/kernel/prom.c b/arch/openrisc/kernel/prom.c
index 5869e3fa5dd3..a63e76872f84 100644
--- a/arch/openrisc/kernel/prom.c
+++ b/arch/openrisc/kernel/prom.c
@@ -55,11 +55,6 @@ void __init early_init_dt_add_memory_arch(u64 base, u64 size)
55 memblock_add(base, size); 55 memblock_add(base, size);
56} 56}
57 57
58void * __init early_init_dt_alloc_memory_arch(u64 size, u64 align)
59{
60 return __va(memblock_alloc(size, align));
61}
62
63void __init early_init_devtree(void *params) 58void __init early_init_devtree(void *params)
64{ 59{
65 void *alloc; 60 void *alloc;
@@ -96,8 +91,7 @@ void __init early_init_devtree(void *params)
96} 91}
97 92
98#ifdef CONFIG_BLK_DEV_INITRD 93#ifdef CONFIG_BLK_DEV_INITRD
99void __init early_init_dt_setup_initrd_arch(unsigned long start, 94void __init early_init_dt_setup_initrd_arch(u64 start, u64 end)
100 unsigned long end)
101{ 95{
102 initrd_start = (unsigned long)__va(start); 96 initrd_start = (unsigned long)__va(start);
103 initrd_end = (unsigned long)__va(end); 97 initrd_end = (unsigned long)__va(end);
diff --git a/arch/powerpc/kernel/prom.c b/arch/powerpc/kernel/prom.c
index 6bfcab97c981..b7634ce41dbc 100644
--- a/arch/powerpc/kernel/prom.c
+++ b/arch/powerpc/kernel/prom.c
@@ -546,14 +546,8 @@ void __init early_init_dt_add_memory_arch(u64 base, u64 size)
546 memblock_add(base, size); 546 memblock_add(base, size);
547} 547}
548 548
549void * __init early_init_dt_alloc_memory_arch(u64 size, u64 align)
550{
551 return __va(memblock_alloc(size, align));
552}
553
554#ifdef CONFIG_BLK_DEV_INITRD 549#ifdef CONFIG_BLK_DEV_INITRD
555void __init early_init_dt_setup_initrd_arch(unsigned long start, 550void __init early_init_dt_setup_initrd_arch(u64 start, u64 end)
556 unsigned long end)
557{ 551{
558 initrd_start = (unsigned long)__va(start); 552 initrd_start = (unsigned long)__va(start);
559 initrd_end = (unsigned long)__va(end); 553 initrd_end = (unsigned long)__va(end);
diff --git a/arch/x86/kernel/devicetree.c b/arch/x86/kernel/devicetree.c
index 69eb2fa25494..376dc7873447 100644
--- a/arch/x86/kernel/devicetree.c
+++ b/arch/x86/kernel/devicetree.c
@@ -52,8 +52,7 @@ void * __init early_init_dt_alloc_memory_arch(u64 size, u64 align)
52} 52}
53 53
54#ifdef CONFIG_BLK_DEV_INITRD 54#ifdef CONFIG_BLK_DEV_INITRD
55void __init early_init_dt_setup_initrd_arch(unsigned long start, 55void __init early_init_dt_setup_initrd_arch(u64 start, u64 end)
56 unsigned long end)
57{ 56{
58 initrd_start = (unsigned long)__va(start); 57 initrd_start = (unsigned long)__va(start);
59 initrd_end = (unsigned long)__va(end); 58 initrd_end = (unsigned long)__va(end);
diff --git a/arch/xtensa/kernel/setup.c b/arch/xtensa/kernel/setup.c
index 42a8bba0b0ea..101012bc1ff6 100644
--- a/arch/xtensa/kernel/setup.c
+++ b/arch/xtensa/kernel/setup.c
@@ -170,8 +170,7 @@ static int __init parse_tag_fdt(const bp_tag_t *tag)
170 170
171__tagtable(BP_TAG_FDT, parse_tag_fdt); 171__tagtable(BP_TAG_FDT, parse_tag_fdt);
172 172
173void __init early_init_dt_setup_initrd_arch(unsigned long start, 173void __init early_init_dt_setup_initrd_arch(u64 start, u64 end)
174 unsigned long end)
175{ 174{
176 initrd_start = (void *)__va(start); 175 initrd_start = (void *)__va(start);
177 initrd_end = (void *)__va(end); 176 initrd_end = (void *)__va(end);
diff --git a/drivers/gpio/gpiolib-of.c b/drivers/gpio/gpiolib-of.c
index ba9876ffb017..0dfaf20e4dad 100644
--- a/drivers/gpio/gpiolib-of.c
+++ b/drivers/gpio/gpiolib-of.c
@@ -195,8 +195,8 @@ static void of_gpiochip_add_pin_range(struct gpio_chip *chip)
195 return; 195 return;
196 196
197 for (;; index++) { 197 for (;; index++) {
198 ret = of_parse_phandle_with_args(np, "gpio-ranges", 198 ret = of_parse_phandle_with_fixed_args(np, "gpio-ranges", 3,
199 "#gpio-range-cells", index, &pinspec); 199 index, &pinspec);
200 if (ret) 200 if (ret)
201 break; 201 break;
202 202
diff --git a/drivers/of/base.c b/drivers/of/base.c
index e486e416d5a0..865d3f66c86b 100644
--- a/drivers/of/base.c
+++ b/drivers/of/base.c
@@ -1176,65 +1176,10 @@ int of_property_count_strings(struct device_node *np, const char *propname)
1176} 1176}
1177EXPORT_SYMBOL_GPL(of_property_count_strings); 1177EXPORT_SYMBOL_GPL(of_property_count_strings);
1178 1178
1179/**
1180 * of_parse_phandle - Resolve a phandle property to a device_node pointer
1181 * @np: Pointer to device node holding phandle property
1182 * @phandle_name: Name of property holding a phandle value
1183 * @index: For properties holding a table of phandles, this is the index into
1184 * the table
1185 *
1186 * Returns the device_node pointer with refcount incremented. Use
1187 * of_node_put() on it when done.
1188 */
1189struct device_node *of_parse_phandle(const struct device_node *np,
1190 const char *phandle_name, int index)
1191{
1192 const __be32 *phandle;
1193 int size;
1194
1195 phandle = of_get_property(np, phandle_name, &size);
1196 if ((!phandle) || (size < sizeof(*phandle) * (index + 1)))
1197 return NULL;
1198
1199 return of_find_node_by_phandle(be32_to_cpup(phandle + index));
1200}
1201EXPORT_SYMBOL(of_parse_phandle);
1202
1203/**
1204 * of_parse_phandle_with_args() - Find a node pointed by phandle in a list
1205 * @np: pointer to a device tree node containing a list
1206 * @list_name: property name that contains a list
1207 * @cells_name: property name that specifies phandles' arguments count
1208 * @index: index of a phandle to parse out
1209 * @out_args: optional pointer to output arguments structure (will be filled)
1210 *
1211 * This function is useful to parse lists of phandles and their arguments.
1212 * Returns 0 on success and fills out_args, on error returns appropriate
1213 * errno value.
1214 *
1215 * Caller is responsible to call of_node_put() on the returned out_args->node
1216 * pointer.
1217 *
1218 * Example:
1219 *
1220 * phandle1: node1 {
1221 * #list-cells = <2>;
1222 * }
1223 *
1224 * phandle2: node2 {
1225 * #list-cells = <1>;
1226 * }
1227 *
1228 * node3 {
1229 * list = <&phandle1 1 2 &phandle2 3>;
1230 * }
1231 *
1232 * To get a device_node of the `node2' node you may call this:
1233 * of_parse_phandle_with_args(node3, "list", "#list-cells", 1, &args);
1234 */
1235static int __of_parse_phandle_with_args(const struct device_node *np, 1179static int __of_parse_phandle_with_args(const struct device_node *np,
1236 const char *list_name, 1180 const char *list_name,
1237 const char *cells_name, int index, 1181 const char *cells_name,
1182 int cell_count, int index,
1238 struct of_phandle_args *out_args) 1183 struct of_phandle_args *out_args)
1239{ 1184{
1240 const __be32 *list, *list_end; 1185 const __be32 *list, *list_end;
@@ -1262,19 +1207,32 @@ static int __of_parse_phandle_with_args(const struct device_node *np,
1262 if (phandle) { 1207 if (phandle) {
1263 /* 1208 /*
1264 * Find the provider node and parse the #*-cells 1209 * Find the provider node and parse the #*-cells
1265 * property to determine the argument length 1210 * property to determine the argument length.
1211 *
1212 * This is not needed if the cell count is hard-coded
1213 * (i.e. cells_name not set, but cell_count is set),
1214 * except when we're going to return the found node
1215 * below.
1266 */ 1216 */
1267 node = of_find_node_by_phandle(phandle); 1217 if (cells_name || cur_index == index) {
1268 if (!node) { 1218 node = of_find_node_by_phandle(phandle);
1269 pr_err("%s: could not find phandle\n", 1219 if (!node) {
1270 np->full_name); 1220 pr_err("%s: could not find phandle\n",
1271 goto err; 1221 np->full_name);
1222 goto err;
1223 }
1272 } 1224 }
1273 if (of_property_read_u32(node, cells_name, &count)) { 1225
1274 pr_err("%s: could not get %s for %s\n", 1226 if (cells_name) {
1275 np->full_name, cells_name, 1227 if (of_property_read_u32(node, cells_name,
1276 node->full_name); 1228 &count)) {
1277 goto err; 1229 pr_err("%s: could not get %s for %s\n",
1230 np->full_name, cells_name,
1231 node->full_name);
1232 goto err;
1233 }
1234 } else {
1235 count = cell_count;
1278 } 1236 }
1279 1237
1280 /* 1238 /*
@@ -1334,17 +1292,117 @@ static int __of_parse_phandle_with_args(const struct device_node *np,
1334 return rc; 1292 return rc;
1335} 1293}
1336 1294
1295/**
1296 * of_parse_phandle - Resolve a phandle property to a device_node pointer
1297 * @np: Pointer to device node holding phandle property
1298 * @phandle_name: Name of property holding a phandle value
1299 * @index: For properties holding a table of phandles, this is the index into
1300 * the table
1301 *
1302 * Returns the device_node pointer with refcount incremented. Use
1303 * of_node_put() on it when done.
1304 */
1305struct device_node *of_parse_phandle(const struct device_node *np,
1306 const char *phandle_name, int index)
1307{
1308 struct of_phandle_args args;
1309
1310 if (index < 0)
1311 return NULL;
1312
1313 if (__of_parse_phandle_with_args(np, phandle_name, NULL, 0,
1314 index, &args))
1315 return NULL;
1316
1317 return args.np;
1318}
1319EXPORT_SYMBOL(of_parse_phandle);
1320
1321/**
1322 * of_parse_phandle_with_args() - Find a node pointed by phandle in a list
1323 * @np: pointer to a device tree node containing a list
1324 * @list_name: property name that contains a list
1325 * @cells_name: property name that specifies phandles' arguments count
1326 * @index: index of a phandle to parse out
1327 * @out_args: optional pointer to output arguments structure (will be filled)
1328 *
1329 * This function is useful to parse lists of phandles and their arguments.
1330 * Returns 0 on success and fills out_args, on error returns appropriate
1331 * errno value.
1332 *
1333 * Caller is responsible to call of_node_put() on the returned out_args->node
1334 * pointer.
1335 *
1336 * Example:
1337 *
1338 * phandle1: node1 {
1339 * #list-cells = <2>;
1340 * }
1341 *
1342 * phandle2: node2 {
1343 * #list-cells = <1>;
1344 * }
1345 *
1346 * node3 {
1347 * list = <&phandle1 1 2 &phandle2 3>;
1348 * }
1349 *
1350 * To get a device_node of the `node2' node you may call this:
1351 * of_parse_phandle_with_args(node3, "list", "#list-cells", 1, &args);
1352 */
1337int of_parse_phandle_with_args(const struct device_node *np, const char *list_name, 1353int of_parse_phandle_with_args(const struct device_node *np, const char *list_name,
1338 const char *cells_name, int index, 1354 const char *cells_name, int index,
1339 struct of_phandle_args *out_args) 1355 struct of_phandle_args *out_args)
1340{ 1356{
1341 if (index < 0) 1357 if (index < 0)
1342 return -EINVAL; 1358 return -EINVAL;
1343 return __of_parse_phandle_with_args(np, list_name, cells_name, index, out_args); 1359 return __of_parse_phandle_with_args(np, list_name, cells_name, 0,
1360 index, out_args);
1344} 1361}
1345EXPORT_SYMBOL(of_parse_phandle_with_args); 1362EXPORT_SYMBOL(of_parse_phandle_with_args);
1346 1363
1347/** 1364/**
1365 * of_parse_phandle_with_fixed_args() - Find a node pointed by phandle in a list
1366 * @np: pointer to a device tree node containing a list
1367 * @list_name: property name that contains a list
1368 * @cell_count: number of argument cells following the phandle
1369 * @index: index of a phandle to parse out
1370 * @out_args: optional pointer to output arguments structure (will be filled)
1371 *
1372 * This function is useful to parse lists of phandles and their arguments.
1373 * Returns 0 on success and fills out_args, on error returns appropriate
1374 * errno value.
1375 *
1376 * Caller is responsible to call of_node_put() on the returned out_args->node
1377 * pointer.
1378 *
1379 * Example:
1380 *
1381 * phandle1: node1 {
1382 * }
1383 *
1384 * phandle2: node2 {
1385 * }
1386 *
1387 * node3 {
1388 * list = <&phandle1 0 2 &phandle2 2 3>;
1389 * }
1390 *
1391 * To get a device_node of the `node2' node you may call this:
1392 * of_parse_phandle_with_fixed_args(node3, "list", 2, 1, &args);
1393 */
1394int of_parse_phandle_with_fixed_args(const struct device_node *np,
1395 const char *list_name, int cell_count,
1396 int index, struct of_phandle_args *out_args)
1397{
1398 if (index < 0)
1399 return -EINVAL;
1400 return __of_parse_phandle_with_args(np, list_name, NULL, cell_count,
1401 index, out_args);
1402}
1403EXPORT_SYMBOL(of_parse_phandle_with_fixed_args);
1404
1405/**
1348 * of_count_phandle_with_args() - Find the number of phandles references in a property 1406 * of_count_phandle_with_args() - Find the number of phandles references in a property
1349 * @np: pointer to a device tree node containing a list 1407 * @np: pointer to a device tree node containing a list
1350 * @list_name: property name that contains a list 1408 * @list_name: property name that contains a list
@@ -1362,7 +1420,8 @@ EXPORT_SYMBOL(of_parse_phandle_with_args);
1362int of_count_phandle_with_args(const struct device_node *np, const char *list_name, 1420int of_count_phandle_with_args(const struct device_node *np, const char *list_name,
1363 const char *cells_name) 1421 const char *cells_name)
1364{ 1422{
1365 return __of_parse_phandle_with_args(np, list_name, cells_name, -1, NULL); 1423 return __of_parse_phandle_with_args(np, list_name, cells_name, 0, -1,
1424 NULL);
1366} 1425}
1367EXPORT_SYMBOL(of_count_phandle_with_args); 1426EXPORT_SYMBOL(of_count_phandle_with_args);
1368 1427
@@ -1734,6 +1793,7 @@ void of_alias_scan(void * (*dt_alloc)(u64 size, u64 align))
1734 ap = dt_alloc(sizeof(*ap) + len + 1, 4); 1793 ap = dt_alloc(sizeof(*ap) + len + 1, 4);
1735 if (!ap) 1794 if (!ap)
1736 continue; 1795 continue;
1796 memset(ap, 0, sizeof(*ap) + len + 1);
1737 ap->alias = start; 1797 ap->alias = start;
1738 of_alias_add(ap, np, id, start, len); 1798 of_alias_add(ap, np, id, start, len);
1739 } 1799 }
diff --git a/drivers/of/fdt.c b/drivers/of/fdt.c
index 4fb06f3e7b3c..229dd9d69e18 100644
--- a/drivers/of/fdt.c
+++ b/drivers/of/fdt.c
@@ -11,12 +11,14 @@
11 11
12#include <linux/kernel.h> 12#include <linux/kernel.h>
13#include <linux/initrd.h> 13#include <linux/initrd.h>
14#include <linux/memblock.h>
14#include <linux/module.h> 15#include <linux/module.h>
15#include <linux/of.h> 16#include <linux/of.h>
16#include <linux/of_fdt.h> 17#include <linux/of_fdt.h>
17#include <linux/string.h> 18#include <linux/string.h>
18#include <linux/errno.h> 19#include <linux/errno.h>
19#include <linux/slab.h> 20#include <linux/slab.h>
21#include <linux/random.h>
20 22
21#include <asm/setup.h> /* for COMMAND_LINE_SIZE */ 23#include <asm/setup.h> /* for COMMAND_LINE_SIZE */
22#ifdef CONFIG_PPC 24#ifdef CONFIG_PPC
@@ -125,13 +127,13 @@ int of_fdt_match(struct boot_param_header *blob, unsigned long node,
125 return score; 127 return score;
126} 128}
127 129
128static void *unflatten_dt_alloc(unsigned long *mem, unsigned long size, 130static void *unflatten_dt_alloc(void **mem, unsigned long size,
129 unsigned long align) 131 unsigned long align)
130{ 132{
131 void *res; 133 void *res;
132 134
133 *mem = ALIGN(*mem, align); 135 *mem = PTR_ALIGN(*mem, align);
134 res = (void *)*mem; 136 res = *mem;
135 *mem += size; 137 *mem += size;
136 138
137 return res; 139 return res;
@@ -146,9 +148,9 @@ static void *unflatten_dt_alloc(unsigned long *mem, unsigned long size,
146 * @allnextpp: pointer to ->allnext from last allocated device_node 148 * @allnextpp: pointer to ->allnext from last allocated device_node
147 * @fpsize: Size of the node path up at the current depth. 149 * @fpsize: Size of the node path up at the current depth.
148 */ 150 */
149static unsigned long unflatten_dt_node(struct boot_param_header *blob, 151static void * unflatten_dt_node(struct boot_param_header *blob,
150 unsigned long mem, 152 void *mem,
151 unsigned long *p, 153 void **p,
152 struct device_node *dad, 154 struct device_node *dad,
153 struct device_node ***allnextpp, 155 struct device_node ***allnextpp,
154 unsigned long fpsize) 156 unsigned long fpsize)
@@ -161,15 +163,15 @@ static unsigned long unflatten_dt_node(struct boot_param_header *blob,
161 int has_name = 0; 163 int has_name = 0;
162 int new_format = 0; 164 int new_format = 0;
163 165
164 tag = be32_to_cpup((__be32 *)(*p)); 166 tag = be32_to_cpup(*p);
165 if (tag != OF_DT_BEGIN_NODE) { 167 if (tag != OF_DT_BEGIN_NODE) {
166 pr_err("Weird tag at start of node: %x\n", tag); 168 pr_err("Weird tag at start of node: %x\n", tag);
167 return mem; 169 return mem;
168 } 170 }
169 *p += 4; 171 *p += 4;
170 pathp = (char *)*p; 172 pathp = *p;
171 l = allocl = strlen(pathp) + 1; 173 l = allocl = strlen(pathp) + 1;
172 *p = ALIGN(*p + l, 4); 174 *p = PTR_ALIGN(*p + l, 4);
173 175
174 /* version 0x10 has a more compact unit name here instead of the full 176 /* version 0x10 has a more compact unit name here instead of the full
175 * path. we accumulate the full path size using "fpsize", we'll rebuild 177 * path. we accumulate the full path size using "fpsize", we'll rebuild
@@ -201,7 +203,6 @@ static unsigned long unflatten_dt_node(struct boot_param_header *blob,
201 __alignof__(struct device_node)); 203 __alignof__(struct device_node));
202 if (allnextpp) { 204 if (allnextpp) {
203 char *fn; 205 char *fn;
204 memset(np, 0, sizeof(*np));
205 np->full_name = fn = ((char *)np) + sizeof(*np); 206 np->full_name = fn = ((char *)np) + sizeof(*np);
206 if (new_format) { 207 if (new_format) {
207 /* rebuild full path for new format */ 208 /* rebuild full path for new format */
@@ -239,7 +240,7 @@ static unsigned long unflatten_dt_node(struct boot_param_header *blob,
239 u32 sz, noff; 240 u32 sz, noff;
240 char *pname; 241 char *pname;
241 242
242 tag = be32_to_cpup((__be32 *)(*p)); 243 tag = be32_to_cpup(*p);
243 if (tag == OF_DT_NOP) { 244 if (tag == OF_DT_NOP) {
244 *p += 4; 245 *p += 4;
245 continue; 246 continue;
@@ -247,11 +248,11 @@ static unsigned long unflatten_dt_node(struct boot_param_header *blob,
247 if (tag != OF_DT_PROP) 248 if (tag != OF_DT_PROP)
248 break; 249 break;
249 *p += 4; 250 *p += 4;
250 sz = be32_to_cpup((__be32 *)(*p)); 251 sz = be32_to_cpup(*p);
251 noff = be32_to_cpup((__be32 *)((*p) + 4)); 252 noff = be32_to_cpup(*p + 4);
252 *p += 8; 253 *p += 8;
253 if (be32_to_cpu(blob->version) < 0x10) 254 if (be32_to_cpu(blob->version) < 0x10)
254 *p = ALIGN(*p, sz >= 8 ? 8 : 4); 255 *p = PTR_ALIGN(*p, sz >= 8 ? 8 : 4);
255 256
256 pname = of_fdt_get_string(blob, noff); 257 pname = of_fdt_get_string(blob, noff);
257 if (pname == NULL) { 258 if (pname == NULL) {
@@ -281,11 +282,11 @@ static unsigned long unflatten_dt_node(struct boot_param_header *blob,
281 np->phandle = be32_to_cpup((__be32 *)*p); 282 np->phandle = be32_to_cpup((__be32 *)*p);
282 pp->name = pname; 283 pp->name = pname;
283 pp->length = sz; 284 pp->length = sz;
284 pp->value = (void *)*p; 285 pp->value = *p;
285 *prev_pp = pp; 286 *prev_pp = pp;
286 prev_pp = &pp->next; 287 prev_pp = &pp->next;
287 } 288 }
288 *p = ALIGN((*p) + sz, 4); 289 *p = PTR_ALIGN((*p) + sz, 4);
289 } 290 }
290 /* with version 0x10 we may not have the name property, recreate 291 /* with version 0x10 we may not have the name property, recreate
291 * it here from the unit name if absent 292 * it here from the unit name if absent
@@ -334,7 +335,7 @@ static unsigned long unflatten_dt_node(struct boot_param_header *blob,
334 else 335 else
335 mem = unflatten_dt_node(blob, mem, p, np, allnextpp, 336 mem = unflatten_dt_node(blob, mem, p, np, allnextpp,
336 fpsize); 337 fpsize);
337 tag = be32_to_cpup((__be32 *)(*p)); 338 tag = be32_to_cpup(*p);
338 } 339 }
339 if (tag != OF_DT_END_NODE) { 340 if (tag != OF_DT_END_NODE) {
340 pr_err("Weird tag at end of node: %x\n", tag); 341 pr_err("Weird tag at end of node: %x\n", tag);
@@ -360,7 +361,8 @@ static void __unflatten_device_tree(struct boot_param_header *blob,
360 struct device_node **mynodes, 361 struct device_node **mynodes,
361 void * (*dt_alloc)(u64 size, u64 align)) 362 void * (*dt_alloc)(u64 size, u64 align))
362{ 363{
363 unsigned long start, mem, size; 364 unsigned long size;
365 void *start, *mem;
364 struct device_node **allnextp = mynodes; 366 struct device_node **allnextp = mynodes;
365 367
366 pr_debug(" -> unflatten_device_tree()\n"); 368 pr_debug(" -> unflatten_device_tree()\n");
@@ -381,32 +383,28 @@ static void __unflatten_device_tree(struct boot_param_header *blob,
381 } 383 }
382 384
383 /* First pass, scan for size */ 385 /* First pass, scan for size */
384 start = ((unsigned long)blob) + 386 start = ((void *)blob) + be32_to_cpu(blob->off_dt_struct);
385 be32_to_cpu(blob->off_dt_struct); 387 size = (unsigned long)unflatten_dt_node(blob, 0, &start, NULL, NULL, 0);
386 size = unflatten_dt_node(blob, 0, &start, NULL, NULL, 0); 388 size = ALIGN(size, 4);
387 size = (size | 3) + 1;
388 389
389 pr_debug(" size is %lx, allocating...\n", size); 390 pr_debug(" size is %lx, allocating...\n", size);
390 391
391 /* Allocate memory for the expanded device tree */ 392 /* Allocate memory for the expanded device tree */
392 mem = (unsigned long) 393 mem = dt_alloc(size + 4, __alignof__(struct device_node));
393 dt_alloc(size + 4, __alignof__(struct device_node)); 394 memset(mem, 0, size);
394 395
395 memset((void *)mem, 0, size); 396 *(__be32 *)(mem + size) = cpu_to_be32(0xdeadbeef);
396 397
397 ((__be32 *)mem)[size / 4] = cpu_to_be32(0xdeadbeef); 398 pr_debug(" unflattening %p...\n", mem);
398
399 pr_debug(" unflattening %lx...\n", mem);
400 399
401 /* Second pass, do actual unflattening */ 400 /* Second pass, do actual unflattening */
402 start = ((unsigned long)blob) + 401 start = ((void *)blob) + be32_to_cpu(blob->off_dt_struct);
403 be32_to_cpu(blob->off_dt_struct);
404 unflatten_dt_node(blob, mem, &start, NULL, &allnextp, 0); 402 unflatten_dt_node(blob, mem, &start, NULL, &allnextp, 0);
405 if (be32_to_cpup((__be32 *)start) != OF_DT_END) 403 if (be32_to_cpup(start) != OF_DT_END)
406 pr_warning("Weird tag at end of tree: %08x\n", *((u32 *)start)); 404 pr_warning("Weird tag at end of tree: %08x\n", be32_to_cpup(start));
407 if (be32_to_cpu(((__be32 *)mem)[size / 4]) != 0xdeadbeef) 405 if (be32_to_cpup(mem + size) != 0xdeadbeef)
408 pr_warning("End of tree marker overwritten: %08x\n", 406 pr_warning("End of tree marker overwritten: %08x\n",
409 be32_to_cpu(((__be32 *)mem)[size / 4])); 407 be32_to_cpup(mem + size));
410 *allnextp = NULL; 408 *allnextp = NULL;
411 409
412 pr_debug(" <- unflatten_device_tree()\n"); 410 pr_debug(" <- unflatten_device_tree()\n");
@@ -628,7 +626,8 @@ int __init of_scan_flat_dt_by_path(const char *path,
628 */ 626 */
629void __init early_init_dt_check_for_initrd(unsigned long node) 627void __init early_init_dt_check_for_initrd(unsigned long node)
630{ 628{
631 unsigned long start, end, len; 629 u64 start, end;
630 unsigned long len;
632 __be32 *prop; 631 __be32 *prop;
633 632
634 pr_debug("Looking for initrd properties... "); 633 pr_debug("Looking for initrd properties... ");
@@ -636,15 +635,16 @@ void __init early_init_dt_check_for_initrd(unsigned long node)
636 prop = of_get_flat_dt_prop(node, "linux,initrd-start", &len); 635 prop = of_get_flat_dt_prop(node, "linux,initrd-start", &len);
637 if (!prop) 636 if (!prop)
638 return; 637 return;
639 start = of_read_ulong(prop, len/4); 638 start = of_read_number(prop, len/4);
640 639
641 prop = of_get_flat_dt_prop(node, "linux,initrd-end", &len); 640 prop = of_get_flat_dt_prop(node, "linux,initrd-end", &len);
642 if (!prop) 641 if (!prop)
643 return; 642 return;
644 end = of_read_ulong(prop, len/4); 643 end = of_read_number(prop, len/4);
645 644
646 early_init_dt_setup_initrd_arch(start, end); 645 early_init_dt_setup_initrd_arch(start, end);
647 pr_debug("initrd_start=0x%lx initrd_end=0x%lx\n", start, end); 646 pr_debug("initrd_start=0x%llx initrd_end=0x%llx\n",
647 (unsigned long long)start, (unsigned long long)end);
648} 648}
649#else 649#else
650inline void early_init_dt_check_for_initrd(unsigned long node) 650inline void early_init_dt_check_for_initrd(unsigned long node)
@@ -774,6 +774,17 @@ int __init early_init_dt_scan_chosen(unsigned long node, const char *uname,
774 return 1; 774 return 1;
775} 775}
776 776
777#ifdef CONFIG_HAVE_MEMBLOCK
778/*
779 * called from unflatten_device_tree() to bootstrap devicetree itself
780 * Architectures can override this definition if memblock isn't used
781 */
782void * __init __weak early_init_dt_alloc_memory_arch(u64 size, u64 align)
783{
784 return __va(memblock_alloc(size, align));
785}
786#endif
787
777/** 788/**
778 * unflatten_device_tree - create tree of device_nodes from flat blob 789 * unflatten_device_tree - create tree of device_nodes from flat blob
779 * 790 *
@@ -792,3 +803,14 @@ void __init unflatten_device_tree(void)
792} 803}
793 804
794#endif /* CONFIG_OF_EARLY_FLATTREE */ 805#endif /* CONFIG_OF_EARLY_FLATTREE */
806
807/* Feed entire flattened device tree into the random pool */
808static int __init add_fdt_randomness(void)
809{
810 if (initial_boot_params)
811 add_device_randomness(initial_boot_params,
812 be32_to_cpu(initial_boot_params->totalsize));
813
814 return 0;
815}
816core_initcall(add_fdt_randomness);
diff --git a/drivers/of/irq.c b/drivers/of/irq.c
index 1264923ade0f..1752988d6aa8 100644
--- a/drivers/of/irq.c
+++ b/drivers/of/irq.c
@@ -28,7 +28,7 @@
28 28
29/** 29/**
30 * irq_of_parse_and_map - Parse and map an interrupt into linux virq space 30 * irq_of_parse_and_map - Parse and map an interrupt into linux virq space
31 * @device: Device node of the device whose interrupt is to be mapped 31 * @dev: Device node of the device whose interrupt is to be mapped
32 * @index: Index of the interrupt to map 32 * @index: Index of the interrupt to map
33 * 33 *
34 * This function is a wrapper that chains of_irq_map_one() and 34 * This function is a wrapper that chains of_irq_map_one() and
diff --git a/drivers/of/of_net.c b/drivers/of/of_net.c
index ea174c8ee34b..8f9be2e09937 100644
--- a/drivers/of/of_net.c
+++ b/drivers/of/of_net.c
@@ -39,7 +39,7 @@ static const char *phy_modes[] = {
39 * The function gets phy interface string from property 'phy-mode', 39 * The function gets phy interface string from property 'phy-mode',
40 * and return its index in phy_modes table, or errno in error case. 40 * and return its index in phy_modes table, or errno in error case.
41 */ 41 */
42const int of_get_phy_mode(struct device_node *np) 42int of_get_phy_mode(struct device_node *np)
43{ 43{
44 const char *pm; 44 const char *pm;
45 int err, i; 45 int err, i;
diff --git a/drivers/of/platform.c b/drivers/of/platform.c
index eeca8a596973..9b439ac63d8e 100644
--- a/drivers/of/platform.c
+++ b/drivers/of/platform.c
@@ -197,7 +197,7 @@ EXPORT_SYMBOL(of_device_alloc);
197 * Returns pointer to created platform device, or NULL if a device was not 197 * Returns pointer to created platform device, or NULL if a device was not
198 * registered. Unavailable devices will not get registered. 198 * registered. Unavailable devices will not get registered.
199 */ 199 */
200struct platform_device *of_platform_device_create_pdata( 200static struct platform_device *of_platform_device_create_pdata(
201 struct device_node *np, 201 struct device_node *np,
202 const char *bus_id, 202 const char *bus_id,
203 void *platform_data, 203 void *platform_data,
@@ -268,8 +268,11 @@ static struct amba_device *of_amba_device_create(struct device_node *node,
268 return NULL; 268 return NULL;
269 269
270 dev = amba_device_alloc(NULL, 0, 0); 270 dev = amba_device_alloc(NULL, 0, 0);
271 if (!dev) 271 if (!dev) {
272 pr_err("%s(): amba_device_alloc() failed for %s\n",
273 __func__, node->full_name);
272 return NULL; 274 return NULL;
275 }
273 276
274 /* setup generic device info */ 277 /* setup generic device info */
275 dev->dev.coherent_dma_mask = ~0; 278 dev->dev.coherent_dma_mask = ~0;
@@ -294,12 +297,18 @@ static struct amba_device *of_amba_device_create(struct device_node *node,
294 dev->irq[i] = irq_of_parse_and_map(node, i); 297 dev->irq[i] = irq_of_parse_and_map(node, i);
295 298
296 ret = of_address_to_resource(node, 0, &dev->res); 299 ret = of_address_to_resource(node, 0, &dev->res);
297 if (ret) 300 if (ret) {
301 pr_err("%s(): of_address_to_resource() failed (%d) for %s\n",
302 __func__, ret, node->full_name);
298 goto err_free; 303 goto err_free;
304 }
299 305
300 ret = amba_device_add(dev, &iomem_resource); 306 ret = amba_device_add(dev, &iomem_resource);
301 if (ret) 307 if (ret) {
308 pr_err("%s(): amba_device_add() failed (%d) for %s\n",
309 __func__, ret, node->full_name);
302 goto err_free; 310 goto err_free;
311 }
303 312
304 return dev; 313 return dev;
305 314
@@ -378,6 +387,10 @@ static int of_platform_bus_create(struct device_node *bus,
378 } 387 }
379 388
380 if (of_device_is_compatible(bus, "arm,primecell")) { 389 if (of_device_is_compatible(bus, "arm,primecell")) {
390 /*
391 * Don't return an error here to keep compatibility with older
392 * device tree files.
393 */
381 of_amba_device_create(bus, bus_id, platform_data, parent); 394 of_amba_device_create(bus, bus_id, platform_data, parent);
382 return 0; 395 return 0;
383 } 396 }
diff --git a/include/dt-bindings/input/input.h b/include/dt-bindings/input/input.h
new file mode 100644
index 000000000000..042e7b3b6296
--- /dev/null
+++ b/include/dt-bindings/input/input.h
@@ -0,0 +1,525 @@
1/*
2 * This header provides constants for most input bindings.
3 *
4 * Most input bindings include key code, matrix key code format.
5 * In most cases, key code and matrix key code format uses
6 * the standard values/macro defined in this header.
7 */
8
9#ifndef _DT_BINDINGS_INPUT_INPUT_H
10#define _DT_BINDINGS_INPUT_INPUT_H
11
12#define KEY_RESERVED 0
13#define KEY_ESC 1
14#define KEY_1 2
15#define KEY_2 3
16#define KEY_3 4
17#define KEY_4 5
18#define KEY_5 6
19#define KEY_6 7
20#define KEY_7 8
21#define KEY_8 9
22#define KEY_9 10
23#define KEY_0 11
24#define KEY_MINUS 12
25#define KEY_EQUAL 13
26#define KEY_BACKSPACE 14
27#define KEY_TAB 15
28#define KEY_Q 16
29#define KEY_W 17
30#define KEY_E 18
31#define KEY_R 19
32#define KEY_T 20
33#define KEY_Y 21
34#define KEY_U 22
35#define KEY_I 23
36#define KEY_O 24
37#define KEY_P 25
38#define KEY_LEFTBRACE 26
39#define KEY_RIGHTBRACE 27
40#define KEY_ENTER 28
41#define KEY_LEFTCTRL 29
42#define KEY_A 30
43#define KEY_S 31
44#define KEY_D 32
45#define KEY_F 33
46#define KEY_G 34
47#define KEY_H 35
48#define KEY_J 36
49#define KEY_K 37
50#define KEY_L 38
51#define KEY_SEMICOLON 39
52#define KEY_APOSTROPHE 40
53#define KEY_GRAVE 41
54#define KEY_LEFTSHIFT 42
55#define KEY_BACKSLASH 43
56#define KEY_Z 44
57#define KEY_X 45
58#define KEY_C 46
59#define KEY_V 47
60#define KEY_B 48
61#define KEY_N 49
62#define KEY_M 50
63#define KEY_COMMA 51
64#define KEY_DOT 52
65#define KEY_SLASH 53
66#define KEY_RIGHTSHIFT 54
67#define KEY_KPASTERISK 55
68#define KEY_LEFTALT 56
69#define KEY_SPACE 57
70#define KEY_CAPSLOCK 58
71#define KEY_F1 59
72#define KEY_F2 60
73#define KEY_F3 61
74#define KEY_F4 62
75#define KEY_F5 63
76#define KEY_F6 64
77#define KEY_F7 65
78#define KEY_F8 66
79#define KEY_F9 67
80#define KEY_F10 68
81#define KEY_NUMLOCK 69
82#define KEY_SCROLLLOCK 70
83#define KEY_KP7 71
84#define KEY_KP8 72
85#define KEY_KP9 73
86#define KEY_KPMINUS 74
87#define KEY_KP4 75
88#define KEY_KP5 76
89#define KEY_KP6 77
90#define KEY_KPPLUS 78
91#define KEY_KP1 79
92#define KEY_KP2 80
93#define KEY_KP3 81
94#define KEY_KP0 82
95#define KEY_KPDOT 83
96
97#define KEY_ZENKAKUHANKAKU 85
98#define KEY_102ND 86
99#define KEY_F11 87
100#define KEY_F12 88
101#define KEY_RO 89
102#define KEY_KATAKANA 90
103#define KEY_HIRAGANA 91
104#define KEY_HENKAN 92
105#define KEY_KATAKANAHIRAGANA 93
106#define KEY_MUHENKAN 94
107#define KEY_KPJPCOMMA 95
108#define KEY_KPENTER 96
109#define KEY_RIGHTCTRL 97
110#define KEY_KPSLASH 98
111#define KEY_SYSRQ 99
112#define KEY_RIGHTALT 100
113#define KEY_LINEFEED 101
114#define KEY_HOME 102
115#define KEY_UP 103
116#define KEY_PAGEUP 104
117#define KEY_LEFT 105
118#define KEY_RIGHT 106
119#define KEY_END 107
120#define KEY_DOWN 108
121#define KEY_PAGEDOWN 109
122#define KEY_INSERT 110
123#define KEY_DELETE 111
124#define KEY_MACRO 112
125#define KEY_MUTE 113
126#define KEY_VOLUMEDOWN 114
127#define KEY_VOLUMEUP 115
128#define KEY_POWER 116 /* SC System Power Down */
129#define KEY_KPEQUAL 117
130#define KEY_KPPLUSMINUS 118
131#define KEY_PAUSE 119
132#define KEY_SCALE 120 /* AL Compiz Scale (Expose) */
133
134#define KEY_KPCOMMA 121
135#define KEY_HANGEUL 122
136#define KEY_HANGUEL KEY_HANGEUL
137#define KEY_HANJA 123
138#define KEY_YEN 124
139#define KEY_LEFTMETA 125
140#define KEY_RIGHTMETA 126
141#define KEY_COMPOSE 127
142
143#define KEY_STOP 128 /* AC Stop */
144#define KEY_AGAIN 129
145#define KEY_PROPS 130 /* AC Properties */
146#define KEY_UNDO 131 /* AC Undo */
147#define KEY_FRONT 132
148#define KEY_COPY 133 /* AC Copy */
149#define KEY_OPEN 134 /* AC Open */
150#define KEY_PASTE 135 /* AC Paste */
151#define KEY_FIND 136 /* AC Search */
152#define KEY_CUT 137 /* AC Cut */
153#define KEY_HELP 138 /* AL Integrated Help Center */
154#define KEY_MENU 139 /* Menu (show menu) */
155#define KEY_CALC 140 /* AL Calculator */
156#define KEY_SETUP 141
157#define KEY_SLEEP 142 /* SC System Sleep */
158#define KEY_WAKEUP 143 /* System Wake Up */
159#define KEY_FILE 144 /* AL Local Machine Browser */
160#define KEY_SENDFILE 145
161#define KEY_DELETEFILE 146
162#define KEY_XFER 147
163#define KEY_PROG1 148
164#define KEY_PROG2 149
165#define KEY_WWW 150 /* AL Internet Browser */
166#define KEY_MSDOS 151
167#define KEY_COFFEE 152 /* AL Terminal Lock/Screensaver */
168#define KEY_SCREENLOCK KEY_COFFEE
169#define KEY_DIRECTION 153
170#define KEY_CYCLEWINDOWS 154
171#define KEY_MAIL 155
172#define KEY_BOOKMARKS 156 /* AC Bookmarks */
173#define KEY_COMPUTER 157
174#define KEY_BACK 158 /* AC Back */
175#define KEY_FORWARD 159 /* AC Forward */
176#define KEY_CLOSECD 160
177#define KEY_EJECTCD 161
178#define KEY_EJECTCLOSECD 162
179#define KEY_NEXTSONG 163
180#define KEY_PLAYPAUSE 164
181#define KEY_PREVIOUSSONG 165
182#define KEY_STOPCD 166
183#define KEY_RECORD 167
184#define KEY_REWIND 168
185#define KEY_PHONE 169 /* Media Select Telephone */
186#define KEY_ISO 170
187#define KEY_CONFIG 171 /* AL Consumer Control Configuration */
188#define KEY_HOMEPAGE 172 /* AC Home */
189#define KEY_REFRESH 173 /* AC Refresh */
190#define KEY_EXIT 174 /* AC Exit */
191#define KEY_MOVE 175
192#define KEY_EDIT 176
193#define KEY_SCROLLUP 177
194#define KEY_SCROLLDOWN 178
195#define KEY_KPLEFTPAREN 179
196#define KEY_KPRIGHTPAREN 180
197#define KEY_NEW 181 /* AC New */
198#define KEY_REDO 182 /* AC Redo/Repeat */
199
200#define KEY_F13 183
201#define KEY_F14 184
202#define KEY_F15 185
203#define KEY_F16 186
204#define KEY_F17 187
205#define KEY_F18 188
206#define KEY_F19 189
207#define KEY_F20 190
208#define KEY_F21 191
209#define KEY_F22 192
210#define KEY_F23 193
211#define KEY_F24 194
212
213#define KEY_PLAYCD 200
214#define KEY_PAUSECD 201
215#define KEY_PROG3 202
216#define KEY_PROG4 203
217#define KEY_DASHBOARD 204 /* AL Dashboard */
218#define KEY_SUSPEND 205
219#define KEY_CLOSE 206 /* AC Close */
220#define KEY_PLAY 207
221#define KEY_FASTFORWARD 208
222#define KEY_BASSBOOST 209
223#define KEY_PRINT 210 /* AC Print */
224#define KEY_HP 211
225#define KEY_CAMERA 212
226#define KEY_SOUND 213
227#define KEY_QUESTION 214
228#define KEY_EMAIL 215
229#define KEY_CHAT 216
230#define KEY_SEARCH 217
231#define KEY_CONNECT 218
232#define KEY_FINANCE 219 /* AL Checkbook/Finance */
233#define KEY_SPORT 220
234#define KEY_SHOP 221
235#define KEY_ALTERASE 222
236#define KEY_CANCEL 223 /* AC Cancel */
237#define KEY_BRIGHTNESSDOWN 224
238#define KEY_BRIGHTNESSUP 225
239#define KEY_MEDIA 226
240
241#define KEY_SWITCHVIDEOMODE 227 /* Cycle between available video
242 outputs (Monitor/LCD/TV-out/etc) */
243#define KEY_KBDILLUMTOGGLE 228
244#define KEY_KBDILLUMDOWN 229
245#define KEY_KBDILLUMUP 230
246
247#define KEY_SEND 231 /* AC Send */
248#define KEY_REPLY 232 /* AC Reply */
249#define KEY_FORWARDMAIL 233 /* AC Forward Msg */
250#define KEY_SAVE 234 /* AC Save */
251#define KEY_DOCUMENTS 235
252
253#define KEY_BATTERY 236
254
255#define KEY_BLUETOOTH 237
256#define KEY_WLAN 238
257#define KEY_UWB 239
258
259#define KEY_UNKNOWN 240
260
261#define KEY_VIDEO_NEXT 241 /* drive next video source */
262#define KEY_VIDEO_PREV 242 /* drive previous video source */
263#define KEY_BRIGHTNESS_CYCLE 243 /* brightness up, after max is min */
264#define KEY_BRIGHTNESS_ZERO 244 /* brightness off, use ambient */
265#define KEY_DISPLAY_OFF 245 /* display device to off state */
266
267#define KEY_WIMAX 246
268#define KEY_RFKILL 247 /* Key that controls all radios */
269
270#define KEY_MICMUTE 248 /* Mute / unmute the microphone */
271
272/* Code 255 is reserved for special needs of AT keyboard driver */
273
274#define BTN_MISC 0x100
275#define BTN_0 0x100
276#define BTN_1 0x101
277#define BTN_2 0x102
278#define BTN_3 0x103
279#define BTN_4 0x104
280#define BTN_5 0x105
281#define BTN_6 0x106
282#define BTN_7 0x107
283#define BTN_8 0x108
284#define BTN_9 0x109
285
286#define BTN_MOUSE 0x110
287#define BTN_LEFT 0x110
288#define BTN_RIGHT 0x111
289#define BTN_MIDDLE 0x112
290#define BTN_SIDE 0x113
291#define BTN_EXTRA 0x114
292#define BTN_FORWARD 0x115
293#define BTN_BACK 0x116
294#define BTN_TASK 0x117
295
296#define BTN_JOYSTICK 0x120
297#define BTN_TRIGGER 0x120
298#define BTN_THUMB 0x121
299#define BTN_THUMB2 0x122
300#define BTN_TOP 0x123
301#define BTN_TOP2 0x124
302#define BTN_PINKIE 0x125
303#define BTN_BASE 0x126
304#define BTN_BASE2 0x127
305#define BTN_BASE3 0x128
306#define BTN_BASE4 0x129
307#define BTN_BASE5 0x12a
308#define BTN_BASE6 0x12b
309#define BTN_DEAD 0x12f
310
311#define BTN_GAMEPAD 0x130
312#define BTN_SOUTH 0x130
313#define BTN_A BTN_SOUTH
314#define BTN_EAST 0x131
315#define BTN_B BTN_EAST
316#define BTN_C 0x132
317#define BTN_NORTH 0x133
318#define BTN_X BTN_NORTH
319#define BTN_WEST 0x134
320#define BTN_Y BTN_WEST
321#define BTN_Z 0x135
322#define BTN_TL 0x136
323#define BTN_TR 0x137
324#define BTN_TL2 0x138
325#define BTN_TR2 0x139
326#define BTN_SELECT 0x13a
327#define BTN_START 0x13b
328#define BTN_MODE 0x13c
329#define BTN_THUMBL 0x13d
330#define BTN_THUMBR 0x13e
331
332#define BTN_DIGI 0x140
333#define BTN_TOOL_PEN 0x140
334#define BTN_TOOL_RUBBER 0x141
335#define BTN_TOOL_BRUSH 0x142
336#define BTN_TOOL_PENCIL 0x143
337#define BTN_TOOL_AIRBRUSH 0x144
338#define BTN_TOOL_FINGER 0x145
339#define BTN_TOOL_MOUSE 0x146
340#define BTN_TOOL_LENS 0x147
341#define BTN_TOOL_QUINTTAP 0x148 /* Five fingers on trackpad */
342#define BTN_TOUCH 0x14a
343#define BTN_STYLUS 0x14b
344#define BTN_STYLUS2 0x14c
345#define BTN_TOOL_DOUBLETAP 0x14d
346#define BTN_TOOL_TRIPLETAP 0x14e
347#define BTN_TOOL_QUADTAP 0x14f /* Four fingers on trackpad */
348
349#define BTN_WHEEL 0x150
350#define BTN_GEAR_DOWN 0x150
351#define BTN_GEAR_UP 0x151
352
353#define KEY_OK 0x160
354#define KEY_SELECT 0x161
355#define KEY_GOTO 0x162
356#define KEY_CLEAR 0x163
357#define KEY_POWER2 0x164
358#define KEY_OPTION 0x165
359#define KEY_INFO 0x166 /* AL OEM Features/Tips/Tutorial */
360#define KEY_TIME 0x167
361#define KEY_VENDOR 0x168
362#define KEY_ARCHIVE 0x169
363#define KEY_PROGRAM 0x16a /* Media Select Program Guide */
364#define KEY_CHANNEL 0x16b
365#define KEY_FAVORITES 0x16c
366#define KEY_EPG 0x16d
367#define KEY_PVR 0x16e /* Media Select Home */
368#define KEY_MHP 0x16f
369#define KEY_LANGUAGE 0x170
370#define KEY_TITLE 0x171
371#define KEY_SUBTITLE 0x172
372#define KEY_ANGLE 0x173
373#define KEY_ZOOM 0x174
374#define KEY_MODE 0x175
375#define KEY_KEYBOARD 0x176
376#define KEY_SCREEN 0x177
377#define KEY_PC 0x178 /* Media Select Computer */
378#define KEY_TV 0x179 /* Media Select TV */
379#define KEY_TV2 0x17a /* Media Select Cable */
380#define KEY_VCR 0x17b /* Media Select VCR */
381#define KEY_VCR2 0x17c /* VCR Plus */
382#define KEY_SAT 0x17d /* Media Select Satellite */
383#define KEY_SAT2 0x17e
384#define KEY_CD 0x17f /* Media Select CD */
385#define KEY_TAPE 0x180 /* Media Select Tape */
386#define KEY_RADIO 0x181
387#define KEY_TUNER 0x182 /* Media Select Tuner */
388#define KEY_PLAYER 0x183
389#define KEY_TEXT 0x184
390#define KEY_DVD 0x185 /* Media Select DVD */
391#define KEY_AUX 0x186
392#define KEY_MP3 0x187
393#define KEY_AUDIO 0x188 /* AL Audio Browser */
394#define KEY_VIDEO 0x189 /* AL Movie Browser */
395#define KEY_DIRECTORY 0x18a
396#define KEY_LIST 0x18b
397#define KEY_MEMO 0x18c /* Media Select Messages */
398#define KEY_CALENDAR 0x18d
399#define KEY_RED 0x18e
400#define KEY_GREEN 0x18f
401#define KEY_YELLOW 0x190
402#define KEY_BLUE 0x191
403#define KEY_CHANNELUP 0x192 /* Channel Increment */
404#define KEY_CHANNELDOWN 0x193 /* Channel Decrement */
405#define KEY_FIRST 0x194
406#define KEY_LAST 0x195 /* Recall Last */
407#define KEY_AB 0x196
408#define KEY_NEXT 0x197
409#define KEY_RESTART 0x198
410#define KEY_SLOW 0x199
411#define KEY_SHUFFLE 0x19a
412#define KEY_BREAK 0x19b
413#define KEY_PREVIOUS 0x19c
414#define KEY_DIGITS 0x19d
415#define KEY_TEEN 0x19e
416#define KEY_TWEN 0x19f
417#define KEY_VIDEOPHONE 0x1a0 /* Media Select Video Phone */
418#define KEY_GAMES 0x1a1 /* Media Select Games */
419#define KEY_ZOOMIN 0x1a2 /* AC Zoom In */
420#define KEY_ZOOMOUT 0x1a3 /* AC Zoom Out */
421#define KEY_ZOOMRESET 0x1a4 /* AC Zoom */
422#define KEY_WORDPROCESSOR 0x1a5 /* AL Word Processor */
423#define KEY_EDITOR 0x1a6 /* AL Text Editor */
424#define KEY_SPREADSHEET 0x1a7 /* AL Spreadsheet */
425#define KEY_GRAPHICSEDITOR 0x1a8 /* AL Graphics Editor */
426#define KEY_PRESENTATION 0x1a9 /* AL Presentation App */
427#define KEY_DATABASE 0x1aa /* AL Database App */
428#define KEY_NEWS 0x1ab /* AL Newsreader */
429#define KEY_VOICEMAIL 0x1ac /* AL Voicemail */
430#define KEY_ADDRESSBOOK 0x1ad /* AL Contacts/Address Book */
431#define KEY_MESSENGER 0x1ae /* AL Instant Messaging */
432#define KEY_DISPLAYTOGGLE 0x1af /* Turn display (LCD) on and off */
433#define KEY_SPELLCHECK 0x1b0 /* AL Spell Check */
434#define KEY_LOGOFF 0x1b1 /* AL Logoff */
435
436#define KEY_DOLLAR 0x1b2
437#define KEY_EURO 0x1b3
438
439#define KEY_FRAMEBACK 0x1b4 /* Consumer - transport controls */
440#define KEY_FRAMEFORWARD 0x1b5
441#define KEY_CONTEXT_MENU 0x1b6 /* GenDesc - system context menu */
442#define KEY_MEDIA_REPEAT 0x1b7 /* Consumer - transport control */
443#define KEY_10CHANNELSUP 0x1b8 /* 10 channels up (10+) */
444#define KEY_10CHANNELSDOWN 0x1b9 /* 10 channels down (10-) */
445#define KEY_IMAGES 0x1ba /* AL Image Browser */
446
447#define KEY_DEL_EOL 0x1c0
448#define KEY_DEL_EOS 0x1c1
449#define KEY_INS_LINE 0x1c2
450#define KEY_DEL_LINE 0x1c3
451
452#define KEY_FN 0x1d0
453#define KEY_FN_ESC 0x1d1
454#define KEY_FN_F1 0x1d2
455#define KEY_FN_F2 0x1d3
456#define KEY_FN_F3 0x1d4
457#define KEY_FN_F4 0x1d5
458#define KEY_FN_F5 0x1d6
459#define KEY_FN_F6 0x1d7
460#define KEY_FN_F7 0x1d8
461#define KEY_FN_F8 0x1d9
462#define KEY_FN_F9 0x1da
463#define KEY_FN_F10 0x1db
464#define KEY_FN_F11 0x1dc
465#define KEY_FN_F12 0x1dd
466#define KEY_FN_1 0x1de
467#define KEY_FN_2 0x1df
468#define KEY_FN_D 0x1e0
469#define KEY_FN_E 0x1e1
470#define KEY_FN_F 0x1e2
471#define KEY_FN_S 0x1e3
472#define KEY_FN_B 0x1e4
473
474#define KEY_BRL_DOT1 0x1f1
475#define KEY_BRL_DOT2 0x1f2
476#define KEY_BRL_DOT3 0x1f3
477#define KEY_BRL_DOT4 0x1f4
478#define KEY_BRL_DOT5 0x1f5
479#define KEY_BRL_DOT6 0x1f6
480#define KEY_BRL_DOT7 0x1f7
481#define KEY_BRL_DOT8 0x1f8
482#define KEY_BRL_DOT9 0x1f9
483#define KEY_BRL_DOT10 0x1fa
484
485#define KEY_NUMERIC_0 0x200 /* used by phones, remote controls, */
486#define KEY_NUMERIC_1 0x201 /* and other keypads */
487#define KEY_NUMERIC_2 0x202
488#define KEY_NUMERIC_3 0x203
489#define KEY_NUMERIC_4 0x204
490#define KEY_NUMERIC_5 0x205
491#define KEY_NUMERIC_6 0x206
492#define KEY_NUMERIC_7 0x207
493#define KEY_NUMERIC_8 0x208
494#define KEY_NUMERIC_9 0x209
495#define KEY_NUMERIC_STAR 0x20a
496#define KEY_NUMERIC_POUND 0x20b
497
498#define KEY_CAMERA_FOCUS 0x210
499#define KEY_WPS_BUTTON 0x211 /* WiFi Protected Setup key */
500
501#define KEY_TOUCHPAD_TOGGLE 0x212 /* Request switch touchpad on or off */
502#define KEY_TOUCHPAD_ON 0x213
503#define KEY_TOUCHPAD_OFF 0x214
504
505#define KEY_CAMERA_ZOOMIN 0x215
506#define KEY_CAMERA_ZOOMOUT 0x216
507#define KEY_CAMERA_UP 0x217
508#define KEY_CAMERA_DOWN 0x218
509#define KEY_CAMERA_LEFT 0x219
510#define KEY_CAMERA_RIGHT 0x21a
511
512#define KEY_ATTENDANT_ON 0x21b
513#define KEY_ATTENDANT_OFF 0x21c
514#define KEY_ATTENDANT_TOGGLE 0x21d /* Attendant call on or off */
515#define KEY_LIGHTS_TOGGLE 0x21e /* Reading light on or off */
516
517#define BTN_DPAD_UP 0x220
518#define BTN_DPAD_DOWN 0x221
519#define BTN_DPAD_LEFT 0x222
520#define BTN_DPAD_RIGHT 0x223
521
522#define MATRIX_KEY(row, col, code) \
523 ((((row) & 0xFF) << 24) | (((col) & 0xFF) << 16) | ((code) & 0xFFFF))
524
525#endif /* _DT_BINDINGS_INPUT_INPUT_H */
diff --git a/include/linux/of.h b/include/linux/of.h
index 3a45c4f593ad..f95aee391e30 100644
--- a/include/linux/of.h
+++ b/include/linux/of.h
@@ -281,6 +281,9 @@ extern struct device_node *of_parse_phandle(const struct device_node *np,
281extern int of_parse_phandle_with_args(const struct device_node *np, 281extern int of_parse_phandle_with_args(const struct device_node *np,
282 const char *list_name, const char *cells_name, int index, 282 const char *list_name, const char *cells_name, int index,
283 struct of_phandle_args *out_args); 283 struct of_phandle_args *out_args);
284extern int of_parse_phandle_with_fixed_args(const struct device_node *np,
285 const char *list_name, int cells_count, int index,
286 struct of_phandle_args *out_args);
284extern int of_count_phandle_with_args(const struct device_node *np, 287extern int of_count_phandle_with_args(const struct device_node *np,
285 const char *list_name, const char *cells_name); 288 const char *list_name, const char *cells_name);
286 289
@@ -324,12 +327,6 @@ extern int of_detach_node(struct device_node *);
324 */ 327 */
325const __be32 *of_prop_next_u32(struct property *prop, const __be32 *cur, 328const __be32 *of_prop_next_u32(struct property *prop, const __be32 *cur,
326 u32 *pu); 329 u32 *pu);
327#define of_property_for_each_u32(np, propname, prop, p, u) \
328 for (prop = of_find_property(np, propname, NULL), \
329 p = of_prop_next_u32(prop, NULL, &u); \
330 p; \
331 p = of_prop_next_u32(prop, p, &u))
332
333/* 330/*
334 * struct property *prop; 331 * struct property *prop;
335 * const char *s; 332 * const char *s;
@@ -338,11 +335,6 @@ const __be32 *of_prop_next_u32(struct property *prop, const __be32 *cur,
338 * printk("String value: %s\n", s); 335 * printk("String value: %s\n", s);
339 */ 336 */
340const char *of_prop_next_string(struct property *prop, const char *cur); 337const char *of_prop_next_string(struct property *prop, const char *cur);
341#define of_property_for_each_string(np, propname, prop, s) \
342 for (prop = of_find_property(np, propname, NULL), \
343 s = of_prop_next_string(prop, NULL); \
344 s; \
345 s = of_prop_next_string(prop, s))
346 338
347int of_device_is_stdout_path(struct device_node *dn); 339int of_device_is_stdout_path(struct device_node *dn);
348 340
@@ -497,6 +489,13 @@ static inline int of_parse_phandle_with_args(struct device_node *np,
497 return -ENOSYS; 489 return -ENOSYS;
498} 490}
499 491
492static inline int of_parse_phandle_with_fixed_args(const struct device_node *np,
493 const char *list_name, int cells_count, int index,
494 struct of_phandle_args *out_args)
495{
496 return -ENOSYS;
497}
498
500static inline int of_count_phandle_with_args(struct device_node *np, 499static inline int of_count_phandle_with_args(struct device_node *np,
501 const char *list_name, 500 const char *list_name,
502 const char *cells_name) 501 const char *cells_name)
@@ -519,12 +518,20 @@ static inline int of_device_is_stdout_path(struct device_node *dn)
519 return 0; 518 return 0;
520} 519}
521 520
521static inline const __be32 *of_prop_next_u32(struct property *prop,
522 const __be32 *cur, u32 *pu)
523{
524 return NULL;
525}
526
527static inline const char *of_prop_next_string(struct property *prop,
528 const char *cur)
529{
530 return NULL;
531}
532
522#define of_match_ptr(_ptr) NULL 533#define of_match_ptr(_ptr) NULL
523#define of_match_node(_matches, _node) NULL 534#define of_match_node(_matches, _node) NULL
524#define of_property_for_each_u32(np, propname, prop, p, u) \
525 while (0)
526#define of_property_for_each_string(np, propname, prop, s) \
527 while (0)
528#endif /* CONFIG_OF */ 535#endif /* CONFIG_OF */
529 536
530#ifndef of_node_to_nid 537#ifndef of_node_to_nid
@@ -573,6 +580,18 @@ static inline int of_property_read_u32(const struct device_node *np,
573 return of_property_read_u32_array(np, propname, out_value, 1); 580 return of_property_read_u32_array(np, propname, out_value, 1);
574} 581}
575 582
583#define of_property_for_each_u32(np, propname, prop, p, u) \
584 for (prop = of_find_property(np, propname, NULL), \
585 p = of_prop_next_u32(prop, NULL, &u); \
586 p; \
587 p = of_prop_next_u32(prop, p, &u))
588
589#define of_property_for_each_string(np, propname, prop, s) \
590 for (prop = of_find_property(np, propname, NULL), \
591 s = of_prop_next_string(prop, NULL); \
592 s; \
593 s = of_prop_next_string(prop, s))
594
576#if defined(CONFIG_PROC_FS) && defined(CONFIG_PROC_DEVICETREE) 595#if defined(CONFIG_PROC_FS) && defined(CONFIG_PROC_DEVICETREE)
577extern void proc_device_tree_add_node(struct device_node *, struct proc_dir_entry *); 596extern void proc_device_tree_add_node(struct device_node *, struct proc_dir_entry *);
578extern void proc_device_tree_add_prop(struct proc_dir_entry *pde, struct property *prop); 597extern void proc_device_tree_add_prop(struct proc_dir_entry *pde, struct property *prop);
diff --git a/include/linux/of_fdt.h b/include/linux/of_fdt.h
index 19f26f8d2202..a478c62a2aab 100644
--- a/include/linux/of_fdt.h
+++ b/include/linux/of_fdt.h
@@ -109,8 +109,7 @@ extern u64 dt_mem_next_cell(int s, __be32 **cellp);
109 * physical addresses. 109 * physical addresses.
110 */ 110 */
111#ifdef CONFIG_BLK_DEV_INITRD 111#ifdef CONFIG_BLK_DEV_INITRD
112extern void early_init_dt_setup_initrd_arch(unsigned long start, 112extern void early_init_dt_setup_initrd_arch(u64 start, u64 end);
113 unsigned long end);
114#endif 113#endif
115 114
116/* Early flat tree scan hooks */ 115/* Early flat tree scan hooks */
diff --git a/include/linux/of_net.h b/include/linux/of_net.h
index 61bf53b02779..34597c8c1a4c 100644
--- a/include/linux/of_net.h
+++ b/include/linux/of_net.h
@@ -9,10 +9,10 @@
9 9
10#ifdef CONFIG_OF_NET 10#ifdef CONFIG_OF_NET
11#include <linux/of.h> 11#include <linux/of.h>
12extern const int of_get_phy_mode(struct device_node *np); 12extern int of_get_phy_mode(struct device_node *np);
13extern const void *of_get_mac_address(struct device_node *np); 13extern const void *of_get_mac_address(struct device_node *np);
14#else 14#else
15static inline const int of_get_phy_mode(struct device_node *np) 15static inline int of_get_phy_mode(struct device_node *np)
16{ 16{
17 return -ENODEV; 17 return -ENODEV;
18} 18}