/* Enable the output direction of the specified GPIO and set the GPIO to the specified value.  */
int32_t gpio_direction_output(struct gpio_desc *desc, uint8_t value)
/* Enable the output direction of the specified GPIO and set the GPIO to the specified value.  */
int32_t gpio_direction_output(struct gpio_desc *desc, uint8_t value)
{
	ADI_GPIO_RESULT ret;
	if (!desc || !nb_gpio)
		return FAILURE;
	ret = adi_gpio_OutputEnable(PORT(desc->number), PIN(desc->number),
				    true);
	if (ret != ADI_GPIO_SUCCESS)
		return FAILURE;
	if (value == 1)
		ret = adi_gpio_SetHigh(PORT(desc->number), PIN(desc->number));
	else
		ret = adi_gpio_SetLow(PORT(desc->number), PIN(desc->number));
	if (ret != ADI_GPIO_SUCCESS)
		return FAILURE;
	return SUCCESS;
}