aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/mmc
diff options
context:
space:
mode:
Diffstat (limited to 'include/linux/mmc')
-rw-r--r--include/linux/mmc/card.h7
-rw-r--r--include/linux/mmc/host.h5
-rw-r--r--include/linux/mmc/mmc.h1
-rw-r--r--include/linux/mmc/pm.h30
-rw-r--r--include/linux/mmc/sdio.h2
-rw-r--r--include/linux/mmc/sdio_func.h5
6 files changed, 50 insertions, 0 deletions
diff --git a/include/linux/mmc/card.h b/include/linux/mmc/card.h
index 2ee22e8af110..d02d2c6e0cfe 100644
--- a/include/linux/mmc/card.h
+++ b/include/linux/mmc/card.h
@@ -99,6 +99,8 @@ struct mmc_card {
99#define MMC_STATE_BLOCKADDR (1<<3) /* card uses block-addressing */ 99#define MMC_STATE_BLOCKADDR (1<<3) /* card uses block-addressing */
100 unsigned int quirks; /* card quirks */ 100 unsigned int quirks; /* card quirks */
101#define MMC_QUIRK_LENIENT_FN0 (1<<0) /* allow SDIO FN0 writes outside of the VS CCCR range */ 101#define MMC_QUIRK_LENIENT_FN0 (1<<0) /* allow SDIO FN0 writes outside of the VS CCCR range */
102#define MMC_QUIRK_BLKSZ_FOR_BYTE_MODE (1<<1) /* use func->cur_blksize */
103 /* for byte mode */
102 104
103 u32 raw_cid[4]; /* raw card CID */ 105 u32 raw_cid[4]; /* raw card CID */
104 u32 raw_csd[4]; /* raw card CSD */ 106 u32 raw_csd[4]; /* raw card CSD */
@@ -139,6 +141,11 @@ static inline int mmc_card_lenient_fn0(const struct mmc_card *c)
139 return c->quirks & MMC_QUIRK_LENIENT_FN0; 141 return c->quirks & MMC_QUIRK_LENIENT_FN0;
140} 142}
141 143
144static inline int mmc_blksz_for_byte_mode(const struct mmc_card *c)
145{
146 return c->quirks & MMC_QUIRK_BLKSZ_FOR_BYTE_MODE;
147}
148
142#define mmc_card_name(c) ((c)->cid.prod_name) 149#define mmc_card_name(c) ((c)->cid.prod_name)
143#define mmc_card_id(c) (dev_name(&(c)->dev)) 150#define mmc_card_id(c) (dev_name(&(c)->dev))
144 151
diff --git a/include/linux/mmc/host.h b/include/linux/mmc/host.h
index eaf36364b7d4..43eaf5ca5848 100644
--- a/include/linux/mmc/host.h
+++ b/include/linux/mmc/host.h
@@ -14,6 +14,7 @@
14#include <linux/sched.h> 14#include <linux/sched.h>
15 15
16#include <linux/mmc/core.h> 16#include <linux/mmc/core.h>
17#include <linux/mmc/pm.h>
17 18
18struct mmc_ios { 19struct mmc_ios {
19 unsigned int clock; /* clock rate */ 20 unsigned int clock; /* clock rate */
@@ -152,6 +153,8 @@ struct mmc_host {
152#define MMC_CAP_NONREMOVABLE (1 << 8) /* Nonremovable e.g. eMMC */ 153#define MMC_CAP_NONREMOVABLE (1 << 8) /* Nonremovable e.g. eMMC */
153#define MMC_CAP_WAIT_WHILE_BUSY (1 << 9) /* Waits while card is busy */ 154#define MMC_CAP_WAIT_WHILE_BUSY (1 << 9) /* Waits while card is busy */
154 155
156 mmc_pm_flag_t pm_caps; /* supported pm features */
157
155 /* host specific block data */ 158 /* host specific block data */
156 unsigned int max_seg_size; /* see blk_queue_max_segment_size */ 159 unsigned int max_seg_size; /* see blk_queue_max_segment_size */
157 unsigned short max_hw_segs; /* see blk_queue_max_hw_segments */ 160 unsigned short max_hw_segs; /* see blk_queue_max_hw_segments */
@@ -197,6 +200,8 @@ struct mmc_host {
197 struct task_struct *sdio_irq_thread; 200 struct task_struct *sdio_irq_thread;
198 atomic_t sdio_irq_thread_abort; 201 atomic_t sdio_irq_thread_abort;
199 202
203 mmc_pm_flag_t pm_flags; /* requested pm features */
204
200#ifdef CONFIG_LEDS_TRIGGERS 205#ifdef CONFIG_LEDS_TRIGGERS
201 struct led_trigger *led; /* activity led */ 206 struct led_trigger *led; /* activity led */
202#endif 207#endif
diff --git a/include/linux/mmc/mmc.h b/include/linux/mmc/mmc.h
index c02c8db73701..8a49cbf0376d 100644
--- a/include/linux/mmc/mmc.h
+++ b/include/linux/mmc/mmc.h
@@ -268,6 +268,7 @@ struct _mmc_csd {
268 268
269#define EXT_CSD_CARD_TYPE_26 (1<<0) /* Card can run at 26MHz */ 269#define EXT_CSD_CARD_TYPE_26 (1<<0) /* Card can run at 26MHz */
270#define EXT_CSD_CARD_TYPE_52 (1<<1) /* Card can run at 52MHz */ 270#define EXT_CSD_CARD_TYPE_52 (1<<1) /* Card can run at 52MHz */
271#define EXT_CSD_CARD_TYPE_MASK 0x3 /* Mask out reserved and DDR bits */
271 272
272#define EXT_CSD_BUS_WIDTH_1 0 /* Card is in 1 bit mode */ 273#define EXT_CSD_BUS_WIDTH_1 0 /* Card is in 1 bit mode */
273#define EXT_CSD_BUS_WIDTH_4 1 /* Card is in 4 bit mode */ 274#define EXT_CSD_BUS_WIDTH_4 1 /* Card is in 4 bit mode */
diff --git a/include/linux/mmc/pm.h b/include/linux/mmc/pm.h
new file mode 100644
index 000000000000..d37aac49cf9a
--- /dev/null
+++ b/include/linux/mmc/pm.h
@@ -0,0 +1,30 @@
1/*
2 * linux/include/linux/mmc/pm.h
3 *
4 * Author: Nicolas Pitre
5 * Copyright: (C) 2009 Marvell Technology Group Ltd.
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License version 2 as
9 * published by the Free Software Foundation.
10 */
11
12#ifndef LINUX_MMC_PM_H
13#define LINUX_MMC_PM_H
14
15/*
16 * These flags are used to describe power management features that
17 * some cards (typically SDIO cards) might wish to benefit from when
18 * the host system is being suspended. There are several layers of
19 * abstractions involved, from the host controller driver, to the MMC core
20 * code, to the SDIO core code, to finally get to the actual SDIO function
21 * driver. This file is therefore used for common definitions shared across
22 * all those layers.
23 */
24
25typedef unsigned int mmc_pm_flag_t;
26
27#define MMC_PM_KEEP_POWER (1 << 0) /* preserve card power during suspend */
28#define MMC_PM_WAKE_SDIO_IRQ (1 << 1) /* wake up host system on SDIO IRQ assertion */
29
30#endif
diff --git a/include/linux/mmc/sdio.h b/include/linux/mmc/sdio.h
index 118f0295a575..329a8faa6e37 100644
--- a/include/linux/mmc/sdio.h
+++ b/include/linux/mmc/sdio.h
@@ -97,6 +97,8 @@
97#define SDIO_BUS_ECSI 0x20 /* Enable continuous SPI interrupt */ 97#define SDIO_BUS_ECSI 0x20 /* Enable continuous SPI interrupt */
98#define SDIO_BUS_SCSI 0x40 /* Support continuous SPI interrupt */ 98#define SDIO_BUS_SCSI 0x40 /* Support continuous SPI interrupt */
99 99
100#define SDIO_BUS_ASYNC_INT 0x20
101
100#define SDIO_BUS_CD_DISABLE 0x80 /* disable pull-up on DAT3 (pin 1) */ 102#define SDIO_BUS_CD_DISABLE 0x80 /* disable pull-up on DAT3 (pin 1) */
101 103
102#define SDIO_CCCR_CAPS 0x08 104#define SDIO_CCCR_CAPS 0x08
diff --git a/include/linux/mmc/sdio_func.h b/include/linux/mmc/sdio_func.h
index ac3ab683fec6..c6c0cceba5fe 100644
--- a/include/linux/mmc/sdio_func.h
+++ b/include/linux/mmc/sdio_func.h
@@ -15,6 +15,8 @@
15#include <linux/device.h> 15#include <linux/device.h>
16#include <linux/mod_devicetable.h> 16#include <linux/mod_devicetable.h>
17 17
18#include <linux/mmc/pm.h>
19
18struct mmc_card; 20struct mmc_card;
19struct sdio_func; 21struct sdio_func;
20 22
@@ -153,5 +155,8 @@ extern unsigned char sdio_f0_readb(struct sdio_func *func,
153extern void sdio_f0_writeb(struct sdio_func *func, unsigned char b, 155extern void sdio_f0_writeb(struct sdio_func *func, unsigned char b,
154 unsigned int addr, int *err_ret); 156 unsigned int addr, int *err_ret);
155 157
158extern mmc_pm_flag_t sdio_get_host_pm_caps(struct sdio_func *func);
159extern int sdio_set_host_pm_flags(struct sdio_func *func, mmc_pm_flag_t flags);
160
156#endif 161#endif
157 162