/*
 * Copyright 2020,2021 Sony Corporation
 */

#include <stdio.h>
#include <command.h>
#include <debug_impl.h>
#include <sony_gpio_init.h>

int do_sony_gpio_init(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
{
	int ret = -1;

	ret = sony_gpio_init();
	if (ret != 0) {
		printf("failed to set sony gpio init to bootargs.\n");
		return CMD_RET_FAILURE;
	}
	return CMD_RET_SUCCESS;
}

int do_sony_gpio_get_all(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
{
	int ret = -1;

	ret = sony_gpio_get_all();
	if (ret != 0) {
		printf("failed to set sony gpio init to bootargs.\n");
		return CMD_RET_FAILURE;
	}
	return CMD_RET_SUCCESS;
}

U_BOOT_CMD(
	sony_gpio_init, CONFIG_SYS_MAXARGS, 1, do_sony_gpio_init,
	"sony_gpio_init - GPIO initialize setting.\n",
	NULL
);

U_BOOT_CMD(
	sony_gpio_get_all, CONFIG_SYS_MAXARGS, 2, do_sony_gpio_get_all,
	"sony_gpio_get_all - All GPIO get status.\n",
	NULL
);
