ssp.h 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  1. /*
  2. * ssp.h
  3. *
  4. * Copyright (C) 2003 Russell King, All Rights Reserved.
  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 driver supports the following PXA CPU/SSP ports:-
  11. *
  12. * PXA250 SSP
  13. * PXA255 SSP, NSSP
  14. * PXA26x SSP, NSSP, ASSP
  15. * PXA27x SSP1, SSP2, SSP3
  16. * PXA3xx SSP1, SSP2, SSP3, SSP4
  17. */
  18. #ifndef __ASM_ARCH_SSP_H
  19. #define __ASM_ARCH_SSP_H
  20. #include <linux/list.h>
  21. enum pxa_ssp_type {
  22. SSP_UNDEFINED = 0,
  23. PXA25x_SSP, /* pxa 210, 250, 255, 26x */
  24. PXA25x_NSSP, /* pxa 255, 26x (including ASSP) */
  25. PXA27x_SSP,
  26. };
  27. struct ssp_device {
  28. struct platform_device *pdev;
  29. struct list_head node;
  30. struct clk *clk;
  31. void __iomem *mmio_base;
  32. unsigned long phys_base;
  33. const char *label;
  34. int port_id;
  35. int type;
  36. int use_count;
  37. int irq;
  38. int drcmr_rx;
  39. int drcmr_tx;
  40. };
  41. /*
  42. * SSP initialisation flags
  43. */
  44. #define SSP_NO_IRQ 0x1 /* don't register an irq handler in SSP driver */
  45. struct ssp_state {
  46. u32 cr0;
  47. u32 cr1;
  48. u32 to;
  49. u32 psp;
  50. };
  51. struct ssp_dev {
  52. struct ssp_device *ssp;
  53. u32 port;
  54. u32 mode;
  55. u32 flags;
  56. u32 psp_flags;
  57. u32 speed;
  58. int irq;
  59. };
  60. int ssp_write_word(struct ssp_dev *dev, u32 data);
  61. int ssp_read_word(struct ssp_dev *dev, u32 *data);
  62. int ssp_flush(struct ssp_dev *dev);
  63. void ssp_enable(struct ssp_dev *dev);
  64. void ssp_disable(struct ssp_dev *dev);
  65. void ssp_save_state(struct ssp_dev *dev, struct ssp_state *ssp);
  66. void ssp_restore_state(struct ssp_dev *dev, struct ssp_state *ssp);
  67. int ssp_init(struct ssp_dev *dev, u32 port, u32 init_flags);
  68. int ssp_config(struct ssp_dev *dev, u32 mode, u32 flags, u32 psp_flags, u32 speed);
  69. void ssp_exit(struct ssp_dev *dev);
  70. struct ssp_device *ssp_request(int port, const char *label);
  71. void ssp_free(struct ssp_device *);
  72. #endif /* __ASM_ARCH_SSP_H */