Lines Matching refs:mmc

16 static struct mmc mmc_static;
17 struct mmc *find_mmc_device(int dev_num) in find_mmc_device()
24 struct mmc *m = &mmc_static; in mmc_do_preinit()
32 struct blk_desc *mmc_get_blk_desc(struct mmc *mmc) in mmc_get_blk_desc() argument
34 return &mmc->block_dev; in mmc_get_blk_desc()
37 struct mmc *find_mmc_device(int dev_num) in find_mmc_device()
39 struct mmc *m; in find_mmc_device()
43 m = list_entry(entry, struct mmc, link); in find_mmc_device()
61 struct blk_desc *mmc_get_blk_desc(struct mmc *mmc) in mmc_get_blk_desc() argument
63 return &mmc->block_dev; in mmc_get_blk_desc()
73 struct mmc *m; in mmc_do_preinit()
77 m = list_entry(entry, struct mmc, link); in mmc_do_preinit()
94 void mmc_list_add(struct mmc *mmc) in mmc_list_add() argument
96 INIT_LIST_HEAD(&mmc->link); in mmc_list_add()
98 list_add_tail(&mmc->link, &mmc_devices); in mmc_list_add()
104 struct mmc *m; in print_mmc_devices()
109 m = list_entry(entry, struct mmc, link); in print_mmc_devices()
135 static struct mmc mmc_static = {
149 struct mmc *mmc_create(const struct mmc_config *cfg, void *priv) in mmc_create()
151 struct mmc *mmc = &mmc_static; in mmc_create() local
153 mmc->cfg = cfg; in mmc_create()
154 mmc->priv = priv; in mmc_create()
156 return mmc; in mmc_create()
159 void mmc_destroy(struct mmc *mmc) in mmc_destroy() argument
163 struct mmc *mmc_create(const struct mmc_config *cfg, void *priv) in mmc_create()
166 struct mmc *mmc; in mmc_create() local
178 mmc = calloc(1, sizeof(*mmc)); in mmc_create()
179 if (mmc == NULL) in mmc_create()
182 mmc->cfg = cfg; in mmc_create()
183 mmc->priv = priv; in mmc_create()
188 mmc->dsr_imp = 0; in mmc_create()
189 mmc->dsr = 0xffffffff; in mmc_create()
191 bdesc = mmc_get_blk_desc(mmc); in mmc_create()
200 bdesc->part_type = mmc->cfg->part_type; in mmc_create()
201 mmc_list_add(mmc); in mmc_create()
203 return mmc; in mmc_create()
206 void mmc_destroy(struct mmc *mmc) in mmc_destroy() argument
209 free(mmc); in mmc_destroy()
215 struct mmc *mmc = find_mmc_device(desc->devnum); in mmc_select_hwpartp() local
218 if (!mmc) in mmc_select_hwpartp()
221 if (mmc->block_dev.hwpart == hwpart) in mmc_select_hwpartp()
224 if (mmc->part_config == MMCPART_NOAVAILABLE) in mmc_select_hwpartp()
227 ret = mmc_switch_part(mmc, hwpart); in mmc_select_hwpartp()
236 struct mmc *mmc = find_mmc_device(dev); in mmc_get_dev() local
239 if (!mmc) in mmc_get_dev()
241 ret = mmc_init(mmc); in mmc_get_dev()
245 *descp = &mmc->block_dev; in mmc_get_dev()
250 U_BOOT_LEGACY_BLK(mmc) = {