*参照元 [#b5156b86] #backlinks *説明 [#w62ee860] -パス: [[linux-4.4.1/]] -パス: [[linux-4.4.1/drivers/pinctrl/core.c]] -FIXME: これは何? --説明 **引数 [#pb6ee7f5] -unsigned gpio -- **返り値 [#pc75c28e] -int -- **参考 [#r2bc3793] *実装 [#yf0e30b8] /** * pinctrl_request_gpio() - request a single pin to be used as GPIO * @gpio: the GPIO pin number from the GPIO subsystem number space * * This function should *ONLY* be used from gpiolib-based GPIO drivers, * as part of their gpio_request() semantics, platforms and individual drivers * shall *NOT* request GPIO pins to be muxed in. */ int pinctrl_request_gpio(unsigned gpio) { struct pinctrl_dev *pctldev; struct pinctrl_gpio_range *range; int ret; int pin; - --[[linux-4.4.1/pinctrl_dev]] --[[linux-4.4.1/pinctrl_gpio_range]] ret = pinctrl_get_device_gpio_range(gpio, &pctldev, &range); if (ret) { if (pinctrl_ready_for_gpio_range(gpio)) ret = 0; return ret; } - --[[linux-4.4.1/pinctrl_get_device_gpio_range()]] --[[linux-4.4.1/pinctrl_ready_for_gpio_range()]] mutex_lock(&pctldev->mutex); - --[[linux-4.4.1/mutex_lock()]] /* Convert to the pin controllers number space */ pin = gpio_to_pin(range, gpio); - --[[linux-4.4.1/gpio_to_pin()]] ret = pinmux_request_gpio(pctldev, range, pin, gpio); - --[[linux-4.4.1/pinmux_request_gpio()]] mutex_unlock(&pctldev->mutex); - --[[linux-4.4.1/mutex_unlock()]] return ret; } EXPORT_SYMBOL_GPL(pinctrl_request_gpio); - --[[linux-4.4.1/EXPORT_SYMBOL_GPL()]] *コメント [#r91cadec]