Skip to content

Commit

Permalink
[media] ite-cir: finish tx before suspending
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Jarod Wilson authored and Mauro Carvalho Chehab committed May 20, 2011
1 parent f0c1629 commit c812045
Showing 1 changed file with 7 additions and 9 deletions.
16 changes: 7 additions & 9 deletions drivers/media/rc/ite-cir.c
Original file line number Diff line number Diff line change
Expand Up @@ -1650,6 +1650,9 @@ static int ite_suspend(struct pnp_dev *pdev, pm_message_t state)

ite_dbg("%s called", __func__);

/* wait for any transmission to end */
wait_event_interruptible(dev->tx_ended, !dev->transmitting);

spin_lock_irqsave(&dev->lock, flags);

/* disable all interrupts */
Expand All @@ -1670,15 +1673,10 @@ static int ite_resume(struct pnp_dev *pdev)

spin_lock_irqsave(&dev->lock, flags);

if (dev->transmitting) {
/* wake up the transmitter */
wake_up_interruptible(&dev->tx_queue);
} else {
/* reinitialize hardware config registers */
dev->params.init_hardware(dev);
/* enable the receiver */
dev->params.enable_rx(dev);
}
/* reinitialize hardware config registers */
dev->params.init_hardware(dev);
/* enable the receiver */
dev->params.enable_rx(dev);

spin_unlock_irqrestore(&dev->lock, flags);

Expand Down

0 comments on commit c812045

Please sign in to comment.