Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Macros | Functions | Variables
host.h File Reference
#include <linux/leds.h>
#include <linux/mutex.h>
#include <linux/sched.h>
#include <linux/device.h>
#include <linux/fault-inject.h>
#include <linux/mmc/core.h>
#include <linux/mmc/pm.h>

Go to the source code of this file.

Data Structures

struct  mmc_ios
 
struct  mmc_host_ops
 
struct  mmc_async_req
 
struct  mmc_slot
 
struct  mmc_supply
 
struct  mmc_host
 

Macros

#define MMC_BUSMODE_OPENDRAIN   1
 
#define MMC_BUSMODE_PUSHPULL   2
 
#define MMC_CS_DONTCARE   0
 
#define MMC_CS_HIGH   1
 
#define MMC_CS_LOW   2
 
#define MMC_POWER_OFF   0
 
#define MMC_POWER_UP   1
 
#define MMC_POWER_ON   2
 
#define MMC_BUS_WIDTH_1   0
 
#define MMC_BUS_WIDTH_4   2
 
#define MMC_BUS_WIDTH_8   3
 
#define MMC_TIMING_LEGACY   0
 
#define MMC_TIMING_MMC_HS   1
 
#define MMC_TIMING_SD_HS   2
 
#define MMC_TIMING_UHS_SDR12   MMC_TIMING_LEGACY
 
#define MMC_TIMING_UHS_SDR25   MMC_TIMING_SD_HS
 
#define MMC_TIMING_UHS_SDR50   3
 
#define MMC_TIMING_UHS_SDR104   4
 
#define MMC_TIMING_UHS_DDR50   5
 
#define MMC_TIMING_MMC_HS200   6
 
#define MMC_SDR_MODE   0
 
#define MMC_1_2V_DDR_MODE   1
 
#define MMC_1_8V_DDR_MODE   2
 
#define MMC_1_2V_SDR_MODE   3
 
#define MMC_1_8V_SDR_MODE   4
 
#define MMC_SIGNAL_VOLTAGE_330   0
 
#define MMC_SIGNAL_VOLTAGE_180   1
 
#define MMC_SIGNAL_VOLTAGE_120   2
 
#define MMC_SET_DRIVER_TYPE_B   0
 
#define MMC_SET_DRIVER_TYPE_A   1
 
#define MMC_SET_DRIVER_TYPE_C   2
 
#define MMC_SET_DRIVER_TYPE_D   3
 
#define MMC_VDD_165_195   0x00000080 /* VDD voltage 1.65 - 1.95 */
 
#define MMC_VDD_20_21   0x00000100 /* VDD voltage 2.0 ~ 2.1 */
 
#define MMC_VDD_21_22   0x00000200 /* VDD voltage 2.1 ~ 2.2 */
 
#define MMC_VDD_22_23   0x00000400 /* VDD voltage 2.2 ~ 2.3 */
 
#define MMC_VDD_23_24   0x00000800 /* VDD voltage 2.3 ~ 2.4 */
 
#define MMC_VDD_24_25   0x00001000 /* VDD voltage 2.4 ~ 2.5 */
 
#define MMC_VDD_25_26   0x00002000 /* VDD voltage 2.5 ~ 2.6 */
 
#define MMC_VDD_26_27   0x00004000 /* VDD voltage 2.6 ~ 2.7 */
 
#define MMC_VDD_27_28   0x00008000 /* VDD voltage 2.7 ~ 2.8 */
 
#define MMC_VDD_28_29   0x00010000 /* VDD voltage 2.8 ~ 2.9 */
 
#define MMC_VDD_29_30   0x00020000 /* VDD voltage 2.9 ~ 3.0 */
 
#define MMC_VDD_30_31   0x00040000 /* VDD voltage 3.0 ~ 3.1 */
 
#define MMC_VDD_31_32   0x00080000 /* VDD voltage 3.1 ~ 3.2 */
 
#define MMC_VDD_32_33   0x00100000 /* VDD voltage 3.2 ~ 3.3 */
 
#define MMC_VDD_33_34   0x00200000 /* VDD voltage 3.3 ~ 3.4 */
 
#define MMC_VDD_34_35   0x00400000 /* VDD voltage 3.4 ~ 3.5 */
 
#define MMC_VDD_35_36   0x00800000 /* VDD voltage 3.5 ~ 3.6 */
 
#define MMC_CAP_4_BIT_DATA   (1 << 0) /* Can the host do 4 bit transfers */
 
#define MMC_CAP_MMC_HIGHSPEED   (1 << 1) /* Can do MMC high-speed timing */
 
#define MMC_CAP_SD_HIGHSPEED   (1 << 2) /* Can do SD high-speed timing */
 
#define MMC_CAP_SDIO_IRQ   (1 << 3) /* Can signal pending SDIO IRQs */
 
#define MMC_CAP_SPI   (1 << 4) /* Talks only SPI protocols */
 
#define MMC_CAP_NEEDS_POLL   (1 << 5) /* Needs polling for card-detection */
 
#define MMC_CAP_8_BIT_DATA   (1 << 6) /* Can the host do 8 bit transfers */
 
#define MMC_CAP_NONREMOVABLE   (1 << 8) /* Nonremovable e.g. eMMC */
 
#define MMC_CAP_WAIT_WHILE_BUSY   (1 << 9) /* Waits while card is busy */
 
#define MMC_CAP_ERASE   (1 << 10) /* Allow erase/trim commands */
 
#define MMC_CAP_1_8V_DDR   (1 << 11) /* can support */
 
#define MMC_CAP_1_2V_DDR   (1 << 12) /* can support */
 
#define MMC_CAP_POWER_OFF_CARD   (1 << 13) /* Can power off after boot */
 
#define MMC_CAP_BUS_WIDTH_TEST   (1 << 14) /* CMD14/CMD19 bus width ok */
 
#define MMC_CAP_UHS_SDR12   (1 << 15) /* Host supports UHS SDR12 mode */
 
#define MMC_CAP_UHS_SDR25   (1 << 16) /* Host supports UHS SDR25 mode */
 
#define MMC_CAP_UHS_SDR50   (1 << 17) /* Host supports UHS SDR50 mode */
 
#define MMC_CAP_UHS_SDR104   (1 << 18) /* Host supports UHS SDR104 mode */
 
#define MMC_CAP_UHS_DDR50   (1 << 19) /* Host supports UHS DDR50 mode */
 
#define MMC_CAP_DRIVER_TYPE_A   (1 << 23) /* Host supports Driver Type A */
 
#define MMC_CAP_DRIVER_TYPE_C   (1 << 24) /* Host supports Driver Type C */
 
#define MMC_CAP_DRIVER_TYPE_D   (1 << 25) /* Host supports Driver Type D */
 
#define MMC_CAP_CMD23   (1 << 30) /* CMD23 supported. */
 
#define MMC_CAP_HW_RESET   (1 << 31) /* Hardware reset */
 
#define MMC_CAP2_BOOTPART_NOACC   (1 << 0) /* Boot partition no access */
 
#define MMC_CAP2_CACHE_CTRL   (1 << 1) /* Allow cache control */
 
#define MMC_CAP2_POWEROFF_NOTIFY   (1 << 2) /* Notify poweroff supported */
 
#define MMC_CAP2_NO_MULTI_READ   (1 << 3) /* Multiblock reads don't work */
 
#define MMC_CAP2_NO_SLEEP_CMD   (1 << 4) /* Don't allow sleep command */
 
#define MMC_CAP2_HS200_1_8V_SDR   (1 << 5) /* can support */
 
#define MMC_CAP2_HS200_1_2V_SDR   (1 << 6) /* can support */
 
#define MMC_CAP2_HS200
 
#define MMC_CAP2_BROKEN_VOLTAGE   (1 << 7) /* Use the broken voltage */
 
#define MMC_CAP2_DETECT_ON_ERR   (1 << 8) /* On I/O err check card removal */
 
#define MMC_CAP2_HC_ERASE_SZ   (1 << 9) /* High-capacity erase size */
 
#define MMC_CAP2_CD_ACTIVE_HIGH   (1 << 10) /* Card-detect signal active high */
 
#define MMC_CAP2_RO_ACTIVE_HIGH   (1 << 11) /* Write-protect signal active high */
 
#define mmc_host_is_spi(host)   ((host)->caps & MMC_CAP_SPI)
 
#define mmc_dev(x)   ((x)->parent)
 
#define mmc_classdev(x)   (&(x)->class_dev)
 
#define mmc_hostname(x)   (dev_name(&(x)->class_dev))
 

Functions

struct mmc_hostmmc_alloc_host (int extra, struct device *)
 
int mmc_add_host (struct mmc_host *)
 
void mmc_remove_host (struct mmc_host *)
 
void mmc_free_host (struct mmc_host *)
 
int mmc_suspend_host (struct mmc_host *)
 
int mmc_resume_host (struct mmc_host *)
 
int mmc_power_save_host (struct mmc_host *host)
 
int mmc_power_restore_host (struct mmc_host *host)
 
void mmc_detect_change (struct mmc_host *, unsigned long delay)
 
void mmc_request_done (struct mmc_host *, struct mmc_request *)
 
int mmc_cache_ctrl (struct mmc_host *, u8)
 
int mmc_card_awake (struct mmc_host *host)
 
int mmc_card_sleep (struct mmc_host *host)
 
int mmc_card_can_sleep (struct mmc_host *host)
 
int mmc_pm_notify (struct notifier_block *notify_block, unsigned long, void *)
 

Variables

bool mmc_assume_removable
 

Macro Definition Documentation

#define MMC_1_2V_DDR_MODE   1

Definition at line 64 of file host.h.

#define MMC_1_2V_SDR_MODE   3

Definition at line 66 of file host.h.

#define MMC_1_8V_DDR_MODE   2

Definition at line 65 of file host.h.

#define MMC_1_8V_SDR_MODE   4

Definition at line 67 of file host.h.

#define MMC_BUS_WIDTH_1   0

Definition at line 47 of file host.h.

#define MMC_BUS_WIDTH_4   2

Definition at line 48 of file host.h.

#define MMC_BUS_WIDTH_8   3

Definition at line 49 of file host.h.

#define MMC_BUSMODE_OPENDRAIN   1

Definition at line 30 of file host.h.

#define MMC_BUSMODE_PUSHPULL   2

Definition at line 31 of file host.h.

#define MMC_CAP2_BOOTPART_NOACC   (1 << 0) /* Boot partition no access */

Definition at line 246 of file host.h.

#define MMC_CAP2_BROKEN_VOLTAGE   (1 << 7) /* Use the broken voltage */

Definition at line 255 of file host.h.

#define MMC_CAP2_CACHE_CTRL   (1 << 1) /* Allow cache control */

Definition at line 247 of file host.h.

#define MMC_CAP2_CD_ACTIVE_HIGH   (1 << 10) /* Card-detect signal active high */

Definition at line 258 of file host.h.

#define MMC_CAP2_DETECT_ON_ERR   (1 << 8) /* On I/O err check card removal */

Definition at line 256 of file host.h.

#define MMC_CAP2_HC_ERASE_SZ   (1 << 9) /* High-capacity erase size */

Definition at line 257 of file host.h.

#define MMC_CAP2_HS200
Value:
MMC_CAP2_HS200_1_2V_SDR)

Definition at line 253 of file host.h.

#define MMC_CAP2_HS200_1_2V_SDR   (1 << 6) /* can support */

Definition at line 252 of file host.h.

#define MMC_CAP2_HS200_1_8V_SDR   (1 << 5) /* can support */

Definition at line 251 of file host.h.

#define MMC_CAP2_NO_MULTI_READ   (1 << 3) /* Multiblock reads don't work */

Definition at line 249 of file host.h.

#define MMC_CAP2_NO_SLEEP_CMD   (1 << 4) /* Don't allow sleep command */

Definition at line 250 of file host.h.

#define MMC_CAP2_POWEROFF_NOTIFY   (1 << 2) /* Notify poweroff supported */

Definition at line 248 of file host.h.

#define MMC_CAP2_RO_ACTIVE_HIGH   (1 << 11) /* Write-protect signal active high */

Definition at line 259 of file host.h.

#define MMC_CAP_1_2V_DDR   (1 << 12) /* can support */

Definition at line 229 of file host.h.

#define MMC_CAP_1_8V_DDR   (1 << 11) /* can support */

Definition at line 227 of file host.h.

#define MMC_CAP_4_BIT_DATA   (1 << 0) /* Can the host do 4 bit transfers */

Definition at line 216 of file host.h.

#define MMC_CAP_8_BIT_DATA   (1 << 6) /* Can the host do 8 bit transfers */

Definition at line 222 of file host.h.

#define MMC_CAP_BUS_WIDTH_TEST   (1 << 14) /* CMD14/CMD19 bus width ok */

Definition at line 232 of file host.h.

#define MMC_CAP_CMD23   (1 << 30) /* CMD23 supported. */

Definition at line 241 of file host.h.

#define MMC_CAP_DRIVER_TYPE_A   (1 << 23) /* Host supports Driver Type A */

Definition at line 238 of file host.h.

#define MMC_CAP_DRIVER_TYPE_C   (1 << 24) /* Host supports Driver Type C */

Definition at line 239 of file host.h.

#define MMC_CAP_DRIVER_TYPE_D   (1 << 25) /* Host supports Driver Type D */

Definition at line 240 of file host.h.

#define MMC_CAP_ERASE   (1 << 10) /* Allow erase/trim commands */

Definition at line 226 of file host.h.

#define MMC_CAP_HW_RESET   (1 << 31) /* Hardware reset */

Definition at line 242 of file host.h.

#define MMC_CAP_MMC_HIGHSPEED   (1 << 1) /* Can do MMC high-speed timing */

Definition at line 217 of file host.h.

#define MMC_CAP_NEEDS_POLL   (1 << 5) /* Needs polling for card-detection */

Definition at line 221 of file host.h.

#define MMC_CAP_NONREMOVABLE   (1 << 8) /* Nonremovable e.g. eMMC */

Definition at line 224 of file host.h.

#define MMC_CAP_POWER_OFF_CARD   (1 << 13) /* Can power off after boot */

Definition at line 231 of file host.h.

#define MMC_CAP_SD_HIGHSPEED   (1 << 2) /* Can do SD high-speed timing */

Definition at line 218 of file host.h.

#define MMC_CAP_SDIO_IRQ   (1 << 3) /* Can signal pending SDIO IRQs */

Definition at line 219 of file host.h.

#define MMC_CAP_SPI   (1 << 4) /* Talks only SPI protocols */

Definition at line 220 of file host.h.

#define MMC_CAP_UHS_DDR50   (1 << 19) /* Host supports UHS DDR50 mode */

Definition at line 237 of file host.h.

#define MMC_CAP_UHS_SDR104   (1 << 18) /* Host supports UHS SDR104 mode */

Definition at line 236 of file host.h.

#define MMC_CAP_UHS_SDR12   (1 << 15) /* Host supports UHS SDR12 mode */

Definition at line 233 of file host.h.

#define MMC_CAP_UHS_SDR25   (1 << 16) /* Host supports UHS SDR25 mode */

Definition at line 234 of file host.h.

#define MMC_CAP_UHS_SDR50   (1 << 17) /* Host supports UHS SDR50 mode */

Definition at line 235 of file host.h.

#define MMC_CAP_WAIT_WHILE_BUSY   (1 << 9) /* Waits while card is busy */

Definition at line 225 of file host.h.

#define mmc_classdev (   x)    (&(x)->class_dev)

Definition at line 356 of file host.h.

#define MMC_CS_DONTCARE   0

Definition at line 35 of file host.h.

#define MMC_CS_HIGH   1

Definition at line 36 of file host.h.

#define MMC_CS_LOW   2

Definition at line 37 of file host.h.

#define mmc_dev (   x)    ((x)->parent)

Definition at line 355 of file host.h.

#define mmc_host_is_spi (   host)    ((host)->caps & MMC_CAP_SPI)

Definition at line 353 of file host.h.

#define mmc_hostname (   x)    (dev_name(&(x)->class_dev))

Definition at line 357 of file host.h.

#define MMC_POWER_OFF   0

Definition at line 41 of file host.h.

#define MMC_POWER_ON   2

Definition at line 43 of file host.h.

#define MMC_POWER_UP   1

Definition at line 42 of file host.h.

#define MMC_SDR_MODE   0

Definition at line 63 of file host.h.

#define MMC_SET_DRIVER_TYPE_A   1

Definition at line 78 of file host.h.

#define MMC_SET_DRIVER_TYPE_B   0

Definition at line 77 of file host.h.

#define MMC_SET_DRIVER_TYPE_C   2

Definition at line 79 of file host.h.

#define MMC_SET_DRIVER_TYPE_D   3

Definition at line 80 of file host.h.

#define MMC_SIGNAL_VOLTAGE_120   2

Definition at line 73 of file host.h.

#define MMC_SIGNAL_VOLTAGE_180   1

Definition at line 72 of file host.h.

#define MMC_SIGNAL_VOLTAGE_330   0

Definition at line 71 of file host.h.

#define MMC_TIMING_LEGACY   0

Definition at line 53 of file host.h.

#define MMC_TIMING_MMC_HS   1

Definition at line 54 of file host.h.

#define MMC_TIMING_MMC_HS200   6

Definition at line 61 of file host.h.

#define MMC_TIMING_SD_HS   2

Definition at line 55 of file host.h.

#define MMC_TIMING_UHS_DDR50   5

Definition at line 60 of file host.h.

#define MMC_TIMING_UHS_SDR104   4

Definition at line 59 of file host.h.

#define MMC_TIMING_UHS_SDR12   MMC_TIMING_LEGACY

Definition at line 56 of file host.h.

#define MMC_TIMING_UHS_SDR25   MMC_TIMING_SD_HS

Definition at line 57 of file host.h.

#define MMC_TIMING_UHS_SDR50   3

Definition at line 58 of file host.h.

#define MMC_VDD_165_195   0x00000080 /* VDD voltage 1.65 - 1.95 */

Definition at line 196 of file host.h.

#define MMC_VDD_20_21   0x00000100 /* VDD voltage 2.0 ~ 2.1 */

Definition at line 197 of file host.h.

#define MMC_VDD_21_22   0x00000200 /* VDD voltage 2.1 ~ 2.2 */

Definition at line 198 of file host.h.

#define MMC_VDD_22_23   0x00000400 /* VDD voltage 2.2 ~ 2.3 */

Definition at line 199 of file host.h.

#define MMC_VDD_23_24   0x00000800 /* VDD voltage 2.3 ~ 2.4 */

Definition at line 200 of file host.h.

#define MMC_VDD_24_25   0x00001000 /* VDD voltage 2.4 ~ 2.5 */

Definition at line 201 of file host.h.

#define MMC_VDD_25_26   0x00002000 /* VDD voltage 2.5 ~ 2.6 */

Definition at line 202 of file host.h.

#define MMC_VDD_26_27   0x00004000 /* VDD voltage 2.6 ~ 2.7 */

Definition at line 203 of file host.h.

#define MMC_VDD_27_28   0x00008000 /* VDD voltage 2.7 ~ 2.8 */

Definition at line 204 of file host.h.

#define MMC_VDD_28_29   0x00010000 /* VDD voltage 2.8 ~ 2.9 */

Definition at line 205 of file host.h.

#define MMC_VDD_29_30   0x00020000 /* VDD voltage 2.9 ~ 3.0 */

Definition at line 206 of file host.h.

#define MMC_VDD_30_31   0x00040000 /* VDD voltage 3.0 ~ 3.1 */

Definition at line 207 of file host.h.

#define MMC_VDD_31_32   0x00080000 /* VDD voltage 3.1 ~ 3.2 */

Definition at line 208 of file host.h.

#define MMC_VDD_32_33   0x00100000 /* VDD voltage 3.2 ~ 3.3 */

Definition at line 209 of file host.h.

#define MMC_VDD_33_34   0x00200000 /* VDD voltage 3.3 ~ 3.4 */

Definition at line 210 of file host.h.

#define MMC_VDD_34_35   0x00400000 /* VDD voltage 3.4 ~ 3.5 */

Definition at line 211 of file host.h.

#define MMC_VDD_35_36   0x00800000 /* VDD voltage 3.5 ~ 3.6 */

Definition at line 212 of file host.h.

Function Documentation

int mmc_add_host ( struct mmc_host host)

mmc_add_host - initialise host hardware : mmc host

Register the host with the driver model. The host must be prepared to start servicing requests before this function completes.

Definition at line 371 of file host.c.

struct mmc_host* mmc_alloc_host ( int  extra,
struct device dev 
)
read

mmc_alloc_host - initialise the per-host structure. : sizeof private data structure : pointer to host device model structure

Initialise the per-host structure.

Definition at line 304 of file host.c.

int mmc_cache_ctrl ( struct mmc_host ,
u8   
)

Definition at line 2362 of file core.c.

int mmc_card_awake ( struct mmc_host host)

Definition at line 2286 of file core.c.

int mmc_card_can_sleep ( struct mmc_host host)

Definition at line 2322 of file core.c.

int mmc_card_sleep ( struct mmc_host host)

Definition at line 2304 of file core.c.

void mmc_detect_change ( struct mmc_host host,
unsigned long  delay 
)

mmc_detect_change - process change of state on a MMC socket : host which changed state. : optional delay to wait before detection (jiffies)

MMC drivers should call this when they detect a card has been inserted or removed. The MMC layer will confirm that any present card is still functional, and initialize any newly inserted.

Definition at line 1467 of file core.c.

void mmc_free_host ( struct mmc_host host)

mmc_free_host - free the host structure : mmc host

Free the host once all references to it have been dropped.

Definition at line 429 of file host.c.

int mmc_pm_notify ( struct notifier_block notify_block,
unsigned  long,
void  
)
int mmc_power_restore_host ( struct mmc_host host)

Definition at line 2262 of file core.c.

int mmc_power_save_host ( struct mmc_host host)

Definition at line 2236 of file core.c.

void mmc_remove_host ( struct mmc_host host)

mmc_remove_host - remove host hardware : mmc host

Unregister and remove all cards associated with this host, and power down the MMC bus. No new requests will be issued after this function has returned.

Definition at line 405 of file host.c.

void mmc_request_done ( struct mmc_host host,
struct mmc_request mrq 
)

mmc_request_done - finish processing an MMC request : MMC host which completed request : MMC request which request

MMC drivers should call this function when they have completed their processing of a request.

Definition at line 141 of file core.c.

int mmc_resume_host ( struct mmc_host )
int mmc_suspend_host ( struct mmc_host )

Variable Documentation

bool mmc_assume_removable

Definition at line 71 of file core.c.