提交 0c4d8666 编写于 作者: A Andy Shevchenko

gpiolib: Extract gpio_set_config_with_argument() for future use

In the future we will need to have a separate function
that takes an arbitrary argument value.

Extract gpio_set_config_with_argument() for that purpose.
Signed-off-by: NAndy Shevchenko <andriy.shevchenko@linux.intel.com>
Acked-by: NLinus Walleij <linus.walleij@linaro.org>
Reviewed-by: NHans de Goede <hdegoede@redhat.com>
Reviewed-by: NMika Westerberg <mika.westerberg@linux.intel.com>
上级 8b69461c
......@@ -2093,10 +2093,19 @@ static int gpio_do_set_config(struct gpio_chip *gc, unsigned int offset,
return gc->set_config(gc, offset, config);
}
static int gpio_set_config(struct gpio_desc *desc, enum pin_config_param mode)
static int gpio_set_config_with_argument(struct gpio_desc *desc,
enum pin_config_param mode,
u32 argument)
{
struct gpio_chip *gc = desc->gdev->chip;
unsigned long config;
config = pinconf_to_config_packed(mode, argument);
return gpio_do_set_config(gc, gpio_chip_hwgpio(desc), config);
}
static int gpio_set_config(struct gpio_desc *desc, enum pin_config_param mode)
{
unsigned int arg;
switch (mode) {
......@@ -2110,8 +2119,7 @@ static int gpio_set_config(struct gpio_desc *desc, enum pin_config_param mode)
break;
}
config = pinconf_to_config_packed(mode, arg);
return gpio_do_set_config(gc, gpio_chip_hwgpio(desc), config);
return gpio_set_config_with_argument(desc, mode, arg);
}
static int gpio_set_bias(struct gpio_desc *desc)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册