Lines Matching +full:ch +full:- +full:func

1 // SPDX-License-Identifier: GPL-2.0-or-later
8 * Copyright (C) 2009 Michael Buesch <m@bues.ch>
41 for (q = b43_sdio_quirks; q->quirks; q++) { in b43_sdio_get_quirks()
42 if (vendor == q->vendor && device == q->device) in b43_sdio_get_quirks()
43 return q->quirks; in b43_sdio_get_quirks()
49 static void b43_sdio_interrupt_dispatcher(struct sdio_func *func) in b43_sdio_interrupt_dispatcher() argument
51 struct b43_sdio *sdio = sdio_get_drvdata(func); in b43_sdio_interrupt_dispatcher()
52 struct b43_wldev *dev = sdio->irq_handler_opaque; in b43_sdio_interrupt_dispatcher()
57 sdio_release_host(func); in b43_sdio_interrupt_dispatcher()
58 sdio->irq_handler(dev); in b43_sdio_interrupt_dispatcher()
59 sdio_claim_host(func); in b43_sdio_interrupt_dispatcher()
65 struct ssb_bus *bus = dev->dev->sdev->bus; in b43_sdio_request_irq()
66 struct sdio_func *func = bus->host_sdio; in b43_sdio_request_irq() local
67 struct b43_sdio *sdio = sdio_get_drvdata(func); in b43_sdio_request_irq()
70 sdio->irq_handler_opaque = dev; in b43_sdio_request_irq()
71 sdio->irq_handler = handler; in b43_sdio_request_irq()
72 sdio_claim_host(func); in b43_sdio_request_irq()
73 err = sdio_claim_irq(func, b43_sdio_interrupt_dispatcher); in b43_sdio_request_irq()
74 sdio_release_host(func); in b43_sdio_request_irq()
81 struct ssb_bus *bus = dev->dev->sdev->bus; in b43_sdio_free_irq()
82 struct sdio_func *func = bus->host_sdio; in b43_sdio_free_irq() local
83 struct b43_sdio *sdio = sdio_get_drvdata(func); in b43_sdio_free_irq()
85 sdio_claim_host(func); in b43_sdio_free_irq()
86 sdio_release_irq(func); in b43_sdio_free_irq()
87 sdio_release_host(func); in b43_sdio_free_irq()
88 sdio->irq_handler_opaque = NULL; in b43_sdio_free_irq()
89 sdio->irq_handler = NULL; in b43_sdio_free_irq()
92 static int b43_sdio_probe(struct sdio_func *func, in b43_sdio_probe() argument
101 tuple = func->tuples; in b43_sdio_probe()
103 switch (tuple->code) { in b43_sdio_probe()
105 switch (tuple->data[0]) { in b43_sdio_probe()
107 if (tuple->size != 5) in b43_sdio_probe()
109 vendor = tuple->data[1] | (tuple->data[2]<<8); in b43_sdio_probe()
110 device = tuple->data[3] | (tuple->data[4]<<8); in b43_sdio_probe()
111 dev_info(&func->dev, "Chip ID %04x:%04x\n", in b43_sdio_probe()
121 tuple = tuple->next; in b43_sdio_probe()
124 error = -ENODEV; in b43_sdio_probe()
128 sdio_claim_host(func); in b43_sdio_probe()
129 error = sdio_set_block_size(func, B43_SDIO_BLOCK_SIZE); in b43_sdio_probe()
131 dev_err(&func->dev, "failed to set block size to %u bytes," in b43_sdio_probe()
135 error = sdio_enable_func(func); in b43_sdio_probe()
137 dev_err(&func->dev, "failed to enable func, error %d\n", error); in b43_sdio_probe()
140 sdio_release_host(func); in b43_sdio_probe()
144 error = -ENOMEM; in b43_sdio_probe()
145 dev_err(&func->dev, "failed to allocate ssb bus\n"); in b43_sdio_probe()
148 error = ssb_bus_sdiobus_register(&sdio->ssb, func, in b43_sdio_probe()
151 dev_err(&func->dev, "failed to register ssb sdio bus," in b43_sdio_probe()
155 sdio_set_drvdata(func, sdio); in b43_sdio_probe()
162 sdio_claim_host(func); in b43_sdio_probe()
163 sdio_disable_func(func); in b43_sdio_probe()
165 sdio_release_host(func); in b43_sdio_probe()
170 static void b43_sdio_remove(struct sdio_func *func) in b43_sdio_remove() argument
172 struct b43_sdio *sdio = sdio_get_drvdata(func); in b43_sdio_remove()
174 ssb_bus_unregister(&sdio->ssb); in b43_sdio_remove()
175 sdio_claim_host(func); in b43_sdio_remove()
176 sdio_disable_func(func); in b43_sdio_remove()
177 sdio_release_host(func); in b43_sdio_remove()
179 sdio_set_drvdata(func, NULL); in b43_sdio_remove()
189 .name = "b43-sdio",