Lines Matching full:card

3  * card.c - contains functions for managing groups of PnP devices
20 struct pnp_card *card) in match_card() argument
25 if (compare_pnp_id(card->id, drv_id->id)) { in match_card()
36 card_for_each_dev(card, dev) { in match_card()
62 if (!dev->card || !drv) in card_remove_first()
71 static int card_probe(struct pnp_card *card, struct pnp_card_driver *drv) in card_probe() argument
79 id = match_card(drv, card); in card_probe()
86 clink->card = card; in card_probe()
94 card_for_each_dev(card, dev) { in card_probe()
103 * pnp_add_card_id - adds an EISA id to the specified card
105 * @card: pointer to the desired card
107 static struct pnp_id *pnp_add_card_id(struct pnp_card *card, char *id) in pnp_add_card_id() argument
125 ptr = card->id; in pnp_add_card_id()
131 card->id = dev_id; in pnp_add_card_id()
136 static void pnp_free_card_ids(struct pnp_card *card) in pnp_free_card_ids() argument
141 id = card->id; in pnp_free_card_ids()
151 struct pnp_card *card = to_pnp_card(dmdev); in pnp_release_card() local
153 pnp_free_card_ids(card); in pnp_release_card()
154 kfree(card); in pnp_release_card()
159 struct pnp_card *card; in pnp_alloc_card() local
162 card = kzalloc(sizeof(struct pnp_card), GFP_KERNEL); in pnp_alloc_card()
163 if (!card) in pnp_alloc_card()
166 card->protocol = protocol; in pnp_alloc_card()
167 card->number = id; in pnp_alloc_card()
169 card->dev.parent = &card->protocol->dev; in pnp_alloc_card()
170 dev_set_name(&card->dev, "%02x:%02x", card->protocol->number, card->number); in pnp_alloc_card()
172 card->dev.coherent_dma_mask = DMA_BIT_MASK(24); in pnp_alloc_card()
173 card->dev.dma_mask = &card->dev.coherent_dma_mask; in pnp_alloc_card()
175 dev_id = pnp_add_card_id(card, pnpid); in pnp_alloc_card()
177 kfree(card); in pnp_alloc_card()
181 return card; in pnp_alloc_card()
188 struct pnp_card *card = to_pnp_card(dmdev); in name_show() local
190 str += sprintf(str, "%s\n", card->name); in name_show()
200 struct pnp_card *card = to_pnp_card(dmdev); in card_id_show() local
201 struct pnp_id *pos = card->id; in card_id_show()
212 static int pnp_interface_attach_card(struct pnp_card *card) in pnp_interface_attach_card() argument
214 int rc = device_create_file(&card->dev, &dev_attr_name); in pnp_interface_attach_card()
219 rc = device_create_file(&card->dev, &dev_attr_card_id); in pnp_interface_attach_card()
226 device_remove_file(&card->dev, &dev_attr_name); in pnp_interface_attach_card()
231 * pnp_add_card - adds a PnP card to the PnP Layer
232 * @card: pointer to the card to add
234 int pnp_add_card(struct pnp_card *card) in pnp_add_card() argument
239 card->dev.bus = NULL; in pnp_add_card()
240 card->dev.release = &pnp_release_card; in pnp_add_card()
241 error = device_register(&card->dev); in pnp_add_card()
243 dev_err(&card->dev, "could not register (err=%d)\n", error); in pnp_add_card()
244 put_device(&card->dev); in pnp_add_card()
248 pnp_interface_attach_card(card); in pnp_add_card()
250 list_add_tail(&card->global_list, &pnp_cards); in pnp_add_card()
251 list_add_tail(&card->protocol_list, &card->protocol->cards); in pnp_add_card()
255 * will be able to use all of the related devices on the card in pnp_add_card()
257 list_for_each(pos, &card->devices) { in pnp_add_card()
262 /* match with card drivers */ in pnp_add_card()
267 card_probe(card, drv); in pnp_add_card()
273 * pnp_remove_card - removes a PnP card from the PnP Layer
274 * @card: pointer to the card to remove
276 void pnp_remove_card(struct pnp_card *card) in pnp_remove_card() argument
280 device_unregister(&card->dev); in pnp_remove_card()
282 list_del(&card->global_list); in pnp_remove_card()
283 list_del(&card->protocol_list); in pnp_remove_card()
285 list_for_each_safe(pos, temp, &card->devices) { in pnp_remove_card()
292 * pnp_add_card_device - adds a device to the specified card
293 * @card: pointer to the card to add to
296 int pnp_add_card_device(struct pnp_card *card, struct pnp_dev *dev) in pnp_add_card_device() argument
298 dev->dev.parent = &card->dev; in pnp_add_card_device()
301 dev->protocol->number, card->number, dev->number); in pnp_add_card_device()
303 dev->card = card; in pnp_add_card_device()
304 list_add_tail(&dev->card_list, &card->devices); in pnp_add_card_device()
310 * pnp_remove_card_device- removes a device from the specified card
316 dev->card = NULL; in pnp_remove_card_device()
323 * pnp_request_card_device - Searches for a PnP device under the specified card
324 * @clink: pointer to the card link, cannot be NULL
334 struct pnp_card *card; in pnp_request_card_device() local
339 card = clink->card; in pnp_request_card_device()
342 pos = card->devices.next; in pnp_request_card_device()
344 if (from->card != card) in pnp_request_card_device()
348 while (pos != &card->devices) { in pnp_request_card_device()
413 * pnp_register_card_driver - registers a PnP card driver with the PnP Layer
438 struct pnp_card *card = in pnp_register_card_driver() local
440 card_probe(card, drv); in pnp_register_card_driver()
447 * pnp_unregister_card_driver - unregisters a PnP card driver from the PnP Layer