static int __init hom_fli7610_setup(void)
{
	int ret;
	int i;

	ret = gpio_request(LMI_RETENTION_PIN, "LMI retention mode");
	if (ret) {
		pr_err("stm pm hom: GPIO for retention mode"
			"not acquired\n");
		return ret;
	};

	gpio_direction_output(LMI_RETENTION_PIN, 1);

	INIT_LIST_HEAD(&fli7610_hom.table);

	fli7610_hom.early_console_base = (void *)ioremap(
		stm_asc_console_device->resource[0].start, 0x1000);

	pr_info("stm pm hom: Early console [%d] @ 0x%x\n",
			stm_asc_console_device->id,
			(unsigned int) fli7610_hom.early_console_base);

	for (i = 0; i < ARRAY_SIZE(fli7610_hom_table); ++i)
		list_add_tail(&fli7610_hom_table[i].node, &fli7610_hom.table);

	ret =  stm_hom_register(&fli7610_hom);
	if (ret) {
		gpio_free(LMI_RETENTION_PIN);
		pr_err("stm pm hom: Error: on stm_hom_register\n");
	}
	return ret;
}
Esempio n. 2
0
static int __init hom_stxh205_setup(void)
{
	int ret;

	ret = gpio_request(LMI_RETENTION_PIN, "LMI retention mode");
	if (ret) {
		pr_err("[STM]: [PM]: [HoM]: GPIO for retention mode"
			"not acquired\n");
		return ret;
	};

	gpio_direction_output(LMI_RETENTION_PIN, 1);

	ret = stm_hom_register(&stxh205_hom);
	if (ret) {
		gpio_free(LMI_RETENTION_PIN);
		return ret;
	}

	early_console_base = (void *)
		ioremap(stm_asc_configured_devices[stm_asc_console_device]
			->resource[0].start, 0x1000);

	pr_info("[STM]: [PM]: [HoM]: Early console @ %p\n",
		early_console_base);
	stxh205_hom.early_console = stxh205_hom_early_console;

	return ret;
}