Lines Matching refs:card
34 struct mmc_card *card = mmc_dev_to_card(dev); in type_show() local
36 switch (card->type) { in type_show()
60 struct mmc_card *card = mmc_dev_to_card(dev); in mmc_bus_uevent() local
65 switch (card->type) { in mmc_bus_uevent()
88 if (mmc_card_sdio(card) || mmc_card_sd_combo(card)) { in mmc_bus_uevent()
90 card->cis.vendor, card->cis.device); in mmc_bus_uevent()
95 card->major_rev, card->minor_rev); in mmc_bus_uevent()
99 for (i = 0; i < card->num_info; i++) { in mmc_bus_uevent()
100 retval = add_uevent_var(env, "SDIO_INFO%u=%s", i+1, card->info[i]); in mmc_bus_uevent()
110 if (mmc_card_sdio(card)) in mmc_bus_uevent()
113 retval = add_uevent_var(env, "MMC_NAME=%s", mmc_card_name(card)); in mmc_bus_uevent()
129 struct mmc_card *card = mmc_dev_to_card(dev); in mmc_bus_probe() local
131 return drv->probe(card); in mmc_bus_probe()
137 struct mmc_card *card = mmc_dev_to_card(dev); in mmc_bus_remove() local
139 drv->remove(card); in mmc_bus_remove()
145 struct mmc_card *card = mmc_dev_to_card(dev); in mmc_bus_shutdown() local
146 struct mmc_host *host = card->host; in mmc_bus_shutdown()
150 drv->shutdown(card); in mmc_bus_shutdown()
163 struct mmc_card *card = mmc_dev_to_card(dev); in mmc_bus_suspend() local
164 struct mmc_host *host = card->host; in mmc_bus_suspend()
180 struct mmc_card *card = mmc_dev_to_card(dev); in mmc_bus_resume() local
181 struct mmc_host *host = card->host; in mmc_bus_resume()
197 struct mmc_card *card = mmc_dev_to_card(dev); in mmc_runtime_suspend() local
198 struct mmc_host *host = card->host; in mmc_runtime_suspend()
205 struct mmc_card *card = mmc_dev_to_card(dev); in mmc_runtime_resume() local
206 struct mmc_host *host = card->host; in mmc_runtime_resume()
263 struct mmc_card *card = mmc_dev_to_card(dev); in mmc_release_card() local
265 sdio_free_common_cis(card); in mmc_release_card()
267 kfree(card->info); in mmc_release_card()
269 kfree(card); in mmc_release_card()
277 struct mmc_card *card; in mmc_alloc_card() local
279 card = kzalloc(sizeof(struct mmc_card), GFP_KERNEL); in mmc_alloc_card()
280 if (!card) in mmc_alloc_card()
283 card->host = host; in mmc_alloc_card()
285 device_initialize(&card->dev); in mmc_alloc_card()
287 card->dev.parent = mmc_classdev(host); in mmc_alloc_card()
288 card->dev.bus = &mmc_bus_type; in mmc_alloc_card()
289 card->dev.release = mmc_release_card; in mmc_alloc_card()
290 card->dev.type = type; in mmc_alloc_card()
292 return card; in mmc_alloc_card()
298 int mmc_add_card(struct mmc_card *card) in mmc_add_card() argument
312 dev_set_name(&card->dev, "%s:%04x", mmc_hostname(card->host), card->rca); in mmc_add_card()
314 switch (card->type) { in mmc_add_card()
320 if (mmc_card_blockaddr(card)) { in mmc_add_card()
321 if (mmc_card_ext_capacity(card)) in mmc_add_card()
332 if (mmc_card_blockaddr(card)) in mmc_add_card()
340 if (mmc_card_uhs(card) && in mmc_add_card()
341 (card->sd_bus_speed < ARRAY_SIZE(uhs_speeds))) in mmc_add_card()
342 uhs_bus_speed_mode = uhs_speeds[card->sd_bus_speed]; in mmc_add_card()
344 if (mmc_host_is_spi(card->host)) { in mmc_add_card()
346 mmc_hostname(card->host), in mmc_add_card()
347 mmc_card_hs(card) ? "high speed " : "", in mmc_add_card()
348 mmc_card_ddr52(card) ? "DDR " : "", in mmc_add_card()
352 mmc_hostname(card->host), in mmc_add_card()
353 mmc_card_uhs(card) ? "ultra high speed " : in mmc_add_card()
354 (mmc_card_hs(card) ? "high speed " : ""), in mmc_add_card()
355 mmc_card_hs400(card) ? "HS400 " : in mmc_add_card()
356 (mmc_card_hs200(card) ? "HS200 " : ""), in mmc_add_card()
357 mmc_card_hs400es(card) ? "Enhanced strobe " : "", in mmc_add_card()
358 mmc_card_ddr52(card) ? "DDR " : "", in mmc_add_card()
359 uhs_bus_speed_mode, type, card->rca); in mmc_add_card()
363 mmc_add_card_debugfs(card); in mmc_add_card()
365 card->dev.of_node = mmc_of_find_child_device(card->host, 0); in mmc_add_card()
367 device_enable_async_suspend(&card->dev); in mmc_add_card()
369 ret = device_add(&card->dev); in mmc_add_card()
373 mmc_card_set_present(card); in mmc_add_card()
382 void mmc_remove_card(struct mmc_card *card) in mmc_remove_card() argument
384 struct mmc_host *host = card->host; in mmc_remove_card()
387 mmc_remove_card_debugfs(card); in mmc_remove_card()
390 if (mmc_card_present(card)) { in mmc_remove_card()
391 if (mmc_host_is_spi(card->host)) { in mmc_remove_card()
393 mmc_hostname(card->host)); in mmc_remove_card()
396 mmc_hostname(card->host), card->rca); in mmc_remove_card()
398 device_del(&card->dev); in mmc_remove_card()
399 of_node_put(card->dev.of_node); in mmc_remove_card()
407 put_device(&card->dev); in mmc_remove_card()