Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 4650b7cb authored by Dong Aisheng's avatar Dong Aisheng Committed by Linus Walleij
Browse files

pinctrl: support gpio request deferred probing



As pinctrl handles, it may be possible the pinctrl gpio ranges
are still not got registered when user call pinctrl_gpio_request.
Thus, add defer support for it too.

Signed-off-by: default avatarDong Aisheng <dong.aisheng@linaro.org>
Acked-by: default avatarStephen Warren <swarren@wwwdotorg.org>
Signed-off-by: default avatarLinus Walleij <linus.walleij@linaro.org>
parent 5b3aa5f7
Loading
Loading
Loading
Loading
+4 −3
Original line number Original line Diff line number Diff line
@@ -291,7 +291,8 @@ pinctrl_match_gpio_range(struct pinctrl_dev *pctldev, unsigned gpio)
 *
 *
 * Find the pin controller handling a certain GPIO pin from the pinspace of
 * Find the pin controller handling a certain GPIO pin from the pinspace of
 * the GPIO subsystem, return the device and the matching GPIO range. Returns
 * the GPIO subsystem, return the device and the matching GPIO range. Returns
 * negative if the GPIO range could not be found in any device.
 * -EPROBE_DEFER if the GPIO range could not be found in any device since it
 * may still have not been registered.
 */
 */
static int pinctrl_get_device_gpio_range(unsigned gpio,
static int pinctrl_get_device_gpio_range(unsigned gpio,
					 struct pinctrl_dev **outdev,
					 struct pinctrl_dev **outdev,
@@ -311,7 +312,7 @@ static int pinctrl_get_device_gpio_range(unsigned gpio,
		}
		}
	}
	}


	return -EINVAL;
	return -EPROBE_DEFER;
}
}


/**
/**
@@ -397,7 +398,7 @@ int pinctrl_request_gpio(unsigned gpio)
	ret = pinctrl_get_device_gpio_range(gpio, &pctldev, &range);
	ret = pinctrl_get_device_gpio_range(gpio, &pctldev, &range);
	if (ret) {
	if (ret) {
		mutex_unlock(&pinctrl_mutex);
		mutex_unlock(&pinctrl_mutex);
		return -EINVAL;
		return ret;
	}
	}


	/* Convert to the pin controllers number space */
	/* Convert to the pin controllers number space */