Commit c8120454 authored by Jarod Wilson's avatar Jarod Wilson Committed by Mauro Carvalho Chehab

[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: default avatarJarod Wilson <jarod@redhat.com>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@redhat.com>
parent f0c1629d
...@@ -1650,6 +1650,9 @@ static int ite_suspend(struct pnp_dev *pdev, pm_message_t state) ...@@ -1650,6 +1650,9 @@ static int ite_suspend(struct pnp_dev *pdev, pm_message_t state)
ite_dbg("%s called", __func__); 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); spin_lock_irqsave(&dev->lock, flags);
/* disable all interrupts */ /* disable all interrupts */
...@@ -1670,15 +1673,10 @@ static int ite_resume(struct pnp_dev *pdev) ...@@ -1670,15 +1673,10 @@ static int ite_resume(struct pnp_dev *pdev)
spin_lock_irqsave(&dev->lock, flags); spin_lock_irqsave(&dev->lock, flags);
if (dev->transmitting) { /* reinitialize hardware config registers */
/* wake up the transmitter */ dev->params.init_hardware(dev);
wake_up_interruptible(&dev->tx_queue); /* enable the receiver */
} else { 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); spin_unlock_irqrestore(&dev->lock, flags);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment