/** * snd_soc_alloc_ac97_component() - Allocate new a AC'97 device * @component: The COMPONENT for which to create the AC'97 device * * Allocated a new snd_ac97 device and intializes it, but does not yet register * it. The caller is responsible to either call device_add(&ac97->dev) to * register the device, or to call put_device(&ac97->dev) to free the device. * * Returns: A snd_ac97 device or an ERR_PTR in case of an error.
*/ struct snd_ac97 *snd_soc_alloc_ac97_component(struct snd_soc_component *component)
{ struct snd_ac97 *ac97;
/** * snd_soc_new_ac97_component - initailise AC97 device * @component: audio component * @id: The expected device ID * @id_mask: Mask that is applied to the device ID before comparing with @id * * Initialises AC97 component resources for use by ad-hoc devices only. * * If @id is not 0 this function will reset the device, then read the ID from * the device and check if it matches the expected ID. If it doesn't match an * error will be returned and device will not be registered. * * Returns: An ERR_PTR on failure or a valid snd_ac97 struct on success.
*/ struct snd_ac97 *snd_soc_new_ac97_component(struct snd_soc_component *component, unsignedint id, unsignedint id_mask)
{ struct snd_ac97 *ac97; int ret;
ac97 = snd_soc_alloc_ac97_component(component); if (IS_ERR(ac97)) return ac97;
if (id) {
ret = snd_ac97_reset(ac97, false, id, id_mask); if (ret < 0) {
dev_err(component->dev, "Failed to reset AC97 device: %d\n",
ret); goto err_put_device;
}
}
ret = device_add(&ac97->dev); if (ret) goto err_put_device;
ret = snd_soc_ac97_init_gpio(ac97, component); if (ret) goto err_put_device;
/** * snd_soc_set_ac97_ops_of_reset - Set ac97 ops with generic ac97 reset functions * @ops: bus ops * @pdev: platform device * * This function sets the reset and warm_reset properties of ops and parses * the device node of pdev to get pinctrl states and gpio numbers to use.
*/ int snd_soc_set_ac97_ops_of_reset(struct snd_ac97_bus_ops *ops, struct platform_device *pdev)
{ struct device *dev = &pdev->dev; struct snd_ac97_reset_cfg cfg; int ret;
ret = snd_soc_ac97_parse_pinctl(dev, &cfg); if (ret) return ret;
ret = snd_soc_set_ac97_ops(ops); if (ret) return ret;
¤ Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.0.14Bemerkung:
(vorverarbeitet am 2026-06-08)
¤
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.