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+ */
47 #define CTL_SD_STATUS 0xf2 /* only known on RZ/{G2L,G3E,V2H} */
72 #define TMIO_STAT_DAT0 BIT(23) /* only known on R-Car so far */
75 #define TMIO_STAT_ALWAYS_SET_27 BIT(27) /* only known on R-Car 2+ so far */
76 #define TMIO_STAT_ILL_FUNC BIT(29) /* only when !TMIO_MMC_HAS_IDLE_WAIT */
77 #define TMIO_STAT_SCLKDIVEN BIT(29) /* only when TMIO_MMC_HAS_IDLE_WAIT */
88 #define CARD_OPT_EXTOP BIT(9) /* first appeared on R-Car Gen3 SDHI */
105 #define SDIF_MODE_HS400 BIT(0) /* only known on R-Car 2+ */
108 #define SD_STATUS_PWEN BIT(0) /* only known on RZ/{G3E,V2H} */
109 #define SD_STATUS_IOVS BIT(16) /* only known on RZ/{G3E,V2H} */
127 void (*start)(struct tmio_mmc_host *host, struct mmc_data *data);
128 void (*enable)(struct tmio_mmc_host *host, bool enable);
129 void (*request)(struct tmio_mmc_host *host,
131 void (*release)(struct tmio_mmc_host *host);
132 void (*abort)(struct tmio_mmc_host *host);
133 void (*dataend)(struct tmio_mmc_host *host);
136 void (*end)(struct tmio_mmc_host *host); /* held host->lock */
137 bool (*dma_irq)(struct tmio_mmc_host *host);
177 spinlock_t lock; /* protect host private data */
184 int (*clk_enable)(struct tmio_mmc_host *host);
185 void (*set_clock)(struct tmio_mmc_host *host, unsigned int clock);
188 void (*clk_disable)(struct tmio_mmc_host *host);
191 int (*write16_hook)(struct tmio_mmc_host *host, int addr);
192 void (*reset)(struct tmio_mmc_host *host, bool preserve);
193 bool (*check_retune)(struct tmio_mmc_host *host, struct mmc_request *mrq);
194 void (*fixup_request)(struct tmio_mmc_host *host, struct mmc_request *mrq);
195 unsigned int (*get_timeout_cycles)(struct tmio_mmc_host *host);
202 void tmio_mmc_host_free(struct tmio_mmc_host *host);
203 int tmio_mmc_host_probe(struct tmio_mmc_host *host);
204 void tmio_mmc_host_remove(struct tmio_mmc_host *host);
205 void tmio_mmc_do_data_irq(struct tmio_mmc_host *host);
207 void tmio_mmc_enable_mmc_irqs(struct tmio_mmc_host *host, u32 i);
208 void tmio_mmc_disable_mmc_irqs(struct tmio_mmc_host *host, u32 i);
216 static inline u16 sd_ctrl_read16(struct tmio_mmc_host *host, int addr) in sd_ctrl_read16() argument
218 return ioread16(host->ctl + (addr << host->bus_shift)); in sd_ctrl_read16()
221 static inline void sd_ctrl_read16_rep(struct tmio_mmc_host *host, int addr, in sd_ctrl_read16_rep() argument
224 ioread16_rep(host->ctl + (addr << host->bus_shift), buf, count); in sd_ctrl_read16_rep()
227 static inline u32 sd_ctrl_read16_and_16_as_32(struct tmio_mmc_host *host, in sd_ctrl_read16_and_16_as_32() argument
230 return ioread16(host->ctl + (addr << host->bus_shift)) | in sd_ctrl_read16_and_16_as_32()
231 ioread16(host->ctl + ((addr + 2) << host->bus_shift)) << 16; in sd_ctrl_read16_and_16_as_32()
234 static inline u32 sd_ctrl_read32(struct tmio_mmc_host *host, int addr) in sd_ctrl_read32() argument
236 return ioread32(host->ctl + (addr << host->bus_shift)); in sd_ctrl_read32()
239 static inline void sd_ctrl_read32_rep(struct tmio_mmc_host *host, int addr, in sd_ctrl_read32_rep() argument
242 ioread32_rep(host->ctl + (addr << host->bus_shift), buf, count); in sd_ctrl_read32_rep()
245 static inline void sd_ctrl_write16(struct tmio_mmc_host *host, int addr, in sd_ctrl_write16() argument
248 /* If there is a hook and it returns non-zero then there in sd_ctrl_write16()
251 if (host->write16_hook && host->write16_hook(host, addr)) in sd_ctrl_write16()
253 iowrite16(val, host->ctl + (addr << host->bus_shift)); in sd_ctrl_write16()
256 static inline void sd_ctrl_write16_rep(struct tmio_mmc_host *host, int addr, in sd_ctrl_write16_rep() argument
259 iowrite16_rep(host->ctl + (addr << host->bus_shift), buf, count); in sd_ctrl_write16_rep()
262 static inline void sd_ctrl_write32_as_16_and_16(struct tmio_mmc_host *host, in sd_ctrl_write32_as_16_and_16() argument
266 val |= host->sdcard_irq_setbit_mask; in sd_ctrl_write32_as_16_and_16()
268 iowrite16(val & 0xffff, host->ctl + (addr << host->bus_shift)); in sd_ctrl_write32_as_16_and_16()
269 iowrite16(val >> 16, host->ctl + ((addr + 2) << host->bus_shift)); in sd_ctrl_write32_as_16_and_16()
272 static inline void sd_ctrl_write32(struct tmio_mmc_host *host, int addr, u32 val) in sd_ctrl_write32() argument
274 iowrite32(val, host->ctl + (addr << host->bus_shift)); in sd_ctrl_write32()
277 static inline void sd_ctrl_write32_rep(struct tmio_mmc_host *host, int addr, in sd_ctrl_write32_rep() argument
280 iowrite32_rep(host->ctl + (addr << host->bus_shift), buf, count); in sd_ctrl_write32_rep()