Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Macros | Functions | Variables
sd.c File Reference
#include <linux/err.h>
#include <linux/slab.h>
#include <linux/stat.h>
#include <linux/mmc/host.h>
#include <linux/mmc/card.h>
#include <linux/mmc/mmc.h>
#include <linux/mmc/sd.h>
#include "core.h"
#include "bus.h"
#include "mmc_ops.h"
#include "sd.h"
#include "sd_ops.h"

Go to the source code of this file.

Macros

#define UNSTUFF_BITS(resp, start, size)
 

Functions

void mmc_decode_cid (struct mmc_card *card)
 
int mmc_sd_switch_hs (struct mmc_card *card)
 
 MMC_DEV_ATTR (cid,"%08x%08x%08x%08x\n", card->raw_cid[0], card->raw_cid[1], card->raw_cid[2], card->raw_cid[3])
 
 MMC_DEV_ATTR (csd,"%08x%08x%08x%08x\n", card->raw_csd[0], card->raw_csd[1], card->raw_csd[2], card->raw_csd[3])
 
 MMC_DEV_ATTR (scr,"%08x%08x\n", card->raw_scr[0], card->raw_scr[1])
 
 MMC_DEV_ATTR (date,"%02d/%04d\n", card->cid.month, card->cid.year)
 
 MMC_DEV_ATTR (erase_size,"%u\n", card->erase_size<< 9)
 
 MMC_DEV_ATTR (preferred_erase_size,"%u\n", card->pref_erase<< 9)
 
 MMC_DEV_ATTR (fwrev,"0x%x\n", card->cid.fwrev)
 
 MMC_DEV_ATTR (hwrev,"0x%x\n", card->cid.hwrev)
 
 MMC_DEV_ATTR (manfid,"0x%06x\n", card->cid.manfid)
 
 MMC_DEV_ATTR (name,"%s\n", card->cid.prod_name)
 
 MMC_DEV_ATTR (oemid,"0x%04x\n", card->cid.oemid)
 
 MMC_DEV_ATTR (serial,"0x%08x\n", card->cid.serial)
 
int mmc_sd_get_cid (struct mmc_host *host, u32 ocr, u32 *cid, u32 *rocr)
 
int mmc_sd_get_csd (struct mmc_host *host, struct mmc_card *card)
 
int mmc_sd_setup_card (struct mmc_host *host, struct mmc_card *card, bool reinit)
 
unsigned mmc_sd_get_max_clock (struct mmc_card *card)
 
void mmc_sd_go_highspeed (struct mmc_card *card)
 
int mmc_attach_sd (struct mmc_host *host)
 

Variables

struct device_type sd_type
 

Macro Definition Documentation

#define UNSTUFF_BITS (   resp,
  start,
  size 
)
Value:
({ \
const int __size = size; \
const u32 __mask = (__size < 32 ? 1 << __size : 0) - 1; \
const int __off = 3 - ((start) / 32); \
const int __shft = (start) & 31; \
u32 __res; \
\
__res = resp[__off] >> __shft; \
if (__size + __shft > 32) \
__res |= resp[__off-1] << ((32 - __shft) % 32); \
__res & __mask; \
})

Definition at line 47 of file sd.c.

Function Documentation

int mmc_attach_sd ( struct mmc_host host)

Definition at line 1143 of file sd.c.

void mmc_decode_cid ( struct mmc_card card)

Definition at line 64 of file sd.c.

MMC_DEV_ATTR ( cid  ,
"%08x%08x%08x%08x\n"  ,
card->  raw_cid[0],
card->  raw_cid[1],
card->  raw_cid[2],
card->  raw_cid[3] 
)
MMC_DEV_ATTR ( csd  ,
"%08x%08x%08x%08x\n"  ,
card->  raw_csd[0],
card->  raw_csd[1],
card->  raw_csd[2],
card->  raw_csd[3] 
)
MMC_DEV_ATTR ( scr  ,
"%08x%08x\n"  ,
card->  raw_scr[0],
card->  raw_scr[1] 
)
MMC_DEV_ATTR ( date  ,
"%02d/%04d\n"  ,
card->cid.  month,
card->cid.  year 
)
MMC_DEV_ATTR ( erase_size  ,
"%u\n"  ,
card->erase_size<<  9 
)
MMC_DEV_ATTR ( preferred_erase_size  ,
"%u\n"  ,
card->pref_erase<<  9 
)
MMC_DEV_ATTR ( fwrev  ,
"0x%x\n"  ,
card->cid.  fwrev 
)
MMC_DEV_ATTR ( hwrev  ,
"0x%x\n"  ,
card->cid.  hwrev 
)
MMC_DEV_ATTR ( manfid  ,
"0x%06x\n"  ,
card->cid.  manfid 
)
MMC_DEV_ATTR ( name  ,
"%s\n"  ,
card->cid.  prod_name 
)
MMC_DEV_ATTR ( oemid  ,
"0x%04x\n"  ,
card->cid.  oemid 
)
MMC_DEV_ATTR ( serial  ,
"0x%08x\n"  ,
card->cid.  serial 
)
int mmc_sd_get_cid ( struct mmc_host host,
u32  ocr,
u32 cid,
u32 rocr 
)

Definition at line 712 of file sd.c.

int mmc_sd_get_csd ( struct mmc_host host,
struct mmc_card card 
)

Definition at line 777 of file sd.c.

unsigned mmc_sd_get_max_clock ( struct mmc_card card)

Definition at line 867 of file sd.c.

void mmc_sd_go_highspeed ( struct mmc_card card)

Definition at line 881 of file sd.c.

int mmc_sd_setup_card ( struct mmc_host host,
struct mmc_card card,
bool  reinit 
)

Definition at line 795 of file sd.c.

int mmc_sd_switch_hs ( struct mmc_card card)

Definition at line 332 of file sd.c.

Variable Documentation

Initial value:
= {
.groups = sd_attr_groups,
}

Definition at line 705 of file sd.c.