Lines Matching refs:ctx
28 struct syscon_reboot_context *ctx = in syscon_restart_handle() local
33 regmap_update_bits(ctx->map, ctx->offset, ctx->mask, ctx->value); in syscon_restart_handle()
43 struct syscon_reboot_context *ctx; in syscon_reboot_probe() local
49 ctx = devm_kzalloc(&pdev->dev, sizeof(*ctx), GFP_KERNEL); in syscon_reboot_probe()
50 if (!ctx) in syscon_reboot_probe()
53 ctx->map = syscon_regmap_lookup_by_phandle(dev->of_node, "regmap"); in syscon_reboot_probe()
54 if (IS_ERR(ctx->map)) { in syscon_reboot_probe()
55 ctx->map = syscon_node_to_regmap(dev->parent->of_node); in syscon_reboot_probe()
56 if (IS_ERR(ctx->map)) in syscon_reboot_probe()
57 return PTR_ERR(ctx->map); in syscon_reboot_probe()
63 if (of_property_read_u32(pdev->dev.of_node, "offset", &ctx->offset)) in syscon_reboot_probe()
66 value_err = of_property_read_u32(pdev->dev.of_node, "value", &ctx->value); in syscon_reboot_probe()
67 mask_err = of_property_read_u32(pdev->dev.of_node, "mask", &ctx->mask); in syscon_reboot_probe()
75 ctx->value = ctx->mask; in syscon_reboot_probe()
76 ctx->mask = 0xFFFFFFFF; in syscon_reboot_probe()
79 ctx->mask = 0xFFFFFFFF; in syscon_reboot_probe()
82 ctx->restart_handler.notifier_call = syscon_restart_handle; in syscon_reboot_probe()
83 ctx->restart_handler.priority = priority; in syscon_reboot_probe()
84 err = register_restart_handler(&ctx->restart_handler); in syscon_reboot_probe()