1885c316d776b64728b4ed30e3af60d23c9e46825Magnus Damm/* 2885c316d776b64728b4ed30e3af60d23c9e46825Magnus Damm * Touch Screen driver for Renesas MIGO-R Platform 3885c316d776b64728b4ed30e3af60d23c9e46825Magnus Damm * 4885c316d776b64728b4ed30e3af60d23c9e46825Magnus Damm * Copyright (c) 2008 Magnus Damm 5885c316d776b64728b4ed30e3af60d23c9e46825Magnus Damm * Copyright (c) 2007 Ujjwal Pande <ujjwal@kenati.com>, 6885c316d776b64728b4ed30e3af60d23c9e46825Magnus Damm * Kenati Technologies Pvt Ltd. 7885c316d776b64728b4ed30e3af60d23c9e46825Magnus Damm * 8885c316d776b64728b4ed30e3af60d23c9e46825Magnus Damm * This file is free software; you can redistribute it and/or 9885c316d776b64728b4ed30e3af60d23c9e46825Magnus Damm * modify it under the terms of the GNU General Public 10885c316d776b64728b4ed30e3af60d23c9e46825Magnus Damm * License as published by the Free Software Foundation; either 11885c316d776b64728b4ed30e3af60d23c9e46825Magnus Damm * version 2 of the License, or (at your option) any later version. 12885c316d776b64728b4ed30e3af60d23c9e46825Magnus Damm * 13885c316d776b64728b4ed30e3af60d23c9e46825Magnus Damm * This file is distributed in the hope that it will be useful, 14885c316d776b64728b4ed30e3af60d23c9e46825Magnus Damm * but WITHOUT ANY WARRANTY; without even the implied warranty of 15885c316d776b64728b4ed30e3af60d23c9e46825Magnus Damm * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 16885c316d776b64728b4ed30e3af60d23c9e46825Magnus Damm * General Public License for more details. 17885c316d776b64728b4ed30e3af60d23c9e46825Magnus Damm * 18885c316d776b64728b4ed30e3af60d23c9e46825Magnus Damm * You should have received a copy of the GNU General Public 19885c316d776b64728b4ed30e3af60d23c9e46825Magnus Damm * License along with this library; if not, write to the Free Software 20885c316d776b64728b4ed30e3af60d23c9e46825Magnus Damm * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 21885c316d776b64728b4ed30e3af60d23c9e46825Magnus Damm */ 22885c316d776b64728b4ed30e3af60d23c9e46825Magnus Damm#include <linux/module.h> 23885c316d776b64728b4ed30e3af60d23c9e46825Magnus Damm#include <linux/kernel.h> 24885c316d776b64728b4ed30e3af60d23c9e46825Magnus Damm#include <linux/input.h> 25885c316d776b64728b4ed30e3af60d23c9e46825Magnus Damm#include <linux/interrupt.h> 26d72e64ec0b134d26a89c736394ee0b638513bed8Mark Brown#include <linux/pm.h> 275a0e3ad6af8660be21ca98a971cd00f331318c05Tejun Heo#include <linux/slab.h> 28885c316d776b64728b4ed30e3af60d23c9e46825Magnus Damm#include <asm/io.h> 29885c316d776b64728b4ed30e3af60d23c9e46825Magnus Damm#include <linux/i2c.h> 30885c316d776b64728b4ed30e3af60d23c9e46825Magnus Damm#include <linux/timer.h> 31885c316d776b64728b4ed30e3af60d23c9e46825Magnus Damm 32885c316d776b64728b4ed30e3af60d23c9e46825Magnus Damm#define EVENT_PENDOWN 1 33885c316d776b64728b4ed30e3af60d23c9e46825Magnus Damm#define EVENT_REPEAT 2 34885c316d776b64728b4ed30e3af60d23c9e46825Magnus Damm#define EVENT_PENUP 3 35885c316d776b64728b4ed30e3af60d23c9e46825Magnus Damm 36885c316d776b64728b4ed30e3af60d23c9e46825Magnus Dammstruct migor_ts_priv { 37885c316d776b64728b4ed30e3af60d23c9e46825Magnus Damm struct i2c_client *client; 38885c316d776b64728b4ed30e3af60d23c9e46825Magnus Damm struct input_dev *input; 39885c316d776b64728b4ed30e3af60d23c9e46825Magnus Damm int irq; 40885c316d776b64728b4ed30e3af60d23c9e46825Magnus Damm}; 41885c316d776b64728b4ed30e3af60d23c9e46825Magnus Damm 42885c316d776b64728b4ed30e3af60d23c9e46825Magnus Dammstatic const u_int8_t migor_ts_ena_seq[17] = { 0x33, 0x22, 0x11, 43885c316d776b64728b4ed30e3af60d23c9e46825Magnus Damm 0x01, 0x06, 0x07, }; 44885c316d776b64728b4ed30e3af60d23c9e46825Magnus Dammstatic const u_int8_t migor_ts_dis_seq[17] = { }; 45885c316d776b64728b4ed30e3af60d23c9e46825Magnus Damm 46468792eb1e9fb2de855a1978c1228c55d9ed2753Dmitry Torokhovstatic irqreturn_t migor_ts_isr(int irq, void *dev_id) 47885c316d776b64728b4ed30e3af60d23c9e46825Magnus Damm{ 48468792eb1e9fb2de855a1978c1228c55d9ed2753Dmitry Torokhov struct migor_ts_priv *priv = dev_id; 49885c316d776b64728b4ed30e3af60d23c9e46825Magnus Damm unsigned short xpos, ypos; 50885c316d776b64728b4ed30e3af60d23c9e46825Magnus Damm unsigned char event; 51885c316d776b64728b4ed30e3af60d23c9e46825Magnus Damm u_int8_t buf[16]; 52885c316d776b64728b4ed30e3af60d23c9e46825Magnus Damm 53468792eb1e9fb2de855a1978c1228c55d9ed2753Dmitry Torokhov /* 54468792eb1e9fb2de855a1978c1228c55d9ed2753Dmitry Torokhov * The touch screen controller chip is hooked up to the CPU 55468792eb1e9fb2de855a1978c1228c55d9ed2753Dmitry Torokhov * using I2C and a single interrupt line. The interrupt line 56468792eb1e9fb2de855a1978c1228c55d9ed2753Dmitry Torokhov * is pulled low whenever someone taps the screen. To deassert 57468792eb1e9fb2de855a1978c1228c55d9ed2753Dmitry Torokhov * the interrupt line we need to acknowledge the interrupt by 58468792eb1e9fb2de855a1978c1228c55d9ed2753Dmitry Torokhov * communicating with the controller over the slow i2c bus. 59468792eb1e9fb2de855a1978c1228c55d9ed2753Dmitry Torokhov * 60468792eb1e9fb2de855a1978c1228c55d9ed2753Dmitry Torokhov * Since I2C bus controller may sleep we are using threaded 61468792eb1e9fb2de855a1978c1228c55d9ed2753Dmitry Torokhov * IRQ here. 62468792eb1e9fb2de855a1978c1228c55d9ed2753Dmitry Torokhov */ 63468792eb1e9fb2de855a1978c1228c55d9ed2753Dmitry Torokhov 64885c316d776b64728b4ed30e3af60d23c9e46825Magnus Damm memset(buf, 0, sizeof(buf)); 65885c316d776b64728b4ed30e3af60d23c9e46825Magnus Damm 66885c316d776b64728b4ed30e3af60d23c9e46825Magnus Damm /* Set Index 0 */ 67885c316d776b64728b4ed30e3af60d23c9e46825Magnus Damm buf[0] = 0; 68885c316d776b64728b4ed30e3af60d23c9e46825Magnus Damm if (i2c_master_send(priv->client, buf, 1) != 1) { 69885c316d776b64728b4ed30e3af60d23c9e46825Magnus Damm dev_err(&priv->client->dev, "Unable to write i2c index\n"); 70885c316d776b64728b4ed30e3af60d23c9e46825Magnus Damm goto out; 71885c316d776b64728b4ed30e3af60d23c9e46825Magnus Damm } 72885c316d776b64728b4ed30e3af60d23c9e46825Magnus Damm 73885c316d776b64728b4ed30e3af60d23c9e46825Magnus Damm /* Now do Page Read */ 74885c316d776b64728b4ed30e3af60d23c9e46825Magnus Damm if (i2c_master_recv(priv->client, buf, sizeof(buf)) != sizeof(buf)) { 75885c316d776b64728b4ed30e3af60d23c9e46825Magnus Damm dev_err(&priv->client->dev, "Unable to read i2c page\n"); 76885c316d776b64728b4ed30e3af60d23c9e46825Magnus Damm goto out; 77885c316d776b64728b4ed30e3af60d23c9e46825Magnus Damm } 78885c316d776b64728b4ed30e3af60d23c9e46825Magnus Damm 79885c316d776b64728b4ed30e3af60d23c9e46825Magnus Damm ypos = ((buf[9] & 0x03) << 8 | buf[8]); 80885c316d776b64728b4ed30e3af60d23c9e46825Magnus Damm xpos = ((buf[11] & 0x03) << 8 | buf[10]); 81885c316d776b64728b4ed30e3af60d23c9e46825Magnus Damm event = buf[12]; 82885c316d776b64728b4ed30e3af60d23c9e46825Magnus Damm 83468792eb1e9fb2de855a1978c1228c55d9ed2753Dmitry Torokhov switch (event) { 84468792eb1e9fb2de855a1978c1228c55d9ed2753Dmitry Torokhov case EVENT_PENDOWN: 85468792eb1e9fb2de855a1978c1228c55d9ed2753Dmitry Torokhov case EVENT_REPEAT: 86885c316d776b64728b4ed30e3af60d23c9e46825Magnus Damm input_report_key(priv->input, BTN_TOUCH, 1); 87885c316d776b64728b4ed30e3af60d23c9e46825Magnus Damm input_report_abs(priv->input, ABS_X, ypos); /*X-Y swap*/ 88885c316d776b64728b4ed30e3af60d23c9e46825Magnus Damm input_report_abs(priv->input, ABS_Y, xpos); 89885c316d776b64728b4ed30e3af60d23c9e46825Magnus Damm input_sync(priv->input); 90468792eb1e9fb2de855a1978c1228c55d9ed2753Dmitry Torokhov break; 91468792eb1e9fb2de855a1978c1228c55d9ed2753Dmitry Torokhov 92468792eb1e9fb2de855a1978c1228c55d9ed2753Dmitry Torokhov case EVENT_PENUP: 93885c316d776b64728b4ed30e3af60d23c9e46825Magnus Damm input_report_key(priv->input, BTN_TOUCH, 0); 94885c316d776b64728b4ed30e3af60d23c9e46825Magnus Damm input_sync(priv->input); 95468792eb1e9fb2de855a1978c1228c55d9ed2753Dmitry Torokhov break; 96885c316d776b64728b4ed30e3af60d23c9e46825Magnus Damm } 97885c316d776b64728b4ed30e3af60d23c9e46825Magnus Damm 98468792eb1e9fb2de855a1978c1228c55d9ed2753Dmitry Torokhov out: 99885c316d776b64728b4ed30e3af60d23c9e46825Magnus Damm return IRQ_HANDLED; 100885c316d776b64728b4ed30e3af60d23c9e46825Magnus Damm} 101885c316d776b64728b4ed30e3af60d23c9e46825Magnus Damm 102885c316d776b64728b4ed30e3af60d23c9e46825Magnus Dammstatic int migor_ts_open(struct input_dev *dev) 103885c316d776b64728b4ed30e3af60d23c9e46825Magnus Damm{ 104885c316d776b64728b4ed30e3af60d23c9e46825Magnus Damm struct migor_ts_priv *priv = input_get_drvdata(dev); 105885c316d776b64728b4ed30e3af60d23c9e46825Magnus Damm struct i2c_client *client = priv->client; 106885c316d776b64728b4ed30e3af60d23c9e46825Magnus Damm int count; 107885c316d776b64728b4ed30e3af60d23c9e46825Magnus Damm 108885c316d776b64728b4ed30e3af60d23c9e46825Magnus Damm /* enable controller */ 109885c316d776b64728b4ed30e3af60d23c9e46825Magnus Damm count = i2c_master_send(client, migor_ts_ena_seq, 110885c316d776b64728b4ed30e3af60d23c9e46825Magnus Damm sizeof(migor_ts_ena_seq)); 111885c316d776b64728b4ed30e3af60d23c9e46825Magnus Damm if (count != sizeof(migor_ts_ena_seq)) { 112885c316d776b64728b4ed30e3af60d23c9e46825Magnus Damm dev_err(&client->dev, "Unable to enable touchscreen.\n"); 113885c316d776b64728b4ed30e3af60d23c9e46825Magnus Damm return -ENXIO; 114885c316d776b64728b4ed30e3af60d23c9e46825Magnus Damm } 115885c316d776b64728b4ed30e3af60d23c9e46825Magnus Damm 116885c316d776b64728b4ed30e3af60d23c9e46825Magnus Damm return 0; 117885c316d776b64728b4ed30e3af60d23c9e46825Magnus Damm} 118885c316d776b64728b4ed30e3af60d23c9e46825Magnus Damm 119885c316d776b64728b4ed30e3af60d23c9e46825Magnus Dammstatic void migor_ts_close(struct input_dev *dev) 120885c316d776b64728b4ed30e3af60d23c9e46825Magnus Damm{ 121885c316d776b64728b4ed30e3af60d23c9e46825Magnus Damm struct migor_ts_priv *priv = input_get_drvdata(dev); 122885c316d776b64728b4ed30e3af60d23c9e46825Magnus Damm struct i2c_client *client = priv->client; 123885c316d776b64728b4ed30e3af60d23c9e46825Magnus Damm 124885c316d776b64728b4ed30e3af60d23c9e46825Magnus Damm disable_irq(priv->irq); 125885c316d776b64728b4ed30e3af60d23c9e46825Magnus Damm 126885c316d776b64728b4ed30e3af60d23c9e46825Magnus Damm /* disable controller */ 127885c316d776b64728b4ed30e3af60d23c9e46825Magnus Damm i2c_master_send(client, migor_ts_dis_seq, sizeof(migor_ts_dis_seq)); 128885c316d776b64728b4ed30e3af60d23c9e46825Magnus Damm 129885c316d776b64728b4ed30e3af60d23c9e46825Magnus Damm enable_irq(priv->irq); 130885c316d776b64728b4ed30e3af60d23c9e46825Magnus Damm} 131885c316d776b64728b4ed30e3af60d23c9e46825Magnus Damm 132885c316d776b64728b4ed30e3af60d23c9e46825Magnus Dammstatic int migor_ts_probe(struct i2c_client *client, 133885c316d776b64728b4ed30e3af60d23c9e46825Magnus Damm const struct i2c_device_id *idp) 134885c316d776b64728b4ed30e3af60d23c9e46825Magnus Damm{ 135885c316d776b64728b4ed30e3af60d23c9e46825Magnus Damm struct migor_ts_priv *priv; 136885c316d776b64728b4ed30e3af60d23c9e46825Magnus Damm struct input_dev *input; 137885c316d776b64728b4ed30e3af60d23c9e46825Magnus Damm int error; 138885c316d776b64728b4ed30e3af60d23c9e46825Magnus Damm 139885c316d776b64728b4ed30e3af60d23c9e46825Magnus Damm priv = kzalloc(sizeof(*priv), GFP_KERNEL); 140885c316d776b64728b4ed30e3af60d23c9e46825Magnus Damm input = input_allocate_device(); 141ff4d049246727087ee797b6802e7c1bd4d5d172cDmitry Torokhov if (!priv || !input) { 142ff4d049246727087ee797b6802e7c1bd4d5d172cDmitry Torokhov dev_err(&client->dev, "failed to allocate memory\n"); 143885c316d776b64728b4ed30e3af60d23c9e46825Magnus Damm error = -ENOMEM; 144ff4d049246727087ee797b6802e7c1bd4d5d172cDmitry Torokhov goto err_free_mem; 145885c316d776b64728b4ed30e3af60d23c9e46825Magnus Damm } 146885c316d776b64728b4ed30e3af60d23c9e46825Magnus Damm 147ff4d049246727087ee797b6802e7c1bd4d5d172cDmitry Torokhov priv->client = client; 148ff4d049246727087ee797b6802e7c1bd4d5d172cDmitry Torokhov priv->input = input; 149ff4d049246727087ee797b6802e7c1bd4d5d172cDmitry Torokhov priv->irq = client->irq; 150ff4d049246727087ee797b6802e7c1bd4d5d172cDmitry Torokhov 151885c316d776b64728b4ed30e3af60d23c9e46825Magnus Damm input->evbit[0] = BIT_MASK(EV_KEY) | BIT_MASK(EV_ABS); 152ff4d049246727087ee797b6802e7c1bd4d5d172cDmitry Torokhov 153ff4d049246727087ee797b6802e7c1bd4d5d172cDmitry Torokhov __set_bit(BTN_TOUCH, input->keybit); 154885c316d776b64728b4ed30e3af60d23c9e46825Magnus Damm 155885c316d776b64728b4ed30e3af60d23c9e46825Magnus Damm input_set_abs_params(input, ABS_X, 95, 955, 0, 0); 156885c316d776b64728b4ed30e3af60d23c9e46825Magnus Damm input_set_abs_params(input, ABS_Y, 85, 935, 0, 0); 157885c316d776b64728b4ed30e3af60d23c9e46825Magnus Damm 158b6ce9ad05f782e6a00aed8432d9513dc394115ceMagnus Damm input->name = client->name; 159885c316d776b64728b4ed30e3af60d23c9e46825Magnus Damm input->id.bustype = BUS_I2C; 160885c316d776b64728b4ed30e3af60d23c9e46825Magnus Damm input->dev.parent = &client->dev; 161885c316d776b64728b4ed30e3af60d23c9e46825Magnus Damm 162885c316d776b64728b4ed30e3af60d23c9e46825Magnus Damm input->open = migor_ts_open; 163885c316d776b64728b4ed30e3af60d23c9e46825Magnus Damm input->close = migor_ts_close; 164885c316d776b64728b4ed30e3af60d23c9e46825Magnus Damm 165885c316d776b64728b4ed30e3af60d23c9e46825Magnus Damm input_set_drvdata(input, priv); 166885c316d776b64728b4ed30e3af60d23c9e46825Magnus Damm 167468792eb1e9fb2de855a1978c1228c55d9ed2753Dmitry Torokhov error = request_threaded_irq(priv->irq, NULL, migor_ts_isr, 168468792eb1e9fb2de855a1978c1228c55d9ed2753Dmitry Torokhov IRQF_TRIGGER_LOW | IRQF_ONESHOT, 169468792eb1e9fb2de855a1978c1228c55d9ed2753Dmitry Torokhov client->name, priv); 170885c316d776b64728b4ed30e3af60d23c9e46825Magnus Damm if (error) { 171885c316d776b64728b4ed30e3af60d23c9e46825Magnus Damm dev_err(&client->dev, "Unable to request touchscreen IRQ.\n"); 172ff4d049246727087ee797b6802e7c1bd4d5d172cDmitry Torokhov goto err_free_mem; 173885c316d776b64728b4ed30e3af60d23c9e46825Magnus Damm } 174885c316d776b64728b4ed30e3af60d23c9e46825Magnus Damm 175ff4d049246727087ee797b6802e7c1bd4d5d172cDmitry Torokhov error = input_register_device(input); 176ff4d049246727087ee797b6802e7c1bd4d5d172cDmitry Torokhov if (error) 177ff4d049246727087ee797b6802e7c1bd4d5d172cDmitry Torokhov goto err_free_irq; 178ff4d049246727087ee797b6802e7c1bd4d5d172cDmitry Torokhov 179ec20861260824a1be53d24c05636529d45a4e228Dmitry Torokhov i2c_set_clientdata(client, priv); 1800935ade0bf6baf9c5f23024102737bdaf7075abcMagnus Damm device_init_wakeup(&client->dev, 1); 181ff4d049246727087ee797b6802e7c1bd4d5d172cDmitry Torokhov 182885c316d776b64728b4ed30e3af60d23c9e46825Magnus Damm return 0; 183885c316d776b64728b4ed30e3af60d23c9e46825Magnus Damm 184ff4d049246727087ee797b6802e7c1bd4d5d172cDmitry Torokhov err_free_irq: 185ff4d049246727087ee797b6802e7c1bd4d5d172cDmitry Torokhov free_irq(priv->irq, priv); 186ff4d049246727087ee797b6802e7c1bd4d5d172cDmitry Torokhov err_free_mem: 187885c316d776b64728b4ed30e3af60d23c9e46825Magnus Damm input_free_device(input); 188885c316d776b64728b4ed30e3af60d23c9e46825Magnus Damm kfree(priv); 189885c316d776b64728b4ed30e3af60d23c9e46825Magnus Damm return error; 190885c316d776b64728b4ed30e3af60d23c9e46825Magnus Damm} 191885c316d776b64728b4ed30e3af60d23c9e46825Magnus Damm 192885c316d776b64728b4ed30e3af60d23c9e46825Magnus Dammstatic int migor_ts_remove(struct i2c_client *client) 193885c316d776b64728b4ed30e3af60d23c9e46825Magnus Damm{ 194ec20861260824a1be53d24c05636529d45a4e228Dmitry Torokhov struct migor_ts_priv *priv = i2c_get_clientdata(client); 195885c316d776b64728b4ed30e3af60d23c9e46825Magnus Damm 196885c316d776b64728b4ed30e3af60d23c9e46825Magnus Damm free_irq(priv->irq, priv); 197885c316d776b64728b4ed30e3af60d23c9e46825Magnus Damm input_unregister_device(priv->input); 198885c316d776b64728b4ed30e3af60d23c9e46825Magnus Damm kfree(priv); 199885c316d776b64728b4ed30e3af60d23c9e46825Magnus Damm 200885c316d776b64728b4ed30e3af60d23c9e46825Magnus Damm dev_set_drvdata(&client->dev, NULL); 201885c316d776b64728b4ed30e3af60d23c9e46825Magnus Damm 202885c316d776b64728b4ed30e3af60d23c9e46825Magnus Damm return 0; 203885c316d776b64728b4ed30e3af60d23c9e46825Magnus Damm} 204885c316d776b64728b4ed30e3af60d23c9e46825Magnus Damm 205d72e64ec0b134d26a89c736394ee0b638513bed8Mark Brownstatic int migor_ts_suspend(struct device *dev) 2060935ade0bf6baf9c5f23024102737bdaf7075abcMagnus Damm{ 207d72e64ec0b134d26a89c736394ee0b638513bed8Mark Brown struct i2c_client *client = to_i2c_client(dev); 208ec20861260824a1be53d24c05636529d45a4e228Dmitry Torokhov struct migor_ts_priv *priv = i2c_get_clientdata(client); 2090935ade0bf6baf9c5f23024102737bdaf7075abcMagnus Damm 2100935ade0bf6baf9c5f23024102737bdaf7075abcMagnus Damm if (device_may_wakeup(&client->dev)) 2110935ade0bf6baf9c5f23024102737bdaf7075abcMagnus Damm enable_irq_wake(priv->irq); 2120935ade0bf6baf9c5f23024102737bdaf7075abcMagnus Damm 2130935ade0bf6baf9c5f23024102737bdaf7075abcMagnus Damm return 0; 2140935ade0bf6baf9c5f23024102737bdaf7075abcMagnus Damm} 2150935ade0bf6baf9c5f23024102737bdaf7075abcMagnus Damm 216d72e64ec0b134d26a89c736394ee0b638513bed8Mark Brownstatic int migor_ts_resume(struct device *dev) 2170935ade0bf6baf9c5f23024102737bdaf7075abcMagnus Damm{ 218d72e64ec0b134d26a89c736394ee0b638513bed8Mark Brown struct i2c_client *client = to_i2c_client(dev); 219ec20861260824a1be53d24c05636529d45a4e228Dmitry Torokhov struct migor_ts_priv *priv = i2c_get_clientdata(client); 2200935ade0bf6baf9c5f23024102737bdaf7075abcMagnus Damm 2210935ade0bf6baf9c5f23024102737bdaf7075abcMagnus Damm if (device_may_wakeup(&client->dev)) 2220935ade0bf6baf9c5f23024102737bdaf7075abcMagnus Damm disable_irq_wake(priv->irq); 2230935ade0bf6baf9c5f23024102737bdaf7075abcMagnus Damm 2240935ade0bf6baf9c5f23024102737bdaf7075abcMagnus Damm return 0; 2250935ade0bf6baf9c5f23024102737bdaf7075abcMagnus Damm} 2260935ade0bf6baf9c5f23024102737bdaf7075abcMagnus Damm 227d72e64ec0b134d26a89c736394ee0b638513bed8Mark Brownstatic SIMPLE_DEV_PM_OPS(migor_ts_pm, migor_ts_suspend, migor_ts_resume); 228d72e64ec0b134d26a89c736394ee0b638513bed8Mark Brown 229b6ce9ad05f782e6a00aed8432d9513dc394115ceMagnus Dammstatic const struct i2c_device_id migor_ts_id[] = { 230b6ce9ad05f782e6a00aed8432d9513dc394115ceMagnus Damm { "migor_ts", 0 }, 231b6ce9ad05f782e6a00aed8432d9513dc394115ceMagnus Damm { } 232b6ce9ad05f782e6a00aed8432d9513dc394115ceMagnus Damm}; 233b6ce9ad05f782e6a00aed8432d9513dc394115ceMagnus DammMODULE_DEVICE_TABLE(i2c, migor_ts); 234b6ce9ad05f782e6a00aed8432d9513dc394115ceMagnus Damm 235885c316d776b64728b4ed30e3af60d23c9e46825Magnus Dammstatic struct i2c_driver migor_ts_driver = { 236885c316d776b64728b4ed30e3af60d23c9e46825Magnus Damm .driver = { 237885c316d776b64728b4ed30e3af60d23c9e46825Magnus Damm .name = "migor_ts", 238d72e64ec0b134d26a89c736394ee0b638513bed8Mark Brown .pm = &migor_ts_pm, 239885c316d776b64728b4ed30e3af60d23c9e46825Magnus Damm }, 240885c316d776b64728b4ed30e3af60d23c9e46825Magnus Damm .probe = migor_ts_probe, 241885c316d776b64728b4ed30e3af60d23c9e46825Magnus Damm .remove = migor_ts_remove, 242b6ce9ad05f782e6a00aed8432d9513dc394115ceMagnus Damm .id_table = migor_ts_id, 243885c316d776b64728b4ed30e3af60d23c9e46825Magnus Damm}; 244885c316d776b64728b4ed30e3af60d23c9e46825Magnus Damm 2451b92c1cf6b638e7cbe9fdaac3f6efb8874f5cc02Axel Linmodule_i2c_driver(migor_ts_driver); 246885c316d776b64728b4ed30e3af60d23c9e46825Magnus Damm 247885c316d776b64728b4ed30e3af60d23c9e46825Magnus DammMODULE_DESCRIPTION("MigoR Touchscreen driver"); 248885c316d776b64728b4ed30e3af60d23c9e46825Magnus DammMODULE_AUTHOR("Magnus Damm <damm@opensource.se>"); 249885c316d776b64728b4ed30e3af60d23c9e46825Magnus DammMODULE_LICENSE("GPL"); 250