Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 321526
b: refs/heads/master
c: 4eef6cb
h: refs/heads/master
v: v3
  • Loading branch information
Arnd Bergmann committed Aug 9, 2012
1 parent 569dbd2 commit b639f32
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 10 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 59ee93a528b94ef4e81a08db252b0326feff171f
refs/heads/master: 4eef6cbfcc03b294d9d334368a851b35b496ce53
2 changes: 1 addition & 1 deletion trunk/arch/arm/mach-pxa/raumfeld.c
Original file line number Diff line number Diff line change
Expand Up @@ -953,12 +953,12 @@ static struct i2c_board_info raumfeld_connector_i2c_board_info __initdata = {

static struct eeti_ts_platform_data eeti_ts_pdata = {
.irq_active_high = 1,
.irq_gpio = GPIO_TOUCH_IRQ,
};

static struct i2c_board_info raumfeld_controller_i2c_board_info __initdata = {
.type = "eeti_ts",
.addr = 0x0a,
.irq = PXA_GPIO_TO_IRQ(GPIO_TOUCH_IRQ),
.platform_data = &eeti_ts_pdata,
};

Expand Down
21 changes: 13 additions & 8 deletions trunk/drivers/input/touchscreen/eeti_ts.c
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ struct eeti_ts_priv {
struct input_dev *input;
struct work_struct work;
struct mutex mutex;
int irq, irq_active_high;
int irq_gpio, irq, irq_active_high;
};

#define EETI_TS_BITDEPTH (11)
Expand All @@ -62,7 +62,7 @@ struct eeti_ts_priv {

static inline int eeti_ts_irq_active(struct eeti_ts_priv *priv)
{
return gpio_get_value(irq_to_gpio(priv->irq)) == priv->irq_active_high;
return gpio_get_value(priv->irq_gpio) == priv->irq_active_high;
}

static void eeti_ts_read(struct work_struct *work)
Expand Down Expand Up @@ -157,7 +157,7 @@ static void eeti_ts_close(struct input_dev *dev)
static int __devinit eeti_ts_probe(struct i2c_client *client,
const struct i2c_device_id *idp)
{
struct eeti_ts_platform_data *pdata;
struct eeti_ts_platform_data *pdata = client->dev.platform_data;
struct eeti_ts_priv *priv;
struct input_dev *input;
unsigned int irq_flags;
Expand Down Expand Up @@ -199,9 +199,12 @@ static int __devinit eeti_ts_probe(struct i2c_client *client,

priv->client = client;
priv->input = input;
priv->irq = client->irq;
priv->irq_gpio = pdata->irq_gpio;
priv->irq = gpio_to_irq(pdata->irq_gpio);

pdata = client->dev.platform_data;
err = gpio_request_one(pdata->irq_gpio, GPIOF_IN, client->name);
if (err < 0)
goto err1;

if (pdata)
priv->irq_active_high = pdata->irq_active_high;
Expand All @@ -215,13 +218,13 @@ static int __devinit eeti_ts_probe(struct i2c_client *client,

err = input_register_device(input);
if (err)
goto err1;
goto err2;

err = request_irq(priv->irq, eeti_ts_isr, irq_flags,
client->name, priv);
if (err) {
dev_err(&client->dev, "Unable to request touchscreen IRQ.\n");
goto err2;
goto err3;
}

/*
Expand All @@ -233,9 +236,11 @@ static int __devinit eeti_ts_probe(struct i2c_client *client,
device_init_wakeup(&client->dev, 0);
return 0;

err2:
err3:
input_unregister_device(input);
input = NULL; /* so we dont try to free it below */
err2:
gpio_free(pdata->irq_gpio);
err1:
input_free_device(input);
kfree(priv);
Expand Down
1 change: 1 addition & 0 deletions trunk/include/linux/input/eeti_ts.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
#define LINUX_INPUT_EETI_TS_H

struct eeti_ts_platform_data {
int irq_gpio;
unsigned int irq_active_high;
};

Expand Down

0 comments on commit b639f32

Please sign in to comment.