sudmac.h 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. /*
  2. * Header for the SUDMAC driver
  3. *
  4. * Copyright (C) 2013 Renesas Solutions Corp.
  5. *
  6. * This is free software; you can redistribute it and/or modify
  7. * it under the terms of version 2 of the GNU General Public License as
  8. * published by the Free Software Foundation.
  9. */
  10. #ifndef SUDMAC_H
  11. #define SUDMAC_H
  12. #include <linux/dmaengine.h>
  13. #include <linux/shdma-base.h>
  14. #include <linux/types.h>
  15. /* Used by slave DMA clients to request DMA to/from a specific peripheral */
  16. struct sudmac_slave {
  17. struct shdma_slave shdma_slave; /* Set by the platform */
  18. };
  19. /*
  20. * Supplied by platforms to specify, how a DMA channel has to be configured for
  21. * a certain peripheral
  22. */
  23. struct sudmac_slave_config {
  24. int slave_id;
  25. };
  26. struct sudmac_channel {
  27. unsigned long offset;
  28. unsigned long config;
  29. unsigned long wait; /* The configuable range is 0 to 3 */
  30. unsigned long dint_end_bit;
  31. };
  32. struct sudmac_pdata {
  33. const struct sudmac_slave_config *slave;
  34. int slave_num;
  35. const struct sudmac_channel *channel;
  36. int channel_num;
  37. };
  38. /* Definitions for the sudmac_channel.config */
  39. #define SUDMAC_TX_BUFFER_MODE BIT(0)
  40. #define SUDMAC_RX_END_MODE BIT(1)
  41. /* Definitions for the sudmac_channel.dint_end_bit */
  42. #define SUDMAC_DMA_BIT_CH0 BIT(0)
  43. #define SUDMAC_DMA_BIT_CH1 BIT(1)
  44. #endif