[s3c24xx] bump to 2.6.30-rc6
[openwrt/svn-archive/archive.git] / target / linux / s3c24xx / files-2.6.30 / drivers / mfd / glamo / glamo-mci.h
1 /*
2 * linux/drivers/mmc/host/glamo-mmc.h - GLAMO MCI driver
3 *
4 * Copyright (C) 2007-2008 Openmoko, Inc, Andy Green <andy@openmoko.com>
5 * based on S3C MMC driver -->
6 * Copyright (C) 2004-2006 Thomas Kleffel, All Rights Reserved.
7 *
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License version 2 as
10 * published by the Free Software Foundation.
11 */
12
13 #include <linux/regulator/consumer.h>
14
15 enum glamo_mci_waitfor {
16 COMPLETION_NONE,
17 COMPLETION_FINALIZE,
18 COMPLETION_CMDSENT,
19 COMPLETION_RSPFIN,
20 COMPLETION_XFERFINISH,
21 COMPLETION_XFERFINISH_RSPFIN,
22 };
23
24 struct glamo_mci_host {
25 struct platform_device *pdev;
26 struct glamo_mci_pdata *pdata;
27 struct mmc_host *mmc;
28 struct resource *mem;
29 struct resource *mem_data;
30 struct clk *clk;
31 void __iomem *base;
32 u16 __iomem *base_data;
33 int irq;
34 int irq_cd;
35 int dma;
36 int data_max_size;
37
38 int suspending;
39
40 int power_mode_current;
41 unsigned int vdd_current;
42
43 unsigned long clk_rate;
44 unsigned long clk_div;
45 unsigned long real_rate;
46 u8 prescaler;
47
48 int force_slow_during_powerup;
49
50 unsigned sdiimsk;
51 int dodma;
52
53 volatile int dmatogo;
54
55 struct mmc_request *mrq;
56 int cmd_is_stop;
57 struct work_struct irq_work;
58
59 spinlock_t complete_lock;
60 volatile enum glamo_mci_waitfor
61 complete_what;
62
63 volatile int dma_complete;
64
65 volatile u32 pio_sgptr;
66 volatile u32 pio_words;
67 volatile u32 pio_count;
68 volatile u16 *pio_ptr;
69 #define XFER_NONE 0
70 #define XFER_READ 1
71 #define XFER_WRITE 2
72 volatile u32 pio_active;
73
74 int bus_width;
75
76 char dbgmsg_cmd[301];
77 char dbgmsg_dat[301];
78 volatile char *status;
79
80 unsigned int ccnt, dcnt;
81 struct tasklet_struct pio_tasklet;
82
83 struct regulator *regulator;
84 };