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
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 */
100 #define TMIO_MASK_INIT_RCAR2 0x8b7f031d /* Initial value for R-Car Gen2+ */
114 void (*start)(struct tmio_mmc_host *host, struct mmc_data *data);
115 void (*enable)(struct tmio_mmc_host *host, bool enable);
116 void (*request)(struct tmio_mmc_host *host,
118 void (*release)(struct tmio_mmc_host *host);
119 void (*abort)(struct tmio_mmc_host *host);
120 void (*dataend)(struct tmio_mmc_host *host);
123 void (*end)(struct tmio_mmc_host *host); /* held host->lock */
135 void (*set_pwr)(struct platform_device *host, int state);
165 spinlock_t lock; /* protect host private data */
172 int (*clk_enable)(struct tmio_mmc_host *host);
173 void (*set_clock)(struct tmio_mmc_host *host, unsigned int clock);
176 void (*clk_disable)(struct tmio_mmc_host *host);
179 int (*write16_hook)(struct tmio_mmc_host *host, int addr);
180 void (*reset)(struct tmio_mmc_host *host);
181 bool (*check_retune)(struct tmio_mmc_host *host);
182 void (*fixup_request)(struct tmio_mmc_host *host, struct mmc_request *mrq);
184 void (*prepare_hs400_tuning)(struct tmio_mmc_host *host);
185 void (*hs400_downgrade)(struct tmio_mmc_host *host);
186 void (*hs400_complete)(struct tmio_mmc_host *host);
193 void tmio_mmc_host_free(struct tmio_mmc_host *host);
194 int tmio_mmc_host_probe(struct tmio_mmc_host *host);
195 void tmio_mmc_host_remove(struct tmio_mmc_host *host);
196 void tmio_mmc_do_data_irq(struct tmio_mmc_host *host);
198 void tmio_mmc_enable_mmc_irqs(struct tmio_mmc_host *host, u32 i);
199 void tmio_mmc_disable_mmc_irqs(struct tmio_mmc_host *host, u32 i);
206 return kmap_atomic(sg_page(sg)) + sg->offset; in tmio_mmc_kmap_atomic()
212 kunmap_atomic(virt - sg->offset); in tmio_mmc_kunmap_atomic()
221 static inline u16 sd_ctrl_read16(struct tmio_mmc_host *host, int addr) in sd_ctrl_read16() argument
223 return ioread16(host->ctl + (addr << host->bus_shift)); in sd_ctrl_read16()
226 static inline void sd_ctrl_read16_rep(struct tmio_mmc_host *host, int addr, in sd_ctrl_read16_rep() argument
229 ioread16_rep(host->ctl + (addr << host->bus_shift), buf, count); in sd_ctrl_read16_rep()
232 static inline u32 sd_ctrl_read16_and_16_as_32(struct tmio_mmc_host *host, in sd_ctrl_read16_and_16_as_32() argument
235 return ioread16(host->ctl + (addr << host->bus_shift)) | in sd_ctrl_read16_and_16_as_32()
236 ioread16(host->ctl + ((addr + 2) << host->bus_shift)) << 16; in sd_ctrl_read16_and_16_as_32()
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()