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