xref: /openbmc/linux/drivers/input/touchscreen/ili210x.c (revision 971bd8fa369a37b047c26e9a47d4c1f5d2dce4d3)
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>
95c6a7a62SOlivier Sobrie #include <linux/input/ili210x.h>
105c6a7a62SOlivier Sobrie 
115c6a7a62SOlivier Sobrie #define MAX_TOUCHES		2
125c6a7a62SOlivier Sobrie #define DEFAULT_POLL_PERIOD	20
135c6a7a62SOlivier Sobrie 
145c6a7a62SOlivier Sobrie /* Touchscreen commands */
155c6a7a62SOlivier Sobrie #define REG_TOUCHDATA		0x10
165c6a7a62SOlivier Sobrie #define REG_PANEL_INFO		0x20
175c6a7a62SOlivier Sobrie #define REG_FIRMWARE_VERSION	0x40
185c6a7a62SOlivier Sobrie #define REG_CALIBRATE		0xcc
195c6a7a62SOlivier Sobrie 
205c6a7a62SOlivier Sobrie struct finger {
215c6a7a62SOlivier Sobrie 	u8 x_low;
225c6a7a62SOlivier Sobrie 	u8 x_high;
235c6a7a62SOlivier Sobrie 	u8 y_low;
245c6a7a62SOlivier Sobrie 	u8 y_high;
255c6a7a62SOlivier Sobrie } __packed;
265c6a7a62SOlivier Sobrie 
275c6a7a62SOlivier Sobrie struct touchdata {
285c6a7a62SOlivier Sobrie 	u8 status;
295c6a7a62SOlivier Sobrie 	struct finger finger[MAX_TOUCHES];
305c6a7a62SOlivier Sobrie } __packed;
315c6a7a62SOlivier Sobrie 
325c6a7a62SOlivier Sobrie struct panel_info {
335c6a7a62SOlivier Sobrie 	struct finger finger_max;
345c6a7a62SOlivier Sobrie 	u8 xchannel_num;
355c6a7a62SOlivier Sobrie 	u8 ychannel_num;
365c6a7a62SOlivier Sobrie } __packed;
375c6a7a62SOlivier Sobrie 
385c6a7a62SOlivier Sobrie struct firmware_version {
395c6a7a62SOlivier Sobrie 	u8 id;
405c6a7a62SOlivier Sobrie 	u8 major;
415c6a7a62SOlivier Sobrie 	u8 minor;
425c6a7a62SOlivier Sobrie } __packed;
435c6a7a62SOlivier Sobrie 
445c6a7a62SOlivier Sobrie struct ili210x {
455c6a7a62SOlivier Sobrie 	struct i2c_client *client;
465c6a7a62SOlivier Sobrie 	struct input_dev *input;
475c6a7a62SOlivier Sobrie 	bool (*get_pendown_state)(void);
485c6a7a62SOlivier Sobrie 	unsigned int poll_period;
495c6a7a62SOlivier Sobrie 	struct delayed_work dwork;
505c6a7a62SOlivier Sobrie };
515c6a7a62SOlivier Sobrie 
525c6a7a62SOlivier Sobrie static int ili210x_read_reg(struct i2c_client *client, u8 reg, void *buf,
535c6a7a62SOlivier Sobrie 			    size_t len)
545c6a7a62SOlivier Sobrie {
555c6a7a62SOlivier Sobrie 	struct i2c_msg msg[2] = {
565c6a7a62SOlivier Sobrie 		{
575c6a7a62SOlivier Sobrie 			.addr	= client->addr,
585c6a7a62SOlivier Sobrie 			.flags	= 0,
595c6a7a62SOlivier Sobrie 			.len	= 1,
605c6a7a62SOlivier Sobrie 			.buf	= &reg,
615c6a7a62SOlivier Sobrie 		},
625c6a7a62SOlivier Sobrie 		{
635c6a7a62SOlivier Sobrie 			.addr	= client->addr,
645c6a7a62SOlivier Sobrie 			.flags	= I2C_M_RD,
655c6a7a62SOlivier Sobrie 			.len	= len,
665c6a7a62SOlivier Sobrie 			.buf	= buf,
675c6a7a62SOlivier Sobrie 		}
685c6a7a62SOlivier Sobrie 	};
695c6a7a62SOlivier Sobrie 
705c6a7a62SOlivier Sobrie 	if (i2c_transfer(client->adapter, msg, 2) != 2) {
715c6a7a62SOlivier Sobrie 		dev_err(&client->dev, "i2c transfer failed\n");
725c6a7a62SOlivier Sobrie 		return -EIO;
735c6a7a62SOlivier Sobrie 	}
745c6a7a62SOlivier Sobrie 
755c6a7a62SOlivier Sobrie 	return 0;
765c6a7a62SOlivier Sobrie }
775c6a7a62SOlivier Sobrie 
785c6a7a62SOlivier Sobrie static void ili210x_report_events(struct input_dev *input,
795c6a7a62SOlivier Sobrie 				  const struct touchdata *touchdata)
805c6a7a62SOlivier Sobrie {
815c6a7a62SOlivier Sobrie 	int i;
825c6a7a62SOlivier Sobrie 	bool touch;
835c6a7a62SOlivier Sobrie 	unsigned int x, y;
845c6a7a62SOlivier Sobrie 	const struct finger *finger;
855c6a7a62SOlivier Sobrie 
865c6a7a62SOlivier Sobrie 	for (i = 0; i < MAX_TOUCHES; i++) {
875c6a7a62SOlivier Sobrie 		input_mt_slot(input, i);
885c6a7a62SOlivier Sobrie 
895c6a7a62SOlivier Sobrie 		finger = &touchdata->finger[i];
905c6a7a62SOlivier Sobrie 
915c6a7a62SOlivier Sobrie 		touch = touchdata->status & (1 << i);
925c6a7a62SOlivier Sobrie 		input_mt_report_slot_state(input, MT_TOOL_FINGER, touch);
935c6a7a62SOlivier Sobrie 		if (touch) {
945c6a7a62SOlivier Sobrie 			x = finger->x_low | (finger->x_high << 8);
955c6a7a62SOlivier Sobrie 			y = finger->y_low | (finger->y_high << 8);
965c6a7a62SOlivier Sobrie 
975c6a7a62SOlivier Sobrie 			input_report_abs(input, ABS_MT_POSITION_X, x);
985c6a7a62SOlivier Sobrie 			input_report_abs(input, ABS_MT_POSITION_Y, y);
995c6a7a62SOlivier Sobrie 		}
1005c6a7a62SOlivier Sobrie 	}
1015c6a7a62SOlivier Sobrie 
1025c6a7a62SOlivier Sobrie 	input_mt_report_pointer_emulation(input, false);
1035c6a7a62SOlivier Sobrie 	input_sync(input);
1045c6a7a62SOlivier Sobrie }
1055c6a7a62SOlivier Sobrie 
1065c6a7a62SOlivier Sobrie static bool get_pendown_state(const struct ili210x *priv)
1075c6a7a62SOlivier Sobrie {
1085c6a7a62SOlivier Sobrie 	bool state = false;
1095c6a7a62SOlivier Sobrie 
1105c6a7a62SOlivier Sobrie 	if (priv->get_pendown_state)
1115c6a7a62SOlivier Sobrie 		state = priv->get_pendown_state();
1125c6a7a62SOlivier Sobrie 
1135c6a7a62SOlivier Sobrie 	return state;
1145c6a7a62SOlivier Sobrie }
1155c6a7a62SOlivier Sobrie 
1165c6a7a62SOlivier Sobrie static void ili210x_work(struct work_struct *work)
1175c6a7a62SOlivier Sobrie {
1185c6a7a62SOlivier Sobrie 	struct ili210x *priv = container_of(work, struct ili210x,
1195c6a7a62SOlivier Sobrie 					    dwork.work);
1205c6a7a62SOlivier Sobrie 	struct i2c_client *client = priv->client;
1215c6a7a62SOlivier Sobrie 	struct touchdata touchdata;
1225c6a7a62SOlivier Sobrie 	int error;
1235c6a7a62SOlivier Sobrie 
1245c6a7a62SOlivier Sobrie 	error = ili210x_read_reg(client, REG_TOUCHDATA,
1255c6a7a62SOlivier Sobrie 				 &touchdata, sizeof(touchdata));
1265c6a7a62SOlivier Sobrie 	if (error) {
1275c6a7a62SOlivier Sobrie 		dev_err(&client->dev,
1285c6a7a62SOlivier Sobrie 			"Unable to get touchdata, err = %d\n", error);
1295c6a7a62SOlivier Sobrie 		return;
1305c6a7a62SOlivier Sobrie 	}
1315c6a7a62SOlivier Sobrie 
1325c6a7a62SOlivier Sobrie 	ili210x_report_events(priv->input, &touchdata);
1335c6a7a62SOlivier Sobrie 
1345c6a7a62SOlivier Sobrie 	if ((touchdata.status & 0xf3) || get_pendown_state(priv))
1355c6a7a62SOlivier Sobrie 		schedule_delayed_work(&priv->dwork,
1365c6a7a62SOlivier Sobrie 				      msecs_to_jiffies(priv->poll_period));
1375c6a7a62SOlivier Sobrie }
1385c6a7a62SOlivier Sobrie 
1395c6a7a62SOlivier Sobrie static irqreturn_t ili210x_irq(int irq, void *irq_data)
1405c6a7a62SOlivier Sobrie {
1415c6a7a62SOlivier Sobrie 	struct ili210x *priv = irq_data;
1425c6a7a62SOlivier Sobrie 
1435c6a7a62SOlivier Sobrie 	schedule_delayed_work(&priv->dwork, 0);
1445c6a7a62SOlivier Sobrie 
1455c6a7a62SOlivier Sobrie 	return IRQ_HANDLED;
1465c6a7a62SOlivier Sobrie }
1475c6a7a62SOlivier Sobrie 
1485c6a7a62SOlivier Sobrie static ssize_t ili210x_calibrate(struct device *dev,
1495c6a7a62SOlivier Sobrie 				 struct device_attribute *attr,
1505c6a7a62SOlivier Sobrie 				 const char *buf, size_t count)
1515c6a7a62SOlivier Sobrie {
1525c6a7a62SOlivier Sobrie 	struct i2c_client *client = to_i2c_client(dev);
1535c6a7a62SOlivier Sobrie 	struct ili210x *priv = i2c_get_clientdata(client);
1545c6a7a62SOlivier Sobrie 	unsigned long calibrate;
1555c6a7a62SOlivier Sobrie 	int rc;
1565c6a7a62SOlivier Sobrie 	u8 cmd = REG_CALIBRATE;
1575c6a7a62SOlivier Sobrie 
1585c6a7a62SOlivier Sobrie 	if (kstrtoul(buf, 10, &calibrate))
1595c6a7a62SOlivier Sobrie 		return -EINVAL;
1605c6a7a62SOlivier Sobrie 
1615c6a7a62SOlivier Sobrie 	if (calibrate > 1)
1625c6a7a62SOlivier Sobrie 		return -EINVAL;
1635c6a7a62SOlivier Sobrie 
1645c6a7a62SOlivier Sobrie 	if (calibrate) {
1655c6a7a62SOlivier Sobrie 		rc = i2c_master_send(priv->client, &cmd, sizeof(cmd));
1665c6a7a62SOlivier Sobrie 		if (rc != sizeof(cmd))
1675c6a7a62SOlivier Sobrie 			return -EIO;
1685c6a7a62SOlivier Sobrie 	}
1695c6a7a62SOlivier Sobrie 
1705c6a7a62SOlivier Sobrie 	return count;
1715c6a7a62SOlivier Sobrie }
1725c6a7a62SOlivier Sobrie static DEVICE_ATTR(calibrate, 0644, NULL, ili210x_calibrate);
1735c6a7a62SOlivier Sobrie 
1745c6a7a62SOlivier Sobrie static struct attribute *ili210x_attributes[] = {
1755c6a7a62SOlivier Sobrie 	&dev_attr_calibrate.attr,
1765c6a7a62SOlivier Sobrie 	NULL,
1775c6a7a62SOlivier Sobrie };
1785c6a7a62SOlivier Sobrie 
1795c6a7a62SOlivier Sobrie static const struct attribute_group ili210x_attr_group = {
1805c6a7a62SOlivier Sobrie 	.attrs = ili210x_attributes,
1815c6a7a62SOlivier Sobrie };
1825c6a7a62SOlivier Sobrie 
1835298cc4cSBill Pemberton static int ili210x_i2c_probe(struct i2c_client *client,
1845c6a7a62SOlivier Sobrie 				       const struct i2c_device_id *id)
1855c6a7a62SOlivier Sobrie {
1865c6a7a62SOlivier Sobrie 	struct device *dev = &client->dev;
187c838cb3dSJingoo Han 	const struct ili210x_platform_data *pdata = dev_get_platdata(dev);
1885c6a7a62SOlivier Sobrie 	struct ili210x *priv;
1895c6a7a62SOlivier Sobrie 	struct input_dev *input;
1905c6a7a62SOlivier Sobrie 	struct panel_info panel;
1915c6a7a62SOlivier Sobrie 	struct firmware_version firmware;
1925c6a7a62SOlivier Sobrie 	int xmax, ymax;
1935c6a7a62SOlivier Sobrie 	int error;
1945c6a7a62SOlivier Sobrie 
1955c6a7a62SOlivier Sobrie 	dev_dbg(dev, "Probing for ILI210X I2C Touschreen driver");
1965c6a7a62SOlivier Sobrie 
1975c6a7a62SOlivier Sobrie 	if (!pdata) {
1985c6a7a62SOlivier Sobrie 		dev_err(dev, "No platform data!\n");
1995c6a7a62SOlivier Sobrie 		return -EINVAL;
2005c6a7a62SOlivier Sobrie 	}
2015c6a7a62SOlivier Sobrie 
2025c6a7a62SOlivier Sobrie 	if (client->irq <= 0) {
2035c6a7a62SOlivier Sobrie 		dev_err(dev, "No IRQ!\n");
2045c6a7a62SOlivier Sobrie 		return -EINVAL;
2055c6a7a62SOlivier Sobrie 	}
2065c6a7a62SOlivier Sobrie 
2075c6a7a62SOlivier Sobrie 	/* Get firmware version */
2085c6a7a62SOlivier Sobrie 	error = ili210x_read_reg(client, REG_FIRMWARE_VERSION,
2095c6a7a62SOlivier Sobrie 				 &firmware, sizeof(firmware));
2105c6a7a62SOlivier Sobrie 	if (error) {
2115c6a7a62SOlivier Sobrie 		dev_err(dev, "Failed to get firmware version, err: %d\n",
2125c6a7a62SOlivier Sobrie 			error);
2135c6a7a62SOlivier Sobrie 		return error;
2145c6a7a62SOlivier Sobrie 	}
2155c6a7a62SOlivier Sobrie 
2165c6a7a62SOlivier Sobrie 	/* get panel info */
2175c6a7a62SOlivier Sobrie 	error = ili210x_read_reg(client, REG_PANEL_INFO, &panel, sizeof(panel));
2185c6a7a62SOlivier Sobrie 	if (error) {
219*971bd8faSMasanari Iida 		dev_err(dev, "Failed to get panel information, err: %d\n",
2205c6a7a62SOlivier Sobrie 			error);
2215c6a7a62SOlivier Sobrie 		return error;
2225c6a7a62SOlivier Sobrie 	}
2235c6a7a62SOlivier Sobrie 
2245c6a7a62SOlivier Sobrie 	xmax = panel.finger_max.x_low | (panel.finger_max.x_high << 8);
2255c6a7a62SOlivier Sobrie 	ymax = panel.finger_max.y_low | (panel.finger_max.y_high << 8);
2265c6a7a62SOlivier Sobrie 
2275c6a7a62SOlivier Sobrie 	priv = kzalloc(sizeof(*priv), GFP_KERNEL);
2285c6a7a62SOlivier Sobrie 	input = input_allocate_device();
2295c6a7a62SOlivier Sobrie 	if (!priv || !input) {
2305c6a7a62SOlivier Sobrie 		error = -ENOMEM;
2315c6a7a62SOlivier Sobrie 		goto err_free_mem;
2325c6a7a62SOlivier Sobrie 	}
2335c6a7a62SOlivier Sobrie 
2345c6a7a62SOlivier Sobrie 	priv->client = client;
2355c6a7a62SOlivier Sobrie 	priv->input = input;
2365c6a7a62SOlivier Sobrie 	priv->get_pendown_state = pdata->get_pendown_state;
2375c6a7a62SOlivier Sobrie 	priv->poll_period = pdata->poll_period ? : DEFAULT_POLL_PERIOD;
2385c6a7a62SOlivier Sobrie 	INIT_DELAYED_WORK(&priv->dwork, ili210x_work);
2395c6a7a62SOlivier Sobrie 
2405c6a7a62SOlivier Sobrie 	/* Setup input device */
2415c6a7a62SOlivier Sobrie 	input->name = "ILI210x Touchscreen";
2425c6a7a62SOlivier Sobrie 	input->id.bustype = BUS_I2C;
2435c6a7a62SOlivier Sobrie 	input->dev.parent = dev;
2445c6a7a62SOlivier Sobrie 
2455c6a7a62SOlivier Sobrie 	__set_bit(EV_SYN, input->evbit);
2465c6a7a62SOlivier Sobrie 	__set_bit(EV_KEY, input->evbit);
2475c6a7a62SOlivier Sobrie 	__set_bit(EV_ABS, input->evbit);
2485c6a7a62SOlivier Sobrie 	__set_bit(BTN_TOUCH, input->keybit);
2495c6a7a62SOlivier Sobrie 
2505c6a7a62SOlivier Sobrie 	/* Single touch */
2515c6a7a62SOlivier Sobrie 	input_set_abs_params(input, ABS_X, 0, xmax, 0, 0);
2525c6a7a62SOlivier Sobrie 	input_set_abs_params(input, ABS_Y, 0, ymax, 0, 0);
2535c6a7a62SOlivier Sobrie 
2545c6a7a62SOlivier Sobrie 	/* Multi touch */
255b4adbbefSHenrik Rydberg 	input_mt_init_slots(input, MAX_TOUCHES, 0);
2565c6a7a62SOlivier Sobrie 	input_set_abs_params(input, ABS_MT_POSITION_X, 0, xmax, 0, 0);
2575c6a7a62SOlivier Sobrie 	input_set_abs_params(input, ABS_MT_POSITION_Y, 0, ymax, 0, 0);
2585c6a7a62SOlivier Sobrie 
2595c6a7a62SOlivier Sobrie 	input_set_drvdata(input, priv);
2605c6a7a62SOlivier Sobrie 	i2c_set_clientdata(client, priv);
2615c6a7a62SOlivier Sobrie 
2625c6a7a62SOlivier Sobrie 	error = request_irq(client->irq, ili210x_irq, pdata->irq_flags,
2635c6a7a62SOlivier Sobrie 			    client->name, priv);
2645c6a7a62SOlivier Sobrie 	if (error) {
2655c6a7a62SOlivier Sobrie 		dev_err(dev, "Unable to request touchscreen IRQ, err: %d\n",
2665c6a7a62SOlivier Sobrie 			error);
2675c6a7a62SOlivier Sobrie 		goto err_free_mem;
2685c6a7a62SOlivier Sobrie 	}
2695c6a7a62SOlivier Sobrie 
2705c6a7a62SOlivier Sobrie 	error = sysfs_create_group(&dev->kobj, &ili210x_attr_group);
2715c6a7a62SOlivier Sobrie 	if (error) {
2725c6a7a62SOlivier Sobrie 		dev_err(dev, "Unable to create sysfs attributes, err: %d\n",
2735c6a7a62SOlivier Sobrie 			error);
2745c6a7a62SOlivier Sobrie 		goto err_free_irq;
2755c6a7a62SOlivier Sobrie 	}
2765c6a7a62SOlivier Sobrie 
2775c6a7a62SOlivier Sobrie 	error = input_register_device(priv->input);
2785c6a7a62SOlivier Sobrie 	if (error) {
279*971bd8faSMasanari Iida 		dev_err(dev, "Cannot register input device, err: %d\n", error);
2805c6a7a62SOlivier Sobrie 		goto err_remove_sysfs;
2815c6a7a62SOlivier Sobrie 	}
2825c6a7a62SOlivier Sobrie 
2835c6a7a62SOlivier Sobrie 	device_init_wakeup(&client->dev, 1);
2845c6a7a62SOlivier Sobrie 
2855c6a7a62SOlivier Sobrie 	dev_dbg(dev,
2865c6a7a62SOlivier Sobrie 		"ILI210x initialized (IRQ: %d), firmware version %d.%d.%d",
2875c6a7a62SOlivier Sobrie 		client->irq, firmware.id, firmware.major, firmware.minor);
2885c6a7a62SOlivier Sobrie 
2895c6a7a62SOlivier Sobrie 	return 0;
2905c6a7a62SOlivier Sobrie 
2915c6a7a62SOlivier Sobrie err_remove_sysfs:
2925c6a7a62SOlivier Sobrie 	sysfs_remove_group(&dev->kobj, &ili210x_attr_group);
2935c6a7a62SOlivier Sobrie err_free_irq:
2945c6a7a62SOlivier Sobrie 	free_irq(client->irq, priv);
2955c6a7a62SOlivier Sobrie err_free_mem:
2965c6a7a62SOlivier Sobrie 	input_free_device(input);
2975c6a7a62SOlivier Sobrie 	kfree(priv);
2985c6a7a62SOlivier Sobrie 	return error;
2995c6a7a62SOlivier Sobrie }
3005c6a7a62SOlivier Sobrie 
301e2619cf7SBill Pemberton static int ili210x_i2c_remove(struct i2c_client *client)
3025c6a7a62SOlivier Sobrie {
3035c6a7a62SOlivier Sobrie 	struct ili210x *priv = i2c_get_clientdata(client);
3045c6a7a62SOlivier Sobrie 
3055c6a7a62SOlivier Sobrie 	sysfs_remove_group(&client->dev.kobj, &ili210x_attr_group);
3065c6a7a62SOlivier Sobrie 	free_irq(priv->client->irq, priv);
3075c6a7a62SOlivier Sobrie 	cancel_delayed_work_sync(&priv->dwork);
3085c6a7a62SOlivier Sobrie 	input_unregister_device(priv->input);
3095c6a7a62SOlivier Sobrie 	kfree(priv);
3105c6a7a62SOlivier Sobrie 
3115c6a7a62SOlivier Sobrie 	return 0;
3125c6a7a62SOlivier Sobrie }
3135c6a7a62SOlivier Sobrie 
31402b6a58bSJingoo Han static int __maybe_unused ili210x_i2c_suspend(struct device *dev)
3155c6a7a62SOlivier Sobrie {
3165c6a7a62SOlivier Sobrie 	struct i2c_client *client = to_i2c_client(dev);
3175c6a7a62SOlivier Sobrie 
3185c6a7a62SOlivier Sobrie 	if (device_may_wakeup(&client->dev))
3195c6a7a62SOlivier Sobrie 		enable_irq_wake(client->irq);
3205c6a7a62SOlivier Sobrie 
3215c6a7a62SOlivier Sobrie 	return 0;
3225c6a7a62SOlivier Sobrie }
3235c6a7a62SOlivier Sobrie 
32402b6a58bSJingoo Han static int __maybe_unused ili210x_i2c_resume(struct device *dev)
3255c6a7a62SOlivier Sobrie {
3265c6a7a62SOlivier Sobrie 	struct i2c_client *client = to_i2c_client(dev);
3275c6a7a62SOlivier Sobrie 
3285c6a7a62SOlivier Sobrie 	if (device_may_wakeup(&client->dev))
3295c6a7a62SOlivier Sobrie 		disable_irq_wake(client->irq);
3305c6a7a62SOlivier Sobrie 
3315c6a7a62SOlivier Sobrie 	return 0;
3325c6a7a62SOlivier Sobrie }
3335c6a7a62SOlivier Sobrie 
3345c6a7a62SOlivier Sobrie static SIMPLE_DEV_PM_OPS(ili210x_i2c_pm,
3355c6a7a62SOlivier Sobrie 			 ili210x_i2c_suspend, ili210x_i2c_resume);
3365c6a7a62SOlivier Sobrie 
3375c6a7a62SOlivier Sobrie static const struct i2c_device_id ili210x_i2c_id[] = {
3385c6a7a62SOlivier Sobrie 	{ "ili210x", 0 },
3395c6a7a62SOlivier Sobrie 	{ }
3405c6a7a62SOlivier Sobrie };
3415c6a7a62SOlivier Sobrie MODULE_DEVICE_TABLE(i2c, ili210x_i2c_id);
3425c6a7a62SOlivier Sobrie 
3435c6a7a62SOlivier Sobrie static struct i2c_driver ili210x_ts_driver = {
3445c6a7a62SOlivier Sobrie 	.driver = {
3455c6a7a62SOlivier Sobrie 		.name = "ili210x_i2c",
3465c6a7a62SOlivier Sobrie 		.owner = THIS_MODULE,
3475c6a7a62SOlivier Sobrie 		.pm = &ili210x_i2c_pm,
3485c6a7a62SOlivier Sobrie 	},
3495c6a7a62SOlivier Sobrie 	.id_table = ili210x_i2c_id,
3505c6a7a62SOlivier Sobrie 	.probe = ili210x_i2c_probe,
3511cb0aa88SBill Pemberton 	.remove = ili210x_i2c_remove,
3525c6a7a62SOlivier Sobrie };
3535c6a7a62SOlivier Sobrie 
3545c6a7a62SOlivier Sobrie module_i2c_driver(ili210x_ts_driver);
3555c6a7a62SOlivier Sobrie 
3565c6a7a62SOlivier Sobrie MODULE_AUTHOR("Olivier Sobrie <olivier@sobrie.be>");
3575c6a7a62SOlivier Sobrie MODULE_DESCRIPTION("ILI210X I2C Touchscreen Driver");
3585c6a7a62SOlivier Sobrie MODULE_LICENSE("GPL");
359