参照元

説明

引数

返り値

参考

実装

/**
 * pinctrl_get_device_gpio_range() - find device for GPIO range
 * @gpio: the pin to locate the pin controller for
 * @outdev: the pin control device if found
 * @outrange: the GPIO range if found
 *
 * 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
 * -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,
                                         struct pinctrl_dev **outdev,
                                         struct pinctrl_gpio_range **outrange)
{
        struct pinctrl_dev *pctldev = NULL;
        mutex_lock(&pinctrldev_list_mutex);
        /* Loop over the pin controllers */
        list_for_each_entry(pctldev, &pinctrldev_list, node) {
                struct pinctrl_gpio_range *range;
                range = pinctrl_match_gpio_range(pctldev, gpio);
                if (range != NULL) {
                        *outdev = pctldev;
                        *outrange = range;
                        mutex_unlock(&pinctrldev_list_mutex);
                        return 0;
                }
        }

        mutex_unlock(&pinctrldev_list_mutex);

        return -EPROBE_DEFER;
}

コメント


トップ   編集 凍結 差分 履歴 添付 複製 名前変更 リロード   新規 一覧 検索 最終更新   ヘルプ   最終更新のRSS
Last-modified: 2016-05-19 (木) 10:20:52