]> git.proxmox.com Git - mirror_ubuntu-artful-kernel.git/blobdiff - drivers/gpio/gpio-tps65218.c
Merge branches 'for-4.11/upstream-fixes', 'for-4.12/accutouch', 'for-4.12/cp2112...
[mirror_ubuntu-artful-kernel.git] / drivers / gpio / gpio-tps65218.c
index 46e6dcc089cbdd25fdf61025c53e7dc078233de3..a379bba57d31d5d960eaec381dff3627301ac6d8 100644 (file)
@@ -139,28 +139,28 @@ static int tps65218_gpio_request(struct gpio_chip *gc, unsigned offset)
        return 0;
 }
 
-static int tps65218_gpio_set_single_ended(struct gpio_chip *gc,
-                                         unsigned offset,
-                                         enum single_ended_mode mode)
+static int tps65218_gpio_set_config(struct gpio_chip *gc, unsigned offset,
+                                   unsigned long config)
 {
        struct tps65218_gpio *tps65218_gpio = gpiochip_get_data(gc);
        struct tps65218 *tps65218 = tps65218_gpio->tps65218;
+       enum pin_config_param param = pinconf_to_config_param(config);
 
        switch (offset) {
        case 0:
        case 2:
                /* GPO1 is hardwired to be open drain */
-               if (mode == LINE_MODE_OPEN_DRAIN)
+               if (param == PIN_CONFIG_DRIVE_OPEN_DRAIN)
                        return 0;
                return -ENOTSUPP;
        case 1:
                /* GPO2 is push-pull by default, can be set as open drain. */
-               if (mode == LINE_MODE_OPEN_DRAIN)
+               if (param == PIN_CONFIG_DRIVE_OPEN_DRAIN)
                        return tps65218_clear_bits(tps65218,
                                                   TPS65218_REG_CONFIG1,
                                                   TPS65218_CONFIG1_GPO2_BUF,
                                                   TPS65218_PROTECT_L1);
-               if (mode == LINE_MODE_PUSH_PULL)
+               if (param == PIN_CONFIG_DRIVE_PUSH_PULL)
                        return tps65218_set_bits(tps65218,
                                                 TPS65218_REG_CONFIG1,
                                                 TPS65218_CONFIG1_GPO2_BUF,
@@ -181,7 +181,7 @@ static const struct gpio_chip template_chip = {
        .direction_input        = tps65218_gpio_input,
        .get                    = tps65218_gpio_get,
        .set                    = tps65218_gpio_set,
-       .set_single_ended       = tps65218_gpio_set_single_ended,
+       .set_config             = tps65218_gpio_set_config,
        .can_sleep              = true,
        .ngpio                  = 3,
        .base                   = -1,