ppi.h 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  1. /*
  2. * Analog Devices PPI header file
  3. *
  4. * Copyright (c) 2011 Analog Devices Inc.
  5. *
  6. * This program is free software; you can redistribute it and/or modify
  7. * it under the terms of the GNU General Public License version 2 as
  8. * published by the Free Software Foundation.
  9. *
  10. * This program is distributed in the hope that it will be useful,
  11. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  12. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  13. * GNU General Public License for more details.
  14. *
  15. * You should have received a copy of the GNU General Public License
  16. * along with this program; if not, write to the Free Software
  17. * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  18. */
  19. #ifndef _PPI_H_
  20. #define _PPI_H_
  21. #include <linux/interrupt.h>
  22. #ifdef EPPI_EN
  23. #define PORT_EN EPPI_EN
  24. #define DMA32 0
  25. #define PACK_EN PACKEN
  26. #endif
  27. struct ppi_if;
  28. struct ppi_params {
  29. int width;
  30. int height;
  31. int bpp;
  32. unsigned long ppi_control;
  33. u32 int_mask;
  34. int blank_clocks;
  35. };
  36. struct ppi_ops {
  37. int (*attach_irq)(struct ppi_if *ppi, irq_handler_t handler);
  38. void (*detach_irq)(struct ppi_if *ppi);
  39. int (*start)(struct ppi_if *ppi);
  40. int (*stop)(struct ppi_if *ppi);
  41. int (*set_params)(struct ppi_if *ppi, struct ppi_params *params);
  42. void (*update_addr)(struct ppi_if *ppi, unsigned long addr);
  43. };
  44. enum ppi_type {
  45. PPI_TYPE_PPI,
  46. PPI_TYPE_EPPI,
  47. };
  48. struct ppi_info {
  49. enum ppi_type type;
  50. int dma_ch;
  51. int irq_err;
  52. void __iomem *base;
  53. const unsigned short *pin_req;
  54. };
  55. struct ppi_if {
  56. unsigned long ppi_control;
  57. const struct ppi_ops *ops;
  58. const struct ppi_info *info;
  59. bool err_int;
  60. void *priv;
  61. };
  62. struct ppi_if *ppi_create_instance(const struct ppi_info *info);
  63. void ppi_delete_instance(struct ppi_if *ppi);
  64. #endif