diff options
author | Jarod Wilson <jarod@redhat.com> | 2011-05-09 15:53:17 -0400 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2011-05-20 14:58:28 -0400 |
commit | c812045488afbe3830843fc6686ae84bfc928a5f (patch) | |
tree | e6425199ac610a8e7cdca9b4f30a929add51d86a /drivers/media | |
parent | f0c1629dca6ffd8b1b07654704ac56c5a63270e3 (diff) |
[media] ite-cir: finish tx before suspending
Continuing with IR transmit after resuming from suspend seems fairly
useless, given that the only place we can actually end up suspending is
after IR has been send and we're simply mdelay'ing. Lets simplify the
resume path by just waiting on tx to complete in the suspend path, then
we know we can't be transmitting on resume, and reinitialization of the
hardware registers becomes more straight-forward.
CC: Juan Jesús García de Soria <skandalfo@gmail.com>
Signed-off-by: Jarod Wilson <jarod@redhat.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media')
-rw-r--r-- | drivers/media/rc/ite-cir.c | 16 |
1 files changed, 7 insertions, 9 deletions
diff --git a/drivers/media/rc/ite-cir.c b/drivers/media/rc/ite-cir.c index d1dec5c25324..e716b931cf7e 100644 --- a/drivers/media/rc/ite-cir.c +++ b/drivers/media/rc/ite-cir.c | |||
@@ -1650,6 +1650,9 @@ static int ite_suspend(struct pnp_dev *pdev, pm_message_t state) | |||
1650 | 1650 | ||
1651 | ite_dbg("%s called", __func__); | 1651 | ite_dbg("%s called", __func__); |
1652 | 1652 | ||
1653 | /* wait for any transmission to end */ | ||
1654 | wait_event_interruptible(dev->tx_ended, !dev->transmitting); | ||
1655 | |||
1653 | spin_lock_irqsave(&dev->lock, flags); | 1656 | spin_lock_irqsave(&dev->lock, flags); |
1654 | 1657 | ||
1655 | /* disable all interrupts */ | 1658 | /* disable all interrupts */ |
@@ -1670,15 +1673,10 @@ static int ite_resume(struct pnp_dev *pdev) | |||
1670 | 1673 | ||
1671 | spin_lock_irqsave(&dev->lock, flags); | 1674 | spin_lock_irqsave(&dev->lock, flags); |
1672 | 1675 | ||
1673 | if (dev->transmitting) { | 1676 | /* reinitialize hardware config registers */ |
1674 | /* wake up the transmitter */ | 1677 | dev->params.init_hardware(dev); |
1675 | wake_up_interruptible(&dev->tx_queue); | 1678 | /* enable the receiver */ |
1676 | } else { | 1679 | dev->params.enable_rx(dev); |
1677 | /* reinitialize hardware config registers */ | ||
1678 | dev->params.init_hardware(dev); | ||
1679 | /* enable the receiver */ | ||
1680 | dev->params.enable_rx(dev); | ||
1681 | } | ||
1682 | 1680 | ||
1683 | spin_unlock_irqrestore(&dev->lock, flags); | 1681 | spin_unlock_irqrestore(&dev->lock, flags); |
1684 | 1682 | ||