/** * aspeed_sig_desc_eval() - Query the enabled or disabled state of a signal * descriptor. * * @desc: The signal descriptor of interest * @enabled: True to query the enabled state, false to query disabled state * @map: The IP block's regmap instance * * Return: 1 if the descriptor's bitfield is configured to the state * selected by @enabled, 0 if not, and less than zero if an unrecoverable * failure occurred * * Evaluation of descriptor state is non-trivial in that it is not a binary * outcome: The bitfields can be greater than one bit in size and thus can take * a value that is neither the enabled nor disabled state recorded in the * descriptor (typically this means a different function to the one of interest * is enabled). Thus we must explicitly test for either condition as required.
*/ int aspeed_sig_desc_eval(conststruct aspeed_sig_desc *desc, bool enabled, struct regmap *map)
{ int ret; unsignedint raw;
u32 want;
if (!map) return -ENODEV;
ret = regmap_read(map, desc->reg, &raw); if (ret) return ret;
/** * aspeed_sig_expr_eval - Query the enabled or disabled state for a * mux function's signal on a pin * * @ctx: The driver context for the pinctrl IP * @expr: An expression controlling the signal for a mux function on a pin * @enabled: True to query the enabled state, false to query disabled state * * Return: 1 if the expression composed by @enabled evaluates true, 0 if not, * and less than zero if an unrecoverable failure occurred. * * A mux function is enabled or disabled if the function's signal expression * for each pin in the function's pin group evaluates true for the desired * state. An signal expression evaluates true if all of its associated signal * descriptors evaluate true for the desired state. * * If an expression's state is described by more than one bit, either through * multi-bit bitfields in a single signal descriptor or through multiple signal * descriptors of a single bit then it is possible for the expression to be in * neither the enabled nor disabled state. Thus we must explicitly test for * either condition as required.
*/ int aspeed_sig_expr_eval(struct aspeed_pinmux_data *ctx, conststruct aspeed_sig_expr *expr, bool enabled)
{ int ret; int i;
if (ctx->ops->eval) return ctx->ops->eval(ctx, expr, enabled);
for (i = 0; i < expr->ndescs; i++) { conststruct aspeed_sig_desc *desc = &expr->descs[i];
ret = aspeed_sig_desc_eval(desc, enabled, ctx->maps[desc->ip]); if (ret <= 0) 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.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.