renesas_sdhi.h 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. /*
  2. * Renesas Mobile SDHI
  3. *
  4. * Copyright (C) 2017 Horms Solutions Ltd., Simon Horman
  5. * Copyright (C) 2017 Renesas Electronics Corporation
  6. *
  7. * This program is free software; you can redistribute it and/or modify
  8. * it under the terms of the GNU General Public License version 2 as
  9. * published by the Free Software Foundation.
  10. */
  11. #ifndef RENESAS_SDHI_H
  12. #define RENESAS_SDHI_H
  13. #include <linux/platform_device.h>
  14. #include "tmio_mmc.h"
  15. struct renesas_sdhi_scc {
  16. unsigned long clk_rate; /* clock rate for SDR104 */
  17. u32 tap; /* sampling clock position for SDR104 */
  18. };
  19. struct renesas_sdhi_of_data {
  20. unsigned long tmio_flags;
  21. u32 tmio_ocr_mask;
  22. unsigned long capabilities;
  23. unsigned long capabilities2;
  24. enum dma_slave_buswidth dma_buswidth;
  25. dma_addr_t dma_rx_offset;
  26. unsigned int bus_shift;
  27. int scc_offset;
  28. struct renesas_sdhi_scc *taps;
  29. int taps_num;
  30. unsigned int max_blk_count;
  31. unsigned short max_segs;
  32. };
  33. struct tmio_mmc_dma {
  34. enum dma_slave_buswidth dma_buswidth;
  35. bool (*filter)(struct dma_chan *chan, void *arg);
  36. void (*enable)(struct tmio_mmc_host *host, bool enable);
  37. struct completion dma_dataend;
  38. struct tasklet_struct dma_complete;
  39. };
  40. struct renesas_sdhi {
  41. struct clk *clk;
  42. struct clk *clk_cd;
  43. struct tmio_mmc_data mmc_data;
  44. struct tmio_mmc_dma dma_priv;
  45. struct pinctrl *pinctrl;
  46. struct pinctrl_state *pins_default, *pins_uhs;
  47. void __iomem *scc_ctl;
  48. u32 scc_tappos;
  49. };
  50. #define host_to_priv(host) \
  51. container_of((host)->pdata, struct renesas_sdhi, mmc_data)
  52. int renesas_sdhi_probe(struct platform_device *pdev,
  53. const struct tmio_mmc_dma_ops *dma_ops);
  54. int renesas_sdhi_remove(struct platform_device *pdev);
  55. #endif