Lines Matching refs:sock

34 static int tifm_dev_match(struct tifm_dev *sock, struct tifm_device_id *id)  in tifm_dev_match()  argument
36 if (sock->type == id->type) in tifm_dev_match()
43 struct tifm_dev *sock = container_of(dev, struct tifm_dev, dev); in tifm_bus_match() local
50 if (tifm_dev_match(sock, ids)) in tifm_bus_match()
60 struct tifm_dev *sock = container_of(dev, struct tifm_dev, dev); in tifm_uevent() local
62 if (add_uevent_var(env, "TIFM_CARD_TYPE=%s", tifm_media_type_name(sock->type, 1))) in tifm_uevent()
70 struct tifm_dev *sock = container_of(dev, struct tifm_dev, dev); in tifm_device_probe() local
77 rc = drv->probe(sock); in tifm_device_probe()
85 static void tifm_dummy_event(struct tifm_dev *sock) in tifm_dummy_event() argument
92 struct tifm_dev *sock = container_of(dev, struct tifm_dev, dev); in tifm_device_remove() local
97 sock->card_event = tifm_dummy_event; in tifm_device_remove()
98 sock->data_event = tifm_dummy_event; in tifm_device_remove()
99 drv->remove(sock); in tifm_device_remove()
100 sock->dev.driver = NULL; in tifm_device_remove()
110 struct tifm_dev *sock = container_of(dev, struct tifm_dev, dev); in tifm_device_suspend() local
115 return drv->suspend(sock, state); in tifm_device_suspend()
121 struct tifm_dev *sock = container_of(dev, struct tifm_dev, dev); in tifm_device_resume() local
126 return drv->resume(sock); in tifm_device_resume()
140 struct tifm_dev *sock = container_of(dev, struct tifm_dev, dev); in type_show() local
141 return sprintf(buf, "%x", sock->type); in type_show()
242 struct tifm_dev *sock = container_of(dev, struct tifm_dev, dev); in tifm_free_device() local
243 kfree(sock); in tifm_free_device()
250 struct tifm_dev *sock = NULL; in tifm_alloc_device() local
253 return sock; in tifm_alloc_device()
255 sock = kzalloc(sizeof(struct tifm_dev), GFP_KERNEL); in tifm_alloc_device()
256 if (sock) { in tifm_alloc_device()
257 spin_lock_init(&sock->lock); in tifm_alloc_device()
258 sock->type = type; in tifm_alloc_device()
259 sock->socket_id = id; in tifm_alloc_device()
260 sock->card_event = tifm_dummy_event; in tifm_alloc_device()
261 sock->data_event = tifm_dummy_event; in tifm_alloc_device()
263 sock->dev.parent = fm->dev.parent; in tifm_alloc_device()
264 sock->dev.bus = &tifm_bus_type; in tifm_alloc_device()
265 sock->dev.dma_mask = fm->dev.parent->dma_mask; in tifm_alloc_device()
266 sock->dev.release = tifm_free_device; in tifm_alloc_device()
268 dev_set_name(&sock->dev, "tifm_%s%u:%u", in tifm_alloc_device()
274 return sock; in tifm_alloc_device()
278 void tifm_eject(struct tifm_dev *sock) in tifm_eject() argument
280 struct tifm_adapter *fm = dev_get_drvdata(sock->dev.parent); in tifm_eject()
281 fm->eject(fm, sock); in tifm_eject()
285 int tifm_has_ms_pif(struct tifm_dev *sock) in tifm_has_ms_pif() argument
287 struct tifm_adapter *fm = dev_get_drvdata(sock->dev.parent); in tifm_has_ms_pif()
288 return fm->has_ms_pif(fm, sock); in tifm_has_ms_pif()
292 int tifm_map_sg(struct tifm_dev *sock, struct scatterlist *sg, int nents, in tifm_map_sg() argument
295 return dma_map_sg(&to_pci_dev(sock->dev.parent)->dev, sg, nents, in tifm_map_sg()
300 void tifm_unmap_sg(struct tifm_dev *sock, struct scatterlist *sg, int nents, in tifm_unmap_sg() argument
303 dma_unmap_sg(&to_pci_dev(sock->dev.parent)->dev, sg, nents, direction); in tifm_unmap_sg()