Lines Matching +full:host +full:- +full:only
1 /* SPDX-License-Identifier: GPL-2.0 */
7 * Copyright (C) 2015-19 Renesas Electronics Corporation
8 * Copyright (C) 2016-19 Sang Engineering, Wolfram Sang
9 * Copyright (C) 2016-17 Horms Solutions, Simon Horman
46 #define CTL_SDIF_MODE 0xe6 /* only known on R-Car 2+ */
71 #define TMIO_STAT_DAT0 BIT(23) /* only known on R-Car so far */
74 #define TMIO_STAT_ALWAYS_SET_27 BIT(27) /* only known on R-Car 2+ so far */
75 #define TMIO_STAT_ILL_FUNC BIT(29) /* only when !TMIO_MMC_HAS_IDLE_WAIT */
76 #define TMIO_STAT_SCLKDIVEN BIT(29) /* only when TMIO_MMC_HAS_IDLE_WAIT */
87 #define CARD_OPT_EXTOP BIT(9) /* first appeared on R-Car Gen3 SDHI */
104 #define SDIF_MODE_HS400 BIT(0) /* only known on R-Car 2+ */
122 void (*start)(struct tmio_mmc_host *host, struct mmc_data *data);
123 void (*enable)(struct tmio_mmc_host *host, bool enable);
124 void (*request)(struct tmio_mmc_host *host,
126 void (*release)(struct tmio_mmc_host *host);
127 void (*abort)(struct tmio_mmc_host *host);
128 void (*dataend)(struct tmio_mmc_host *host);
131 void (*end)(struct tmio_mmc_host *host); /* held host->lock */
132 bool (*dma_irq)(struct tmio_mmc_host *host);
172 spinlock_t lock; /* protect host private data */
179 int (*clk_enable)(struct tmio_mmc_host *host);
180 void (*set_clock)(struct tmio_mmc_host *host, unsigned int clock);
183 void (*clk_disable)(struct tmio_mmc_host *host);
186 int (*write16_hook)(struct tmio_mmc_host *host, int addr);
187 void (*reset)(struct tmio_mmc_host *host, bool preserve);
188 bool (*check_retune)(struct tmio_mmc_host *host, struct mmc_request *mrq);
189 void (*fixup_request)(struct tmio_mmc_host *host, struct mmc_request *mrq);
190 unsigned int (*get_timeout_cycles)(struct tmio_mmc_host *host);
197 void tmio_mmc_host_free(struct tmio_mmc_host *host);
198 int tmio_mmc_host_probe(struct tmio_mmc_host *host);
199 void tmio_mmc_host_remove(struct tmio_mmc_host *host);
200 void tmio_mmc_do_data_irq(struct tmio_mmc_host *host);
202 void tmio_mmc_enable_mmc_irqs(struct tmio_mmc_host *host, u32 i);
203 void tmio_mmc_disable_mmc_irqs(struct tmio_mmc_host *host, u32 i);
211 static inline u16 sd_ctrl_read16(struct tmio_mmc_host *host, int addr) in sd_ctrl_read16() argument
213 return ioread16(host->ctl + (addr << host->bus_shift)); in sd_ctrl_read16()
216 static inline void sd_ctrl_read16_rep(struct tmio_mmc_host *host, int addr, in sd_ctrl_read16_rep() argument
219 ioread16_rep(host->ctl + (addr << host->bus_shift), buf, count); in sd_ctrl_read16_rep()
222 static inline u32 sd_ctrl_read16_and_16_as_32(struct tmio_mmc_host *host, in sd_ctrl_read16_and_16_as_32() argument
225 return ioread16(host->ctl + (addr << host->bus_shift)) | in sd_ctrl_read16_and_16_as_32()
226 ioread16(host->ctl + ((addr + 2) << host->bus_shift)) << 16; in sd_ctrl_read16_and_16_as_32()
229 static inline void sd_ctrl_read32_rep(struct tmio_mmc_host *host, int addr, in sd_ctrl_read32_rep() argument
232 ioread32_rep(host->ctl + (addr << host->bus_shift), buf, count); in sd_ctrl_read32_rep()
235 static inline void sd_ctrl_write16(struct tmio_mmc_host *host, int addr, in sd_ctrl_write16() argument
238 /* If there is a hook and it returns non-zero then there in sd_ctrl_write16()
241 if (host->write16_hook && host->write16_hook(host, addr)) in sd_ctrl_write16()
243 iowrite16(val, host->ctl + (addr << host->bus_shift)); in sd_ctrl_write16()
246 static inline void sd_ctrl_write16_rep(struct tmio_mmc_host *host, int addr, in sd_ctrl_write16_rep() argument
249 iowrite16_rep(host->ctl + (addr << host->bus_shift), buf, count); in sd_ctrl_write16_rep()
252 static inline void sd_ctrl_write32_as_16_and_16(struct tmio_mmc_host *host, in sd_ctrl_write32_as_16_and_16() argument
256 val |= host->sdcard_irq_setbit_mask; in sd_ctrl_write32_as_16_and_16()
258 iowrite16(val & 0xffff, host->ctl + (addr << host->bus_shift)); in sd_ctrl_write32_as_16_and_16()
259 iowrite16(val >> 16, host->ctl + ((addr + 2) << host->bus_shift)); in sd_ctrl_write32_as_16_and_16()
262 static inline void sd_ctrl_write32(struct tmio_mmc_host *host, int addr, u32 val) in sd_ctrl_write32() argument
264 iowrite32(val, host->ctl + (addr << host->bus_shift)); in sd_ctrl_write32()
267 static inline void sd_ctrl_write32_rep(struct tmio_mmc_host *host, int addr, in sd_ctrl_write32_rep() argument
270 iowrite32_rep(host->ctl + (addr << host->bus_shift), buf, count); in sd_ctrl_write32_rep()