/* @dev: GPIO peripheral device @offset: the GPIO pin offset from the GPIO controller  */
int pinctrl_gpio_request(struct udevice *dev, unsigned offset)
/* @dev: GPIO peripheral device @offset: the GPIO pin offset from the GPIO controller  */
int pinctrl_gpio_request(struct udevice *dev, unsigned offset)
{
	const struct pinctrl_ops *ops;
	struct udevice *pctldev;
	unsigned int pin_selector;
	int ret;
	ret = pinctrl_gpio_get_pinctrl_and_offset(dev, offset,
						  &pctldev, &pin_selector);
	if (ret)
		return ret;
	ops = pinctrl_get_ops(pctldev);
	if (!ops || !ops->gpio_request_enable)
		return -ENOTSUPP;
	return ops->gpio_request_enable(pctldev, pin_selector);
}