Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 84342
b: refs/heads/master
c: fbb38e3
h: refs/heads/master
v: v3
  • Loading branch information
David Brownell authored and Dmitry Torokhov committed Jan 21, 2008
1 parent 0d49a16 commit 7c4cae6
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 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: 3b04a61107dfe46dbfc1796298b59ca3c0a09cd9
refs/heads/master: fbb38e30e414c9ccd8b5d04344264522551008bc
8 changes: 4 additions & 4 deletions trunk/drivers/input/touchscreen/ads7846.c
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,7 @@ struct ads7846 {
// FIXME remove "irq_disabled"
unsigned irq_disabled:1; /* P: lock */
unsigned disabled:1;
unsigned is_suspended:1;

int (*filter)(void *data, int data_idx, int *val);
void *filter_data;
Expand Down Expand Up @@ -203,7 +204,7 @@ static void ads7846_disable(struct ads7846 *ts);
static int device_suspended(struct device *dev)
{
struct ads7846 *ts = dev_get_drvdata(dev);
return dev->power.power_state.event != PM_EVENT_ON || ts->disabled;
return ts->is_suspended || ts->disabled;
}

static int ads7846_read12_ser(struct device *dev, unsigned command)
Expand Down Expand Up @@ -795,7 +796,7 @@ static int ads7846_suspend(struct spi_device *spi, pm_message_t message)

spin_lock_irq(&ts->lock);

spi->dev.power.power_state = message;
ts->is_suspended = 1;
ads7846_disable(ts);

spin_unlock_irq(&ts->lock);
Expand All @@ -810,7 +811,7 @@ static int ads7846_resume(struct spi_device *spi)

spin_lock_irq(&ts->lock);

spi->dev.power.power_state = PMSG_ON;
ts->is_suspended = 0;
ads7846_enable(ts);

spin_unlock_irq(&ts->lock);
Expand Down Expand Up @@ -872,7 +873,6 @@ static int __devinit ads7846_probe(struct spi_device *spi)
}

dev_set_drvdata(&spi->dev, ts);
spi->dev.power.power_state = PMSG_ON;

ts->spi = spi;
ts->input = input_dev;
Expand Down

0 comments on commit 7c4cae6

Please sign in to comment.