Lines Matching +full:drv +full:- +full:id

1 // SPDX-License-Identifier: GPL-2.0-or-later
6 *----------------------------------------------------------------
17 * Each sequencer device entry has an id string and the corresponding
18 * driver with the same id is loaded when required. For example,
20 * emu8000-synth module. To activate this module, the hardware
43 static int snd_seq_bus_match(struct device *dev, const struct device_driver *drv) in snd_seq_bus_match() argument
46 struct snd_seq_driver *sdrv = to_seq_drv(drv); in snd_seq_bus_match()
48 return strcmp(sdrv->id, sdev->id) == 0 && in snd_seq_bus_match()
49 sdrv->argsize == sdev->argsize; in snd_seq_bus_match()
58 * proc interface -- just for compatibility
68 snd_iprintf(buffer, "snd-%s,%s,%d\n", sdev->id, in print_dev_info()
69 dev->driver ? "loaded" : "empty", in print_dev_info()
70 dev->driver ? 1 : 0); in print_dev_info()
86 /* flag to block auto-loading */
93 if (!dev->driver) in request_seq_drv()
94 request_module("snd-%s", sdev->id); in request_seq_drv()
118 /* initial autoload only when snd-seq is a module */ in snd_seq_autoload_init()
156 struct snd_seq_device *dev = device->device_data; in snd_seq_device_dev_free()
159 if (dev->private_free) in snd_seq_device_dev_free()
160 dev->private_free(dev); in snd_seq_device_dev_free()
161 put_device(&dev->dev); in snd_seq_device_dev_free()
167 struct snd_seq_device *dev = device->device_data; in snd_seq_device_dev_register()
170 err = device_add(&dev->dev); in snd_seq_device_dev_register()
173 if (!dev->dev.driver) in snd_seq_device_dev_register()
180 struct snd_seq_device *dev = device->device_data; in snd_seq_device_dev_disconnect()
182 device_del(&dev->dev); in snd_seq_device_dev_disconnect()
195 * id = id of driver
198 int snd_seq_device_new(struct snd_card *card, int device, const char *id, in snd_seq_device_new() argument
212 if (snd_BUG_ON(!id)) in snd_seq_device_new()
213 return -EINVAL; in snd_seq_device_new()
217 return -ENOMEM; in snd_seq_device_new()
220 dev->card = card; in snd_seq_device_new()
221 dev->device = device; in snd_seq_device_new()
222 dev->id = id; in snd_seq_device_new()
223 dev->argsize = argsize; in snd_seq_device_new()
225 device_initialize(&dev->dev); in snd_seq_device_new()
226 dev->dev.parent = &card->card_dev; in snd_seq_device_new()
227 dev->dev.bus = &snd_seq_bus_type; in snd_seq_device_new()
228 dev->dev.release = snd_seq_dev_release; in snd_seq_device_new()
229 dev_set_name(&dev->dev, "%s-%d-%d", dev->id, card->number, device); in snd_seq_device_new()
234 put_device(&dev->dev); in snd_seq_device_new()
248 int __snd_seq_driver_register(struct snd_seq_driver *drv, struct module *mod) in __snd_seq_driver_register() argument
250 if (WARN_ON(!drv->driver.name || !drv->id)) in __snd_seq_driver_register()
251 return -EINVAL; in __snd_seq_driver_register()
252 drv->driver.bus = &snd_seq_bus_type; in __snd_seq_driver_register()
253 drv->driver.owner = mod; in __snd_seq_driver_register()
254 return driver_register(&drv->driver); in __snd_seq_driver_register()
258 void snd_seq_driver_unregister(struct snd_seq_driver *drv) in snd_seq_driver_unregister() argument
260 driver_unregister(&drv->driver); in snd_seq_driver_unregister()
274 return -ENOMEM; in seq_dev_proc_init()
275 info_entry->content = SNDRV_INFO_CONTENT_TEXT; in seq_dev_proc_init()
276 info_entry->c.text.read = snd_seq_device_info; in seq_dev_proc_init()
279 return -ENOMEM; in seq_dev_proc_init()