The Android Open Source Project | a27d2ba | 2008-10-21 07:00:00 -0700 | [diff] [blame^] | 1 | /**************************************************************************** |
| 2 | **************************************************************************** |
| 3 | *** |
| 4 | *** This header was automatically generated from a Linux kernel header |
| 5 | *** of the same name, to make information necessary for userspace to |
| 6 | *** call into the kernel available to libc. It contains only constants, |
| 7 | *** structures, and macros generated from the original header, and thus, |
| 8 | *** contains no copyrightable information. |
| 9 | *** |
| 10 | **************************************************************************** |
| 11 | ****************************************************************************/ |
| 12 | #ifndef LINUX_MMC_HOST_H |
| 13 | #define LINUX_MMC_HOST_H |
| 14 | |
| 15 | #include <linux/mmc/mmc.h> |
| 16 | |
| 17 | struct mmc_ios { |
| 18 | unsigned int clock; |
| 19 | unsigned short vdd; |
| 20 | |
| 21 | #define MMC_VDD_150 0 |
| 22 | #define MMC_VDD_155 1 |
| 23 | #define MMC_VDD_160 2 |
| 24 | #define MMC_VDD_165 3 |
| 25 | #define MMC_VDD_170 4 |
| 26 | #define MMC_VDD_180 5 |
| 27 | #define MMC_VDD_190 6 |
| 28 | #define MMC_VDD_200 7 |
| 29 | #define MMC_VDD_210 8 |
| 30 | #define MMC_VDD_220 9 |
| 31 | #define MMC_VDD_230 10 |
| 32 | #define MMC_VDD_240 11 |
| 33 | #define MMC_VDD_250 12 |
| 34 | #define MMC_VDD_260 13 |
| 35 | #define MMC_VDD_270 14 |
| 36 | #define MMC_VDD_280 15 |
| 37 | #define MMC_VDD_290 16 |
| 38 | #define MMC_VDD_300 17 |
| 39 | #define MMC_VDD_310 18 |
| 40 | #define MMC_VDD_320 19 |
| 41 | #define MMC_VDD_330 20 |
| 42 | #define MMC_VDD_340 21 |
| 43 | #define MMC_VDD_350 22 |
| 44 | #define MMC_VDD_360 23 |
| 45 | |
| 46 | unsigned char bus_mode; |
| 47 | |
| 48 | #define MMC_BUSMODE_OPENDRAIN 1 |
| 49 | #define MMC_BUSMODE_PUSHPULL 2 |
| 50 | |
| 51 | unsigned char chip_select; |
| 52 | |
| 53 | #define MMC_CS_DONTCARE 0 |
| 54 | #define MMC_CS_HIGH 1 |
| 55 | #define MMC_CS_LOW 2 |
| 56 | |
| 57 | unsigned char power_mode; |
| 58 | |
| 59 | #define MMC_POWER_OFF 0 |
| 60 | #define MMC_POWER_UP 1 |
| 61 | #define MMC_POWER_ON 2 |
| 62 | |
| 63 | unsigned char bus_width; |
| 64 | |
| 65 | #define MMC_BUS_WIDTH_1 0 |
| 66 | #define MMC_BUS_WIDTH_4 2 |
| 67 | }; |
| 68 | |
| 69 | struct mmc_host_ops { |
| 70 | void (*request)(struct mmc_host *host, struct mmc_request *req); |
| 71 | void (*set_ios)(struct mmc_host *host, struct mmc_ios *ios); |
| 72 | int (*get_ro)(struct mmc_host *host); |
| 73 | }; |
| 74 | |
| 75 | struct mmc_card; |
| 76 | struct device; |
| 77 | |
| 78 | struct mmc_host { |
| 79 | struct device *dev; |
| 80 | struct class_device class_dev; |
| 81 | int index; |
| 82 | const struct mmc_host_ops *ops; |
| 83 | unsigned int f_min; |
| 84 | unsigned int f_max; |
| 85 | u32 ocr_avail; |
| 86 | |
| 87 | unsigned long caps; |
| 88 | |
| 89 | #define MMC_CAP_4_BIT_DATA (1 << 0) |
| 90 | |
| 91 | unsigned int max_seg_size; |
| 92 | unsigned short max_hw_segs; |
| 93 | unsigned short max_phys_segs; |
| 94 | unsigned short max_sectors; |
| 95 | unsigned short unused; |
| 96 | |
| 97 | struct mmc_ios ios; |
| 98 | u32 ocr; |
| 99 | |
| 100 | unsigned int mode; |
| 101 | #define MMC_MODE_MMC 0 |
| 102 | #define MMC_MODE_SD 1 |
| 103 | |
| 104 | struct list_head cards; |
| 105 | |
| 106 | wait_queue_head_t wq; |
| 107 | spinlock_t lock; |
| 108 | struct mmc_card *card_busy; |
| 109 | struct mmc_card *card_selected; |
| 110 | |
| 111 | struct work_struct detect; |
| 112 | |
| 113 | unsigned long private[0] ____cacheline_aligned; |
| 114 | }; |
| 115 | |
| 116 | #define mmc_dev(x) ((x)->dev) |
| 117 | #define mmc_hostname(x) ((x)->class_dev.class_id) |
| 118 | |
| 119 | #endif |
| 120 | |