parport.h 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  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. extern struct parport *parport_pc_probe_port (unsigned long int base,
  13. unsigned long int base_hi,
  14. int irq, int dma,
  15. struct pci_dev *dev);
  16. static int __devinit parport_pc_find_nonpci_ports (int autoirq, int autodma)
  17. {
  18. struct device_node *np;
  19. u32 *prop;
  20. u32 io1, io2;
  21. int propsize;
  22. int count = 0;
  23. for (np = NULL; (np = of_find_compatible_node(np,
  24. "parallel",
  25. "pnpPNP,400")) != NULL;) {
  26. prop = (u32 *)get_property(np, "reg", &propsize);
  27. if (!prop || propsize > 6*sizeof(u32))
  28. continue;
  29. io1 = prop[1]; io2 = prop[2];
  30. prop = (u32 *)get_property(np, "interrupts", NULL);
  31. if (!prop)
  32. continue;
  33. if (parport_pc_probe_port(io1, io2, prop[0], autodma, NULL) != NULL)
  34. count++;
  35. }
  36. return count;
  37. }
  38. #endif /* __KERNEL__ */
  39. #endif /* !(_ASM_POWERPC_PARPORT_H) */