Lines Matching full:mmc

10 #include <mmc.h>
17 struct mmc *find_mmc_device(int dev_num) in find_mmc_device()
19 struct mmc *m; in find_mmc_device()
23 m = list_entry(entry, struct mmc, link); in find_mmc_device()
30 printf("MMC Device %d not found\n", dev_num); in find_mmc_device()
41 struct blk_desc *mmc_get_blk_desc(struct mmc *mmc) in mmc_get_blk_desc() argument
43 return &mmc->block_dev; in mmc_get_blk_desc()
53 struct mmc *m; in mmc_do_preinit()
57 m = list_entry(entry, struct mmc, link); in mmc_do_preinit()
74 void mmc_list_add(struct mmc *mmc) in mmc_list_add() argument
76 INIT_LIST_HEAD(&mmc->link); in mmc_list_add()
78 list_add_tail(&mmc->link, &mmc_devices); in mmc_list_add()
84 struct mmc *m; in print_mmc_devices()
89 m = list_entry(entry, struct mmc, link); in print_mmc_devices()
115 static struct mmc mmc_static = {
129 struct mmc *mmc_create(const struct mmc_config *cfg, void *priv) in mmc_create()
131 struct mmc *mmc = &mmc_static; in mmc_create() local
133 mmc->cfg = cfg; in mmc_create()
134 mmc->priv = priv; in mmc_create()
136 return mmc; in mmc_create()
139 void mmc_destroy(struct mmc *mmc) in mmc_destroy() argument
143 struct mmc *mmc_create(const struct mmc_config *cfg, void *priv) in mmc_create()
146 struct mmc *mmc; in mmc_create() local
158 mmc = calloc(1, sizeof(*mmc)); in mmc_create()
159 if (mmc == NULL) in mmc_create()
162 mmc->cfg = cfg; in mmc_create()
163 mmc->priv = priv; in mmc_create()
168 mmc->dsr_imp = 0; in mmc_create()
169 mmc->dsr = 0xffffffff; in mmc_create()
171 bdesc = mmc_get_blk_desc(mmc); in mmc_create()
180 bdesc->part_type = mmc->cfg->part_type; in mmc_create()
181 mmc_list_add(mmc); in mmc_create()
183 return mmc; in mmc_create()
186 void mmc_destroy(struct mmc *mmc) in mmc_destroy() argument
189 free(mmc); in mmc_destroy()
195 struct mmc *mmc = find_mmc_device(desc->devnum); in mmc_select_hwpartp() local
198 if (!mmc) in mmc_select_hwpartp()
201 if (mmc->block_dev.hwpart == hwpart) in mmc_select_hwpartp()
204 if (mmc->part_config == MMCPART_NOAVAILABLE) in mmc_select_hwpartp()
207 ret = mmc_switch_part(mmc, hwpart); in mmc_select_hwpartp()
216 struct mmc *mmc = find_mmc_device(dev); in mmc_get_dev() local
219 if (!mmc) in mmc_get_dev()
221 ret = mmc_init(mmc); in mmc_get_dev()
225 *descp = &mmc->block_dev; in mmc_get_dev()
230 U_BOOT_LEGACY_BLK(mmc) = {
231 .if_typename = "mmc",