1 /* SPDX-License-Identifier: GPL-2.0 */
5 * Copyright (C) 2017 Horms Solutions Ltd., Simon Horman
6 * Copyright (C) 2017-19 Renesas Electronics Corporation
10 #define RENESAS_SDHI_H
12 #include <linux/platform_device.h>
15 struct renesas_sdhi_scc
{
16 unsigned long clk_rate
; /* clock rate for SDR104 */
17 u32 tap
; /* sampling clock position for SDR104/HS400 (8 TAP) */
18 u32 tap_hs400_4tap
; /* sampling clock position for HS400 (4 TAP) */
21 struct renesas_sdhi_of_data
{
22 unsigned long tmio_flags
;
24 unsigned long capabilities
;
25 unsigned long capabilities2
;
26 enum dma_slave_buswidth dma_buswidth
;
27 dma_addr_t dma_rx_offset
;
28 unsigned int bus_shift
;
30 struct renesas_sdhi_scc
*taps
;
32 unsigned int max_blk_count
;
33 unsigned short max_segs
;
36 struct renesas_sdhi_quirks
{
42 enum dma_slave_buswidth dma_buswidth
;
43 bool (*filter
)(struct dma_chan
*chan
, void *arg
);
44 void (*enable
)(struct tmio_mmc_host
*host
, bool enable
);
45 struct completion dma_dataend
;
46 struct tasklet_struct dma_complete
;
52 struct tmio_mmc_data mmc_data
;
53 struct tmio_mmc_dma dma_priv
;
54 const struct renesas_sdhi_quirks
*quirks
;
55 struct pinctrl
*pinctrl
;
56 struct pinctrl_state
*pins_default
, *pins_uhs
;
57 void __iomem
*scc_ctl
;
62 #define host_to_priv(host) \
63 container_of((host)->pdata, struct renesas_sdhi, mmc_data)
65 int renesas_sdhi_probe(struct platform_device
*pdev
,
66 const struct tmio_mmc_dma_ops
*dma_ops
);
67 int renesas_sdhi_remove(struct platform_device
*pdev
);