Loading...
1/* SPDX-License-Identifier: GPL-2.0-only */
2/*
3 * linux/drivers/mmc/s3cmci.h - Samsung S3C MCI driver
4 *
5 * Copyright (C) 2004-2006 Thomas Kleffel, All Rights Reserved.
6 */
7
8enum 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;
19 struct s3c24xx_mci_pdata *pdata;
20 struct mmc_host *mmc;
21 struct resource *mem;
22 struct clk *clk;
23 void __iomem *base;
24 int irq;
25 int irq_cd;
26 struct dma_chan *dma;
27
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;
36
37 bool irq_disabled;
38 bool irq_enabled;
39 bool irq_state;
40 int sdio_irqen;
41
42 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;
51 u32 pio_bytes;
52 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;
67
68#ifdef CONFIG_DEBUG_FS
69 struct dentry *debug_root;
70#endif
71
72#ifdef CONFIG_ARM_S3C24XX_CPUFREQ
73 struct notifier_block freq_transition;
74#endif
75};
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
11enum s3cmci_waitfor {
12 COMPLETION_NONE,
13 COMPLETION_FINALIZE,
14 COMPLETION_CMDSENT,
15 COMPLETION_RSPFIN,
16 COMPLETION_XFERFINISH,
17 COMPLETION_XFERFINISH_RSPFIN,
18};
19
20struct s3cmci_host {
21 struct platform_device *pdev;
22 struct s3c24xx_mci_pdata *pdata;
23 struct mmc_host *mmc;
24 struct resource *mem;
25 struct clk *clk;
26 void __iomem *base;
27 int irq;
28 int irq_cd;
29 int dma;
30
31 unsigned long clk_rate;
32 unsigned long clk_div;
33 unsigned long real_rate;
34 u8 prescaler;
35
36 int is2440;
37 unsigned sdiimsk;
38 unsigned sdidata;
39 int dodma;
40 int dmatogo;
41
42 bool irq_disabled;
43 bool irq_enabled;
44 bool irq_state;
45 int sdio_irqen;
46
47 struct mmc_request *mrq;
48 int cmd_is_stop;
49
50 spinlock_t complete_lock;
51 enum s3cmci_waitfor complete_what;
52
53 int dma_complete;
54
55 u32 pio_sgptr;
56 u32 pio_bytes;
57 u32 pio_count;
58 u32 *pio_ptr;
59#define XFER_NONE 0
60#define XFER_READ 1
61#define XFER_WRITE 2
62 u32 pio_active;
63
64 int bus_width;
65
66 char dbgmsg_cmd[301];
67 char dbgmsg_dat[301];
68 char *status;
69
70 unsigned int ccnt, dcnt;
71 struct tasklet_struct pio_tasklet;
72
73#ifdef CONFIG_DEBUG_FS
74 struct dentry *debug_root;
75 struct dentry *debug_state;
76 struct dentry *debug_regs;
77#endif
78
79#ifdef CONFIG_CPU_FREQ
80 struct notifier_block freq_transition;
81#endif
82};