2 * linux/include/linux/mmc/card.h
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License version 2 as
6 * published by the Free Software Foundation.
8 * Card driver specific definitions.
10 #ifndef LINUX_MMC_CARD_H
11 #define LINUX_MMC_CARD_H
13 #include <linux/mmc/mmc.h>
26 unsigned char mmc_prot;
27 unsigned short cmdclass;
28 unsigned short tacc_clks;
31 unsigned int read_blkbits;
32 unsigned int capacity;
41 struct list_head node; /* node in hosts devices list */
42 struct mmc_host *host; /* the host this device belongs to */
43 struct device dev; /* the device */
44 unsigned int rca; /* relative card address of device */
45 unsigned int state; /* (our) card state */
46 #define MMC_STATE_PRESENT (1<<0)
47 #define MMC_STATE_DEAD (1<<1)
48 struct mmc_cid cid; /* card identification */
49 struct mmc_csd csd; /* card specific */
52 #define mmc_card_dead(c) ((c)->state & MMC_STATE_DEAD)
53 #define mmc_card_present(c) ((c)->state & MMC_STATE_PRESENT)
55 #define mmc_card_name(c) ((c)->cid.prod_name)
56 #define mmc_card_id(c) ((c)->dev.bus_id)
58 #define mmc_list_to_card(l) container_of(l, struct mmc_card, node)
59 #define mmc_get_drvdata(c) dev_get_drvdata(&(c)->dev)
60 #define mmc_set_drvdata(c,d) dev_set_drvdata(&(c)->dev, d)
63 * MMC device driver (e.g., Flash card, I/O card...)
66 struct device_driver drv;
67 int (*probe)(struct mmc_card *);
68 void (*remove)(struct mmc_card *);
69 int (*suspend)(struct mmc_card *, u32);
70 int (*resume)(struct mmc_card *);
73 extern int mmc_register_driver(struct mmc_driver *);
74 extern void mmc_unregister_driver(struct mmc_driver *);
76 static inline int mmc_card_claim_host(struct mmc_card *card)
78 return __mmc_claim_host(card->host, card);
81 #define mmc_card_release_host(c) mmc_release_host((c)->host)