Lines Matching refs:sock
38 static int tifm_dev_match(struct tifm_dev *sock, struct tifm_device_id *id) in tifm_dev_match() argument
40 if (sock->type == id->type) in tifm_dev_match()
47 struct tifm_dev *sock = container_of(dev, struct tifm_dev, dev); in tifm_bus_match() local
54 if (tifm_dev_match(sock, ids)) in tifm_bus_match()
64 struct tifm_dev *sock = container_of(dev, struct tifm_dev, dev); in tifm_uevent() local
66 if (add_uevent_var(env, "TIFM_CARD_TYPE=%s", tifm_media_type_name(sock->type, 1))) in tifm_uevent()
74 struct tifm_dev *sock = container_of(dev, struct tifm_dev, dev); in tifm_device_probe() local
81 rc = drv->probe(sock); in tifm_device_probe()
89 static void tifm_dummy_event(struct tifm_dev *sock) in tifm_dummy_event() argument
96 struct tifm_dev *sock = container_of(dev, struct tifm_dev, dev); in tifm_device_remove() local
101 sock->card_event = tifm_dummy_event; in tifm_device_remove()
102 sock->data_event = tifm_dummy_event; in tifm_device_remove()
103 drv->remove(sock); in tifm_device_remove()
104 sock->dev.driver = NULL; in tifm_device_remove()
115 struct tifm_dev *sock = container_of(dev, struct tifm_dev, dev); in tifm_device_suspend() local
120 return drv->suspend(sock, state); in tifm_device_suspend()
126 struct tifm_dev *sock = container_of(dev, struct tifm_dev, dev); in tifm_device_resume() local
131 return drv->resume(sock); in tifm_device_resume()
145 struct tifm_dev *sock = container_of(dev, struct tifm_dev, dev); in type_show() local
146 return sprintf(buf, "%x", sock->type); in type_show()
248 struct tifm_dev *sock = container_of(dev, struct tifm_dev, dev); in tifm_free_device() local
249 kfree(sock); in tifm_free_device()
256 struct tifm_dev *sock = NULL; in tifm_alloc_device() local
259 return sock; in tifm_alloc_device()
261 sock = kzalloc(sizeof(struct tifm_dev), GFP_KERNEL); in tifm_alloc_device()
262 if (sock) { in tifm_alloc_device()
263 spin_lock_init(&sock->lock); in tifm_alloc_device()
264 sock->type = type; in tifm_alloc_device()
265 sock->socket_id = id; in tifm_alloc_device()
266 sock->card_event = tifm_dummy_event; in tifm_alloc_device()
267 sock->data_event = tifm_dummy_event; in tifm_alloc_device()
269 sock->dev.parent = fm->dev.parent; in tifm_alloc_device()
270 sock->dev.bus = &tifm_bus_type; in tifm_alloc_device()
271 sock->dev.dma_mask = fm->dev.parent->dma_mask; in tifm_alloc_device()
272 sock->dev.release = tifm_free_device; in tifm_alloc_device()
274 dev_set_name(&sock->dev, "tifm_%s%u:%u", in tifm_alloc_device()
280 return sock; in tifm_alloc_device()
284 void tifm_eject(struct tifm_dev *sock) in tifm_eject() argument
286 struct tifm_adapter *fm = dev_get_drvdata(sock->dev.parent); in tifm_eject()
287 fm->eject(fm, sock); in tifm_eject()
291 int tifm_has_ms_pif(struct tifm_dev *sock) in tifm_has_ms_pif() argument
293 struct tifm_adapter *fm = dev_get_drvdata(sock->dev.parent); in tifm_has_ms_pif()
294 return fm->has_ms_pif(fm, sock); in tifm_has_ms_pif()
298 int tifm_map_sg(struct tifm_dev *sock, struct scatterlist *sg, int nents, in tifm_map_sg() argument
301 return pci_map_sg(to_pci_dev(sock->dev.parent), sg, nents, direction); in tifm_map_sg()
305 void tifm_unmap_sg(struct tifm_dev *sock, struct scatterlist *sg, int nents, in tifm_unmap_sg() argument
308 pci_unmap_sg(to_pci_dev(sock->dev.parent), sg, nents, direction); in tifm_unmap_sg()