Lines Matching refs:func

39 	struct sdio_func *func;						\
41 func = dev_to_sdio_func (dev); \
42 return sprintf (buf, format_string, func->field); \
52 struct sdio_func *func = dev_to_sdio_func (dev); in modalias_show() local
55 func->class, func->vendor, func->device); in modalias_show()
68 static const struct sdio_device_id *sdio_match_one(struct sdio_func *func, in sdio_match_one() argument
71 if (id->class != (__u8)SDIO_ANY_ID && id->class != func->class) in sdio_match_one()
73 if (id->vendor != (__u16)SDIO_ANY_ID && id->vendor != func->vendor) in sdio_match_one()
75 if (id->device != (__u16)SDIO_ANY_ID && id->device != func->device) in sdio_match_one()
80 static const struct sdio_device_id *sdio_match_device(struct sdio_func *func, in sdio_match_device() argument
89 if (sdio_match_one(func, ids)) in sdio_match_device()
100 struct sdio_func *func = dev_to_sdio_func(dev); in sdio_bus_match() local
103 if (sdio_match_device(func, sdrv)) in sdio_bus_match()
112 struct sdio_func *func = dev_to_sdio_func(dev); in sdio_bus_uevent() local
115 "SDIO_CLASS=%02X", func->class)) in sdio_bus_uevent()
119 "SDIO_ID=%04X:%04X", func->vendor, func->device)) in sdio_bus_uevent()
124 func->class, func->vendor, func->device)) in sdio_bus_uevent()
133 struct sdio_func *func = dev_to_sdio_func(dev); in sdio_bus_probe() local
137 id = sdio_match_device(func, drv); in sdio_bus_probe()
151 if (func->card->host->caps & MMC_CAP_POWER_OFF_CARD) { in sdio_bus_probe()
159 sdio_claim_host(func); in sdio_bus_probe()
160 ret = sdio_set_block_size(func, 0); in sdio_bus_probe()
161 sdio_release_host(func); in sdio_bus_probe()
165 ret = drv->probe(func, id); in sdio_bus_probe()
172 if (func->card->host->caps & MMC_CAP_POWER_OFF_CARD) in sdio_bus_probe()
181 struct sdio_func *func = dev_to_sdio_func(dev); in sdio_bus_remove() local
185 if (func->card->host->caps & MMC_CAP_POWER_OFF_CARD) in sdio_bus_remove()
188 drv->remove(func); in sdio_bus_remove()
190 if (func->irq_handler) { in sdio_bus_remove()
193 sdio_claim_host(func); in sdio_bus_remove()
194 sdio_release_irq(func); in sdio_bus_remove()
195 sdio_release_host(func); in sdio_bus_remove()
199 if (func->card->host->caps & MMC_CAP_POWER_OFF_CARD) in sdio_bus_remove()
203 if (func->card->host->caps & MMC_CAP_POWER_OFF_CARD) in sdio_bus_remove()
265 struct sdio_func *func = dev_to_sdio_func(dev); in sdio_release_func() local
267 sdio_free_func_cis(func); in sdio_release_func()
269 kfree(func->info); in sdio_release_func()
270 kfree(func->tmpbuf); in sdio_release_func()
271 kfree(func); in sdio_release_func()
279 struct sdio_func *func; in sdio_alloc_func() local
281 func = kzalloc(sizeof(struct sdio_func), GFP_KERNEL); in sdio_alloc_func()
282 if (!func) in sdio_alloc_func()
289 func->tmpbuf = kmalloc(4, GFP_KERNEL); in sdio_alloc_func()
290 if (!func->tmpbuf) { in sdio_alloc_func()
291 kfree(func); in sdio_alloc_func()
295 func->card = card; in sdio_alloc_func()
297 device_initialize(&func->dev); in sdio_alloc_func()
299 func->dev.parent = &card->dev; in sdio_alloc_func()
300 func->dev.bus = &sdio_bus_type; in sdio_alloc_func()
301 func->dev.release = sdio_release_func; in sdio_alloc_func()
303 return func; in sdio_alloc_func()
307 static void sdio_acpi_set_handle(struct sdio_func *func) in sdio_acpi_set_handle() argument
309 struct mmc_host *host = func->card->host; in sdio_acpi_set_handle()
310 u64 addr = ((u64)host->slotno << 16) | func->num; in sdio_acpi_set_handle()
312 acpi_preset_companion(&func->dev, ACPI_COMPANION(host->parent), addr); in sdio_acpi_set_handle()
315 static inline void sdio_acpi_set_handle(struct sdio_func *func) {} in sdio_acpi_set_handle() argument
318 static void sdio_set_of_node(struct sdio_func *func) in sdio_set_of_node() argument
320 struct mmc_host *host = func->card->host; in sdio_set_of_node()
322 func->dev.of_node = mmc_of_find_child_device(host, func->num); in sdio_set_of_node()
328 int sdio_add_func(struct sdio_func *func) in sdio_add_func() argument
332 dev_set_name(&func->dev, "%s:%d", mmc_card_id(func->card), func->num); in sdio_add_func()
334 sdio_set_of_node(func); in sdio_add_func()
335 sdio_acpi_set_handle(func); in sdio_add_func()
336 device_enable_async_suspend(&func->dev); in sdio_add_func()
337 ret = device_add(&func->dev); in sdio_add_func()
339 sdio_func_set_present(func); in sdio_add_func()
350 void sdio_remove_func(struct sdio_func *func) in sdio_remove_func() argument
352 if (!sdio_func_present(func)) in sdio_remove_func()
355 device_del(&func->dev); in sdio_remove_func()
356 of_node_put(func->dev.of_node); in sdio_remove_func()
357 put_device(&func->dev); in sdio_remove_func()