arch/arm/mach-mvebu/pm-board.c

Source file repositories/reference/linux-study-clean/arch/arm/mach-mvebu/pm-board.c

File Facts

System
Linux kernel
Corpus path
arch/arm/mach-mvebu/pm-board.c
Extension
.c
Size
3312 bytes
Lines
145
Domain
Architecture Layer
Bucket
arch/arm
Inferred role
Architecture Layer: exported/initcall integration point
Status
integration implementation candidate

Why This File Exists

CPU and platform-specific kernel glue: boot entry, traps, syscall entry, interrupts, page tables, context switch, and low-level barriers.

Dependency Surface

Detected Declarations

Annotated Snippet

if (!name) {
			ret = -ENOMEM;
			goto out;
		}

		pic_gpios[i] = fwnode_gpiod_get_index(of_fwnode_handle(np),
						      "ctrl", i, GPIOD_OUT_HIGH,
						      name);
		ret = PTR_ERR_OR_ZERO(pic_gpios[i]);
		if (ret) {
			kfree(name);
			goto out;
		}

		ret = of_parse_phandle_with_fixed_args(np, "ctrl-gpios", 2,
						       i, &args);
		if (ret < 0) {
			gpiod_put(pic_gpios[i]);
			kfree(name);
			goto out;
		}

		if (gpio_ctrl_np)
			of_node_put(gpio_ctrl_np);
		gpio_ctrl_np = args.np;
		pic_raw_gpios[i] = args.args[0];
	}

	gpio_ctrl = of_iomap(gpio_ctrl_np, 0);
	if (!gpio_ctrl) {
		ret = -ENOMEM;
		goto out;
	}

	mvebu_pm_suspend_init(mvebu_armada_pm_enter);

out:
	of_node_put(np);
	of_node_put(gpio_ctrl_np);
	return ret;
}

/*
 * Registering the mvebu_board_pm_enter callback must be done before
 * the platform_suspend_ops will be registered. In the same time we
 * also need to have the gpio devices registered. That's why we use a
 * device_initcall_sync which is called after all the device_initcall
 * (used by the gpio device) but before the late_initcall (used to
 * register the platform_suspend_ops)
 */
device_initcall_sync(mvebu_armada_pm_init);

Annotation

Implementation Notes