@@ -115,6 +115,21 @@
VDDIO-supply = <®_3p3v>;
};
};
+
+ i2c@021a8000 { /* I2C3 */
+ status = "okay";
+ clock-frequency = <400000>;
+ pinctrl-names = "default";
+ pinctrl-0 = <&pinctrl_i2c3_1>;
+
+ egalax@04 {
+ compatible = "eeti,egalax";
+ reg = <0x04>;
+ interrupt-parent = <&gpio1>;
+ interrupts = <9 0x8>;
+ wakeup-gpios = <&gpio1 9 0>;
+ };
+ };
};
};
@@ -545,6 +545,13 @@
};
};
+ i2c3 {
+ pinctrl_i2c3_1: i2c3grp-1 {
+ fsl,pins = <1013 0x4001b8b1 /* MX6Q_PAD_GPIO_5__I2C3_SCL */
+ 1037 0x4001b8b1>; /* MX6Q_PAD_GPIO_16__I2C3_SDA */
+ };
+ };
+
serial2 {
pinctrl_serial2_1: serial2grp-1 {
fsl,pins = <183 0x1b0b1 /* MX6Q_PAD_EIM_D26__UART2_TXD */
@@ -28,6 +28,8 @@
#include <linux/slab.h>
#include <linux/bitops.h>
#include <linux/input/mt.h>
+#include <linux/of_device.h>
+#include <linux/of_gpio.h>
/*
* Mouse Mode: some panel may configure the controller to mouse mode,
@@ -122,7 +124,7 @@ static irqreturn_t egalax_ts_interrupt(int irq, void *dev_id)
/* wake up controller by an falling edge of interrupt gpio. */
static int egalax_wake_up_device(struct i2c_client *client)
{
- int gpio = irq_to_gpio(client->irq);
+ int gpio = of_get_named_gpio(client->dev.of_node, "wakeup-gpios", 0);
int ret;
ret = gpio_request(gpio, "egalax_irq");
@@ -251,6 +253,12 @@ static const struct i2c_device_id egalax_ts_id[] = {
};
MODULE_DEVICE_TABLE(i2c, egalax_ts_id);
+static struct of_device_id egalax_ts_dt_ids[] = {
+ { .compatible = "eeti,egalax" },
+ { /* sentinel */ }
+};
+MODULE_DEVICE_TABLE(of, egalax_ts_dt_ids);
+
#ifdef CONFIG_PM_SLEEP
static int egalax_ts_suspend(struct device *dev)
{
@@ -279,6 +287,7 @@ static struct i2c_driver egalax_ts_driver = {
.name = "egalax_ts",
.owner = THIS_MODULE,
.pm = &egalax_ts_pm_ops,
+ .of_match_table = egalax_ts_dt_ids,
},
.id_table = egalax_ts_id,
.probe = egalax_ts_probe,