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
45 #define CTL_SDIF_MODE 0xe6 /* only known on R-Car 2+ */
70 #define TMIO_STAT_DAT0 BIT(23) /* only known on R-Car so far */
73 #define TMIO_STAT_ALWAYS_SET_27 BIT(27) /* only known on R-Car 2+ so far */
74 #define TMIO_STAT_ILL_FUNC BIT(29) /* only when !TMIO_MMC_HAS_IDLE_WAIT */
75 #define TMIO_STAT_SCLKDIVEN BIT(29) /* only when TMIO_MMC_HAS_IDLE_WAIT */
86 #define CARD_OPT_EXTOP BIT(9) /* first appeared on R-Car Gen3 SDHI */
103 #define SDIF_MODE_HS400 BIT(0) /* only known on R-Car 2+ */
121 void (*start)(struct tmio_mmc_host *host, struct mmc_data *data);
122 void (*enable)(struct tmio_mmc_host *host, bool enable);
123 void (*request)(struct tmio_mmc_host *host,
125 void (*release)(struct tmio_mmc_host *host);
126 void (*abort)(struct tmio_mmc_host *host);
127 void (*dataend)(struct tmio_mmc_host *host);
130 void (*end)(struct tmio_mmc_host *host); /* held host->lock */
131 bool (*dma_irq)(struct tmio_mmc_host *host);
143 void (*set_pwr)(struct platform_device *host, int state);
174 spinlock_t lock; /* protect host private data */
181 int (*clk_enable)(struct tmio_mmc_host *host);
182 void (*set_clock)(struct tmio_mmc_host *host, unsigned int clock);
185 void (*clk_disable)(struct tmio_mmc_host *host);
188 int (*write16_hook)(struct tmio_mmc_host *host, int addr);
189 void (*reset)(struct tmio_mmc_host *host, bool preserve);
190 bool (*check_retune)(struct tmio_mmc_host *host, struct mmc_request *mrq);
191 void (*fixup_request)(struct tmio_mmc_host *host, struct mmc_request *mrq);
192 unsigned int (*get_timeout_cycles)(struct tmio_mmc_host *host);
199 void tmio_mmc_host_free(struct tmio_mmc_host *host);
200 int tmio_mmc_host_probe(struct tmio_mmc_host *host);
201 void tmio_mmc_host_remove(struct tmio_mmc_host *host);
202 void tmio_mmc_do_data_irq(struct tmio_mmc_host *host);
204 void tmio_mmc_enable_mmc_irqs(struct tmio_mmc_host *host, u32 i);
205 void tmio_mmc_disable_mmc_irqs(struct tmio_mmc_host *host, u32 i);
213 static inline u16 sd_ctrl_read16(struct tmio_mmc_host *host, int addr) in sd_ctrl_read16() argument
215 return ioread16(host->ctl + (addr << host->bus_shift)); in sd_ctrl_read16()
218 static inline void sd_ctrl_read16_rep(struct tmio_mmc_host *host, int addr, in sd_ctrl_read16_rep() argument
221 ioread16_rep(host->ctl + (addr << host->bus_shift), buf, count); in sd_ctrl_read16_rep()
224 static inline u32 sd_ctrl_read16_and_16_as_32(struct tmio_mmc_host *host, in sd_ctrl_read16_and_16_as_32() argument
227 return ioread16(host->ctl + (addr << host->bus_shift)) | in sd_ctrl_read16_and_16_as_32()
228 ioread16(host->ctl + ((addr + 2) << host->bus_shift)) << 16; in sd_ctrl_read16_and_16_as_32()
231 static inline void sd_ctrl_read32_rep(struct tmio_mmc_host *host, int addr, in sd_ctrl_read32_rep() argument
234 ioread32_rep(host->ctl + (addr << host->bus_shift), buf, count); in sd_ctrl_read32_rep()
237 static inline void sd_ctrl_write16(struct tmio_mmc_host *host, int addr, in sd_ctrl_write16() argument
240 /* If there is a hook and it returns non-zero then there in sd_ctrl_write16()
243 if (host->write16_hook && host->write16_hook(host, addr)) in sd_ctrl_write16()
245 iowrite16(val, host->ctl + (addr << host->bus_shift)); in sd_ctrl_write16()
248 static inline void sd_ctrl_write16_rep(struct tmio_mmc_host *host, int addr, in sd_ctrl_write16_rep() argument
251 iowrite16_rep(host->ctl + (addr << host->bus_shift), buf, count); in sd_ctrl_write16_rep()
254 static inline void sd_ctrl_write32_as_16_and_16(struct tmio_mmc_host *host, in sd_ctrl_write32_as_16_and_16() argument
258 val |= host->sdcard_irq_setbit_mask; in sd_ctrl_write32_as_16_and_16()
260 iowrite16(val & 0xffff, host->ctl + (addr << host->bus_shift)); in sd_ctrl_write32_as_16_and_16()
261 iowrite16(val >> 16, host->ctl + ((addr + 2) << host->bus_shift)); in sd_ctrl_write32_as_16_and_16()
264 static inline void sd_ctrl_write32(struct tmio_mmc_host *host, int addr, u32 val) in sd_ctrl_write32() argument
266 iowrite32(val, host->ctl + (addr << host->bus_shift)); in sd_ctrl_write32()
269 static inline void sd_ctrl_write32_rep(struct tmio_mmc_host *host, int addr, in sd_ctrl_write32_rep() argument
272 iowrite32_rep(host->ctl + (addr << host->bus_shift), buf, count); in sd_ctrl_write32_rep()