*dflags |= GPIOD_OUT_LOW;
else if (of_property_read_bool(np, "output-high"))
*dflags |= GPIOD_OUT_HIGH;
+ else if (of_property_read_bool(np, "function"))
+ *dflags = 0;
else {
pr_warn("GPIO line %d (%s): no hogging state specified, bailing out\n",
desc_to_gpio(gg_data.out_gpio), np->name);
if (IS_ERR(desc))
continue;
+ /* dflags is 0 for making pin in non-gpio mode */
+ if (!dflags) {
+ ret = chip->request(chip,
+ gpio_chip_hwgpio(desc));
+ if (!ret)
+ chip->free(chip,
+ gpio_chip_hwgpio(desc));
+ continue;
+ }
+
ret = gpiod_hog(desc, name, lflags, dflags);
if (ret < 0)
return ret;