xref: /openbmc/linux/drivers/input/touchscreen/ili210x.c (revision 122945776271efee91012c2a345b720d39b15b7c)
15c6a7a62SOlivier Sobrie #include <linux/module.h>
25c6a7a62SOlivier Sobrie #include <linux/i2c.h>
35c6a7a62SOlivier Sobrie #include <linux/interrupt.h>
45c6a7a62SOlivier Sobrie #include <linux/slab.h>
55c6a7a62SOlivier Sobrie #include <linux/input.h>
65c6a7a62SOlivier Sobrie #include <linux/input/mt.h>
75c6a7a62SOlivier Sobrie #include <linux/delay.h>
85c6a7a62SOlivier Sobrie #include <linux/workqueue.h>
9201f3c80SMarek Vasut #include <linux/gpio/consumer.h>
10e3559442SMarek Vasut #include <asm/unaligned.h>
115c6a7a62SOlivier Sobrie 
125c6a7a62SOlivier Sobrie #define MAX_TOUCHES		2
135c6a7a62SOlivier Sobrie #define DEFAULT_POLL_PERIOD	20
145c6a7a62SOlivier Sobrie 
155c6a7a62SOlivier Sobrie /* Touchscreen commands */
165c6a7a62SOlivier Sobrie #define REG_TOUCHDATA		0x10
175c6a7a62SOlivier Sobrie #define REG_PANEL_INFO		0x20
185c6a7a62SOlivier Sobrie #define REG_FIRMWARE_VERSION	0x40
195c6a7a62SOlivier Sobrie #define REG_CALIBRATE		0xcc
205c6a7a62SOlivier Sobrie 
21e3559442SMarek Vasut struct panel_info {
225c6a7a62SOlivier Sobrie 	u8 x_low;
235c6a7a62SOlivier Sobrie 	u8 x_high;
245c6a7a62SOlivier Sobrie 	u8 y_low;
255c6a7a62SOlivier Sobrie 	u8 y_high;
265c6a7a62SOlivier Sobrie 	u8 xchannel_num;
275c6a7a62SOlivier Sobrie 	u8 ychannel_num;
285c6a7a62SOlivier Sobrie } __packed;
295c6a7a62SOlivier Sobrie 
305c6a7a62SOlivier Sobrie struct firmware_version {
315c6a7a62SOlivier Sobrie 	u8 id;
325c6a7a62SOlivier Sobrie 	u8 major;
335c6a7a62SOlivier Sobrie 	u8 minor;
345c6a7a62SOlivier Sobrie } __packed;
355c6a7a62SOlivier Sobrie 
365c6a7a62SOlivier Sobrie struct ili210x {
375c6a7a62SOlivier Sobrie 	struct i2c_client *client;
385c6a7a62SOlivier Sobrie 	struct input_dev *input;
395c6a7a62SOlivier Sobrie 	unsigned int poll_period;
405c6a7a62SOlivier Sobrie 	struct delayed_work dwork;
41201f3c80SMarek Vasut 	struct gpio_desc *reset_gpio;
425c6a7a62SOlivier Sobrie };
435c6a7a62SOlivier Sobrie 
445c6a7a62SOlivier Sobrie static int ili210x_read_reg(struct i2c_client *client, u8 reg, void *buf,
455c6a7a62SOlivier Sobrie 			    size_t len)
465c6a7a62SOlivier Sobrie {
475c6a7a62SOlivier Sobrie 	struct i2c_msg msg[2] = {
485c6a7a62SOlivier Sobrie 		{
495c6a7a62SOlivier Sobrie 			.addr	= client->addr,
505c6a7a62SOlivier Sobrie 			.flags	= 0,
515c6a7a62SOlivier Sobrie 			.len	= 1,
525c6a7a62SOlivier Sobrie 			.buf	= &reg,
535c6a7a62SOlivier Sobrie 		},
545c6a7a62SOlivier Sobrie 		{
555c6a7a62SOlivier Sobrie 			.addr	= client->addr,
565c6a7a62SOlivier Sobrie 			.flags	= I2C_M_RD,
575c6a7a62SOlivier Sobrie 			.len	= len,
585c6a7a62SOlivier Sobrie 			.buf	= buf,
595c6a7a62SOlivier Sobrie 		}
605c6a7a62SOlivier Sobrie 	};
615c6a7a62SOlivier Sobrie 
625c6a7a62SOlivier Sobrie 	if (i2c_transfer(client->adapter, msg, 2) != 2) {
635c6a7a62SOlivier Sobrie 		dev_err(&client->dev, "i2c transfer failed\n");
645c6a7a62SOlivier Sobrie 		return -EIO;
655c6a7a62SOlivier Sobrie 	}
665c6a7a62SOlivier Sobrie 
675c6a7a62SOlivier Sobrie 	return 0;
685c6a7a62SOlivier Sobrie }
695c6a7a62SOlivier Sobrie 
70e3559442SMarek Vasut static bool ili210x_touchdata_to_coords(struct ili210x *priv, u8 *touchdata,
71e3559442SMarek Vasut 					unsigned int finger,
72e3559442SMarek Vasut 					unsigned int *x, unsigned int *y)
735c6a7a62SOlivier Sobrie {
74e3559442SMarek Vasut 	if (finger >= MAX_TOUCHES)
75e3559442SMarek Vasut 		return false;
76e3559442SMarek Vasut 
77e3559442SMarek Vasut 	if (touchdata[0] & BIT(finger))
78e3559442SMarek Vasut 		return false;
79e3559442SMarek Vasut 
80e3559442SMarek Vasut 	*x = get_unaligned_be16(touchdata + 1 + (finger * 4) + 0);
81e3559442SMarek Vasut 	*y = get_unaligned_be16(touchdata + 1 + (finger * 4) + 2);
82e3559442SMarek Vasut 
83e3559442SMarek Vasut 	return true;
84e3559442SMarek Vasut }
85e3559442SMarek Vasut 
86e3559442SMarek Vasut static bool ili210x_report_events(struct ili210x *priv, u8 *touchdata)
87e3559442SMarek Vasut {
88e3559442SMarek Vasut 	struct input_dev *input = priv->input;
895c6a7a62SOlivier Sobrie 	int i;
905c6a7a62SOlivier Sobrie 	bool touch;
915c6a7a62SOlivier Sobrie 	unsigned int x, y;
925c6a7a62SOlivier Sobrie 
935c6a7a62SOlivier Sobrie 	for (i = 0; i < MAX_TOUCHES; i++) {
945c6a7a62SOlivier Sobrie 		input_mt_slot(input, i);
955c6a7a62SOlivier Sobrie 
96e3559442SMarek Vasut 		touch = ili210x_touchdata_to_coords(priv, touchdata, i, &x, &y);
975c6a7a62SOlivier Sobrie 		input_mt_report_slot_state(input, MT_TOOL_FINGER, touch);
985c6a7a62SOlivier Sobrie 		if (touch) {
995c6a7a62SOlivier Sobrie 			input_report_abs(input, ABS_MT_POSITION_X, x);
1005c6a7a62SOlivier Sobrie 			input_report_abs(input, ABS_MT_POSITION_Y, y);
1015c6a7a62SOlivier Sobrie 		}
1025c6a7a62SOlivier Sobrie 	}
1035c6a7a62SOlivier Sobrie 
1045c6a7a62SOlivier Sobrie 	input_mt_report_pointer_emulation(input, false);
1055c6a7a62SOlivier Sobrie 	input_sync(input);
106e3559442SMarek Vasut 
107e3559442SMarek Vasut 	return touchdata[0] & 0xf3;
1085c6a7a62SOlivier Sobrie }
1095c6a7a62SOlivier Sobrie 
1105c6a7a62SOlivier Sobrie static void ili210x_work(struct work_struct *work)
1115c6a7a62SOlivier Sobrie {
1125c6a7a62SOlivier Sobrie 	struct ili210x *priv = container_of(work, struct ili210x,
1135c6a7a62SOlivier Sobrie 					    dwork.work);
1145c6a7a62SOlivier Sobrie 	struct i2c_client *client = priv->client;
115e3559442SMarek Vasut 	u8 touchdata[1 + 4 * MAX_TOUCHES];
116e3559442SMarek Vasut 	bool touch;
1175c6a7a62SOlivier Sobrie 	int error;
1185c6a7a62SOlivier Sobrie 
1195c6a7a62SOlivier Sobrie 	error = ili210x_read_reg(client, REG_TOUCHDATA,
120e3559442SMarek Vasut 				 touchdata, sizeof(touchdata));
1215c6a7a62SOlivier Sobrie 	if (error) {
1225c6a7a62SOlivier Sobrie 		dev_err(&client->dev,
1235c6a7a62SOlivier Sobrie 			"Unable to get touchdata, err = %d\n", error);
1245c6a7a62SOlivier Sobrie 		return;
1255c6a7a62SOlivier Sobrie 	}
1265c6a7a62SOlivier Sobrie 
127e3559442SMarek Vasut 	touch = ili210x_report_events(priv, touchdata);
1285c6a7a62SOlivier Sobrie 
129e3559442SMarek Vasut 	if (touch)
1305c6a7a62SOlivier Sobrie 		schedule_delayed_work(&priv->dwork,
1315c6a7a62SOlivier Sobrie 				      msecs_to_jiffies(priv->poll_period));
1325c6a7a62SOlivier Sobrie }
1335c6a7a62SOlivier Sobrie 
1345c6a7a62SOlivier Sobrie static irqreturn_t ili210x_irq(int irq, void *irq_data)
1355c6a7a62SOlivier Sobrie {
1365c6a7a62SOlivier Sobrie 	struct ili210x *priv = irq_data;
1375c6a7a62SOlivier Sobrie 
1385c6a7a62SOlivier Sobrie 	schedule_delayed_work(&priv->dwork, 0);
1395c6a7a62SOlivier Sobrie 
1405c6a7a62SOlivier Sobrie 	return IRQ_HANDLED;
1415c6a7a62SOlivier Sobrie }
1425c6a7a62SOlivier Sobrie 
1435c6a7a62SOlivier Sobrie static ssize_t ili210x_calibrate(struct device *dev,
1445c6a7a62SOlivier Sobrie 				 struct device_attribute *attr,
1455c6a7a62SOlivier Sobrie 				 const char *buf, size_t count)
1465c6a7a62SOlivier Sobrie {
1475c6a7a62SOlivier Sobrie 	struct i2c_client *client = to_i2c_client(dev);
1485c6a7a62SOlivier Sobrie 	struct ili210x *priv = i2c_get_clientdata(client);
1495c6a7a62SOlivier Sobrie 	unsigned long calibrate;
1505c6a7a62SOlivier Sobrie 	int rc;
1515c6a7a62SOlivier Sobrie 	u8 cmd = REG_CALIBRATE;
1525c6a7a62SOlivier Sobrie 
1535c6a7a62SOlivier Sobrie 	if (kstrtoul(buf, 10, &calibrate))
1545c6a7a62SOlivier Sobrie 		return -EINVAL;
1555c6a7a62SOlivier Sobrie 
1565c6a7a62SOlivier Sobrie 	if (calibrate > 1)
1575c6a7a62SOlivier Sobrie 		return -EINVAL;
1585c6a7a62SOlivier Sobrie 
1595c6a7a62SOlivier Sobrie 	if (calibrate) {
1605c6a7a62SOlivier Sobrie 		rc = i2c_master_send(priv->client, &cmd, sizeof(cmd));
1615c6a7a62SOlivier Sobrie 		if (rc != sizeof(cmd))
1625c6a7a62SOlivier Sobrie 			return -EIO;
1635c6a7a62SOlivier Sobrie 	}
1645c6a7a62SOlivier Sobrie 
1655c6a7a62SOlivier Sobrie 	return count;
1665c6a7a62SOlivier Sobrie }
167b27c0d0cSDmitry Torokhov static DEVICE_ATTR(calibrate, S_IWUSR, NULL, ili210x_calibrate);
1685c6a7a62SOlivier Sobrie 
1695c6a7a62SOlivier Sobrie static struct attribute *ili210x_attributes[] = {
1705c6a7a62SOlivier Sobrie 	&dev_attr_calibrate.attr,
1715c6a7a62SOlivier Sobrie 	NULL,
1725c6a7a62SOlivier Sobrie };
1735c6a7a62SOlivier Sobrie 
1745c6a7a62SOlivier Sobrie static const struct attribute_group ili210x_attr_group = {
1755c6a7a62SOlivier Sobrie 	.attrs = ili210x_attributes,
1765c6a7a62SOlivier Sobrie };
1775c6a7a62SOlivier Sobrie 
178201f3c80SMarek Vasut static void ili210x_power_down(void *data)
179201f3c80SMarek Vasut {
180201f3c80SMarek Vasut 	struct gpio_desc *reset_gpio = data;
181201f3c80SMarek Vasut 
182201f3c80SMarek Vasut 	gpiod_set_value_cansleep(reset_gpio, 1);
183201f3c80SMarek Vasut }
184201f3c80SMarek Vasut 
1851bdec5d9SMarek Vasut static void ili210x_cancel_work(void *data)
1861bdec5d9SMarek Vasut {
1871bdec5d9SMarek Vasut 	struct ili210x *priv = data;
1881bdec5d9SMarek Vasut 
1891bdec5d9SMarek Vasut 	cancel_delayed_work_sync(&priv->dwork);
1901bdec5d9SMarek Vasut }
1911bdec5d9SMarek Vasut 
1925298cc4cSBill Pemberton static int ili210x_i2c_probe(struct i2c_client *client,
1935c6a7a62SOlivier Sobrie 				       const struct i2c_device_id *id)
1945c6a7a62SOlivier Sobrie {
1955c6a7a62SOlivier Sobrie 	struct device *dev = &client->dev;
1965c6a7a62SOlivier Sobrie 	struct ili210x *priv;
197201f3c80SMarek Vasut 	struct gpio_desc *reset_gpio;
1985c6a7a62SOlivier Sobrie 	struct input_dev *input;
1995c6a7a62SOlivier Sobrie 	struct panel_info panel;
2005c6a7a62SOlivier Sobrie 	struct firmware_version firmware;
2015c6a7a62SOlivier Sobrie 	int xmax, ymax;
2025c6a7a62SOlivier Sobrie 	int error;
2035c6a7a62SOlivier Sobrie 
2045c6a7a62SOlivier Sobrie 	dev_dbg(dev, "Probing for ILI210X I2C Touschreen driver");
2055c6a7a62SOlivier Sobrie 
2065c6a7a62SOlivier Sobrie 	if (client->irq <= 0) {
2075c6a7a62SOlivier Sobrie 		dev_err(dev, "No IRQ!\n");
2085c6a7a62SOlivier Sobrie 		return -EINVAL;
2095c6a7a62SOlivier Sobrie 	}
2105c6a7a62SOlivier Sobrie 
211201f3c80SMarek Vasut 	reset_gpio = devm_gpiod_get_optional(dev, "reset", GPIOD_OUT_HIGH);
212201f3c80SMarek Vasut 	if (IS_ERR(reset_gpio))
213201f3c80SMarek Vasut 		return PTR_ERR(reset_gpio);
214201f3c80SMarek Vasut 
215201f3c80SMarek Vasut 	if (reset_gpio) {
216201f3c80SMarek Vasut 		error = devm_add_action_or_reset(dev, ili210x_power_down,
217201f3c80SMarek Vasut 						 reset_gpio);
218201f3c80SMarek Vasut 		if (error)
219201f3c80SMarek Vasut 			return error;
220201f3c80SMarek Vasut 
221201f3c80SMarek Vasut 		usleep_range(50, 100);
222201f3c80SMarek Vasut 		gpiod_set_value_cansleep(reset_gpio, 0);
223201f3c80SMarek Vasut 		msleep(100);
224201f3c80SMarek Vasut 	}
225201f3c80SMarek Vasut 
226*12294577SMarek Vasut 	priv = devm_kzalloc(dev, sizeof(*priv), GFP_KERNEL);
227*12294577SMarek Vasut 	if (!priv)
228*12294577SMarek Vasut 		return -ENOMEM;
229*12294577SMarek Vasut 
230*12294577SMarek Vasut 	input = devm_input_allocate_device(dev);
231*12294577SMarek Vasut 	if (!input)
232*12294577SMarek Vasut 		return -ENOMEM;
233*12294577SMarek Vasut 
234*12294577SMarek Vasut 	priv->client = client;
235*12294577SMarek Vasut 	priv->input = input;
236*12294577SMarek Vasut 	priv->poll_period = DEFAULT_POLL_PERIOD;
237*12294577SMarek Vasut 	INIT_DELAYED_WORK(&priv->dwork, ili210x_work);
238*12294577SMarek Vasut 	priv->reset_gpio = reset_gpio;
239*12294577SMarek Vasut 
240*12294577SMarek Vasut 	i2c_set_clientdata(client, priv);
241*12294577SMarek Vasut 
2425c6a7a62SOlivier Sobrie 	/* Get firmware version */
2435c6a7a62SOlivier Sobrie 	error = ili210x_read_reg(client, REG_FIRMWARE_VERSION,
2445c6a7a62SOlivier Sobrie 				 &firmware, sizeof(firmware));
2455c6a7a62SOlivier Sobrie 	if (error) {
2465c6a7a62SOlivier Sobrie 		dev_err(dev, "Failed to get firmware version, err: %d\n",
2475c6a7a62SOlivier Sobrie 			error);
2485c6a7a62SOlivier Sobrie 		return error;
2495c6a7a62SOlivier Sobrie 	}
2505c6a7a62SOlivier Sobrie 
2515c6a7a62SOlivier Sobrie 	/* get panel info */
2525c6a7a62SOlivier Sobrie 	error = ili210x_read_reg(client, REG_PANEL_INFO, &panel, sizeof(panel));
2535c6a7a62SOlivier Sobrie 	if (error) {
254971bd8faSMasanari Iida 		dev_err(dev, "Failed to get panel information, err: %d\n",
2555c6a7a62SOlivier Sobrie 			error);
2565c6a7a62SOlivier Sobrie 		return error;
2575c6a7a62SOlivier Sobrie 	}
2585c6a7a62SOlivier Sobrie 
259e3559442SMarek Vasut 	xmax = panel.x_low | (panel.x_high << 8);
260e3559442SMarek Vasut 	ymax = panel.y_low | (panel.y_high << 8);
2615c6a7a62SOlivier Sobrie 
2625c6a7a62SOlivier Sobrie 	/* Setup input device */
2635c6a7a62SOlivier Sobrie 	input->name = "ILI210x Touchscreen";
2645c6a7a62SOlivier Sobrie 	input->id.bustype = BUS_I2C;
2655c6a7a62SOlivier Sobrie 	input->dev.parent = dev;
2665c6a7a62SOlivier Sobrie 
2675c6a7a62SOlivier Sobrie 	__set_bit(EV_SYN, input->evbit);
2685c6a7a62SOlivier Sobrie 	__set_bit(EV_KEY, input->evbit);
2695c6a7a62SOlivier Sobrie 	__set_bit(EV_ABS, input->evbit);
2705c6a7a62SOlivier Sobrie 	__set_bit(BTN_TOUCH, input->keybit);
2715c6a7a62SOlivier Sobrie 
2725c6a7a62SOlivier Sobrie 	/* Single touch */
2735c6a7a62SOlivier Sobrie 	input_set_abs_params(input, ABS_X, 0, xmax, 0, 0);
2745c6a7a62SOlivier Sobrie 	input_set_abs_params(input, ABS_Y, 0, ymax, 0, 0);
2755c6a7a62SOlivier Sobrie 
2765c6a7a62SOlivier Sobrie 	/* Multi touch */
277b4adbbefSHenrik Rydberg 	input_mt_init_slots(input, MAX_TOUCHES, 0);
2785c6a7a62SOlivier Sobrie 	input_set_abs_params(input, ABS_MT_POSITION_X, 0, xmax, 0, 0);
2795c6a7a62SOlivier Sobrie 	input_set_abs_params(input, ABS_MT_POSITION_Y, 0, ymax, 0, 0);
2805c6a7a62SOlivier Sobrie 
2811bdec5d9SMarek Vasut 	error = devm_add_action(dev, ili210x_cancel_work, priv);
2821bdec5d9SMarek Vasut 	if (error)
2831bdec5d9SMarek Vasut 		return error;
2841bdec5d9SMarek Vasut 
2851bdec5d9SMarek Vasut 	error = devm_request_irq(dev, client->irq, ili210x_irq, 0,
2865c6a7a62SOlivier Sobrie 				 client->name, priv);
2875c6a7a62SOlivier Sobrie 	if (error) {
2885c6a7a62SOlivier Sobrie 		dev_err(dev, "Unable to request touchscreen IRQ, err: %d\n",
2895c6a7a62SOlivier Sobrie 			error);
2901bdec5d9SMarek Vasut 		return error;
2915c6a7a62SOlivier Sobrie 	}
2925c6a7a62SOlivier Sobrie 
2935c6a7a62SOlivier Sobrie 	error = sysfs_create_group(&dev->kobj, &ili210x_attr_group);
2945c6a7a62SOlivier Sobrie 	if (error) {
2955c6a7a62SOlivier Sobrie 		dev_err(dev, "Unable to create sysfs attributes, err: %d\n",
2965c6a7a62SOlivier Sobrie 			error);
2971bdec5d9SMarek Vasut 		return error;
2985c6a7a62SOlivier Sobrie 	}
2995c6a7a62SOlivier Sobrie 
3005c6a7a62SOlivier Sobrie 	error = input_register_device(priv->input);
3015c6a7a62SOlivier Sobrie 	if (error) {
302971bd8faSMasanari Iida 		dev_err(dev, "Cannot register input device, err: %d\n", error);
3035c6a7a62SOlivier Sobrie 		goto err_remove_sysfs;
3045c6a7a62SOlivier Sobrie 	}
3055c6a7a62SOlivier Sobrie 
306d7ddf154SGuenter Roeck 	device_init_wakeup(dev, 1);
3075c6a7a62SOlivier Sobrie 
3085c6a7a62SOlivier Sobrie 	dev_dbg(dev,
3095c6a7a62SOlivier Sobrie 		"ILI210x initialized (IRQ: %d), firmware version %d.%d.%d",
3105c6a7a62SOlivier Sobrie 		client->irq, firmware.id, firmware.major, firmware.minor);
3115c6a7a62SOlivier Sobrie 
3125c6a7a62SOlivier Sobrie 	return 0;
3135c6a7a62SOlivier Sobrie 
3145c6a7a62SOlivier Sobrie err_remove_sysfs:
3155c6a7a62SOlivier Sobrie 	sysfs_remove_group(&dev->kobj, &ili210x_attr_group);
3165c6a7a62SOlivier Sobrie 	return error;
3175c6a7a62SOlivier Sobrie }
3185c6a7a62SOlivier Sobrie 
319e2619cf7SBill Pemberton static int ili210x_i2c_remove(struct i2c_client *client)
3205c6a7a62SOlivier Sobrie {
3215c6a7a62SOlivier Sobrie 	sysfs_remove_group(&client->dev.kobj, &ili210x_attr_group);
3225c6a7a62SOlivier Sobrie 
3235c6a7a62SOlivier Sobrie 	return 0;
3245c6a7a62SOlivier Sobrie }
3255c6a7a62SOlivier Sobrie 
32602b6a58bSJingoo Han static int __maybe_unused ili210x_i2c_suspend(struct device *dev)
3275c6a7a62SOlivier Sobrie {
3285c6a7a62SOlivier Sobrie 	struct i2c_client *client = to_i2c_client(dev);
3295c6a7a62SOlivier Sobrie 
3305c6a7a62SOlivier Sobrie 	if (device_may_wakeup(&client->dev))
3315c6a7a62SOlivier Sobrie 		enable_irq_wake(client->irq);
3325c6a7a62SOlivier Sobrie 
3335c6a7a62SOlivier Sobrie 	return 0;
3345c6a7a62SOlivier Sobrie }
3355c6a7a62SOlivier Sobrie 
33602b6a58bSJingoo Han static int __maybe_unused ili210x_i2c_resume(struct device *dev)
3375c6a7a62SOlivier Sobrie {
3385c6a7a62SOlivier Sobrie 	struct i2c_client *client = to_i2c_client(dev);
3395c6a7a62SOlivier Sobrie 
3405c6a7a62SOlivier Sobrie 	if (device_may_wakeup(&client->dev))
3415c6a7a62SOlivier Sobrie 		disable_irq_wake(client->irq);
3425c6a7a62SOlivier Sobrie 
3435c6a7a62SOlivier Sobrie 	return 0;
3445c6a7a62SOlivier Sobrie }
3455c6a7a62SOlivier Sobrie 
3465c6a7a62SOlivier Sobrie static SIMPLE_DEV_PM_OPS(ili210x_i2c_pm,
3475c6a7a62SOlivier Sobrie 			 ili210x_i2c_suspend, ili210x_i2c_resume);
3485c6a7a62SOlivier Sobrie 
3495c6a7a62SOlivier Sobrie static const struct i2c_device_id ili210x_i2c_id[] = {
3505c6a7a62SOlivier Sobrie 	{ "ili210x", 0 },
3515c6a7a62SOlivier Sobrie 	{ }
3525c6a7a62SOlivier Sobrie };
3535c6a7a62SOlivier Sobrie MODULE_DEVICE_TABLE(i2c, ili210x_i2c_id);
3545c6a7a62SOlivier Sobrie 
3555c6a7a62SOlivier Sobrie static struct i2c_driver ili210x_ts_driver = {
3565c6a7a62SOlivier Sobrie 	.driver = {
3575c6a7a62SOlivier Sobrie 		.name = "ili210x_i2c",
3585c6a7a62SOlivier Sobrie 		.pm = &ili210x_i2c_pm,
3595c6a7a62SOlivier Sobrie 	},
3605c6a7a62SOlivier Sobrie 	.id_table = ili210x_i2c_id,
3615c6a7a62SOlivier Sobrie 	.probe = ili210x_i2c_probe,
3621cb0aa88SBill Pemberton 	.remove = ili210x_i2c_remove,
3635c6a7a62SOlivier Sobrie };
3645c6a7a62SOlivier Sobrie 
3655c6a7a62SOlivier Sobrie module_i2c_driver(ili210x_ts_driver);
3665c6a7a62SOlivier Sobrie 
3675c6a7a62SOlivier Sobrie MODULE_AUTHOR("Olivier Sobrie <olivier@sobrie.be>");
3685c6a7a62SOlivier Sobrie MODULE_DESCRIPTION("ILI210X I2C Touchscreen Driver");
3695c6a7a62SOlivier Sobrie MODULE_LICENSE("GPL");
370