]> asedeno.scripts.mit.edu Git - linux.git/blobdiff - drivers/gpio/gpio-mvebu.c
Merge tag 'nfsd-5.4' of git://linux-nfs.org/~bfields/linux
[linux.git] / drivers / gpio / gpio-mvebu.c
index 059094ac44cb38458ecfce964041450f409bf039..6c06876943412bc974999e247d6ffcd91301a7a3 100644 (file)
@@ -38,6 +38,7 @@
 #include <linux/err.h>
 #include <linux/gpio/driver.h>
 #include <linux/gpio/consumer.h>
+#include <linux/gpio/machine.h>
 #include <linux/init.h>
 #include <linux/io.h>
 #include <linux/irq.h>
@@ -618,18 +619,14 @@ static int mvebu_pwm_request(struct pwm_chip *chip, struct pwm_device *pwm)
                ret = -EBUSY;
        } else {
                desc = gpiochip_request_own_desc(&mvchip->chip,
-                                                pwm->hwpwm, "mvebu-pwm", 0);
+                                                pwm->hwpwm, "mvebu-pwm",
+                                                GPIO_ACTIVE_HIGH,
+                                                GPIOD_OUT_LOW);
                if (IS_ERR(desc)) {
                        ret = PTR_ERR(desc);
                        goto out;
                }
 
-               ret = gpiod_direction_output(desc, 0);
-               if (ret) {
-                       gpiochip_free_own_desc(desc);
-                       goto out;
-               }
-
                mvpwm->gpiod = desc;
        }
 out:
@@ -697,7 +694,7 @@ static void mvebu_pwm_get_state(struct pwm_chip *chip,
 }
 
 static int mvebu_pwm_apply(struct pwm_chip *chip, struct pwm_device *pwm,
-                          struct pwm_state *state)
+                          const struct pwm_state *state)
 {
        struct mvebu_pwm *mvpwm = to_mvebu_pwm(chip);
        struct mvebu_gpio_chip *mvchip = mvpwm->mvchip;