]> git.karo-electronics.de Git - karo-tx-linux.git/blob - drivers/mmc/host/s3cmci.h
s3cmci: add SDIO IRQ support
[karo-tx-linux.git] / drivers / mmc / host / s3cmci.h
1 /*
2  *  linux/drivers/mmc/s3cmci.h - Samsung S3C MCI driver
3  *
4  *  Copyright (C) 2004-2006 Thomas Kleffel, All Rights Reserved.
5  *
6  * This program is free software; you can redistribute it and/or modify
7  * it under the terms of the GNU General Public License version 2 as
8  * published by the Free Software Foundation.
9  */
10
11 /* FIXME: DMA Resource management ?! */
12 #define S3CMCI_DMA 0
13
14 enum s3cmci_waitfor {
15         COMPLETION_NONE,
16         COMPLETION_FINALIZE,
17         COMPLETION_CMDSENT,
18         COMPLETION_RSPFIN,
19         COMPLETION_XFERFINISH,
20         COMPLETION_XFERFINISH_RSPFIN,
21 };
22
23 struct s3cmci_host {
24         struct platform_device  *pdev;
25         struct s3c24xx_mci_pdata *pdata;
26         struct mmc_host         *mmc;
27         struct resource         *mem;
28         struct clk              *clk;
29         void __iomem            *base;
30         int                     irq;
31         int                     irq_cd;
32         int                     dma;
33
34         unsigned long           clk_rate;
35         unsigned long           clk_div;
36         unsigned long           real_rate;
37         u8                      prescaler;
38
39         int                     is2440;
40         unsigned                sdiimsk;
41         unsigned                sdidata;
42         int                     dodma;
43         int                     dmatogo;
44
45         bool                    irq_disabled;
46         bool                    irq_enabled;
47         bool                    irq_state;
48         int                     sdio_irqen;
49
50         struct mmc_request      *mrq;
51         int                     cmd_is_stop;
52
53         spinlock_t              complete_lock;
54         enum s3cmci_waitfor     complete_what;
55
56         int                     dma_complete;
57
58         u32                     pio_sgptr;
59         u32                     pio_bytes;
60         u32                     pio_count;
61         u32                     *pio_ptr;
62 #define XFER_NONE 0
63 #define XFER_READ 1
64 #define XFER_WRITE 2
65         u32                     pio_active;
66
67         int                     bus_width;
68
69         char                    dbgmsg_cmd[301];
70         char                    dbgmsg_dat[301];
71         char                    *status;
72
73         unsigned int            ccnt, dcnt;
74         struct tasklet_struct   pio_tasklet;
75
76 #ifdef CONFIG_DEBUG_FS
77         struct dentry           *debug_root;
78         struct dentry           *debug_state;
79         struct dentry           *debug_regs;
80 #endif
81
82 #ifdef CONFIG_CPU_FREQ
83         struct notifier_block   freq_transition;
84 #endif
85 };