+#ifdef CONFIG_OF
+static int edt_ft5x06_i2c_ts_probe_dt(struct device *dev,
+ struct edt_ft5x06_ts_data *tsdata)
+{
+ int ret;
+ struct device_node *np = dev->of_node;
+ enum of_gpio_flags gpio_flags;
+
+ if (!np)
+ return -ENODEV;
+
+ /*
+ * irq_pin is not needed for DT setup.
+ * irq is associated via 'interrupts' property in DT
+ */
+ tsdata->irq_pin = -EINVAL;
+
+ ret = of_get_named_gpio_flags(np, "reset-gpios", 0, &gpio_flags);
+ tsdata->reset_pin = ret;
+
+ ret = of_get_named_gpio_flags(np, "wake-gpios", 0, &gpio_flags);
+ tsdata->wake_pin = ret;
+
+ return 0;
+}
+#else
+static inline int edt_ft5x06_i2c_ts_probe_dt(struct device *dev,
+ struct edt_ft5x06_i2c_ts_data *tsdata)
+{
+ return -ENODEV;
+}
+#endif
+