parport.h 992 B

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