#include <linux/clk.h>
 #include <linux/delay.h>
 #include <linux/err.h>
-#include <linux/gpio.h>
+#include <linux/gpio/consumer.h>
 #include <linux/interrupt.h>
 #include <linux/mfd/core.h>
 #include <linux/module.h>
 #include <linux/of.h>
 #include <linux/of_device.h>
-#include <linux/of_gpio.h>
 #include <linux/pm_runtime.h>
 #include <linux/regmap.h>
 #include <linux/regulator/consumer.h>
 static inline void arizona_enable_reset(struct arizona *arizona)
 {
        if (arizona->pdata.reset)
-               gpio_set_value_cansleep(arizona->pdata.reset, 0);
+               gpiod_set_raw_value_cansleep(arizona->pdata.reset, 0);
 }
 
 static void arizona_disable_reset(struct arizona *arizona)
                        break;
                }
 
-               gpio_set_value_cansleep(arizona->pdata.reset, 1);
+               gpiod_set_raw_value_cansleep(arizona->pdata.reset, 1);
                usleep_range(1000, 5000);
        }
 }
        struct arizona_pdata *pdata = &arizona->pdata;
        int ret, i;
 
-       pdata->reset = of_get_named_gpio(arizona->dev->of_node, "wlf,reset", 0);
-       if (pdata->reset == -EPROBE_DEFER) {
-               return pdata->reset;
-       } else if (pdata->reset < 0) {
-               dev_err(arizona->dev, "Reset GPIO missing/malformed: %d\n",
-                       pdata->reset);
+       /* Handle old non-standard DT binding */
+       pdata->reset = devm_gpiod_get_from_of_node(arizona->dev,
+                                                  arizona->dev->of_node,
+                                                  "wlf,reset", 0,
+                                                  GPIOD_OUT_LOW,
+                                                  "arizona /RESET");
+       if (IS_ERR(pdata->reset)) {
+               ret = PTR_ERR(pdata->reset);
 
-               pdata->reset = 0;
+               /*
+                * Reset missing will be caught when other binding is read
+                * but all other errors imply this binding is in use but has
+                * encountered a problem so should be handled.
+                */
+               if (ret == -EPROBE_DEFER)
+                       return ret;
+               else if (ret != -ENOENT && ret != -ENOSYS)
+                       dev_err(arizona->dev, "Reset GPIO malformed: %d\n",
+                               ret);
+
+               pdata->reset = NULL;
        }
 
        ret = of_property_read_u32_array(arizona->dev->of_node,
                goto err_early;
        }
 
-       if (arizona->pdata.reset) {
+       if (!arizona->pdata.reset) {
                /* Start out with /RESET low to put the chip into reset */
-               ret = devm_gpio_request_one(arizona->dev, arizona->pdata.reset,
-                                           GPIOF_DIR_OUT | GPIOF_INIT_LOW,
-                                           "arizona /RESET");
-               if (ret != 0) {
-                       dev_err(dev, "Failed to request /RESET: %d\n", ret);
-                       goto err_dcvdd;
+               arizona->pdata.reset = devm_gpiod_get(arizona->dev, "reset",
+                                                     GPIOD_OUT_LOW);
+               if (IS_ERR(arizona->pdata.reset)) {
+                       ret = PTR_ERR(arizona->pdata.reset);
+                       if (ret == -EPROBE_DEFER)
+                               goto err_dcvdd;
+
+                       dev_err(arizona->dev,
+                               "Reset GPIO missing/malformed: %d\n", ret);
+
+                       arizona->pdata.reset = NULL;
                }
        }