/* *Enabletheresource. *Thefunctionreturnswitherrororthecontentoftheregister
*/ int twl4030_audio_enable_resource(enum twl4030_audio_res id)
{ struct twl4030_audio *audio = platform_get_drvdata(twl4030_audio_dev); int val;
if (id >= TWL4030_AUDIO_RES_MAX) {
dev_err(&twl4030_audio_dev->dev, "Invalid resource ID (%u)\n", id); return -EINVAL;
}
mutex_lock(&audio->mutex); if (!audio->resource[id].request_count) /* Resource was disabled, enable it */
val = twl4030_audio_set_resource(id, 1); else
val = twl4030_audio_get_resource(id);
/* *Disabletheresource. *Thefunctionreturnswitherrororthecontentoftheregister
*/ int twl4030_audio_disable_resource(enum twl4030_audio_res id)
{ struct twl4030_audio *audio = platform_get_drvdata(twl4030_audio_dev); int val;
if (id >= TWL4030_AUDIO_RES_MAX) {
dev_err(&twl4030_audio_dev->dev, "Invalid resource ID (%u)\n", id); return -EINVAL;
}
mutex_lock(&audio->mutex); if (!audio->resource[id].request_count) {
dev_err(&twl4030_audio_dev->dev, "Resource has been disabled already (%u)\n", id);
mutex_unlock(&audio->mutex); return -EPERM;
}
audio->resource[id].request_count--;
if (!audio->resource[id].request_count) /* Resource can be disabled now */
val = twl4030_audio_set_resource(id, 0); else
val = twl4030_audio_get_resource(id);
if (childs)
ret = mfd_add_devices(&pdev->dev, pdev->id, audio->cells,
childs, NULL, 0, NULL); else {
dev_err(&pdev->dev, "No platform data found for childs\n");
ret = -ENODEV;
}
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.