parport.h 926 B

123456789101112131415161718192021222324252627282930313233343536373839404142
  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 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_each_compatible_node(np, "parallel", "pnpPNP,400") {
  21. prop = of_get_property(np, "reg", &propsize);
  22. if (!prop || propsize > 6*sizeof(u32))
  23. continue;
  24. io1 = prop[1]; io2 = prop[2];
  25. virq = irq_of_parse_and_map(np, 0);
  26. if (virq == NO_IRQ)
  27. continue;
  28. if (parport_pc_probe_port(io1, io2, virq, autodma, NULL, 0)
  29. != NULL)
  30. count++;
  31. }
  32. return count;
  33. }
  34. #endif /* __KERNEL__ */
  35. #endif /* !(_ASM_POWERPC_PARPORT_H) */