/* Issue the reboot */
regmap_update_bits(ctx->map, mode_bits->offset, mode_bits->mask,
mode_bits->value);
mdelay(1000);
pr_emerg("Unable to restart system\n"); return NOTIFY_DONE;
}
staticint syscon_reboot_probe(struct platform_device *pdev)
{ struct syscon_reboot_context *ctx; struct device *dev = &pdev->dev; int priority; int err;
ctx = devm_kzalloc(&pdev->dev, sizeof(*ctx), GFP_KERNEL); if (!ctx) return -ENOMEM;
ctx->map = syscon_regmap_lookup_by_phandle(dev->of_node, "regmap"); if (IS_ERR(ctx->map)) {
ctx->map = syscon_node_to_regmap(dev->parent->of_node); if (IS_ERR(ctx->map)) return PTR_ERR(ctx->map);
}
if (of_property_read_s32(pdev->dev.of_node, "priority", &priority))
priority = 192;
ctx->rd = of_device_get_match_data(dev); if (!ctx->rd) { int mask_err, value_err;
if (of_property_read_u32(pdev->dev.of_node, "offset",
&ctx->catchall.offset) &&
of_property_read_u32(pdev->dev.of_node, "reg",
&ctx->catchall.offset)) return -EINVAL;
value_err = of_property_read_u32(pdev->dev.of_node, "value",
&ctx->catchall.value);
mask_err = of_property_read_u32(pdev->dev.of_node, "mask",
&ctx->catchall.mask); if (value_err && mask_err) {
dev_err(dev, "unable to read 'value' and 'mask'"); return -EINVAL;
}
if (value_err) { /* support old binding */
ctx->catchall.value = ctx->catchall.mask;
ctx->catchall.mask = 0xFFFFFFFF;
} elseif (mask_err) { /* support value without mask */
ctx->catchall.mask = 0xFFFFFFFF;
}
}
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.