parport.h 977 B

123456789101112131415161718192021222324252627282930313233343536373839
  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. for (np = NULL; (np = of_find_compatible_node(np,
  20. "parallel",
  21. "pnpPNP,400")) != NULL;) {
  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. prop = of_get_property(np, "interrupts", NULL);
  27. if (!prop)
  28. continue;
  29. if (parport_pc_probe_port(io1, io2, prop[0], autodma, NULL) != NULL)
  30. count++;
  31. }
  32. return count;
  33. }
  34. #endif /* __KERNEL__ */
  35. #endif /* !(_ASM_POWERPC_PARPORT_H) */