Lines Matching refs:np
33 struct device_node *np; member
75 static int __init add_legacy_port(struct device_node *np, int want_index, in add_legacy_port() argument
86 clk = of_get_property(np, "clock-frequency", NULL); in add_legacy_port()
91 spd = of_get_property(np, "current-speed", NULL); in add_legacy_port()
94 rs = of_get_property(np, "reg-shift", NULL); in add_legacy_port()
114 if (legacy_serial_infos[index].np != NULL) { in add_legacy_port()
143 legacy_serial_infos[index].np = of_node_get(np); in add_legacy_port()
154 index, np); in add_legacy_port()
164 static int __init add_legacy_soc_port(struct device_node *np, in add_legacy_soc_port() argument
169 struct device_node *tsi = of_get_parent(np); in add_legacy_soc_port()
174 if (!of_property_present(np, "clock-frequency")) in add_legacy_soc_port()
178 if (of_property_present(np, "reg-offset")) in add_legacy_soc_port()
182 if (of_property_read_bool(np, "used-by-rtas")) in add_legacy_soc_port()
198 return add_legacy_port(np, -1, UPIO_TSI, addr, addr, in add_legacy_soc_port()
201 return add_legacy_port(np, -1, UPIO_MEM, addr, addr, in add_legacy_soc_port()
205 static int __init add_legacy_isa_port(struct device_node *np, in add_legacy_isa_port() argument
213 DBG(" -> add_legacy_isa_port(%pOF)\n", np); in add_legacy_isa_port()
216 reg = of_get_property(np, "reg", NULL); in add_legacy_isa_port()
227 typep = of_get_property(np, "ibm,aix-loc", NULL); in add_legacy_isa_port()
241 taddr = of_translate_address(np, reg); in add_legacy_isa_port()
248 return add_legacy_port(np, index, UPIO_PORT, be32_to_cpu(reg[1]), in add_legacy_isa_port()
254 static int __init add_legacy_pci_port(struct device_node *np, in add_legacy_pci_port() argument
262 DBG(" -> add_legacy_pci_port(%pOF)\n", np); in add_legacy_pci_port()
271 if (!of_property_present(np, "clock-frequency")) in add_legacy_pci_port()
296 if (np != pci_dev) { in add_legacy_pci_port()
297 const __be32 *reg = of_get_property(np, "reg", NULL); in add_legacy_pci_port()
321 return add_legacy_port(np, index, iotype, base, addr, 0, in add_legacy_pci_port()
322 legacy_port_flags, np != pci_dev); in add_legacy_pci_port()
395 struct device_node *np, *stdout = NULL; in find_legacy_serial_ports() local
414 for_each_compatible_node(np, "serial", "ns16550") { in find_legacy_serial_ports()
415 struct device_node *parent = of_get_parent(np); in find_legacy_serial_ports()
419 if (of_device_is_available(np)) { in find_legacy_serial_ports()
420 index = add_legacy_soc_port(np, np); in find_legacy_serial_ports()
421 if (index >= 0 && np == stdout) in find_legacy_serial_ports()
429 for_each_node_by_type(np, "serial") { in find_legacy_serial_ports()
430 struct device_node *isa = of_get_parent(np); in find_legacy_serial_ports()
432 if (of_device_is_available(np)) { in find_legacy_serial_ports()
433 index = add_legacy_isa_port(np, isa); in find_legacy_serial_ports()
434 if (index >= 0 && np == stdout) in find_legacy_serial_ports()
443 for (np = NULL; (np = of_find_all_nodes(np));) { in find_legacy_serial_ports()
444 struct device_node *pci, *parent = of_get_parent(np); in find_legacy_serial_ports()
449 if (!of_node_name_eq(np, "serial") && in find_legacy_serial_ports()
450 !of_node_is_type(np, "serial")) { in find_legacy_serial_ports()
457 if (of_device_is_compatible(np, "pciclass,0700") || in find_legacy_serial_ports()
458 of_device_is_compatible(np, "pciclass,070002")) in find_legacy_serial_ports()
459 pci = np; in find_legacy_serial_ports()
467 index = add_legacy_pci_port(np, pci); in find_legacy_serial_ports()
468 if (index >= 0 && np == stdout) in find_legacy_serial_ports()
491 struct device_node *np, in fixup_port_irq() argument
498 virq = irq_of_parse_and_map(np, 0); in fixup_port_irq()
500 np = of_get_parent(np); in fixup_port_irq()
501 if (np == NULL) in fixup_port_irq()
503 virq = irq_of_parse_and_map(np, 0); in fixup_port_irq()
504 of_node_put(np); in fixup_port_irq()
512 of_device_is_compatible(np, "fsl,ns16550")) { in fixup_port_irq()
518 np); in fixup_port_irq()
524 struct device_node *np, in fixup_port_pio() argument
532 hose = pci_find_hose_for_OF_device(np); in fixup_port_pio()
548 struct device_node *np, in fixup_port_mmio() argument
584 struct device_node *np = legacy_serial_infos[i].np; in serial_dev_init() local
587 fixup_port_irq(i, np, port); in serial_dev_init()
589 fixup_port_pio(i, np, port); in serial_dev_init()
591 fixup_port_mmio(i, np, port); in serial_dev_init()
663 if (prom_stdout != legacy_serial_infos[i].np) in check_legacy_serial_console()