• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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  ***   To edit the content of this header, modify the corresponding
11  ***   source file (e.g. under external/kernel-headers/original/) then
12  ***   run bionic/libc/kernel/tools/update_all.py
13  ***
14  ***   Any manual change here will be lost the next time this script will
15  ***   be run. You've been warned!
16  ***
17  ****************************************************************************
18  ****************************************************************************/
19 #ifndef LINUX_MMC_CARD_H
20 #define LINUX_MMC_CARD_H
21 #include <linux/mmc/mmc.h>
22 struct mmc_cid {
23 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
24  unsigned int manfid;
25  char prod_name[8];
26  unsigned int serial;
27  unsigned short oemid;
28 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
29  unsigned short year;
30  unsigned char hwrev;
31  unsigned char fwrev;
32  unsigned char month;
33 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
34 };
35 struct mmc_csd {
36  unsigned char mmca_vsn;
37  unsigned short cmdclass;
38 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
39  unsigned short tacc_clks;
40  unsigned int tacc_ns;
41  unsigned int r2w_factor;
42  unsigned int max_dtr;
43 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
44  unsigned int read_blkbits;
45  unsigned int write_blkbits;
46  unsigned int capacity;
47  unsigned int read_partial:1,
48 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
49  read_misalign:1,
50  write_partial:1,
51  write_misalign:1;
52 };
53 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
54 struct sd_scr {
55  unsigned char sda_vsn;
56  unsigned char bus_widths;
57 #define SD_SCR_BUS_WIDTH_1 (1<<0)
58 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
59 #define SD_SCR_BUS_WIDTH_4 (1<<2)
60 };
61 struct mmc_host;
62 struct mmc_card {
63 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
64  struct list_head node;
65  struct mmc_host *host;
66  struct device dev;
67  unsigned int rca;
68 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
69  unsigned int state;
70 #define MMC_STATE_PRESENT (1<<0)
71 #define MMC_STATE_DEAD (1<<1)
72 #define MMC_STATE_BAD (1<<2)
73 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
74 #define MMC_STATE_SDCARD (1<<3)
75 #define MMC_STATE_READONLY (1<<4)
76  u32 raw_cid[4];
77  u32 raw_csd[4];
78 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
79  u32 raw_scr[2];
80  struct mmc_cid cid;
81  struct mmc_csd csd;
82  struct sd_scr scr;
83 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
84 };
85 #define mmc_card_present(c) ((c)->state & MMC_STATE_PRESENT)
86 #define mmc_card_dead(c) ((c)->state & MMC_STATE_DEAD)
87 #define mmc_card_bad(c) ((c)->state & MMC_STATE_BAD)
88 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
89 #define mmc_card_sd(c) ((c)->state & MMC_STATE_SDCARD)
90 #define mmc_card_readonly(c) ((c)->state & MMC_STATE_READONLY)
91 #define mmc_card_set_present(c) ((c)->state |= MMC_STATE_PRESENT)
92 #define mmc_card_set_dead(c) ((c)->state |= MMC_STATE_DEAD)
93 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
94 #define mmc_card_set_bad(c) ((c)->state |= MMC_STATE_BAD)
95 #define mmc_card_set_sd(c) ((c)->state |= MMC_STATE_SDCARD)
96 #define mmc_card_set_readonly(c) ((c)->state |= MMC_STATE_READONLY)
97 #define mmc_card_name(c) ((c)->cid.prod_name)
98 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
99 #define mmc_card_id(c) ((c)->dev.bus_id)
100 #define mmc_list_to_card(l) container_of(l, struct mmc_card, node)
101 #define mmc_get_drvdata(c) dev_get_drvdata(&(c)->dev)
102 #define mmc_set_drvdata(c,d) dev_set_drvdata(&(c)->dev, d)
103 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
104 struct mmc_driver {
105  struct device_driver drv;
106  int (*probe)(struct mmc_card *);
107  void (*remove)(struct mmc_card *);
108 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
109  int (*suspend)(struct mmc_card *, pm_message_t);
110  int (*resume)(struct mmc_card *);
111 };
112 #define mmc_card_release_host(c) mmc_release_host((c)->host)
113 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
114 #endif
115