renesas_sdhi.h 1.5 KB

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