Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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

+787 -190
+1 -1
Documentation/devicetree/bindings/net/can/sja1000.txt
··· 37 37 If not specified or if the specified value is 0, the CLKOUT pin 38 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 42 42 For further information, please have a look to the SJA1000 data sheet. 43 43
-6
arch/arc/kernel/devtree.c
··· 18 18 #include <asm/clk.h> 19 19 #include <asm/mach_desc.h> 20 20 21 - /* called from unflatten_device_tree() to bootstrap devicetree itself */ 22 - void * __init early_init_dt_alloc_memory_arch(u64 size, u64 align) 23 - { 24 - return __va(memblock_alloc(size, align)); 25 - } 26 - 27 21 /** 28 22 * setup_machine_fdt - Machine setup when an dtb was passed to the kernel 29 23 * @dt: virtual address pointer to dt blob
+2 -3
arch/arc/mm/init.c
··· 127 127 #endif 128 128 129 129 #ifdef CONFIG_OF_FLATTREE 130 - void __init early_init_dt_setup_initrd_arch(unsigned long start, 131 - unsigned long end) 130 + void __init early_init_dt_setup_initrd_arch(u64 start, u64 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 134 #endif /* CONFIG_OF_FLATTREE */
+1 -1
arch/arm/mm/init.c
··· 78 78 __tagtable(ATAG_INITRD2, parse_tag_initrd2); 79 79 80 80 #ifdef CONFIG_OF_FLATTREE 81 - void __init early_init_dt_setup_initrd_arch(unsigned long start, unsigned long end) 81 + void __init early_init_dt_setup_initrd_arch(u64 start, u64 end) 82 82 { 83 83 phys_initrd_start = start; 84 84 phys_initrd_size = end - start;
-5
arch/arm64/kernel/setup.c
··· 190 190 memblock_add(base, size); 191 191 } 192 192 193 - void * __init early_init_dt_alloc_memory_arch(u64 size, u64 align) 194 - { 195 - return __va(memblock_alloc(size, align)); 196 - } 197 - 198 193 /* 199 194 * Limit the memory size that was specified via FDT. 200 195 */
+1 -2
arch/arm64/mm/init.c
··· 44 44 45 45 phys_addr_t memstart_addr __read_mostly = 0; 46 46 47 - void __init early_init_dt_setup_initrd_arch(unsigned long start, 48 - unsigned long end) 47 + void __init early_init_dt_setup_initrd_arch(u64 start, u64 end) 49 48 { 50 49 phys_initrd_start = start; 51 50 phys_initrd_size = end - start;
+1 -7
arch/c6x/kernel/devicetree.c
··· 33 33 34 34 35 35 #ifdef CONFIG_BLK_DEV_INITRD 36 - void __init early_init_dt_setup_initrd_arch(unsigned long start, 37 - unsigned long end) 36 + void __init early_init_dt_setup_initrd_arch(u64 start, u64 end) 38 37 { 39 38 initrd_start = (unsigned long)__va(start); 40 39 initrd_end = (unsigned long)__va(end); ··· 44 45 void __init early_init_dt_add_memory_arch(u64 base, u64 size) 45 46 { 46 47 c6x_add_memory(base, size); 47 - } 48 - 49 - void * __init early_init_dt_alloc_memory_arch(u64 size, u64 align) 50 - { 51 - return __va(memblock_alloc(size, align)); 52 48 }
+2 -3
arch/metag/mm/init.c
··· 407 407 #endif 408 408 409 409 #ifdef CONFIG_OF_FLATTREE 410 - void __init early_init_dt_setup_initrd_arch(unsigned long start, 411 - unsigned long end) 410 + void __init early_init_dt_setup_initrd_arch(u64 start, u64 end) 412 411 { 413 - pr_err("%s(%lx, %lx)\n", 412 + pr_err("%s(%llx, %llx)\n", 414 413 __func__, start, end); 415 414 } 416 415 #endif /* CONFIG_OF_FLATTREE */
+1 -7
arch/microblaze/kernel/prom.c
··· 46 46 memblock_add(base, size); 47 47 } 48 48 49 - void * __init early_init_dt_alloc_memory_arch(u64 size, u64 align) 50 - { 51 - return __va(memblock_alloc(size, align)); 52 - } 53 - 54 49 #ifdef CONFIG_EARLY_PRINTK 55 50 static char *stdout; 56 51 ··· 131 136 } 132 137 133 138 #ifdef CONFIG_BLK_DEV_INITRD 134 - void __init early_init_dt_setup_initrd_arch(unsigned long start, 135 - unsigned long end) 139 + void __init early_init_dt_setup_initrd_arch(u64 start, u64 end) 136 140 { 137 141 initrd_start = (unsigned long)__va(start); 138 142 initrd_end = (unsigned long)__va(end);
+1 -2
arch/mips/kernel/prom.c
··· 58 58 } 59 59 60 60 #ifdef CONFIG_BLK_DEV_INITRD 61 - void __init early_init_dt_setup_initrd_arch(unsigned long start, 62 - unsigned long end) 61 + void __init early_init_dt_setup_initrd_arch(u64 start, u64 end) 63 62 { 64 63 initrd_start = (unsigned long)__va(start); 65 64 initrd_end = (unsigned long)__va(end);
+1 -7
arch/openrisc/kernel/prom.c
··· 55 55 memblock_add(base, size); 56 56 } 57 57 58 - void * __init early_init_dt_alloc_memory_arch(u64 size, u64 align) 59 - { 60 - return __va(memblock_alloc(size, align)); 61 - } 62 - 63 58 void __init early_init_devtree(void *params) 64 59 { 65 60 void *alloc; ··· 91 96 } 92 97 93 98 #ifdef CONFIG_BLK_DEV_INITRD 94 - void __init early_init_dt_setup_initrd_arch(unsigned long start, 95 - unsigned long end) 99 + void __init early_init_dt_setup_initrd_arch(u64 start, u64 end) 96 100 { 97 101 initrd_start = (unsigned long)__va(start); 98 102 initrd_end = (unsigned long)__va(end);
+1 -7
arch/powerpc/kernel/prom.c
··· 546 546 memblock_add(base, size); 547 547 } 548 548 549 - void * __init early_init_dt_alloc_memory_arch(u64 size, u64 align) 550 - { 551 - return __va(memblock_alloc(size, align)); 552 - } 553 - 554 549 #ifdef CONFIG_BLK_DEV_INITRD 555 - void __init early_init_dt_setup_initrd_arch(unsigned long start, 556 - unsigned long end) 550 + void __init early_init_dt_setup_initrd_arch(u64 start, u64 end) 557 551 { 558 552 initrd_start = (unsigned long)__va(start); 559 553 initrd_end = (unsigned long)__va(end);
+1 -2
arch/x86/kernel/devicetree.c
··· 52 52 } 53 53 54 54 #ifdef CONFIG_BLK_DEV_INITRD 55 - void __init early_init_dt_setup_initrd_arch(unsigned long start, 56 - unsigned long end) 55 + void __init early_init_dt_setup_initrd_arch(u64 start, u64 end) 57 56 { 58 57 initrd_start = (unsigned long)__va(start); 59 58 initrd_end = (unsigned long)__va(end);
+1 -2
arch/xtensa/kernel/setup.c
··· 170 170 171 171 __tagtable(BP_TAG_FDT, parse_tag_fdt); 172 172 173 - void __init early_init_dt_setup_initrd_arch(unsigned long start, 174 - unsigned long end) 173 + void __init early_init_dt_setup_initrd_arch(u64 start, u64 end) 175 174 { 176 175 initrd_start = (void *)__va(start); 177 176 initrd_end = (void *)__va(end);
+2 -2
drivers/gpio/gpiolib-of.c
··· 195 195 return; 196 196 197 197 for (;; index++) { 198 - ret = of_parse_phandle_with_args(np, "gpio-ranges", 199 - "#gpio-range-cells", index, &pinspec); 198 + ret = of_parse_phandle_with_fixed_args(np, "gpio-ranges", 3, 199 + index, &pinspec); 200 200 if (ret) 201 201 break; 202 202
+130 -70
drivers/of/base.c
··· 1176 1176 } 1177 1177 EXPORT_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 - */ 1189 - struct 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 - } 1201 - EXPORT_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 - */ 1235 1179 static int __of_parse_phandle_with_args(const struct device_node *np, 1236 1180 const char *list_name, 1237 - const char *cells_name, int index, 1181 + const char *cells_name, 1182 + int cell_count, int index, 1238 1183 struct of_phandle_args *out_args) 1239 1184 { 1240 1185 const __be32 *list, *list_end; ··· 1207 1262 if (phandle) { 1208 1263 /* 1209 1264 * Find the provider node and parse the #*-cells 1210 - * property to determine the argument length 1265 + * property to determine the argument length. 1266 + * 1267 + * This is not needed if the cell count is hard-coded 1268 + * (i.e. cells_name not set, but cell_count is set), 1269 + * except when we're going to return the found node 1270 + * below. 1211 1271 */ 1212 - node = of_find_node_by_phandle(phandle); 1213 - if (!node) { 1214 - pr_err("%s: could not find phandle\n", 1215 - np->full_name); 1216 - goto err; 1272 + if (cells_name || cur_index == index) { 1273 + node = of_find_node_by_phandle(phandle); 1274 + if (!node) { 1275 + pr_err("%s: could not find phandle\n", 1276 + np->full_name); 1277 + goto err; 1278 + } 1217 1279 } 1218 - if (of_property_read_u32(node, cells_name, &count)) { 1219 - pr_err("%s: could not get %s for %s\n", 1220 - np->full_name, cells_name, 1221 - node->full_name); 1222 - goto err; 1280 + 1281 + if (cells_name) { 1282 + if (of_property_read_u32(node, cells_name, 1283 + &count)) { 1284 + pr_err("%s: could not get %s for %s\n", 1285 + np->full_name, cells_name, 1286 + node->full_name); 1287 + goto err; 1288 + } 1289 + } else { 1290 + count = cell_count; 1223 1291 } 1224 1292 1225 1293 /* ··· 1292 1334 return rc; 1293 1335 } 1294 1336 1337 + /** 1338 + * of_parse_phandle - Resolve a phandle property to a device_node pointer 1339 + * @np: Pointer to device node holding phandle property 1340 + * @phandle_name: Name of property holding a phandle value 1341 + * @index: For properties holding a table of phandles, this is the index into 1342 + * the table 1343 + * 1344 + * Returns the device_node pointer with refcount incremented. Use 1345 + * of_node_put() on it when done. 1346 + */ 1347 + struct device_node *of_parse_phandle(const struct device_node *np, 1348 + const char *phandle_name, int index) 1349 + { 1350 + struct of_phandle_args args; 1351 + 1352 + if (index < 0) 1353 + return NULL; 1354 + 1355 + if (__of_parse_phandle_with_args(np, phandle_name, NULL, 0, 1356 + index, &args)) 1357 + return NULL; 1358 + 1359 + return args.np; 1360 + } 1361 + EXPORT_SYMBOL(of_parse_phandle); 1362 + 1363 + /** 1364 + * of_parse_phandle_with_args() - Find a node pointed by phandle in a list 1365 + * @np: pointer to a device tree node containing a list 1366 + * @list_name: property name that contains a list 1367 + * @cells_name: property name that specifies phandles' arguments count 1368 + * @index: index of a phandle to parse out 1369 + * @out_args: optional pointer to output arguments structure (will be filled) 1370 + * 1371 + * This function is useful to parse lists of phandles and their arguments. 1372 + * Returns 0 on success and fills out_args, on error returns appropriate 1373 + * errno value. 1374 + * 1375 + * Caller is responsible to call of_node_put() on the returned out_args->node 1376 + * pointer. 1377 + * 1378 + * Example: 1379 + * 1380 + * phandle1: node1 { 1381 + * #list-cells = <2>; 1382 + * } 1383 + * 1384 + * phandle2: node2 { 1385 + * #list-cells = <1>; 1386 + * } 1387 + * 1388 + * node3 { 1389 + * list = <&phandle1 1 2 &phandle2 3>; 1390 + * } 1391 + * 1392 + * To get a device_node of the `node2' node you may call this: 1393 + * of_parse_phandle_with_args(node3, "list", "#list-cells", 1, &args); 1394 + */ 1295 1395 int of_parse_phandle_with_args(const struct device_node *np, const char *list_name, 1296 1396 const char *cells_name, int index, 1297 1397 struct of_phandle_args *out_args) 1298 1398 { 1299 1399 if (index < 0) 1300 1400 return -EINVAL; 1301 - return __of_parse_phandle_with_args(np, list_name, cells_name, index, out_args); 1401 + return __of_parse_phandle_with_args(np, list_name, cells_name, 0, 1402 + index, out_args); 1302 1403 } 1303 1404 EXPORT_SYMBOL(of_parse_phandle_with_args); 1405 + 1406 + /** 1407 + * of_parse_phandle_with_fixed_args() - Find a node pointed by phandle in a list 1408 + * @np: pointer to a device tree node containing a list 1409 + * @list_name: property name that contains a list 1410 + * @cell_count: number of argument cells following the phandle 1411 + * @index: index of a phandle to parse out 1412 + * @out_args: optional pointer to output arguments structure (will be filled) 1413 + * 1414 + * This function is useful to parse lists of phandles and their arguments. 1415 + * Returns 0 on success and fills out_args, on error returns appropriate 1416 + * errno value. 1417 + * 1418 + * Caller is responsible to call of_node_put() on the returned out_args->node 1419 + * pointer. 1420 + * 1421 + * Example: 1422 + * 1423 + * phandle1: node1 { 1424 + * } 1425 + * 1426 + * phandle2: node2 { 1427 + * } 1428 + * 1429 + * node3 { 1430 + * list = <&phandle1 0 2 &phandle2 2 3>; 1431 + * } 1432 + * 1433 + * To get a device_node of the `node2' node you may call this: 1434 + * of_parse_phandle_with_fixed_args(node3, "list", 2, 1, &args); 1435 + */ 1436 + int of_parse_phandle_with_fixed_args(const struct device_node *np, 1437 + const char *list_name, int cell_count, 1438 + int index, struct of_phandle_args *out_args) 1439 + { 1440 + if (index < 0) 1441 + return -EINVAL; 1442 + return __of_parse_phandle_with_args(np, list_name, NULL, cell_count, 1443 + index, out_args); 1444 + } 1445 + EXPORT_SYMBOL(of_parse_phandle_with_fixed_args); 1304 1446 1305 1447 /** 1306 1448 * of_count_phandle_with_args() - Find the number of phandles references in a property ··· 1420 1362 int of_count_phandle_with_args(const struct device_node *np, const char *list_name, 1421 1363 const char *cells_name) 1422 1364 { 1423 - return __of_parse_phandle_with_args(np, list_name, cells_name, -1, NULL); 1365 + return __of_parse_phandle_with_args(np, list_name, cells_name, 0, -1, 1366 + NULL); 1424 1367 } 1425 1368 EXPORT_SYMBOL(of_count_phandle_with_args); 1426 1369 ··· 1793 1734 ap = dt_alloc(sizeof(*ap) + len + 1, 4); 1794 1735 if (!ap) 1795 1736 continue; 1737 + memset(ap, 0, sizeof(*ap) + len + 1); 1796 1738 ap->alias = start; 1797 1739 of_alias_add(ap, np, id, start, len); 1798 1740 }
+60 -38
drivers/of/fdt.c
··· 11 11 12 12 #include <linux/kernel.h> 13 13 #include <linux/initrd.h> 14 + #include <linux/memblock.h> 14 15 #include <linux/module.h> 15 16 #include <linux/of.h> 16 17 #include <linux/of_fdt.h> 17 18 #include <linux/string.h> 18 19 #include <linux/errno.h> 19 20 #include <linux/slab.h> 21 + #include <linux/random.h> 20 22 21 23 #include <asm/setup.h> /* for COMMAND_LINE_SIZE */ 22 24 #ifdef CONFIG_PPC ··· 127 125 return score; 128 126 } 129 127 130 - static void *unflatten_dt_alloc(unsigned long *mem, unsigned long size, 128 + static void *unflatten_dt_alloc(void **mem, unsigned long size, 131 129 unsigned long align) 132 130 { 133 131 void *res; 134 132 135 - *mem = ALIGN(*mem, align); 136 - res = (void *)*mem; 133 + *mem = PTR_ALIGN(*mem, align); 134 + res = *mem; 137 135 *mem += size; 138 136 139 137 return res; ··· 148 146 * @allnextpp: pointer to ->allnext from last allocated device_node 149 147 * @fpsize: Size of the node path up at the current depth. 150 148 */ 151 - static unsigned long unflatten_dt_node(struct boot_param_header *blob, 152 - unsigned long mem, 153 - unsigned long *p, 149 + static void * unflatten_dt_node(struct boot_param_header *blob, 150 + void *mem, 151 + void **p, 154 152 struct device_node *dad, 155 153 struct device_node ***allnextpp, 156 154 unsigned long fpsize) ··· 163 161 int has_name = 0; 164 162 int new_format = 0; 165 163 166 - tag = be32_to_cpup((__be32 *)(*p)); 164 + tag = be32_to_cpup(*p); 167 165 if (tag != OF_DT_BEGIN_NODE) { 168 166 pr_err("Weird tag at start of node: %x\n", tag); 169 167 return mem; 170 168 } 171 169 *p += 4; 172 - pathp = (char *)*p; 170 + pathp = *p; 173 171 l = allocl = strlen(pathp) + 1; 174 - *p = ALIGN(*p + l, 4); 172 + *p = PTR_ALIGN(*p + l, 4); 175 173 176 174 /* version 0x10 has a more compact unit name here instead of the full 177 175 * path. we accumulate the full path size using "fpsize", we'll rebuild ··· 203 201 __alignof__(struct device_node)); 204 202 if (allnextpp) { 205 203 char *fn; 206 - memset(np, 0, sizeof(*np)); 207 204 np->full_name = fn = ((char *)np) + sizeof(*np); 208 205 if (new_format) { 209 206 /* rebuild full path for new format */ ··· 240 239 u32 sz, noff; 241 240 char *pname; 242 241 243 - tag = be32_to_cpup((__be32 *)(*p)); 242 + tag = be32_to_cpup(*p); 244 243 if (tag == OF_DT_NOP) { 245 244 *p += 4; 246 245 continue; ··· 248 247 if (tag != OF_DT_PROP) 249 248 break; 250 249 *p += 4; 251 - sz = be32_to_cpup((__be32 *)(*p)); 252 - noff = be32_to_cpup((__be32 *)((*p) + 4)); 250 + sz = be32_to_cpup(*p); 251 + noff = be32_to_cpup(*p + 4); 253 252 *p += 8; 254 253 if (be32_to_cpu(blob->version) < 0x10) 255 - *p = ALIGN(*p, sz >= 8 ? 8 : 4); 254 + *p = PTR_ALIGN(*p, sz >= 8 ? 8 : 4); 256 255 257 256 pname = of_fdt_get_string(blob, noff); 258 257 if (pname == NULL) { ··· 282 281 np->phandle = be32_to_cpup((__be32 *)*p); 283 282 pp->name = pname; 284 283 pp->length = sz; 285 - pp->value = (void *)*p; 284 + pp->value = *p; 286 285 *prev_pp = pp; 287 286 prev_pp = &pp->next; 288 287 } 289 - *p = ALIGN((*p) + sz, 4); 288 + *p = PTR_ALIGN((*p) + sz, 4); 290 289 } 291 290 /* with version 0x10 we may not have the name property, recreate 292 291 * it here from the unit name if absent ··· 335 334 else 336 335 mem = unflatten_dt_node(blob, mem, p, np, allnextpp, 337 336 fpsize); 338 - tag = be32_to_cpup((__be32 *)(*p)); 337 + tag = be32_to_cpup(*p); 339 338 } 340 339 if (tag != OF_DT_END_NODE) { 341 340 pr_err("Weird tag at end of node: %x\n", tag); ··· 361 360 struct device_node **mynodes, 362 361 void * (*dt_alloc)(u64 size, u64 align)) 363 362 { 364 - unsigned long start, mem, size; 363 + unsigned long size; 364 + void *start, *mem; 365 365 struct device_node **allnextp = mynodes; 366 366 367 367 pr_debug(" -> unflatten_device_tree()\n"); ··· 383 381 } 384 382 385 383 /* First pass, scan for size */ 386 - start = ((unsigned long)blob) + 387 - be32_to_cpu(blob->off_dt_struct); 388 - size = unflatten_dt_node(blob, 0, &start, NULL, NULL, 0); 389 - size = (size | 3) + 1; 384 + start = ((void *)blob) + be32_to_cpu(blob->off_dt_struct); 385 + size = (unsigned long)unflatten_dt_node(blob, 0, &start, NULL, NULL, 0); 386 + size = ALIGN(size, 4); 390 387 391 388 pr_debug(" size is %lx, allocating...\n", size); 392 389 393 390 /* Allocate memory for the expanded device tree */ 394 - mem = (unsigned long) 395 - dt_alloc(size + 4, __alignof__(struct device_node)); 391 + mem = dt_alloc(size + 4, __alignof__(struct device_node)); 392 + memset(mem, 0, size); 396 393 397 - memset((void *)mem, 0, size); 394 + *(__be32 *)(mem + size) = cpu_to_be32(0xdeadbeef); 398 395 399 - ((__be32 *)mem)[size / 4] = cpu_to_be32(0xdeadbeef); 400 - 401 - pr_debug(" unflattening %lx...\n", mem); 396 + pr_debug(" unflattening %p...\n", mem); 402 397 403 398 /* Second pass, do actual unflattening */ 404 - start = ((unsigned long)blob) + 405 - be32_to_cpu(blob->off_dt_struct); 399 + start = ((void *)blob) + be32_to_cpu(blob->off_dt_struct); 406 400 unflatten_dt_node(blob, mem, &start, NULL, &allnextp, 0); 407 - if (be32_to_cpup((__be32 *)start) != OF_DT_END) 408 - pr_warning("Weird tag at end of tree: %08x\n", *((u32 *)start)); 409 - if (be32_to_cpu(((__be32 *)mem)[size / 4]) != 0xdeadbeef) 401 + if (be32_to_cpup(start) != OF_DT_END) 402 + pr_warning("Weird tag at end of tree: %08x\n", be32_to_cpup(start)); 403 + if (be32_to_cpup(mem + size) != 0xdeadbeef) 410 404 pr_warning("End of tree marker overwritten: %08x\n", 411 - be32_to_cpu(((__be32 *)mem)[size / 4])); 405 + be32_to_cpup(mem + size)); 412 406 *allnextp = NULL; 413 407 414 408 pr_debug(" <- unflatten_device_tree()\n"); ··· 626 628 */ 627 629 void __init early_init_dt_check_for_initrd(unsigned long node) 628 630 { 629 - unsigned long start, end, len; 631 + u64 start, end; 632 + unsigned long len; 630 633 __be32 *prop; 631 634 632 635 pr_debug("Looking for initrd properties... "); ··· 635 636 prop = of_get_flat_dt_prop(node, "linux,initrd-start", &len); 636 637 if (!prop) 637 638 return; 638 - start = of_read_ulong(prop, len/4); 639 + start = of_read_number(prop, len/4); 639 640 640 641 prop = of_get_flat_dt_prop(node, "linux,initrd-end", &len); 641 642 if (!prop) 642 643 return; 643 - end = of_read_ulong(prop, len/4); 644 + end = of_read_number(prop, len/4); 644 645 645 646 early_init_dt_setup_initrd_arch(start, end); 646 - pr_debug("initrd_start=0x%lx initrd_end=0x%lx\n", start, end); 647 + pr_debug("initrd_start=0x%llx initrd_end=0x%llx\n", 648 + (unsigned long long)start, (unsigned long long)end); 647 649 } 648 650 #else 649 651 inline void early_init_dt_check_for_initrd(unsigned long node) ··· 774 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 + */ 782 + void * __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 789 * unflatten_device_tree - create tree of device_nodes from flat blob 779 790 * ··· 803 792 } 804 793 805 794 #endif /* CONFIG_OF_EARLY_FLATTREE */ 795 + 796 + /* Feed entire flattened device tree into the random pool */ 797 + static int __init add_fdt_randomness(void) 798 + { 799 + if (initial_boot_params) 800 + add_device_randomness(initial_boot_params, 801 + be32_to_cpu(initial_boot_params->totalsize)); 802 + 803 + return 0; 804 + } 805 + core_initcall(add_fdt_randomness);
+1 -1
drivers/of/irq.c
··· 28 28 29 29 /** 30 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 32 * @index: Index of the interrupt to map 33 33 * 34 34 * This function is a wrapper that chains of_irq_map_one() and
+1 -1
drivers/of/of_net.c
··· 39 39 * The function gets phy interface string from property 'phy-mode', 40 40 * and return its index in phy_modes table, or errno in error case. 41 41 */ 42 - const int of_get_phy_mode(struct device_node *np) 42 + int of_get_phy_mode(struct device_node *np) 43 43 { 44 44 const char *pm; 45 45 int err, i;
+17 -4
drivers/of/platform.c
··· 197 197 * Returns pointer to created platform device, or NULL if a device was not 198 198 * registered. Unavailable devices will not get registered. 199 199 */ 200 - struct platform_device *of_platform_device_create_pdata( 200 + static struct platform_device *of_platform_device_create_pdata( 201 201 struct device_node *np, 202 202 const char *bus_id, 203 203 void *platform_data, ··· 268 268 return NULL; 269 269 270 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 274 return NULL; 275 + } 273 276 274 277 /* setup generic device info */ 275 278 dev->dev.coherent_dma_mask = ~0; ··· 297 294 dev->irq[i] = irq_of_parse_and_map(node, i); 298 295 299 296 ret = of_address_to_resource(node, 0, &dev->res); 300 - if (ret) 297 + if (ret) { 298 + pr_err("%s(): of_address_to_resource() failed (%d) for %s\n", 299 + __func__, ret, node->full_name); 301 300 goto err_free; 301 + } 302 302 303 303 ret = amba_device_add(dev, &iomem_resource); 304 - if (ret) 304 + if (ret) { 305 + pr_err("%s(): amba_device_add() failed (%d) for %s\n", 306 + __func__, ret, node->full_name); 305 307 goto err_free; 308 + } 306 309 307 310 return dev; 308 311 ··· 387 378 } 388 379 389 380 if (of_device_is_compatible(bus, "arm,primecell")) { 381 + /* 382 + * Don't return an error here to keep compatibility with older 383 + * device tree files. 384 + */ 390 385 of_amba_device_create(bus, bus_id, platform_data, parent); 391 386 return 0; 392 387 }
+525
include/dt-bindings/input/input.h
··· 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 */
+34 -15
include/linux/of.h
··· 281 281 extern int of_parse_phandle_with_args(const struct device_node *np, 282 282 const char *list_name, const char *cells_name, int index, 283 283 struct of_phandle_args *out_args); 284 + extern 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); 284 287 extern int of_count_phandle_with_args(const struct device_node *np, 285 288 const char *list_name, const char *cells_name); 286 289 ··· 327 324 */ 328 325 const __be32 *of_prop_next_u32(struct property *prop, const __be32 *cur, 329 326 u32 *pu); 330 - #define of_property_for_each_u32(np, propname, prop, p, u) \ 331 - for (prop = of_find_property(np, propname, NULL), \ 332 - p = of_prop_next_u32(prop, NULL, &u); \ 333 - p; \ 334 - p = of_prop_next_u32(prop, p, &u)) 335 - 336 327 /* 337 328 * struct property *prop; 338 329 * const char *s; ··· 335 338 * printk("String value: %s\n", s); 336 339 */ 337 340 const char *of_prop_next_string(struct property *prop, const char *cur); 338 - #define of_property_for_each_string(np, propname, prop, s) \ 339 - for (prop = of_find_property(np, propname, NULL), \ 340 - s = of_prop_next_string(prop, NULL); \ 341 - s; \ 342 - s = of_prop_next_string(prop, s)) 343 341 344 342 int of_device_is_stdout_path(struct device_node *dn); 345 343 ··· 489 497 return -ENOSYS; 490 498 } 491 499 500 + static inline int of_parse_phandle_with_fixed_args(const struct device_node *np, 501 + const char *list_name, int cells_count, int index, 502 + struct of_phandle_args *out_args) 503 + { 504 + return -ENOSYS; 505 + } 506 + 492 507 static inline int of_count_phandle_with_args(struct device_node *np, 493 508 const char *list_name, 494 509 const char *cells_name) ··· 518 519 return 0; 519 520 } 520 521 522 + static inline const __be32 *of_prop_next_u32(struct property *prop, 523 + const __be32 *cur, u32 *pu) 524 + { 525 + return NULL; 526 + } 527 + 528 + static inline const char *of_prop_next_string(struct property *prop, 529 + const char *cur) 530 + { 531 + return NULL; 532 + } 533 + 521 534 #define of_match_ptr(_ptr) NULL 522 535 #define of_match_node(_matches, _node) NULL 523 - #define of_property_for_each_u32(np, propname, prop, p, u) \ 524 - while (0) 525 - #define of_property_for_each_string(np, propname, prop, s) \ 526 - while (0) 527 536 #endif /* CONFIG_OF */ 528 537 529 538 #ifndef of_node_to_nid ··· 579 572 { 580 573 return of_property_read_u32_array(np, propname, out_value, 1); 581 574 } 575 + 576 + #define of_property_for_each_u32(np, propname, prop, p, u) \ 577 + for (prop = of_find_property(np, propname, NULL), \ 578 + p = of_prop_next_u32(prop, NULL, &u); \ 579 + p; \ 580 + p = of_prop_next_u32(prop, p, &u)) 581 + 582 + #define of_property_for_each_string(np, propname, prop, s) \ 583 + for (prop = of_find_property(np, propname, NULL), \ 584 + s = of_prop_next_string(prop, NULL); \ 585 + s; \ 586 + s = of_prop_next_string(prop, s)) 582 587 583 588 #if defined(CONFIG_PROC_FS) && defined(CONFIG_PROC_DEVICETREE) 584 589 extern void proc_device_tree_add_node(struct device_node *, struct proc_dir_entry *);
+1 -2
include/linux/of_fdt.h
··· 109 109 * physical addresses. 110 110 */ 111 111 #ifdef CONFIG_BLK_DEV_INITRD 112 - extern void early_init_dt_setup_initrd_arch(unsigned long start, 113 - unsigned long end); 112 + extern void early_init_dt_setup_initrd_arch(u64 start, u64 end); 114 113 #endif 115 114 116 115 /* Early flat tree scan hooks */
+2 -2
include/linux/of_net.h
··· 9 9 10 10 #ifdef CONFIG_OF_NET 11 11 #include <linux/of.h> 12 - extern const int of_get_phy_mode(struct device_node *np); 12 + extern int of_get_phy_mode(struct device_node *np); 13 13 extern const void *of_get_mac_address(struct device_node *np); 14 14 #else 15 - static inline const int of_get_phy_mode(struct device_node *np) 15 + static inline int of_get_phy_mode(struct device_node *np) 16 16 { 17 17 return -ENODEV; 18 18 }