blob: 7ca1d9d639c4b60f7f7956432fb2d816ad8d50b2 [file] [log] [blame]
Thomas Gleixnerd2912cb2019-06-04 10:11:33 +02001/* SPDX-License-Identifier: GPL-2.0-only */
Thomas Kleffelbe518012008-06-30 22:40:24 +01002/*
3 * linux/drivers/mmc/s3cmci.h - Samsung S3C MCI driver
4 *
5 * Copyright (C) 2004-2006 Thomas Kleffel, All Rights Reserved.
Thomas Kleffelbe518012008-06-30 22:40:24 +01006 */
7
Thomas Kleffelbe518012008-06-30 22:40:24 +01008enum s3cmci_waitfor {
9 COMPLETION_NONE,
10 COMPLETION_FINALIZE,
11 COMPLETION_CMDSENT,
12 COMPLETION_RSPFIN,
13 COMPLETION_XFERFINISH,
14 COMPLETION_XFERFINISH_RSPFIN,
15};
16
17struct s3cmci_host {
18 struct platform_device *pdev;
Ben Dooksedb5a982008-06-30 22:40:29 +010019 struct s3c24xx_mci_pdata *pdata;
Thomas Kleffelbe518012008-06-30 22:40:24 +010020 struct mmc_host *mmc;
21 struct resource *mem;
22 struct clk *clk;
23 void __iomem *base;
24 int irq;
25 int irq_cd;
Vasily Khoruzhickb45e4b52014-06-01 20:22:09 +030026 struct dma_chan *dma;
Thomas Kleffelbe518012008-06-30 22:40:24 +010027
28 unsigned long clk_rate;
29 unsigned long clk_div;
30 unsigned long real_rate;
31 u8 prescaler;
32
33 int is2440;
34 unsigned sdiimsk;
35 unsigned sdidata;
Thomas Kleffelbe518012008-06-30 22:40:24 +010036
Ben Dooksc2258892009-10-01 15:44:18 -070037 bool irq_disabled;
38 bool irq_enabled;
39 bool irq_state;
40 int sdio_irqen;
41
Thomas Kleffelbe518012008-06-30 22:40:24 +010042 struct mmc_request *mrq;
43 int cmd_is_stop;
44
45 spinlock_t complete_lock;
46 enum s3cmci_waitfor complete_what;
47
48 int dma_complete;
49
50 u32 pio_sgptr;
Christer Weinigel088a78a2008-10-15 00:17:17 +010051 u32 pio_bytes;
Thomas Kleffelbe518012008-06-30 22:40:24 +010052 u32 pio_count;
53 u32 *pio_ptr;
54#define XFER_NONE 0
55#define XFER_READ 1
56#define XFER_WRITE 2
57 u32 pio_active;
58
59 int bus_width;
60
61 char dbgmsg_cmd[301];
62 char dbgmsg_dat[301];
63 char *status;
64
65 unsigned int ccnt, dcnt;
66 struct tasklet_struct pio_tasklet;
ben@fluff.org.ukf87e6d02008-10-15 00:17:16 +010067
Ben Dooks9bdd2032009-10-01 15:44:17 -070068#ifdef CONFIG_DEBUG_FS
69 struct dentry *debug_root;
70 struct dentry *debug_state;
71 struct dentry *debug_regs;
72#endif
73
Krzysztof Kozlowski39f80bc2016-06-27 14:52:03 +020074#ifdef CONFIG_ARM_S3C24XX_CPUFREQ
ben@fluff.org.ukf87e6d02008-10-15 00:17:16 +010075 struct notifier_block freq_transition;
76#endif
Thomas Kleffelbe518012008-06-30 22:40:24 +010077};