parport.h 960 B

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. /* SPDX-License-Identifier: GPL-2.0 */
  2. /*
  3. * parport.h: platform-specific PC-style parport initialisation
  4. *
  5. * Copyright (C) 1999, 2000 Tim Waugh <[email protected]>
  6. *
  7. * This file should only be included by drivers/parport/parport_pc.c.
  8. */
  9. #ifndef _ASM_POWERPC_PARPORT_H
  10. #define _ASM_POWERPC_PARPORT_H
  11. #ifdef __KERNEL__
  12. #include <linux/of_irq.h>
  13. static int parport_pc_find_nonpci_ports (int autoirq, int autodma)
  14. {
  15. struct device_node *np;
  16. const u32 *prop;
  17. u32 io1, io2;
  18. int propsize;
  19. int count = 0;
  20. int virq;
  21. for_each_compatible_node(np, "parallel", "pnpPNP,400") {
  22. prop = of_get_property(np, "reg", &propsize);
  23. if (!prop || propsize > 6*sizeof(u32))
  24. continue;
  25. io1 = prop[1]; io2 = prop[2];
  26. virq = irq_of_parse_and_map(np, 0);
  27. if (!virq)
  28. continue;
  29. if (parport_pc_probe_port(io1, io2, virq, autodma, NULL, 0)
  30. != NULL)
  31. count++;
  32. }
  33. return count;
  34. }
  35. #endif /* __KERNEL__ */
  36. #endif /* !(_ASM_POWERPC_PARPORT_H) */